Skip to content
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

reloader can use sys.orig_argv to get exact command #2589

Closed
davidism opened this issue Feb 17, 2023 · 2 comments · Fixed by #2591
Closed

reloader can use sys.orig_argv to get exact command #2589

davidism opened this issue Feb 17, 2023 · 2 comments · Fixed by #2591
Assignees
Labels
Milestone

Comments

@davidism
Copy link
Member

sys.orig_argv, added in Python 3.10, contains the exact command line used to start the python command. It does not modify -m name into /path/to/name.py, and keeps arguments like -X dev. The reloader can use this instead of all the reconstructing it does right now.

@davidism
Copy link
Member Author

This would also happen to fix #2588, where poetry run creates a python -c 'import...' command (somewhat incorrectly, but still). There's no way for the existing code to work with this, sys.argv only sees "-c", not the rest of the command.

@delucca
Copy link

delucca commented Feb 20, 2023

@davidism thanks for all your work!

After this PR is released, I assume I can simply update Flask and it will allow me to use Poetry even if they insist in not fixing the unexpected mutation of sys.argv?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants