[issue3719] platform.py: _syscmd_file() can't handle target path with space or special shell character

Hirokazu Yamamoto report at bugs.python.org
Tue Sep 2 12:15:45 CEST 2008


Hirokazu Yamamoto <ocean-city at m2.ccsnet.ne.jp> added the comment:

Can you try this patch?

1. used "file -b" option to eliminate file path. Otherwide, re.split
won't work because file path will contain space like this. (I hope -b
option can be used anywhere "file" command exists)

a b/python.exe: MS-DOS executable PE  for MS Windows (console) Intel
80386 32-bit

2. used subprocess module instead of popen. subprocess is useful when
argument contains space or quote like this issue.

----------
keywords: +patch
nosy: +ocean-city
Added file: http://bugs.python.org/file11342/platform.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3719>
_______________________________________


More information about the Python-bugs-list mailing list