Kaydet (Commit) 098d79d7 authored tarafından Kurt B. Kaiser's avatar Kurt B. Kaiser

Backport rpc.py rev 1.28 dating from 21Jan04

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
üst 7c89f1ab
......@@ -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.
......
IDLE_VERSION = "1.0.5"
IDLE_VERSION = "1.0.4"
......@@ -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__)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment