-
Notifications
You must be signed in to change notification settings - Fork 761
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
sys.argv support: Consider call PySys_SetArgv on python initialization. #1241
Comments
I wonder if we should be using the python initialization configuration from Python 3.8 onwards? I'll have a play with this this morning. |
@XUWeijiang I took a look this morning and I can't reproduce this issue. On my system the snippet you provide above works fine, and Can you please provide detail on your OS and Python version? |
@davidhewitt I am using ubuntu 18.04 on wsl, and python3.6. |
So I can confirm that on Python 3.6 this issue reproduces on my system. On Python 3.7 and up However, I'm unsure whether pyo3 should be setting |
Note for the future - the folks in The design of their implementation would take arguments passed from c++ Additionally, it's clearly less of a problem once we move away from supporting Python 3.6, because after that point accessing |
Currently if I use sys.argv in python code, it would complain: 'module' object has no attribute 'argv'
This is because python's argv is not initialized.
I hope PyO3 can provide an option to initialize argv in its initialization.
Repro Example
Output:
The text was updated successfully, but these errors were encountered: