]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-117722: Fix Stream.readuntil with non-bytes buffer objects (#117723)
authorBruce Merry <1963944+bmerry@users.noreply.github.com>
Thu, 11 Apr 2024 14:41:55 +0000 (16:41 +0200)
committerGitHub <noreply@github.com>
Thu, 11 Apr 2024 14:41:55 +0000 (07:41 -0700)
commit01a51f949475f1590eb5899f3002304060501ab2
tree88528120d948fd0b392f0628a02ad57230f29f4f
parent898f6de63fd5285006ee0f4993aeb8ed3e8f97f9
gh-117722: Fix Stream.readuntil with non-bytes buffer objects (#117723)

gh-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 gh-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 gh-117722.
Doc/library/asyncio-stream.rst
Doc/whatsnew/3.13.rst
Lib/asyncio/streams.py
Lib/test/test_asyncio/test_streams.py
Misc/NEWS.d/next/Library/2024-04-10-20-59-10.gh-issue-117722.oxIUEI.rst [new file with mode: 0644]