[Python-checkins] [3.12] More actionable error message when spawn is incorrectly used. (GH-102203) (#107990)

Yhg1s webhook-mailer at python.org
Wed Aug 16 08:22:26 EDT 2023


https://github.com/python/cpython/commit/c2fb25a7145cbb6bbe92de28a230e963fe4d696f
commit: c2fb25a7145cbb6bbe92de28a230e963fe4d696f
branch: 3.12
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: Yhg1s <thomas at python.org>
date: 2023-08-16T14:22:22+02:00
summary:

[3.12] More actionable error message when spawn is incorrectly used. (GH-102203) (#107990)

More actionable error message when spawn is incorrectly used. (GH-102203)
(cherry picked from commit a794ebeb028f7ef287c780d3890f816db9c21c51)

Co-authored-by: Yuxin Wu <ppwwyyxxc at gmail.com>
Co-authored-by: Yuxin Wu <ppwwyyxx at users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg at arhadthedev.net>

files:
M Lib/multiprocessing/spawn.py

diff --git a/Lib/multiprocessing/spawn.py b/Lib/multiprocessing/spawn.py
index f1af770910471..daac1ecc34b55 100644
--- a/Lib/multiprocessing/spawn.py
+++ b/Lib/multiprocessing/spawn.py
@@ -150,7 +150,11 @@ def _check_not_importing_main():
                 ...
 
         The "freeze_support()" line can be omitted if the program
-        is not going to be frozen to produce an executable.''')
+        is not going to be frozen to produce an executable.
+
+        To fix this issue, refer to the "Safe importing of main module"
+        section in https://docs.python.org/3/library/multiprocessing.html
+        ''')
 
 
 def get_preparation_data(name):



More information about the Python-checkins mailing list