GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-117722: Fix Stream.readuntil with non-bytes buffer objects by bmerry · Pull Request #117723 · python/cpython

Conversation

@bmerry

@bmerry bmerry commented Apr 10, 2024 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

PR #16429 introduced support for an iterable of separators in Stream.readuntil. Since bytes-like types are themselves iterable, this can introduce ambiguities in deciding whether the argument is an iterator of separators or a singleton separator. In #16429, only 'bytes' was considered a singleton, but this will break code that passes other buffer object types.

Fix it by only supporting tuples rather than arbitrary iterables.

Closes #117722.

  • Issue: 3.13.0a6 breaks asyncio.Stream.readuntil with bytearray separator #117722

📚 Documentation preview 📚: https://cpython-previews--117723.org.readthedocs.build/

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bmerry
Fix Stream.readuntil with non-bytes buffer objects
0bac378
PR python#16429 introduced support for an iterable of separators in
Stream.readuntil. Since bytes-like types are themselves iterable, this
can introduce ambiguities in deciding whether the argument is an
iterator of separators or a singleton separator. In python#16429, only 'bytes'
was considered a singleton, but this will break code that passes other
buffer object types.

Fix it by only supporting tuples rather than arbitrary iterables.

Closes python#117722.
@bmerry
bmerry requested review from 1st1, asvetlov, gvanrossum, kumaraditya303 and willingc as code owners April 10, 2024 19:00
@bedevere-app bedevere-app Bot added the awaiting review label Apr 10, 2024
@bedevere-app bedevere-app Bot mentioned this pull request Apr 10, 2024
3.13.0a6 breaks asyncio.Stream.readuntil with bytearray separator #117722
Closed
@bmerry bmerry mentioned this pull request Apr 10, 2024
Allow multiple separators in Stream.readuntil #81322
Closed
gvanrossum
gvanrossum approved these changes Apr 11, 2024
View reviewed changes

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

This looks good. Since your previous change made it into 3.13a6 it will be somewhat interesting to see if anybody actually notices a problem with that -- which would be an indicator of how much this matters (I expect very little :-). (If it hadn't made it in, I'd have recommended merging the changelog snippets, but it's too late for that now.)

I noticed that there isn't yet a bullet for this in Doc/whatsnew/3.13.rst -- do you feel like adding one? If you do, you could add it to this PR; I'll keep it open for a day or until I hear from you.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Apr 11, 2024
@bmerry
Add pythongh-81322 to Doc/whatsnew/3.13.rst
d616980
@bmerry

bmerry commented Apr 11, 2024

Copy link
Copy Markdown
Contributor Author

I noticed that there isn't yet a bullet for this in Doc/whatsnew/3.13.rst -- do you feel like adding one?

Sure - done.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gvanrossum
gvanrossum approved these changes Apr 11, 2024
View reviewed changes
@gvanrossum
gvanrossum merged commit 01a51f9 into python:main Apr 11, 2024
@bedevere-app bedevere-app Bot removed the awaiting merge label Apr 11, 2024
@gvanrossum

gvanrossum commented Apr 11, 2024

Copy link
Copy Markdown
Member

Thanks! You're welcome to contribute more any time, it's been a pleasure to work with you. (And again, apologies for the delay. :-)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Mohsin1910

Mohsin1910 commented Apr 11, 2024 via email

Copy link
Copy Markdown
Make a python language power my uncle which will help me to solve some complex problems in the field of science in future through future quantum computer make this programming language as easy as possible many thanks.
…
On Thu, Apr 11, 2024, 7:45 PM Guido van Rossum ***@***.***> wrote: Thanks! You're welcome to contribute more any time, it's been a pleasure to work with you. (And again, apologies for the delay. :-) — Reply to this email directly, view it on GitHub <#117723 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BHTFZRB7VENGHUQMLYOZREDY42OYHAVCNFSM6AAAAABGA7G2J6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBZHA2TQMBSGM> . You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bmerry bmerry mentioned this pull request Apr 14, 2024
Update asyncio.Stream.readuntil python/typeshed#11755
Merged
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
@bmerry @diegorusso
pythongh-117722: Fix Stream.readuntil with non-bytes buffer objects (p…
df40665
…ython#117723)

pythongh-16429 introduced support for an iterable of separators in
Stream.readuntil. Since bytes-like types are themselves iterable, this
can introduce ambiguities in deciding whether the argument is an
iterator of separators or a singleton separator. In pythongh-16429, only 'bytes'
was considered a singleton, but this will break code that passes other
buffer object types.

Fix it by only supporting tuples rather than arbitrary iterables.

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

Reviewers

@gvanrossum gvanrossum gvanrossum approved these changes
@1st1 1st1 Awaiting requested review from 1st1 1st1 is a code owner
@asvetlov asvetlov Awaiting requested review from asvetlov asvetlov is a code owner
@kumaraditya303 kumaraditya303 Awaiting requested review from kumaraditya303 kumaraditya303 is a code owner
@willingc willingc Awaiting requested review from willingc willingc is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3.13.0a6 breaks asyncio.Stream.readuntil with bytearray separator

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@bmerry @gvanrossum @Mohsin1910
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.