why does close() fail miserably on popen with exit code -1 ?!

Rene Pijlman reply.in.the.newsgroup at my.address.is.invalid
Mon Feb 20 06:04:46 EST 2006


Atanas Banov:
>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.

Not here.

Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)]
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> print os.popen('exit 1').close()
1

-- 
René Pijlman



More information about the Python-list mailing list