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
5a2da3b3
Commit
5a2da3b3
authored
Oct 02, 2010
by
Senthil Kumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use proper variable name 'data' instead of 'str' in the send method.
parent
7cafd264
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
Lib/http/client.py
Lib/http/client.py
+10
-10
No files found.
Lib/http/client.py
View file @
5a2da3b3
...
...
@@ -730,8 +730,8 @@ class HTTPConnection:
self
.
__response
=
None
self
.
__state
=
_CS_IDLE
def
send
(
self
,
str
):
"""Send `
str
' to the server."""
def
send
(
self
,
data
):
"""Send `
data
' to the server."""
if
self
.
sock
is
None
:
if
self
.
auto_open
:
self
.
connect
()
...
...
@@ -739,14 +739,14 @@ class HTTPConnection:
raise
NotConnected
()
if
self
.
debuglevel
>
0
:
print
(
"send:"
,
repr
(
str
))
print
(
"send:"
,
repr
(
data
))
blocksize
=
8192
if
hasattr
(
str
,
"read"
)
:
if
hasattr
(
data
,
"read"
)
:
if
self
.
debuglevel
>
0
:
print
(
"sendIng a read()able"
)
encode
=
False
try
:
mode
=
str
.
mode
mode
=
data
.
mode
except
AttributeError
:
# io.BytesIO and other file-like objects don't have a `mode`
# attribute.
...
...
@@ -757,14 +757,14 @@ class HTTPConnection:
if
self
.
debuglevel
>
0
:
print
(
"encoding file using iso-8859-1"
)
while
1
:
data
=
str
.
read
(
blocksize
)
if
not
data
:
data
block
=
data
.
read
(
blocksize
)
if
not
data
block
:
break
if
encode
:
data
=
data
.
encode
(
"iso-8859-1"
)
self
.
sock
.
sendall
(
data
)
data
block
=
datablock
.
encode
(
"iso-8859-1"
)
self
.
sock
.
sendall
(
data
block
)
else
:
self
.
sock
.
sendall
(
str
)
self
.
sock
.
sendall
(
data
)
def
_output
(
self
,
s
):
"""Add a line of output to the current request buffer.
...
...
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