Skip to content

Make sure pil files are closed correctly #4619

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

Closed
wants to merge 1 commit into from

Conversation

jenshnielsen
Copy link
Member

While fixing #4613 I noticed some warnings in the tests.

This silences some of them by making sure that the files are closed probably when reading files using PIL

It seems like PIL doesn't probably close the files so pass a open file to PIL instead using a context manager.

Silence warnings in some tests
@WeatherGod
Copy link
Member

Does this interfere with pillow's ability to open URLs (I think that is a
feature)
On Jul 10, 2015 2:34 PM, "Jens Hedegaard Nielsen" notifications@github.com
wrote:

While fixing #4613 #4613
I noticed some warnings in the tests.

This silences some of them by making sure that the files are closed
probably when reading files using PIL

It seems like PIL doesn't probably close the files so pass a open file to

PIL instead using a context manager.

You can view, comment on, or merge this pull request online at:

#4619
Commit Summary

  • Make sure pil files are closed correctly

File Changes

Patch Links:


Reply to this email directly or view it on GitHub
#4619.

@jenshnielsen
Copy link
Member Author

Yes probably it does. I guess we could just ignore this these warnings and hope that PIL will eventually fix this

@tacaswell
Copy link
Member

Huh, I did the same thing recently, and it didn't actually fix the warnings.

@jenshnielsen
Copy link
Member Author

This seems to work, but using Image.close does not fix the warning

@jenshnielsen
Copy link
Member Author

This will probably break the tests in #4485

@anntzer
Copy link
Contributor

anntzer commented Jun 26, 2017

Was fixed by #5515.

@anntzer anntzer closed this Jun 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants