From 685a075380e6927dfbbd7314a9ebe1bd9215a4ba Mon Sep 17 00:00:00 2001 From: Anton Bolshakov Date: Tue, 2 Jan 2024 10:55:22 +0800 Subject: [PATCH] pillow: sync with gentoo --- .../files/pillow-10.1.0-olefile-0.47.patch | 50 +++++++++++++++++++ ...-10.1.0.ebuild => pillow-10.1.0-r1.ebuild} | 7 ++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 dev-python/pillow/files/pillow-10.1.0-olefile-0.47.patch rename dev-python/pillow/{pillow-10.1.0.ebuild => pillow-10.1.0-r1.ebuild} (96%) diff --git a/dev-python/pillow/files/pillow-10.1.0-olefile-0.47.patch b/dev-python/pillow/files/pillow-10.1.0-olefile-0.47.patch new file mode 100644 index 000000000..e3b6a6473 --- /dev/null +++ b/dev-python/pillow/files/pillow-10.1.0-olefile-0.47.patch @@ -0,0 +1,50 @@ +From 0e523d986858e7c0b4acd45ea1c5a3a639e39b4b Mon Sep 17 00:00:00 2001 +From: Andrew Murray +Date: Sat, 2 Dec 2023 10:57:16 +1100 +Subject: [PATCH] Fixed closing file pointer with olefile 0.47 + +--- + src/PIL/FpxImagePlugin.py | 1 + + src/PIL/MicImagePlugin.py | 3 +++ + 2 files changed, 4 insertions(+) + +diff --git a/src/PIL/FpxImagePlugin.py b/src/PIL/FpxImagePlugin.py +index a878cbfd2..3027ef45b 100644 +--- a/src/PIL/FpxImagePlugin.py ++++ b/src/PIL/FpxImagePlugin.py +@@ -227,6 +227,7 @@ class FpxImageFile(ImageFile.ImageFile): + break # isn't really required + + self.stream = stream ++ self._fp = self.fp + self.fp = None + + def load(self): +diff --git a/src/PIL/MicImagePlugin.py b/src/PIL/MicImagePlugin.py +index 801318930..e4154902f 100644 +--- a/src/PIL/MicImagePlugin.py ++++ b/src/PIL/MicImagePlugin.py +@@ -66,6 +66,7 @@ class MicImageFile(TiffImagePlugin.TiffImageFile): + self._n_frames = len(self.images) + self.is_animated = self._n_frames > 1 + ++ self.__fp = self.fp + self.seek(0) + + def seek(self, frame): +@@ -87,10 +88,12 @@ class MicImageFile(TiffImagePlugin.TiffImageFile): + 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__() + +-- +2.43.0 + diff --git a/dev-python/pillow/pillow-10.1.0.ebuild b/dev-python/pillow/pillow-10.1.0-r1.ebuild similarity index 96% rename from dev-python/pillow/pillow-10.1.0.ebuild rename to dev-python/pillow/pillow-10.1.0-r1.ebuild index 70726dde3..223c44c13 100644 --- a/dev-python/pillow/pillow-10.1.0.ebuild +++ b/dev-python/pillow/pillow-10.1.0-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -72,6 +72,11 @@ EPYTEST_DESELECT=( Tests/test_qt_image_qapplication.py::test_sanity ) +PATCHES=( + # https://github.com/python-pillow/pillow/pull/7594 + "${FILESDIR}/${P}-olefile-0.47.patch" +) + usepil() { usex "${1}" enable disable }