Message263651
I write a simple example which behaviour is like Steven's example.
import os
import sys
import threading
import ctypes
import time
def test():
while True:
print(time.time())
_thread = threading.Thread(target=test)
pid = os.fork()
if pid > 0:
sys.exit(0)
_thread.start()
Run this with py3.4 emits one print and then comes fatal error:
[code]$ python3 ctypes_test.py
1460964519.9721818
[code]$ Fatal Python error: could not acquire lock for <_io.BufferedWriter name='<stdout>'> at interpreter shutdown, possibly due to daemon threads
Thread 0x00007f41fdadf700 (most recent call first):
File "ctypes_test.py", line 9 in test
File "/usr/lib/python3.4/threading.py", line 868 in run
File "/usr/lib/python3.4/threading.py", line 920 in _bootstrap_inner
File "/usr/lib/python3.4/threading.py", line 888 in _bootstrap
Current thread 0x00007f41ff9a9700 (most recent call first):
^C
Without import ctypes, it's OK. |
|
Date |
User |
Action |
Args |
2016-04-18 07:29:36 | xiang.zhang | set | recipients:
+ xiang.zhang, amaury.forgeotdarc, belopolsky, vstinner, meador.inge, Steven Adams |
2016-04-18 07:29:36 | xiang.zhang | set | messageid: <1460964576.45.0.25867766325.issue26793@psf.upfronthosting.co.za> |
2016-04-18 07:29:36 | xiang.zhang | link | issue26793 messages |
2016-04-18 07:29:35 | xiang.zhang | create | |
|