Skip to content

text_encoding() is missing from io.__all__ #111356

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

Closed
ntessore opened this issue Oct 26, 2023 · 2 comments
Closed

text_encoding() is missing from io.__all__ #111356

ntessore opened this issue Oct 26, 2023 · 2 comments
Labels
topic-IO type-bug An unexpected behavior, bug, or error

Comments

@ntessore
Copy link
Contributor

ntessore commented Oct 26, 2023

Bug report

Bug description:

The public io.text_encoding() function is missing from io.__all__.

>>> import io
>>> "text_encoding" in io.__all___
False

CPython versions tested on:

3.10, 3.11, 3.12

Operating systems tested on:

macOS

Linked PRs

@ntessore ntessore added the type-bug An unexpected behavior, bug, or error label Oct 26, 2023
@AlexWaygood
Copy link
Member

The function was added in #19481, by @methane. It looks to me like this was just an accidental omission, rather than something that's been deliberately excluded from __all__. Want to make a PR to add it? :)

Possibly we could also add a test to Lib/test/test_io.py similar to this one, so that we assert that all public module members are included in __all__:

def test__all__(self):
support.check__all__(self, inspect, not_exported=("modulesbyfile",))

methane pushed a commit that referenced this issue Nov 10, 2023
Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 10, 2023
…thonGH-111370)

Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
(cherry picked from commit baeb771)

Co-authored-by: Nicolas Tessore <n.tessore@ucl.ac.uk>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 10, 2023
…thonGH-111370)

Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
(cherry picked from commit baeb771)

Co-authored-by: Nicolas Tessore <n.tessore@ucl.ac.uk>
methane pushed a commit that referenced this issue Nov 10, 2023
Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
(cherry picked from commit baeb771)

Co-authored-by: Nicolas Tessore <n.tessore@ucl.ac.uk>
methane pushed a commit that referenced this issue Nov 10, 2023
Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
(cherry picked from commit baeb771)

Co-authored-by: Nicolas Tessore <n.tessore@ucl.ac.uk>
@hugovk
Copy link
Member

hugovk commented Dec 11, 2023

Fixed and backported, thanks for the issue!

@hugovk hugovk closed this as completed Dec 11, 2023
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
…thon#111370)

Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
Glyphack pushed a commit to Glyphack/cpython that referenced this issue Sep 2, 2024
…thon#111370)

Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-IO type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants