This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients
Date 2005-10-17.18:09:52
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
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')
History
Date User Action Args
2007-08-23 15:44:15adminlinkissue1328851 messages
2007-08-23 15:44:15admincreate