Skip to content

codecs.StreamWriter.write() returns None #134706

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
srittau opened this issue May 26, 2025 · 0 comments
Open

codecs.StreamWriter.write() returns None #134706

srittau opened this issue May 26, 2025 · 0 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@srittau
Copy link
Contributor

srittau commented May 26, 2025

Bug report

Bug description:

This violates the usual write() contract of returning the number of items written (for synchronous I/O) and also affects StreamReaderWriter.write() transitively.

In this case it seems trivial to just return the result of the called self.stream.write().

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
Development

No branches or pull requests

2 participants