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
7b2c8bb8
Commit
7b2c8bb8
authored
Apr 12, 2013
by
Andrew Svetlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #16658: add missing return to HTTPConnection.send().
Patch by Jeff Knupp
parent
a3b255f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
1 deletion
+25
-1
Lib/http/client.py
Lib/http/client.py
+1
-1
Lib/test/test_httplib.py
Lib/test/test_httplib.py
+21
-0
Misc/NEWS
Misc/NEWS
+3
-0
No files found.
Lib/http/client.py
View file @
7b2c8bb8
...
...
@@ -866,7 +866,7 @@ class HTTPConnection:
if
encode
:
datablock
=
datablock
.
encode
(
"iso-8859-1"
)
self
.
sock
.
sendall
(
datablock
)
return
try
:
self
.
sock
.
sendall
(
data
)
except
TypeError
:
...
...
Lib/test/test_httplib.py
View file @
7b2c8bb8
...
...
@@ -371,6 +371,27 @@ class BasicTest(TestCase):
conn
.
send
(
io
.
BytesIO
(
expected
))
self
.
assertEqual
(
expected
,
sock
.
data
)
def
test_send_updating_file
(
self
):
def
data
():
yield
'data'
yield
None
yield
'data_two'
class
UpdatingFile
():
mode
=
'r'
d
=
data
()
def
read
(
self
,
blocksize
=-
1
):
return
self
.
d
.
__next__
()
expected
=
b'data'
conn
=
client
.
HTTPConnection
(
'example.com'
)
sock
=
FakeSocket
(
""
)
conn
.
sock
=
sock
conn
.
send
(
UpdatingFile
())
self
.
assertEqual
(
sock
.
data
,
expected
)
def
test_send_iter
(
self
):
expected
=
b'GET /foo HTTP/1.1
\
r
\
n
Host: example.com
\
r
\
n
'
\
b'Accept-Encoding: identity
\
r
\
n
Content-Length: 11
\
r
\
n
'
\
...
...
Misc/NEWS
View file @
7b2c8bb8
...
...
@@ -23,6 +23,9 @@ Core and Builtins
Library
-------
-
Issue
#
16658
:
add
missing
return
to
HTTPConnection
.
send
()
Patch
by
Jeff
Knupp
.
-
Issue
#
14971
:
unittest
test
discovery
no
longer
gets
confused
when
a
function
has
a
different
__name__
than
its
name
in
the
TestCase
class
dictionary
.
...
...
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