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
{{ message }}
Repository navigation
ChainedStream.read() with the default size raises TypeError #652
ChainedStream.read() has size=None as default and the docstring says None reads until EOF. The first condition is if size < 0 or size is None, which evaluates None < 0 first and raises TypeError in Python 3.
Where
b2sdk/_internal/stream/chained.py:100 (ChainedStream.read); docstring at :89 and :93-94.
Why it matters
Impact: Wrong request or result, loud. Severity: Medium, because it hits any caller using the documented default, and read(-1) works as a workaround.
How to check
Build a ChainedStream and call stream.read(); expect TypeError: '<' not supported between instances of 'NoneType' and 'int'. Swapping the order to size is None or size < 0 removes it. Found by reading the code, not reproduced.
Version
Seen at v2.13.4. Present on the default branch: present.
Activity