-
-
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
Multiple "unknown option" errors when passing unknown arguments to the interpreter #84707
Comments
A minor issue I just discovered today: When e.g. doing "python3 --foo", the output is: unknown option --foo With more dashes in the options, it seems to get worse: unknown option --foo-bar-baz This seems very similar to bpo-16306 (thus why I added people involved there to the nosy list), except that it happens with long rather than short arguments. This only happens with Python 3.8/3.9, not 3.7 or older. I was able to bisect this to the following commit: commit 6dcb542
|
Oh right, that's because Python parses the command line at least 3 times :-) The first 2 times, it is not supposed to log errors. It's a bug: attached PR 19955 fix it. |
Oh, well done! Yeah, it's all my fault ;-) It's a regression of the PEP-587 (PyConfig) implementation. I chose to share code between Python/preconfig.c and Python/initconfig.c rather than duplicate code. The implementation of _PyPreConfig_Read() and PyConfig_Read() is quite complex. |
Thanks for the bug report Florian and for work Victor! I am now closing this issue :) |
That was an insanely fast fix - thanks everyone! :) |
Sorry about that. We are working on this issue to ensure that next bugs will not fixed as quickly a this done ;-) |
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: