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

Multiprocessing freeze_support raises RuntimeError #66451

Closed
MichaelMcAuliffe mannequin opened this issue Aug 23, 2014 · 3 comments
Closed

Multiprocessing freeze_support raises RuntimeError #66451

MichaelMcAuliffe mannequin opened this issue Aug 23, 2014 · 3 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@MichaelMcAuliffe
Copy link
Mannequin

MichaelMcAuliffe mannequin commented Aug 23, 2014

BPO 22255
Nosy @applio

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2015-05-09.01:22:47.642>
created_at = <Date 2014-08-23.00:38:58.838>
labels = ['type-bug', 'library']
title = 'Multiprocessing freeze_support raises RuntimeError'
updated_at = <Date 2015-05-09.01:22:47.641>
user = 'https://bugs.python.org/MichaelMcAuliffe'

bugs.python.org fields:

activity = <Date 2015-05-09.01:22:47.641>
actor = 'davin'
assignee = 'none'
closed = True
closed_date = <Date 2015-05-09.01:22:47.642>
closer = 'davin'
components = ['Library (Lib)']
creation = <Date 2014-08-23.00:38:58.838>
creator = 'Michael.McAuliffe'
dependencies = []
files = []
hgrepos = []
issue_num = 22255
keywords = []
message_count = 3.0
messages = ['225719', '237276', '242788']
nosy_count = 3.0
nosy_names = ['sbt', 'Michael.McAuliffe', 'davin']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue22255'
versions = ['Python 3.4']

@MichaelMcAuliffe
Copy link
Mannequin Author

MichaelMcAuliffe mannequin commented Aug 23, 2014

On Windows, I froze a script that uses multiprocessing with cx-freeze and Python 3.4.1 that had freeze_support() in the "if __name__ == '__main__'" section of the main module, and the resulting executable crashes with a RuntimeError 'context has already been set'.

The error happens in a call to set_start_method in multiprocessing.spawn's prepare function, and changing the line in spawn.py from:

if 'start_method' in data:
    set_start_method(data['start_method'])

to:

if 'start_method' in data:
    set_start_method(data['start_method'], force = True)

allows the frozen executable to successfully run.

@MichaelMcAuliffe MichaelMcAuliffe mannequin added type-crash A hard crash of the interpreter, possibly with a core dump stdlib Python modules in the Lib dir labels Aug 23, 2014
@applio
Copy link
Member

applio commented Mar 5, 2015

Updates to both cx-freeze and multiprocessing in the meantime may likely have addressed this since this issue was first reported. Granted, diagnosing issues with cx-freeze are best directed to the cx-freeze project -- that is perhaps where this issue should be opened instead.

Can this issue still be reproduced? If so, a short example would be much appreciated.

@applio applio added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Mar 5, 2015
@applio
Copy link
Member

applio commented May 9, 2015

The issue may already be addressed for the OP and without further information we don't know what or if anything needs pursuing. If new information surfaces, a new issue should be opened.

@applio applio closed this as completed May 9, 2015
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant