Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
d-maurer opened this issue Aug 9, 2021 · 0 comments
Open

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

d-maurer opened this issue Aug 9, 2021 · 0 comments

Comments

@d-maurer
Copy link

d-maurer commented Aug 9, 2021

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[:].

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant