[Python-checkins] r85169 - python/branches/py3k/Lib/http/client.py

senthil.kumaran python-checkins at python.org
Sat Oct 2 12:33:13 CEST 2010


Author: senthil.kumaran
Date: Sat Oct  2 12:33:13 2010
New Revision: 85169

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



Modified:
   python/branches/py3k/Lib/http/client.py

Modified: python/branches/py3k/Lib/http/client.py
==============================================================================
--- python/branches/py3k/Lib/http/client.py	(original)
+++ python/branches/py3k/Lib/http/client.py	Sat Oct  2 12:33:13 2010
@@ -730,8 +730,8 @@
             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 @@
                 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 @@
                     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.


More information about the Python-checkins mailing list