Richard Oudkerk added the comment:

Here is a reproduction without using multiprocessing:

create.py:

import threading, os

def foo():
    print("Trying import")
    import sys
    print("Import successful")

pid = os.fork()
if pid == 0:
    try:
        t = threading.Thread(target=foo)
        t.start()
        t.join()
    finally:
        os._exit(0)

os.waitpid(pid, 0)
print("create.py complete")


run.py:

import create
print("run.py complete")


Using python2.7 and python3.3 this works as expected, but with python3.2 I get

user@mint-vm /tmp $ python3 create.py
Trying import
Import successful
create.py complete
user@mint-vm /tmp $ python3 run.py 
Trying import
<Hang>
^CTraceback (most recent call last):
  File "run.py", line 1, in <module>
    import create
  File "/tmp/create.py", line 17, in <module>
    os.waitpid(pid, 0)
KeyboardInterrupt

----------

_______________________________________
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