bug in os.system?

nicksjacobson at yahoo.com nicksjacobson at yahoo.com
Tue Oct 18 08:33:18 CEST 2005


The following code fails (pythonbugtest.exe takes one parameter, a
string):

import os
result = os.system('"pythonbugtest.exe" "test"')
assert(result == 0)

The error message is:

'pythonbugtest.exe" "test' is not recognized as an internal or external
command, operable program or batch file.
Traceback (most recent call last):
  File "C:\Nick\!My Programs\Python\bugtest\python1.py", line 8, in ?
    assert(result == 0)
AssertionError


If I remove the quote marks around "pythonbugtest.exe" or "test", it
works fine.  But sometimes I need those quote marks, if e.g. there are
spaces in filenames.

I think this is a bug?

I'm running Python 2.4.1 on Windows XP Pro.




More information about the Python-list mailing list