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
1c84ac1f
Commit
1c84ac1f
authored
Dec 17, 2013
by
Serhiy Storchaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
parent
48d761e2
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 @
1c84ac1f
...
...
@@ -544,7 +544,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 @
1c84ac1f
...
...
@@ -162,6 +162,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 @
1c84ac1f
...
...
@@ -1086,6 +1086,7 @@ Adrian Sampson
James Sanders
Ilya Sandler
Rafael Santos
Simon Sapin
Mark Sapiro
Ty Sarna
Hugh Sasse
...
...
Misc/NEWS
View file @
1c84ac1f
...
...
@@ -29,6 +29,9 @@ Core and Builtins
Library
-------
- Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
- Issue #19912: Fixed numerous bugs in ntpath.splitunc().
- Issue #19911: ntpath.splitdrive() now correctly processes the '
İ
' character
...
...
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