Message48875
When a program's exit status is -1, the
Windows-specific _PyPclose() function will return -1,
which is mistaken by its caller file_close() as a
request to raise an exception, which then becomes
IOError with errno set to zero.
My proposed fix is to change
result = exit_code;
into
result = exit_code & 0xffff;
which should do the right thing at least on win32 (I
don't care about win16).
Patch attached. (I'd check this in but I can't test it.)
To reproduce:
(1) On XP, in the control panel, stop the "Server" service.
(2) Run the following code:
import os
p = os.popen("net share <nul:")
print p.read()
p.close()
Notice how the p.close() call raises an IOError: (0,
'Error') |
|
Date |
User |
Action |
Args |
2007-08-23 15:44:15 | admin | link | issue1328851 messages |
2007-08-23 15:44:15 | admin | create | |
|