Quoth "Atanas Banov" <[EMAIL PROTECTED]>: | i ran onto this weirdness today: seems like close() on popen-ed | (pseudo)file fails miserably with exception instead of returning exit | code, when said exit code is -1. | | here is the simplest example (under Windows): | | >>> print popen('exit 1').close() | 1 | >>> print popen('exit -1').close() | Traceback (most recent call last): | File "<interactive input>", line 1, in ? | IOError: (0, 'Error') | >>> print popen('exit -2').close() | -2 | | has anyone have idea why is that?
I have no idea about Microsoft Windows, and I doubt that you could reproduce this on UNIX, but neither does this look like a valid UNIX program. Exit codes are integer values in the range [0..255], so there are no negative numbers (which is what I think you intended), nor are there strings (which is what '-1' would have been with the classic UNIX shell.) So I will leave it to someone else to wrestle with the Microsoft problem, but I just wanted to point out that it isn't something you could expect to work anywhere else. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list