]> granicus.if.org Git - python/commitdiff
Merged revisions 85169 via svnmerge from
authorSenthil Kumaran <orsenthil@gmail.com>
Sat, 2 Oct 2010 10:35:24 +0000 (10:35 +0000)
committerSenthil Kumaran <orsenthil@gmail.com>
Sat, 2 Oct 2010 10:35:24 +0000 (10:35 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r85169 | senthil.kumaran | 2010-10-02 16:03:13 +0530 (Sat, 02 Oct 2010) | 3 lines

  Use proper variable name 'data' instead of 'str' in the send method.
........

Lib/http/client.py

index d490b3ded657aa710285ada841ee7431516e0d49..9348870c3d97a6c474aaa4fe35d7c69f2e77decc 100644 (file)
@@ -724,8 +724,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()
@@ -738,14 +738,14 @@ class HTTPConnection:
         # NOTE: we DO propagate the error, though, because we cannot simply
         #       ignore the error... the caller will know if they can retry.
         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.
@@ -756,14 +756,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.