Open spott opened 7 years ago
Oops, another case that wasn't tested. As a workaround, maybe try something like your_file_object.name = None
?
This actually isn't enough...
You use file_obj.peek()
in the code, and BinaryIO
objects don't have that function.
Interestingly, my workaround is to use GzipFile
, which does have a peek function and takes BinaryIO
objects.
If you are interested, accepting the BufferedIOBase
interface (in the io
library) should allow you to take most file-like objects.
More accurately, how am I supposed to handle a "file" that is really just a bunch of bytes?
Ideally, I would like to use a
BinaryIO
object, however, these don't have aname
attribute, so I get this error:I'm not sure how to get around this.