-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Standardize HTTPResponse.read(X) behavior regardless of compression
Co-authored-by: Franek Magiera <framagie@gmail.com>
- Loading branch information
1 parent
9763f09
commit c35033f
Showing
7 changed files
with
292 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Standardized :meth:`~urllib3.response.HTTPResponse.read` to respect the semantics of BufferedIOBase regardless of compression. Specifically, this method: | ||
|
||
* only returns an empty bytes object to indicate EOF (that is, the response has been fully consumed), | ||
* never returns more bytes than requested, | ||
* can issue any number of system calls: zero, one or multiple. | ||
|
||
If you want each :meth:`~urllib3.response.HTTPResponse.read` call to issue a single system call, you need to disable decompression by setting ``decode_content=False``. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
coverage==6.4 | ||
tornado==6.2 | ||
PySocks==1.7.1 | ||
pytest==7.0.0 | ||
pytest==7.2.0 | ||
pytest-timeout==2.1.0 | ||
pytest-freezegun==0.4.2 | ||
flaky==3.7.0 | ||
trustme==0.9.0 | ||
cryptography==37.0.2 | ||
backports.zoneinfo==0.2.1;python_version<"3.9" | ||
towncrier==21.9.0 | ||
towncrier==21.9.0 | ||
pytest-memray==1.3.0;python_version>="3.8" and sys_platform!="win32" and implementation_name=="cpython" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.