-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-32573: Handle the case when sys.argv is not set #12463
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
Conversation
I encountered a situation where `sys.argv` wasn't set when using Python as an embedded interpreter. The proposed update will avoid an AttributeError in that case. If sys.argv is set, it should not change behavior. There's discussions related to correct behavior in this case: https://bugs.python.org/issue32573 Is this proposed update to spawn.py the correct fix, or should the embedded case be handled differently, somehow?
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
sys.argv is not set in embedded interpreters https://bugs.python.org/issue32573 This workaround avoids trouble in the multiprocessing module. python/cpython#12463
sys.argv is not set in embedded interpreters https://bugs.python.org/issue32573 This workaround avoids trouble in the multiprocessing module. python/cpython#12463
vstinner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In Python 3.8, sys.argv always exist: https://bugs.python.org/issue32573#msg342342
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
Would it make sense to include the workaround and/or setting |
I'm working on a whole PEP for Python 3.8: https://www.python.org/dev/peps/pep-0587/ For Python 3.7, I'm not sure that it's ok to change the behavior, but I just wrote: PR #13553. |
|
This was fixed as of 3.8 and won't be backported to earlier releases. |
I encountered a situation where
sys.argvwasn't set when using Python as an embedded interpreter. The proposed update will avoid an AttributeError in that case. Ifsys.argvis set, it should not change behavior.There's discussions related to correct behavior in this case:
https://bugs.python.org/issue32573
Is this proposed update to spawn.py the correct fix, or should the embedded case be handled differently, somehow?
https://bugs.python.org/issue32573