Details
Description
In pysidedeploy.spec, if any of the arguments of extra_args contains a space, Nuitka will throw an error even if that argument is surrounded by quotes.
For example:
extra_args = ... --macos-app-name="App Name"
will throw an error:
FATAL: Error, specify only one positional argument unless "--run" is specified to pass them to the compiled program execution.
as it is trying to naively split the arguments by space:
subprocess.CalledProcessError: Command '[..., '--macos-app-name="App', 'Name"', ...]' returned non-zero exit status 1.
This can be fixed by replacing
extra_args = extra_args.split()
with
import shlex
extra_args = shlex.split(extra_args)
This will correctly parse the argument string and split it as if it were a real command entered on the command line, preserving quoted strings and spaces escaped with a backslash.
Attachments
For Gerrit Dashboard: PYSIDE-2814 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
579518,4 | deploy: use shlex to split args | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
579535,2 | deploy: use shlex to split args | 6.7 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
579734,3 | deploy: use shlex to split args | tqtc/lts-6.5 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |
582733,3 | deploy: use shlex to split args | tqtc/6.5 | pyside/tqtc-pyside-setup | Status: MERGED | +2 | 0 |
582876,1 | deploy: use shlex to split args | tqtc/lts-6.2 | pyside/tqtc-pyside-setup | Status: ABANDONED | -1 | 0 |
583694,1 | deploy: use shlex to split args | tqtc/6.3 | pyside/tqtc-pyside-setup | Status: ABANDONED | -1 | 0 |
583695,1 | deploy: use shlex to split args | tqtc/6.4 | pyside/tqtc-pyside-setup | Status: ABANDONED | -1 | 0 |