[issue1400] Py3k's print() flushing problem
Guido van Rossum added the comment: Committed revision 59379. This adds proper line_buffering behavior. -- resolution: - fixed status: open - closed __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1400 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1400] Py3k's print() flushing problem
Guido van Rossum added the comment: In r59341 I added a flush of stdout and stderr at the end of each command that restores the following behavior: n = sys.stdout.write('X') X I still need to change io.py to properly implement line buffering though; the current implementation is wrong. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1400 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1400] Py3k's print() flushing problem
Changes by Christian Heimes: -- assignee: - gvanrossum __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1400 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1400] Py3k's print() flushing problem
Changes by Christian Heimes: -- keywords: +py3k priority: - high resolution: - accepted __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1400 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1400] Py3k's print() flushing problem
Wojciech Walczak added the comment: 2007/11/8, admin [EMAIL PROTECTED]: -- keywords: +py3k priority: - high resolution: - accepted Which resolution was accepted? Wojtek Walczak __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1400 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1400] Py3k's print() flushing problem
New submission from Wojciech Walczak: py3k's print() is not flushing when the string's length is 1 byte long and 'end' parameter is set to ''. Example: print('x',end='') # it should print 'x' but it does nothing print('') # we have to call second print() to get buffers flushed x The same thing happens when the string is empty and end's length is 1: print('',end='x') # it should print 'x' but it does nothing print('') # we have to call second print() to get buffers flushed x When there is more characters than one, print() is flushing allright (despite of lack of a newline in the interpreter): print('x',end='y') xy print('xx',end='') xx print('',end='yy') yy The same thing happens in scripts. Try this one as script: - import time print('xx',end='') time.sleep(3) print('x',end='') time.sleep(3) - First print() will flush immediately even though there is no newline and flush is not called, while second print() will flush after second sleep (because python is flushing buffers at the end of the script). The conclusion is that print() is not flushing immediately when string is 1 byte long, but when it is longer - then print() is flushing even when there is no newline or flush was not called by the programmer. I guess print() should act in the same way for every string 0 bytes long instead of for every string 1 byte long. Any ideas where is the bug? You can find Python-3000's mail list discussion about that bug here: http://mail.python.org/pipermail/python-3000/2007-November/011191.html Wojtek Walczak -- components: Build messages: 57215 nosy: wojtekwalczak severity: normal status: open title: Py3k's print() flushing problem type: behavior versions: Python 3.0 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1400 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com