[issue14073] allow per-thread atexit()
report at bugs.python.org
Wed Feb 22 10:20:28 CET 2012
Tarek Ziadé <ziade.tarek at gmail.com> added the comment:
Mmm.. you did not say yet why you are against this feature, other than "the lib *should not* use non-daemonized threads"
This sounds like "the lib should not use feature X in Python because it will block everything"
And now we're proposing to remove the limitation and you are telling me I am vague and unreasonable.
Let me try differently then.
Consider this script to be a library I don't control. I need to call the .stop() function when my main application shuts down.
I can't use signals because you forbid it in mod_wsgi
How do I do, since asking the person to daemonize his thread is not an option ?
I see several options:
1 - monkey patch the lib
2 - remove regular threads from Python, or making them always daemonized
3 - add an atexit() option in threads in Python
4 - use signals and drop the usage of mod_wsgi
I think 3- is the cleanest.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list