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 gaul
Recipients
Date 2003-09-01.12:34:47
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
On Windows, os.popen with an invalid mode throw a
ValueError and on POSIX systems it throws an OSError.

Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32
bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for
more information.
>>> import os
>>> os.popen('dir', '')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: popen() arg 2 must be 'r' or 'w'

Python 2.3 (#167, Sep  1 2003, 06:38:18)
[GCC 3.0.4] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import os
>>> os.popen('ls', '')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
OSError: [Errno 22] Invalid argument

Additionally, the ValueError message is incorrect; arg
2 can be 'r', 'rb', 'rt', 'w', 'wb', or 'wt'.
History
Date User Action Args
2008-01-20 09:59:27adminlinkissue798520 messages
2008-01-20 09:59:27admincreate