This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Devin Jeanpierre
Recipients Devin Jeanpierre, vstinner
Date 2015-05-25.08:37:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1432543061.46.0.0919733214048.issue24283@psf.upfronthosting.co.za>
In-reply-to
Content
The code attached runs a while loop that prints, and has a signal handler that also prints. There is a thread that constantly fires off signals, but this is just to ensure the condition for the bug happens -- this is a bug with signal handling, not threads -- I can trigger a RuntimeError (... with a missing message?) by commenting out the threading lines and instead running a separate process "while true; do kill -s SIGUSR1 4687; done".

Traceback:

$ python3 threading_print_test.py 
hello
world
Traceback (most recent call last):
  File "/usr/local/google/home/devinj/Downloads/threading_print_test.py", line 36, in <module>
    main()
  File "/usr/local/google/home/devinj/Downloads/threading_print_test.py", line 30, in main
    print("world")
  File "/usr/local/google/home/devinj/Downloads/threading_print_test.py", line 13, in print_hello
    print("hello")
RuntimeError: reentrant call inside <_io.BufferedWriter name='<stdout>'>
History
Date User Action Args
2015-05-25 08:37:41Devin Jeanpierresetrecipients: + Devin Jeanpierre, vstinner
2015-05-25 08:37:41Devin Jeanpierresetmessageid: <1432543061.46.0.0919733214048.issue24283@psf.upfronthosting.co.za>
2015-05-25 08:37:41Devin Jeanpierrelinkissue24283 messages
2015-05-25 08:37:41Devin Jeanpierrecreate