-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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
trace changes sys.argv from list to tuple #77033
Comments
Normally sys.argv is a list but when using the trace module sys.argv gets changed to a tuple. In my case this caused an issue with running an entry point due to the line: sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) When researching I found: They point out where trace assigns a tuple to sys.argv. I'll see what I can do to put together a quick patch. $ cat t.py
import sys print(sys.version)
print(type(sys.argv))
$ /home/altendky/.pyenv/versions/3.7.0a2/bin/python t.py
3.7.0a2 (default, Feb 15 2018, 11:20:36)
[GCC 6.3.0 20170516]
<class 'list'>
$ /home/altendky/.pyenv/versions/3.7.0a2/bin/python -m trace --trace t.py
--- modulename: t, funcname: <module>
t.py(1): import sys
t.py(3): print(sys.version)
3.7.0a2 (default, Feb 15 2018, 11:20:36)
[GCC 6.3.0 20170516]
t.py(5): print(type(sys.argv))
<class 'tuple'>
--- modulename: trace, funcname: _unsettrace
trace.py(71): sys.settrace(None) |
Thank you for your contribution Kyle. Usually backports a made after merging the original PR. Thanks to bots this is done in half-automatical way. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: