[issue11633] regression: print buffers output when end=''

2012-01-09 Thread anatoly techtonik
anatoly techtonik added the comment: On Mon, Jan 9, 2012 at 2:03 PM, Terry J. Reedy wrote: > > Terry J. Reedy added the comment: > > No, I don't think so. Another issue will not magically create more time > for anyone. > But anyone will waste less time to get to the outcome of discussion. --

[issue11633] regression: print buffers output when end=''

2012-01-09 Thread Terry J. Reedy
Terry J. Reedy added the comment: No, I don't think so. Another issue will not magically create more time for anyone. -- ___ Python tracker ___

[issue11633] regression: print buffers output when end=''

2012-01-09 Thread anatoly techtonik
anatoly techtonik added the comment: I've tried to switch to Python 3 once more and stumbled upon this problem once more. Seems like this regression got stale. Last Victor's proposal seems reasonable for me. Should we open a new, more clear bug report and close this one? --

[issue11633] regression: print buffers output when end=''

2011-03-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: I completely agree that file/socket output should be left alone. Flushing char by char to either is a bit insane. The two interactive to screen use cases I can think of are text progress meters, mentioned by Anatoly, such as : Working (1 dot printed at

[issue11633] regression: print buffers output when end=''

2011-03-23 Thread STINNER Victor
STINNER Victor added the comment: amaury> When python is run from a console, sys.stdout is line buffered. amaury> sys.stdout.write() flushes if there is a carriage return. amaury> No need to change anything here. Anatoly would like a flush after all calls to print(). > print() could call file.

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread Éric Araujo
Changes by Éric Araujo : -- assignee: docs@python -> components: +Interpreter Core -Documentation, Library (Lib) keywords: +3.2regression nosy: +georg.brandl -docs@python ___ Python tracker ___

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: > Python 3.2, WinXP, IDLE edit window, F5 Run: > 'Processing ...' appears immediately, 'Done' 3 sec later. Terry, IDLE is completely different, its sys.stdout completely bypasses the new io stack, and there is no buffering... -- ___

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The attached patch calls "if file.isatty(): file.flush()" at the end of the print function: - only when an "end" argument was specified - errors in file.isatty() are ignored (and then no flush occurs) -- keywords: +patch Added file: http://bugs.p

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: Python 3.2, WinXP, IDLE edit window, F5 Run: 'Processing ...' appears immediately, 'Done' 3 sec later. The only difference between printtest2/3 is where 'Done' appears. Behavior is same when pasting into interactive interpreter -- has to be since the first two

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: We are talking about different things here: - When python is run from a console, sys.stdout is line buffered. sys.stdout.write() flushes if there is a carriage return. No need to change anything here. - print() could call file.flush() if file.isatty(),

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread anatoly techtonik
anatoly techtonik added the comment: You must realize that the most common use case for print(..., end!='\n') is when you want to notify user about intermediate progress of a very long operation. Making documentation for simple print() statement overloaded with low level buffering details ma

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread STINNER Victor
STINNER Victor added the comment: > How about making print() user-friendly with flushing after every call, > and if you want explicitly want speed - use buffered > sys.stdout.write/flush()? This is exactly the -u option of Python 2: use it if you would like a completly unbuffered sys.stdout in

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread anatoly techtonik
anatoly techtonik added the comment: How about making print() user-friendly with flushing after every call, and if you want explicitly want speed - use buffered sys.stdout.write/flush()? -- ___ Python tracker ___

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread STINNER Victor
STINNER Victor added the comment: > From my perspective it is a regression on Windows and a bug in Linux > version of Python 2.x, which unfortunately can not be fixed, > because of 2.x release process. Line buffering is used by default on most operating systems (ok, maybe not Windows, which lo

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread anatoly techtonik
anatoly techtonik added the comment: >From my perspective it is a regression on Windows and a bug in Linux version >of Python 2.x, which unfortunately can not be fixed, because of 2.x release >process. If the fact that print statement doesn't output anything when called is not a bug - then s

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread STINNER Victor
STINNER Victor added the comment: printtest2.py displays directly "Processing.. " on Windows, but not on Linux. It looks like stdout is not buffered on Windows, which looks like a bug to bug :-) I think that it is safer to always call sys.stdout.flush() to ensure that your message is directly

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread anatoly techtonik
Changes by anatoly techtonik : Added file: http://bugs.python.org/file21334/printtest2.py ___ Python tracker ___ ___ Python-bugs-list mailing

[issue11633] regression: print buffers output when end=''

2011-03-22 Thread anatoly techtonik
New submission from anatoly techtonik : print() function for some reason buffers output on Windows if end!='\n'. In attached examples "Processing.. " string is shown in Python 3.2 only after the actual processing is finished, while in Python 2.6 it is shown before. -- files: printtest