Skip to content
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

S3 old object body was not closed after seek() #187

Closed
inksink opened this issue Apr 9, 2018 · 2 comments
Closed

S3 old object body was not closed after seek() #187

inksink opened this issue Apr 9, 2018 · 2 comments

Comments

@inksink
Copy link
Contributor

inksink commented Apr 9, 2018

In class SeekableRawReader:
If we seek(), self._body will be replaced with a new object['Body']:

self._body = self._object.get(Range=range_string)['Body']

But old body should been closed. Why not :

self._body.close()
self._body = self._object.get(Range=range_string)['Body']
@mpenkov
Copy link
Collaborator

mpenkov commented Apr 9, 2018

I think once the function exits, the old body will get garbage-collected and closed then. I don't have anything to back this up.

However, I agree that closing it explicitly is a better idea. May be worth checking for None before the close.

Are you able to make a PR?

@inksink
Copy link
Contributor Author

inksink commented Apr 9, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants