But got an exception, since get expects the parameter to be either BytesIO or a PathLike/str, and it turns out open() returns a BufferedReader which is neither.
This is a simple fix since BufferedReader implements the same needed API as BytesIO.
I'd like to suggest a change: if the parameter is a str or PathLike, try to open it, in any other case try to use it as a buffer.
This would solve my use case and open more possibilities (i.e. a BufferedReader reading from HTTP could be used for e.g. #44 ).
Does this sound good? If so, I'd be happy to submit a PR.
Hello! Thanks for the awesome package!
I tried doing something similar to:
But got an exception, since
get
expects the parameter to be eitherBytesIO
or aPathLike
/str
, and it turns outopen()
returns aBufferedReader
which is neither.This is a simple fix since
BufferedReader
implements the same needed API asBytesIO
. I'd like to suggest a change: if the parameter is astr
orPathLike
, try to open it, in any other case try to use it as a buffer.This would solve my use case and open more possibilities (i.e. a
BufferedReader
reading from HTTP could be used for e.g. #44 ).Does this sound good? If so, I'd be happy to submit a PR.
Thanks!