Skip to content

Commit 754cba8

Browse files
Tweak seekable check
1 parent cbb51f3 commit 754cba8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

httpx/_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def get_filelike_length(stream: typing.IO) -> int:
326326
fd = stream.fileno()
327327
except OSError:
328328
# No... is it something that supports random access, like `io.BytesIO`?
329-
if not stream.seekable():
329+
if not hasattr(stream, "seekable") or not stream.seekable():
330330
# Not even that? Sorry, we're doomed...
331331
raise # pragma: nocover
332332

0 commit comments

Comments
 (0)