Hello, py3k's print() is not flushing when end is set to '' and all it has to print is one-character-long string:
Python 3.0a1 (py3k, Nov 6 2007, 19:25:33) [GCC 4.1.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print('x',end='') >>> print('') x >>> print('',end='x') >>> print('') x >>> It works OK, when string is longer than 1: >>> print('xx',end='') xx>>> >>> print('',end='xx') xx>>> When end is not set at all, it is flushing allright, because print() prints '\n' at the end: >>> print('x') x >>> What's even stranger - it's sensitive for spaces (or it's just coincidence) in the strings: >>> ret=[print(i,end='') for i in list('print is not flushing')] print is not flushin>>> >>> print() g >>>ret=[print(i,end='') for i in list('printisnotflushing')] printisnotflushing>>> >>> for i in list('print is not flushing'): ... print(i,end='') ... print is not flushin[3.0a1]>>> print() g >>> for i in list('printisnotflushing'): ... print(i,end='') ... printisnotflushing>>> My proposition of patch is in the attachment, but I think that the problem lies somewhere deeper. I was testing both bug and patch on Slack 12 and Debian Etch. Wojtek Walczak
py3k-print.patch
Description: Binary data
_______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com