[issue6750] threading issue in __builtins__.print

2009-08-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: fixed with r74581, r74582 and r74583 (in: trunk, py3k and release31-maint) -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue6750] threading issue in __builtins__.print

2009-08-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: The patch looks ok to me. It should be noted that TextIOWrapper was not designed to be thread-safe at all (neither the Python nor the C version); but admittedly it is more common to write() than to read() from multiple threads, so fixing this particular case mak

[issue6750] threading issue in __builtins__.print

2009-08-21 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The TextIOWrapper class is not thread-safe, because it calls [the equivalent of] self.buffer.write(self.pending_bytes) before clearing self.pending_bytes. Of course the write() function will release the GIL, and another thread may send the same pending_byt

[issue6750] threading issue in __builtins__.print

2009-08-21 Thread Jackson Yang
New submission from Jackson Yang : # Bug Description In a multi-threaded environment, the Win32 Python3000 built-in function "print" may give the output several times. # How to Reproduce: import threading event = threading.Event() class Test(threading.Thread): def __init__(self, ord):