-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
IDLE leaking ARGV into globals() namespace #82258
Comments
Reproducer:
>>> dir()
['__annotations__', '__builtins__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', 'argv'] |
I verified that 'argv' (bound to sys.argv) appears for all three versions after running an editor file, but not when Shell is started normally, without a file. The immediate culprit is the runcommand code in runscript, lines 156-168. As part of the patch to allow additions to sys.argv, temporary name 'argv' was added but not deleted at the end. I missed this when I reviewed the patch. So this bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4. The immediate fix is trivial. The deeper problem is running internal IDLE code in the user namespace. I believe that this is not necessary and opened bpo-38078 to test and fix. |
I just want to express my delight, Terry, about your desire to solve the root of the problem instead of just fixing a particular instance. (This is not the first time I witnessed that.) It's a big part of the reason why I love Python so much. |
This seems complete, can it be closed? |
Since I opened the followup issue, yes. Thanks for noticing. |
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: