Skip to content

gh-90533: Implement BytesIO.peek()#150917

Open
marcelm wants to merge 46 commits into
python:mainfrom
marcelm:fix-issue-46375
Open

gh-90533: Implement BytesIO.peek()#150917
marcelm wants to merge 46 commits into
python:mainfrom
marcelm:fix-issue-46375

Conversation

@marcelm

@marcelm marcelm commented Jun 4, 2026

Copy link
Copy Markdown

marcelm and others added 30 commits April 10, 2026 20:37
This allows peek() to use the same optimization that read_bytes() has of
returning a reference to the buffer when possible (without copying).
Semantic change: The default argument for peek is now size=1.
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
@read-the-docs-community

read-the-docs-community Bot commented Jun 4, 2026

Copy link
Copy Markdown

Comment thread Doc/library/io.rst Outdated
Co-authored-by: Stan Ulbrych <stan@python.org>
@cmaloney

cmaloney commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Looks like make clinic needs to be re-run and committed (lots of things can cause that)

@cmaloney

cmaloney commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

The "Windows (free threading)" failure looks like a flaky on main test: test.test_logging.TimedRotatingFileHandlerTest.test_rollover_based_on_st_birthtime_only also failed on macOS (free-threading)

@vstinner

vstinner commented Jun 5, 2026

Copy link
Copy Markdown
Member

The "Windows (free threading)" failure looks like a flaky on main test: test.test_logging.TimedRotatingFileHandlerTest.test_rollover_based_on_st_birthtime_only also failed on macOS (free-threading)

I created issue gh-150960 to track the test_logging failure.

@cmaloney

cmaloney commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

CI all green! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

io.BytesIO does not have peek()

5 participants