Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2814

pyside6-deploy: Use "shlex.split(extra_args)" instead of "extra_args.split()" in nuitka_helper.py

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Fixed
    • P2: Important
    • 6.5.6, 6.8.0, 6.7.3
    • None
    • Tooling
    • None
    • db0094c46 (dev), b2bd421eb (6.7), dd97ca9e9 (tqtc/lts-6.5), bf79f5e4a (tqtc/6.5)

    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

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shpremna Shyamnath Premnadh
            jirauser71545 user-a8bac (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There is 1 open Gerrit change