SOLVED: Rebooting the machine appears to have removed the issue. I will update if the problem returns.
I\'m having an issue where Python2.6
hangs after
This exact issue has been biting me for awhile now on a RHEL 6 machine. In certain cases, Exceptions cause a hang. In fact, I was able to take your code verbatim and reproduce the symptom.
Thanks to the abrtd answer, I determined that abrt-addon-python package was installed which puts abrt_exception_handler.py into the site-packages location, and that is called during python startup. This file overrides the sys.excepthook function which contacts the abrt daemon using sockets. See ABRT Project Doc for more information.
I verified that adding -S to the python invocation prevents the hang. This is not a good solution, however, because the -S option prevents ALL site packages from being imported on startup.
A better solution is to add the following in your python code:
import sys
sys.excepthook = sys.__excepthook__
which restores the original exception hook and prevents the hang.