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"

2

1 Answer 1

6

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.