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

Fixed closing file pointer with olefile 0.47 #7594

Merged
merged 1 commit into from Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/PIL/FpxImagePlugin.py
Expand Up @@ -227,6 +227,7 @@ def _open_subimage(self, index=1, subimage=0):
break # isn't really required

self.stream = stream
self._fp = self.fp
self.fp = None

def load(self):
Expand Down
3 changes: 3 additions & 0 deletions src/PIL/MicImagePlugin.py
Expand Up @@ -66,6 +66,7 @@ def _open(self):
self._n_frames = len(self.images)
self.is_animated = self._n_frames > 1

self.__fp = self.fp
self.seek(0)

def seek(self, frame):
Expand All @@ -87,10 +88,12 @@ def tell(self):
return self.frame

def close(self):
self.__fp.close()
self.ole.close()
super().close()

def __exit__(self, *args):
self.__fp.close()
self.ole.close()
super().__exit__()

Expand Down