-
-
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
Regression in multiprocessing example using venv on Windows in 3.11rc2 #98360
Comments
There is a bug with using multiprocessing in a virtual environment, which I presume applies to development under PyCharm. Under a virtual environment, multiprocessing bypasses the venv launcher to instead directly run However, multiprocessing leaves the path of the venv launcher in the command line, which hasn't been a problem until 3.11. With the new implementation of path initialization in 3.11, the value of A high-level fix in cpython/Lib/multiprocessing/popen_spawn_win32.py Lines 55 to 68 in 5fe0431
Footnotes
|
Many Thanks, I can confirm that using the System Interpreter in PyCharm (without Virtual Environment) py 3.11.0_rc2 works correctly. |
@zooba Can you have a look at this release blocker? |
This sounds like the right fix here. It should be easy to test (in case someone else gets to it before I can):
|
…orrect argv[0] in virtual environments
PR posted. @pablogsal, for your consideration for next week's release. I don't know how common it is to nest multiprocessing pools like this, but the fix is general goodness and seems unlikely to introduce other issues. |
… argv[0] in virtual environments (GH-98462)
…orrect argv[0] in virtual environments (pythonGH-98462) (cherry picked from commit e48f9b2) Co-authored-by: Steve Dower <steve.dower@python.org>
* main: (40 commits) pythongh-98461: Fix source location in comprehensions bytecode (pythonGH-98464) pythongh-98421: Clean Up PyObject_Print (pythonGH-98422) pythongh-98360: multiprocessing now spawns children on Windows with correct argv[0] in virtual environments (pythonGH-98462) CODEOWNERS: Become a typing code owner (python#98480) [doc] Improve logging cookbook example. (pythonGH-98481) Add more tkinter.Canvas tests (pythonGH-98475) pythongh-95023: Added os.setns and os.unshare functions (python#95046) pythonGH-98363: Presize the list for batched() (pythonGH-98419) pythongh-98374: Suppress ImportError for invalid query for help() command. (pythongh-98450) typing tests: `_overload_dummy` raises `NotImplementedError`, not `RuntimeError` (python#98351) pythongh-98354: Add unicode check for 'name' attribute in _imp_create_builtin (pythonGH-98412) pythongh-98257: Make _PyEval_SetTrace() reentrant (python#98258) pythongh-98414: py.exe launcher does not use defaults for -V:company/ option (pythonGH-98460) pythongh-98417: Store int_max_str_digits on the Interpreter State (pythonGH-98418) Doc: Remove title text from internal links (python#98409) [doc] Refresh the venv introduction documentation, and correct the statement about VIRTUAL_ENV (pythonGH-98350) Docs: Bump sphinx-lint and fix unbalanced inline literal markup (python#98441) pythongh-92886: Replace assertion statements in `handlers.BaseHandler` to support running with optimizations (`-O`) (pythonGH-93231) pythongh-92886: Fix tests that fail when running with optimizations (`-O`) in `_test_multiprocessing.py` (pythonGH-93233) pythongh-92886: Fix tests that fail when running with optimizations (`-O`) in `test_py_compile.py` (pythonGH-93235) ...
This looks fixed. Closing. |
I'm programming in PyCharm in Virtual Environment on Win11 on a 12900k
I use 2 modules:
• mp_tst_all.py
• mp_tst_a.py
mp_tst_all.py
mp_tst_a.py
Bug
first: with PyCharm
mp_tst_a.py works in py 3.11.0_rc2 and in py 3.10(.7)
but
when mp_tst_a.py is called from mp_tst_all.py there is an error in py 3.11.0_rc2,
however, in py 3.10(.7) it works
the error message varies depending on the 'rest' variable (mp_tst_a.py -> def run_main)
secondly: in Command Prompt Window (cmd) it runs:
is it a bug in 3.11.0_rc2 or do i need to change something in the code ?
Thank you
The text was updated successfully, but these errors were encountered: