Richard Oudkerk added the comment:

I get the same hang on Linux with Python 3.2.

For Windows the documentation does warn against starting a process as a side 
effect of importing a process.  There is no explicit warning for Unix, but I 
would still consider it bad form to do such things as a side effect of 
importing a module.

It appears that it is the import of the hmac module inside deliver_challenge() 
that is hanging.  I expect forking a process while an import is in progress may 
cause the import machinery (which I am not familiar with) to be in an 
inconsistent state.  The import lock should have been reset automatically after 
the fork, but maybe that is not enough.  Maybe the fact that the import is 
being done by a non-main thread is relevant.

I would suggest just rewriting the code as

create.py:

import multiprocessing

def main():
    manager = multiprocessing.Manager()
    namespace = manager.Namespace()
    print("create.py complete")

if __name__ == '__main__':
    main()


run.py:

import create
create.main()
print("run.py complete")

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15914>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to