]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport rpc.py rev 1.28 dating from 21Jan04
authorKurt B. Kaiser <kbk@shore.net>
Wed, 19 Jan 2005 01:44:06 +0000 (01:44 +0000)
committerKurt B. Kaiser <kbk@shore.net>
Wed, 19 Jan 2005 01:44:06 +0000 (01:44 +0000)
rpc.py:SocketIO - Large modules were generating large pickles when downloaded
to the execution server.  The return of the OK response from the subprocess
initialization was interfering and causing the sending socket to be not
ready.  Add an IO ready test to fix this.  Moved the polling IO ready test
into pollpacket().

Fix typo in rpc.py, s/b "pickle.PicklingError" not "pickle.UnpicklingError".

idlever.py should be 1.0.4 to align with NEWS.txt.  There was no IDLE release
at 2.3.1 which accounts for the unsync.

M NEWS.txt
M idlever.py
M rpc.py

Lib/idlelib/NEWS.txt
Lib/idlelib/idlever.py
Lib/idlelib/rpc.py

index 0ffb65606d52bb33a51b1563e55235325fff65b8..f1ad5060c01acecb76c9e2bafe60a5d3372eb69a 100644 (file)
@@ -3,6 +3,14 @@ What's New in IDLE 1.0.4?
 
 *Release date: XX-Jan-2005*
 
+- rpc.py:SocketIO - Large modules were generating large pickles when downloaded
+  to the execution server.  The return of the OK response from the subprocess
+  initialization was interfering and causing the sending socket to be not
+  ready.  Add an IO ready test to fix this.  Moved the polling IO ready test
+  into pollpacket(). (Backporting rpc.py rev 1.28 21Jan04)
+
+- Fix typo in rpc.py, s/b "pickle.PicklingError" not "pickle.UnpicklingError".
+
 - If an extension can't be loaded, print warning and skip it instead of
   erroring out.
 
index 548bbb995a0a1ddbb5ba8ff988d3dd046db71674..1cd863b36c0eb4c1ecf16c3618b871338a43b07f 100644 (file)
@@ -1 +1 @@
-IDLE_VERSION = "1.0.5"
+IDLE_VERSION = "1.0.4"
index 63e0ffa814dc803bdfd9b047e587f0a679fe24f2..dc6c6011882dac34e8ca067c6e3d3ebd0feb583f 100644 (file)
@@ -320,23 +320,20 @@ class SocketIO:
         self.debug("putmessage:%d:" % message[0])
         try:
             s = pickle.dumps(message)
-        except pickle.UnpicklingError:
+        except pickle.PicklingError:
             print >>sys.__stderr__, "Cannot pickle:", `message`
             raise
         s = struct.pack("<i", len(s)) + s
         while len(s) > 0:
             try:
-                n = self.sock.send(s)
+                r, w, x = select.select([], [self.sock], [])
+                n = self.sock.send(s[:BUFSIZE])
             except (AttributeError, socket.error):
                 # socket was closed
                 raise IOError
             else:
                 s = s[n:]
 
-    def ioready(self, wait):
-        r, w, x = select.select([self.sock.fileno()], [], [], wait)
-        return len(r)
-
     buffer = ""
     bufneed = 4
     bufstate = 0 # meaning: 0 => reading count; 1 => reading data
@@ -344,7 +341,8 @@ class SocketIO:
     def pollpacket(self, wait):
         self._stage0()
         if len(self.buffer) < self.bufneed:
-            if not self.ioready(wait):
+            r, w, x = select.select([self.sock.fileno()], [], [], wait)
+            if len(r) == 0:
                 return None
             try:
                 s = self.sock.recv(BUFSIZE)
@@ -377,7 +375,7 @@ class SocketIO:
             return None
         try:
             message = pickle.loads(packet)
-        except:
+        except pickle.UnpicklingError:
             print >>sys.__stderr__, "-----------------------"
             print >>sys.__stderr__, "cannot unpickle packet:", `packet`
             traceback.print_stack(file=sys.__stderr__)