Spaces in path name
josef.pktd at gmail.com
Sun Mar 16 14:23:21 CET 2008
Tim Golden wrote:
> subprocess.call ([
> r"C:\Program Files\Adobe\Acrobat 5.0\Reader\acro reader.exe",
> r"C:\Program Files\Adobe\Acr
> obat 5.0\Reader\plug_ins.donotuse\Annotations\Stamps\abc def.pdf"
> Can you confirm that something equivalent *doesn't* work on your
> setup? Or have I misunderstood your point earlier? I'd really
> like to get to the point where we can definitively state: this
> works (and possibly: that doesn't).
This works without problems for me on Windows XP, Python 2.4.3
In the past, I didn't have problems with subprocess.call, and I never
had to look closer to the different versions of quoting.
I often had problems understanding subprocess.Popen and getting it to
work. For example the equivalent case for popen, as your
subprocess.call example, does not work, or I'm making a different
mistake with subprocess.Popen:
p = subprocess.Popen([
r"C:\temp\Copy of papers.rar"],
rettext,reterror = p.communicate()
retcode = p.wait()
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
I assume that there is some difference how subprocess.call and
subprocess.Popen handle and format the command. subprocess.Popen does
the correct formatting when only one file path has spaces and requires
double quoting, but not if there are two file paths with spaces in it.
More information about the Python-list