-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't close file-like objects #654
Comments
I don't want to create my own |
I don't think a new parameter is necessary. Rather, |
Actually, that would be better. I think this should be done in both Another reason why I feel like it should not close, is because I feel like most python users would not expect it to be closed, especially since most libraries don't close file-like objects, and run into unexpected issues like I have. |
Yes, agreed. One thing to figure out is how |
I feel like that behavior would make sense. |
Currently the
internetarchive
library closes any file-like objects that is passed into an input, e.g. using upload or download. This is really frustrating, because a great way to download a file to memory is by passing in aio.BytesIO
object, however sinceinternetarchive
closes the file after downloading it, I can't get the contents after downloading it into aio.BytesIO
object.One way to solve this is by adding a parameter
close_file
, which default toTrue
, and when it's set toFalse
, it won't close the file, allowing for easier downloading a file to memory.The text was updated successfully, but these errors were encountered: