Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
cbbbf504
Commit
cbbbf504
authored
Dec 17, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Plain Diff
Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
parents
11aa5562
539c4a63
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
1 deletion
+8
-1
Lib/http/client.py
Lib/http/client.py
+1
-1
Lib/test/test_httplib.py
Lib/test/test_httplib.py
+3
-0
Misc/ACKS
Misc/ACKS
+1
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/http/client.py
View file @
cbbbf504
...
...
@@ -538,7 +538,7 @@ class HTTPResponse(io.RawIOBase):
# connection, and the user is reading more bytes than will be provided
# (for example, reading in 1k chunks)
n
=
self
.
fp
.
readinto
(
b
)
if
not
n
:
if
not
n
and
b
:
# Ideally, we would raise IncompleteRead if the content-length
# wasn't satisfied, but it might break compatibility.
self
.
_close_conn
()
...
...
Lib/test/test_httplib.py
View file @
cbbbf504
...
...
@@ -164,6 +164,9 @@ class BasicTest(TestCase):
sock
=
FakeSocket
(
body
)
resp
=
client
.
HTTPResponse
(
sock
)
resp
.
begin
()
self
.
assertEqual
(
resp
.
read
(
0
),
b''
)
# Issue #20007
self
.
assertFalse
(
resp
.
isclosed
())
self
.
assertFalse
(
resp
.
closed
)
self
.
assertEqual
(
resp
.
read
(),
b"Text"
)
self
.
assertTrue
(
resp
.
isclosed
())
self
.
assertFalse
(
resp
.
closed
)
...
...
Misc/ACKS
View file @
cbbbf504
...
...
@@ -1136,6 +1136,7 @@ Adrian Sampson
James Sanders
Ilya Sandler
Rafael Santos
Simon Sapin
Mark Sapiro
Ty Sarna
Hugh Sasse
...
...
Misc/NEWS
View file @
cbbbf504
...
...
@@ -44,6 +44,9 @@ Core and Builtins
Library
-------
- Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
- Issue #19946: multiprocessing now uses runpy to initialize __main__ in
child processes when necessary, allowing it to correctly handle scripts
without suffixes and submodules that use explicit relative imports or
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment