Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improove download files from artifacts #2890

Open
q000p opened this issue Jun 4, 2024 · 0 comments
Open

Improove download files from artifacts #2890

q000p opened this issue Jun 4, 2024 · 0 comments

Comments

@q000p
Copy link

q000p commented Jun 4, 2024

Description of the problem, including code/CLI snippet

If file is absent in repository that will error:
('Connection broken: IncompleteRead(0 bytes read, 2 more expected)', IncompleteRead(0 bytes read, 2 more expected))
It has not information, and I can`t clearly use try-except to handle this error.

Expected Behavior

gitlab.exceptions.IncompleteRead
to add this as exception line

Actual Behavior

`Traceback (most recent call last):
File "/venv/lib/python3.11/site-packages/urllib3/response.py", line 737, in _error_catcher
yield
File "/venv/lib/python3.11/site-packages/urllib3/response.py", line 883, in _raw_read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
urllib3.exceptions.IncompleteRead: IncompleteRead(0 bytes read, 2 more expected)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/venv/lib/python3.11/site-packages/requests/models.py", line 816, in generate
yield from self.raw.stream(chunk_size, decode_content=True)
File "/venv/lib/python3.11/site-packages/urllib3/response.py", line 1043, in stream
data = self.read(amt=amt, decode_content=decode_content)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/urllib3/response.py", line 935, in read
data = self._raw_read(amt)
^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/urllib3/response.py", line 861, in _raw_read
with self._error_catcher():
File "/usr/lib/python3.11/contextlib.py", line 158, in exit
self.gen.throw(typ, value, traceback)
File "/venv/lib/python3.11/site-packages/urllib3/response.py", line 761, in _error_catcher
raise ProtocolError(arg, e) from e
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(0 bytes read, 2 more expected)', IncompleteRead(0 bytes read, 2 more expected))

During handling of the above exception, another exception occurred:

File "/venv/lib/python3.11/site-packages/requests/models.py", line 899, in content
self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/venv/lib/python3.11/site-packages/requests/models.py", line 818, in generate
raise ChunkedEncodingError(e)
requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(0 bytes read, 2 more expected)', IncompleteRead(0 bytes read, 2 more expected))
`

Specifications

  • python-gitlab version: python3.11
  • API version you are using (v3/v4): default
  • Gitlab server version (or gitlab.com): gitlab.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant