Jython

Message7899

Author mniklas
Recipients mniklas
Date 2013年03月04日.10:04:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1362391454.48.0.0827468087785.issue2023@psf.upfronthosting.co.za>
In-reply-to
Content
I have problem when my Jython program tries to execute
Windows batch file which is the current directory, but this directory
is not the directory the program was started in.
Test program: dir_batch_test.py is attached.
In CPython this works well:
C:\share\mn>python dir_batch_test.py
Trying to execute: "batch_test.bat" in dir: "C:\share\mn\test"
file exists: C:\share\mn\test\batch_test.bat
C:\share\mn\test>time /t
10:16
In Jython I got strange exception:
C:\share\mn>jython dir_batch_test.py
Trying to execute: "batch_test.bat" in dir: "C:\share\mn\test"
file exists: C:\share\mn\test\batch_test.bat
Exception while trying to execute batch_test.bat
Traceback (most recent call last):
 File "dir_batch_test.py", line 21, in execute_cmd_args
 proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 File "D:\jython2.5.3\Lib\subprocess.py", line 751, in __init__
 self._execute_child(args, executable, preexec_fn, close_fds,
 File "D:\jython2.5.3\Lib\subprocess.py", line 1265, in _execute_child
 raise OSError(e.getMessage() or e)
OSError: Cannot run program "batch_test.bat" (in directory "C:\share\mn\test"): CreateProcess error=2, The system cannot find the file specified
I think this is a bun in Jython subprocess module.
History
Date User Action Args
2013年03月04日 10:04:14mniklassetrecipients: + mniklas
2013年03月04日 10:04:14mniklassetmessageid: <1362391454.48.0.0827468087785.issue2023@psf.upfronthosting.co.za>
2013年03月04日 10:04:14mniklaslinkissue2023 messages
2013年03月04日 10:04:14mniklascreate

Supported by Python Software Foundation,
Powered by Roundup

AltStyle によって変換されたページ (->オリジナル) /