Skip to content

Fix bpo-30526: make TextIOWrapper.{line_buffering, write_through} writable#1887

Closed
pitrou wants to merge 1 commit intopython:masterfrom
pitrou:writable_line_buffering
Closed

Fix bpo-30526: make TextIOWrapper.{line_buffering, write_through} writable#1887
pitrou wants to merge 1 commit intopython:masterfrom
pitrou:writable_line_buffering

Conversation

@pitrou
Copy link
Copy Markdown
Member

@pitrou pitrou commented May 31, 2017

This simplifies the reconfiguration of standard streams as it can now be done in-place.

…writable

This simplifies the reconfiguration of standard streams as it can now be done in-place.
@mention-bot
Copy link
Copy Markdown

@pitrou, thanks for your PR! By analyzing the history of the files in this pull request, we identified @benjaminp, @serhiy-storchaka and @birkenfeld to be potential reviewers.

@pitrou pitrou changed the title Fix #30526: make TextIOWrapper.{line_buffering, write_through} writable Fix bpo-30526: make TextIOWrapper.{line_buffering, write_through} writable May 31, 2017
@pitrou pitrou added the type-feature A feature request or enhancement label May 31, 2017
@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented May 31, 2017

The AppVeyor failure is unrelated.

Copy link
Copy Markdown
Contributor

@benjaminp benjaminp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what happens when I set line_buffering = True and write_through = True?

Comment thread Doc/library/io.rst
@@ -908,6 +908,16 @@ Text I/O

Whether line buffering is enabled.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should also say that writing to it flushes the stream

Comment thread Doc/library/io.rst
.. attribute:: write_through

Whether writes are passed immediately to the underlying binary
buffer. This argument is writable.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Jun 2, 2017

#1922 is now preferred.

@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Jun 2, 2017

so what happens when I set line_buffering = True and write_through = True?

Same as before: write_through takes precedence (everything is written through).

@pitrou
Copy link
Copy Markdown
Member Author

pitrou commented Jun 6, 2017

Superseded by #1922.

@pitrou pitrou closed this Jun 6, 2017
@pitrou pitrou deleted the writable_line_buffering branch June 6, 2017 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-feature A feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants