4

I run a python task with supervisor, and when I try to use mutilprocess in the python task.I meet with the error

"File/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/multiprocessing/process.py", line 124, in start 

'daemonic processes are not allowed to have children'" 

But that's okay after I execute the command "export PYTHONOPTIMIZE=1" in the terminal .Anyone can tell me what has happened while executing the command "export PYTHONOPTIMIZE=1"

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
DlutAF
  • 53
  • 5

1 Answers1

5

Setting the PYTHONOPTIMIZE environment variable to 1 is the same thing as using the -O command line switch:

Remove assert statements and any code conditional on the value of __debug__.

The error message you see is an AssertionError exception; the relevant section of the source code uses assert:

assert not _current_process._daemonic, \
       'daemonic processes are not allowed to have children'

so setting the environment variable only suppresses the assertion. The problem itself doesn't go away.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343