Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-99370: calculate zip path from prefix when in a venv#99371
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ghost commentedNov 11, 2022 • edited by ghost
Loading Uh oh!
There was an error while loading.Please reload this page.
edited by ghost
Uh oh!
There was an error while loading.Please reload this page.
kkpattern commentedNov 11, 2022
@zooba PR is created. 🥳 |
kkpattern commentedNov 11, 2022
I looked at the failed Windows test case. It's because it's more complicated to create a "fake" non-installed python in tests on the Windows platform. On the other hand, the related code change only affects POSIX platform. So I think is reasonable to skip |
zooba commentedNov 11, 2022
I don't think using I'd suggest grabbing a temp dir and copying |
zooba commentedNov 11, 2022
But also, thinking about this, maybe the venv test isn't proving as much as I first thought. If it doesn't feel like it's falling into place, we probably can live without it. |
kkpattern commentedNov 11, 2022
Cool. I will first try to update the test to manually create the non-installed environment. If then we still feel it's too tricky, we can remove it. At least it has helped us verify that the new behavior is consistent with python3.10. |
9b0a2eb to3110166Comparebedevere-bot commentedNov 11, 2022
Most changes to Pythonrequire a NEWS entry. Please add it using theblurb_it web app or theblurb command-line tool. |
Before python3.11, when in a venv the zip path is calculatedfrom prefix on POSIX platforms. In python3.11 the behavior isaccidentally changed to calculating from default prefix. Thischange will break venv created from a non-installed pythonwith a stdlib zip file. This commit restore the behavior backto before python3.11.
3110166 tod463c31Comparekkpattern commentedNov 11, 2022
I have updated the |
zooba commentedNov 14, 2022
Nice work! Thanks! |
miss-islington commentedNov 14, 2022
Thanks@kkpattern for the PR, and@zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
bedevere-bot commentedNov 14, 2022
GH-99477 is a backport of this pull request to the3.11 branch. |
…GH-99371)Before python3.11, when in a venv the zip path is calculatedfrom prefix on POSIX platforms. In python3.11 the behavior isaccidentally changed to calculating from default prefix. Thischange will break venv created from a non-installed pythonwith a stdlib zip file. This commit restores the behavior backto before python3.11.(cherry picked from commite3d4fed)Co-authored-by: Kai Zhang <kylerzhang11@gmail.com>
miss-islington commentedNov 14, 2022
Thanks@kkpattern for the PR, and@zooba for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11. |
…GH-99371)Before python3.11, when in a venv the zip path is calculatedfrom prefix on POSIX platforms. In python3.11 the behavior isaccidentally changed to calculating from default prefix. Thischange will break venv created from a non-installed pythonwith a stdlib zip file. This commit restores the behavior backto before python3.11.(cherry picked from commite3d4fed)Co-authored-by: Kai Zhang <kylerzhang11@gmail.com>
bedevere-bot commentedNov 14, 2022
|
bedevere-bot commentedNov 14, 2022
|
bedevere-bot commentedNov 14, 2022
|
bedevere-bot commentedNov 14, 2022
|
Before python3.11, when in a venv the zip path is calculatedfrom prefix on POSIX platforms. In python3.11 the behavior isaccidentally changed to calculating from default prefix. Thischange will break venv created from a non-installed pythonwith a stdlib zip file. This commit restores the behavior backto before python3.11.(cherry picked from commite3d4fed)Co-authored-by: Kai Zhang <kylerzhang11@gmail.com>
kkpattern commentedNov 14, 2022
Looks like something is wrong with the |
bedevere-bot commentedNov 14, 2022
|
bedevere-bot commentedNov 14, 2022
|
bedevere-bot commentedNov 14, 2022
|
kkpattern commentedNov 14, 2022
OK. I figured out what happened. So if we enable shared python build. Besides |
kkpattern commentedNov 14, 2022
I will try to follow the instruction oncustom builders to test my fix. |
bedevere-bot commentedNov 14, 2022
|
bedevere-bot commentedNov 14, 2022
|
kkpattern commentedNov 14, 2022
bedevere-bot commentedNov 14, 2022
|
bedevere-bot commentedNov 14, 2022
|
bedevere-bot commentedNov 14, 2022
|
zware commentedNov 14, 2022
Go ahead and create a pull request for it, and we can apply the |
bedevere-bot commentedNov 14, 2022
|
kkpattern commentedNov 14, 2022
Thanks! I have created the PR:#99483 |
| # First try to create a non-installed python. It's not a real full | ||
| # functional non-installed python, but enough for this test. | ||
| non_installed_dir=os.path.realpath(tempfile.mkdtemp()) | ||
| try: |
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.
Rather than an enormoustry block, you can useself.addCleanup(rmtree, non_installed_dir)
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.
Thanks. Do I need to wait for the buildbots test to finish before pushing the change?
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.
Yeah, let's get the failures fixed and clean up afterwards :)
bedevere-bot commentedNov 14, 2022
|
* main: (8272 commits) Update Windows readme.txt to clarify Visual Studio required versions (pythonGH-99522)pythongh-99460 Emscripten trampolines on optimized METH_O and METH_NOARGS code paths (python#99461)pythongh-92647: [Enum] use final status to determine lookup or create (pythonGH-99500)pythongh-81057: Move Globals in Core Code to _PyRuntimeState (pythongh-99496) Post 3.12.0a2pythongh-99300: Use Py_NewRef() in Python/Python-ast.c (python#99499)pythongh-93649: Split pytime and datetime tests from _testcapimodule.c (python#99494)pythongh-99370: fix test_zippath_from_non_installed_posix (pythonGH-99483)pythonGH-99205: remove `_static` field from `PyThreadState` and `PyInterpreterState` (pythonGH-99385)pythongh-81057: Move the Remaining Import State Globals to _PyRuntimeState (pythongh-99488)pythongh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (pythonGH-99373)pythongh-93649: Split getargs tests from _testcapimodule.c (python#99346)pythongh-81057: Move Global Variables Holding Objects to _PyRuntimeState. (pythongh-99487)pythonGH-98219: reduce sleep time in `asyncio` subprocess test (python#99464)pythonGH-99388: add `loop_factory` parameter to `asyncio.run` (python#99462)pythongh-99300: Use Py_NewRef() in PC/ directory (python#99479)pythongh-99300: Use Py_NewRef() in Doc/ directory (python#99480)pythongh-99300: Use Py_NewRef() in Modules/ directory (python#99473)pythongh-99300: Use Py_NewRef() in Modules/ directory (python#99469)pythongh-99370: Calculate zip path from prefix when in a venv (pythonGH-99371) ...
Uh oh!
There was an error while loading.Please reload this page.
Before python3.11, when in a venv the zip path is calculated from prefix. In python3.11 the behavior is accidentally changed to calculating from the default prefix. This change will break venv created from a non-installed python with a stdlib zip file. This commit restores the behavior back to before python3.11.