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

Raise ValueError when trying to access internal fp after close #6213

Merged
merged 4 commits into from May 19, 2022

Conversation

radarhere
Copy link
Member

@radarhere radarhere commented Apr 15, 2022

Resolves #6205

The issue reported an unexpected error when calling seek() after an image had been closed, thrown when trying to use __fp.
This PR adds a DeferredError before trying to access the internal fp, like self.im does after an image is closed.

Since this would be a further modification to _close__fp in multiple plugins, this PR also renames __fp to _fp, making it accessible from Image.py, and allowing _close__fp to be merged into Image.py

@hugovk hugovk merged commit 2c58c3e into python-pillow:main May 19, 2022
@radarhere radarhere deleted the fp branch May 19, 2022 22:36
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

Successfully merging this pull request may close these issues.

Backward seek on closed GifImageFile breaks expected behaviour
2 participants