Issue 22255: Multiprocessing freeze_support raises RuntimeError (original) (raw)

Issue22255

Created on 2014-08-23 00:38 by Michael.McAuliffe, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg225719 - (view) Author: Michael McAuliffe (Michael.McAuliffe) Date: 2014-08-23 00:38
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.
msg237276 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2015-03-05 17:01
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.
msg242788 - (view) Author: Davin Potts (davin) * (Python committer) Date: 2015-05-09 01:22
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.
History
Date User Action Args
2022-04-11 14:58:07 admin set github: 66451
2015-05-09 01:22:47 davin set status: pending -> closedresolution: out of datemessages: +
2015-03-05 17:01:45 davin set status: open -> pendingnosy: + davinmessages: + type: crash -> behavior
2014-08-23 16:38:13 berker.peksag set nosy: + sbt
2014-08-23 00:38:58 Michael.McAuliffe create