Message171649
So it seems the cwd argument to Popen() currently works differently on Windows from Mac OS X. For example, the following doesn't work on Windows (but does on Mac). Windows doesn't look for arg0 relative to arg_cwd:
def test_cwd(arg0, arg_cwd):
os.chdir('foo') # Make sure we're in a different directory from arg0.
p = subprocess.Popen([arg0, "-c",
"import os, sys; "
"sys.stdout.write(os.getcwd()); "
"sys.exit(47)"],
stdout=subprocess.PIPE,
cwd=arg_cwd)
p.wait()
print("stdout: " + p.stdout.read().decode("utf-8"))
print("return_code: %s" % p.returncode)
python_path = os.path.realpath(sys.executable)
python_dir, python_base = os.path.split(python_path)
rel_python = os.path.join(os.curdir, python_base)
# Raises: WindowsError: [Error 2] The system cannot find the file specified
test_cwd(rel_python, python_dir)
I'm going to mark the two tests as "skipped" on Windows pending a resolution. |
|
Date |
User |
Action |
Args |
2012-09-30 16:33:08 | chris.jerdonek | set | recipients:
+ chris.jerdonek, ned.deily, cvrebert, asvetlov, docs@python, python-dev |
2012-09-30 16:33:08 | chris.jerdonek | set | messageid: <1349022788.8.0.209925444879.issue15533@psf.upfronthosting.co.za> |
2012-09-30 16:33:08 | chris.jerdonek | link | issue15533 messages |
2012-09-30 16:33:07 | chris.jerdonek | create | |
|