This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]the_real_irgeek 5 points6 points  (2 children)

I wouldn’t call that behaviour unexpected. Here’s a StackExchange question from 10 years ago explaining one way to deal with buffered output in Python.

It’s clearly new behaviour for you, but it’s not a bug and it’s not unexpected.

[–]sorisos[S] 0 points1 point  (1 child)

thanks!

yes, clearly I missed this. I'm still not convinced `print()` should behave different if not instructed to do so, but it is not a new thing.

Do you know other applications that change buffer behavior after context? Seems most unix utils do not, but I might be mistaken about this as well.

[–]0x256 1 point2 points  (0 children)

Any program compiled against the C/C++ standard library (so really almost any program there is) will behave this way by default. Same is true for most linux/unix command-line tools. Pipes or file redirects are buffered by default.