You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unregistered runtime arguments with embedded quotes are passed incorrectly #438
Version: current main (e634365). Found by reading the source and reproduced at the function level, not through an installed build.
Describe the bug
For runtimes that are registered through PEP 514 but not managed by the install manager, pep514utils reads the ExecutableArguments and WindowedExecutableArguments values with scriptutils.split_args. Those arguments are then quoted again with quote_args and passed to the runtime when it is launched.
split_args only handles quotes that wrap a whole argument. A quote that starts or ends inside an argument, which is valid on Windows, gives the wrong result:
Input
split_args result
Windows C runtime result
--opt="a b" -E
['--opt="a b', '-E']
['--opt=a b', '-E']
-W"ignore"
['-W"ignore']
['-Wignore']
"a b"c d
['a b', 'd']
['a bc', 'd']
a"b"" c d
['a"b', 'c', 'd']
['ab" c d']
-X utf8
['-X', '', 'utf8']
['-X', 'utf8']
As a result, the launched runtime can receive an argument with a stray quote (for example, -W"ignore, which Python ignores as an invalid warning filter), or text can be dropped. The same values are shown in py list -f json as executable_args.
Activity