summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSenthil Kumaran <orsenthil@gmail.com>2010-10-02 10:33:13 (GMT)
committerSenthil Kumaran <orsenthil@gmail.com>2010-10-02 10:33:13 (GMT)
commit5a2da3b3adc6d36fcebac0c4aeceffa1ff4e4d33 (patch)
treef290f99c31800eed20db340eae5e83f822c9b8f0 /Lib
parent7cafd2644a0ea4f62372a29820c870a866e2bd54 (diff)
downloadcpython-5a2da3b3adc6d36fcebac0c4aeceffa1ff4e4d33.zip
cpython-5a2da3b3adc6d36fcebac0c4aeceffa1ff4e4d33.tar.gz
cpython-5a2da3b3adc6d36fcebac0c4aeceffa1ff4e4d33.tar.bz2
Use proper variable name 'data' instead of 'str' in the send method.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/http/client.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/http/client.py b/Lib/http/client.py
index d1d2bb9..2799c07 100644
--- a/Lib/http/client.py
+++ b/Lib/http/client.py
@@ -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:
+ datablock = data.read(blocksize)
+ if not datablock:
break
if encode:
- data = data.encode("iso-8859-1")
- self.sock.sendall(data)
+ datablock = datablock.encode("iso-8859-1")
+ self.sock.sendall(datablock)
else:
- self.sock.sendall(str)
+ self.sock.sendall(data)
def _output(self, s):
"""Add a line of output to the current request buffer.