[issue40399] IO streams locking can be broken after fork() with threads

Delgan report at bugs.python.org
Wed Apr 29 12:37:49 EDT 2020


Delgan <delgan.py at gmail.com> added the comment:

Yeah, I just wanted to illustrate the issue with a more realistic example. The thread is often abstracted away by a class or a library. Conclusion: do not abstract it away. :)

I've noticed that the mere fact of using "sys.stderr.write()", without even involving a queue, could cause the problem.

Out of curiosity: my understanding of "sys.stderr" being a "TextIOWrapper" implies it's not thread-safe. Therefore, do you have any idea of which lock is involved in this issue?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40399>
_______________________________________


More information about the Python-bugs-list mailing list