-
Notifications
You must be signed in to change notification settings - Fork 22
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
Unhandled HTTPErrors When Negative Offset Not Supported #15
Comments
There's probably a much better and less verbose way to do this, but I did fix it with the following:
|
Hi, I have few questions:
|
|
gtsystem
added a commit
that referenced
this issue
Jan 15, 2023
… miss support for suffix range requests.
gtsystem
added a commit
that referenced
this issue
Jan 15, 2023
* v0.12.0: Fixes #15. Add new parameter `support_suffix_range` for backends that miss support for suffix range
@EmmaJaneBonestell, added
|
@gtsystem |
edek437
pushed a commit
to edek437/python-remotezip
that referenced
this issue
Jan 18, 2023
gtsystem
pushed a commit
that referenced
this issue
Jan 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When trying to use remotezip with PyPi, I discovered that while their server supports range requests, it does not support using a negative offset to get {content-length - bytes}-{content-length}.
When raise_for_status is called, an HTTP 501 error is returned (it could theoretically also be a 405) and remotezip aborts.
python-remotezip/remotezip.py
Lines 184 to 189 in 2afca9a
Reproducer:
I was going to do a pull request, but not being super good with Python myself, I found it was not obviously fixible (to me at least) with a simple try/catch since it's going through constructors, etc.
Checking for a 501 or 405 error before raise_for_status and falling back to getting self.__file_size by a separate http request for content-length should fix this.
Something like:
Edit: I also submitted a bug/feature request to PyPI/warehoise about this on their server; I don't anticipate they will implement it quickly, but if they do, the given reproducer may not work.
The text was updated successfully, but these errors were encountered: