You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As discussed in #81322, the change I made in #16429 breaks asyncio.Stream.readuntil when used with iterable buffer-object types other than bytes (such as bytearray) because they're incorrectly interpreted as an iterable of separators.
I've got a patch ready; I'm just filing this bug to be able to reference it.
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.
Closespython#117722.
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.
Closesgh-117722.
diegorusso
pushed a commit
to diegorusso/cpython
that referenced
this issue
Apr 17, 2024
…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.
Closespythongh-117722.
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
As discussed in #81322, the change I made in #16429 breaks asyncio.Stream.readuntil when used with iterable buffer-object types other than
bytes
(such asbytearray
) because they're incorrectly interpreted as an iterable of separators.I've got a patch ready; I'm just filing this bug to be able to reference it.
CPython versions tested on:
3.13, CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: