Message61120
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'. |
|
Date |
User |
Action |
Args |
2008-01-20 09:59:27 | admin | link | issue798520 messages |
2008-01-20 09:59:27 | admin | create | |
|