Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-85393: Handle partial and blocking .write in TextIOWrapper#134467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
cmaloney wants to merge8 commits intopython:main
base:main
Choose a base branch
Loading
fromcmaloney:wip/blocking_partial_io

Conversation

cmaloney
Copy link
Contributor

@cmaloneycmaloney commentedMay 21, 2025
edited
Loading

Also improves non-blocking support (gh-57531) and unbuffered support (gh-61606)

While behavior doesn't (generally) change it adds alot of new warnings so I feel this is more of a feature (support non-blocking and unbuffered!) than a bugfix.

TODO before non-Draft

  • Review what type each warning should be
  • Validate if should warn on None (if so, fix CPython test cases)
  • Implement a blocking I/O write test like the one for BufferedIO (test_nonblock_pipe_write_bigbuf)
  • Add a partial write test

Also improves non-blocking support (pythongh-57531) and unbuffered support (pythongh-61606)
@cmaloneycmaloneyforce-pushed thewip/blocking_partial_io branch from696abe7 to4173474CompareMay 21, 2025 20:56
@cmaloney
Copy link
ContributorAuthor

I'm at the PyConUS sprints, would appreciate a high-level review / if the approach I took here looks like what you expect. In particular I tried to keep behavior around all the unexpected potential return values frombuffer.write but also addDeprecationWarning/RuntimeWarning for many. I'm planning to work on expanding tests for this tomorrow (clone of BufferedIO blocking test, tests for underlying writers that return all the bad values, partial write tests, etc).

cc:@vstinner,@serhiy-storchaka (commented on the underlying issue, but also was quite a while ago. If there's better experts or someone more appropriate let me know)

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@cmaloney

[8]ページ先頭

©2009-2025 Movatter.jp