From: <pj...@us...> - 2009-04-03 00:52:45
|
Revision: 6149 http://jython.svn.sourceforge.net/jython/?rev=6149&view=rev Author: pjenvey Date: 2009-04-03 00:52:31 +0000 (Fri, 03 Apr 2009) Log Message: ----------- ensure sane args to subprocess, fix OSError message Modified Paths: -------------- trunk/jython/Lib/subprocess.py Modified: trunk/jython/Lib/subprocess.py =================================================================== --- trunk/jython/Lib/subprocess.py 2009-04-02 02:32:59 UTC (rev 6148) +++ trunk/jython/Lib/subprocess.py 2009-04-03 00:52:31 UTC (rev 6149) @@ -1143,7 +1143,14 @@ if isinstance(args, types.StringTypes): args = [args] else: - args = escape_args(list(args)) + args = list(args) + for arg in args: + # XXX: CPython posix (execv) will str() any unicode + # args first, maybe we should do the same on + # posix. Windows passes unicode through however + if not isinstance(arg, (str, unicode)): + raise TypeError('args must contain only strings') + args = escape_args(args) if shell: args = shell_command + args @@ -1171,7 +1178,7 @@ elif not os.path.exists(cwd): raise OSError(errno.ENOENT, os.strerror(errno.ENOENT), cwd) elif not os.path.isdir(cwd): - raise OSError(errno.ENOTDIR, os.strerror(errno.ENOENT), cwd) + raise OSError(errno.ENOTDIR, os.strerror(errno.ENOTDIR), cwd) builder.directory(java.io.File(cwd)) # Let Java manage redirection of stderr to stdout (it's more This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |