Python's print() can crash when called from a reentrant signal handler
An investigation into Python signal handling shows that Python signal handlers, unlike C ones, run outside the strict low-level signal context but can still be re-entered mid-execution if another signal arrives. A test script that rapidly sends SIGUSR1 signals to itself while calling print() inside the handler triggers a RuntimeError, since Python's buffered stdout object detects the reentrant write and refuses to proceed.