-
-
Notifications
You must be signed in to change notification settings - Fork 31.3k
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
gh-117722: Fix Stream.readuntil with non-bytes buffer objects #117723
Conversation
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.
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.
Sure - done. |
Thanks! You're welcome to contribute more any time, it's been a pleasure to work with you. (And again, apologies for the delay. :-) |
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: ***@***.***>
|
…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.
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.
📚 Documentation preview 📚: https://cpython-previews--117723.org.readthedocs.build/