Skip to content

"run" command leaves spurios components in sys.argv #177

@d-maurer

Description

@d-maurer

Using bin/client1 run ..., in the run script sys.argv starts with [".../interpreter", "-c"] (rather than the run script).

I observed this with version 6.7.5 (from Plone 5.2.2) under PY2 but according to the change log the problem does not seem to have been fixed in 6.10.0.

The bug seems to be located in ctl.ZopeCmd.do_run:

        # Remove -c and add script as sys.argv[0]
        script = tup[0]
        cmd = [
            "import sys",
            "sys.argv.pop()",
            "sys.argv.append(%r)" % script,
        ]

Of course, sys.argv.pop() does not guarantee that the following append adds component 0 (as it should). I suggest to replace it with del sys.argv[:].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions