Skip to content

gh-111356: Add missing documented objects to io.__all__ #111370

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

Merged
merged 2 commits into from
Nov 10, 2023
Merged

gh-111356: Add missing documented objects to io.__all__ #111370

merged 2 commits into from
Nov 10, 2023

Conversation

ntessore
Copy link
Contributor

@ntessore ntessore commented Oct 26, 2023

This change updates io.__all__ with three missing public and documented entries: text_encoding(), DEFAULT_BUFFER_SIZE, and IncrementalNewlineDecoder.

As suggested by @AlexWaygood, I have also updated the tests to check __all__ using test.support.check__all__(). As a matter of fact, there already was test__all__() in MiscIOTest, which ostensibly checked that all exported symbols existed. It seems like the test was also designed to check some properties of the exported objects; however, these existing checks failed for me.

I have removed the existing checks and replaced them with the suggest check__all__(). I am using a few new attributes to tailor the test to CMiscIOTest and PyMiscIOTest, respectively.

Since I don't understand why existing tests would fail, some extra attention might be warranted here. There is also another detail of possible interest: IncrementalNewlineDecoder was not added to io.__all__, but was added to all_members in the test setup. This could indicate an intentional omission (albeit 15 years ago).

Copy link
Member

@methane methane left a comment

Choose a reason for hiding this comment

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

LGTM. Would you add NEWS entry?

@methane methane added type-bug An unexpected behavior, bug, or error needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Oct 30, 2023
@ntessore
Copy link
Contributor Author

LGTM. Would you add NEWS entry?

Apologies, I thought that would not be necessary. Done now.

@methane methane merged commit baeb771 into python:main Nov 10, 2023
@miss-islington-app
Copy link

Thanks @ntessore for the PR, and @methane for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 10, 2023
…thonGH-111370)

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

Co-authored-by: Nicolas Tessore <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Nov 10, 2023
…thonGH-111370)

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

Co-authored-by: Nicolas Tessore <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Nov 10, 2023

GH-111935 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label Nov 10, 2023
@bedevere-app
Copy link

bedevere-app bot commented Nov 10, 2023

GH-111936 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label Nov 10, 2023
methane pushed a commit that referenced this pull request Nov 10, 2023
Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
(cherry picked from commit baeb771)

Co-authored-by: Nicolas Tessore <[email protected]>
methane pushed a commit that referenced this pull request Nov 10, 2023
Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
(cherry picked from commit baeb771)

Co-authored-by: Nicolas Tessore <[email protected]>
@ntessore ntessore deleted the gh-111356 branch November 10, 2023 10:26
aisk pushed a commit to aisk/cpython that referenced this pull request Feb 11, 2024
…thon#111370)

Add DEFAULT_BUFFER_SIZE, text_encoding, and IncrementalNewlineDecoder.
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request 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
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants