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.

classification
Title: os.system on win32 can't handle pathnames with spaces
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, salty-horse
Priority: normal Keywords:

Created on 2005-08-05 17:55 by salty-horse, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg25995 - (view) Author: Ori Avtalion (salty-horse) * Date: 2005-08-05 17:55
when calling os.system("file with spaces.exe"), Windows
outputs the following:

'file' is not recognized as an internal or external
command,
operable program or batch file.

I tried quoting the filename. Still got the same error.
msg25996 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2005-08-05 18:41
Logged In: YES 
user_id=1188172

Can you escape the spaces with backslashes? Or with
circumflexes?
msg25997 - (view) Author: Ori Avtalion (salty-horse) * Date: 2005-08-06 10:13
Logged In: YES 
user_id=854801

os.execute("\"file with spaces\"") seems to solve the problem.

Documentation here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp

Turns out this is NOT a bug.
History
Date User Action Args
2022-04-11 14:56:12adminsetgithub: 42258
2005-08-05 17:55:20salty-horsecreate