From c98c21db2d48b1eda1b8c98ce4958680aa0eca62 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Tue, 22 Apr 2014 14:03:04 +0200 Subject: [PATCH] Add patch: Have the tempfile use a suffix with a dot --- python-pillow.spec | 9 ++++++++- python-pillow_tmpsuffix.patch | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 python-pillow_tmpsuffix.patch diff --git a/python-pillow.spec b/python-pillow.spec index 0d80a64..8be1600 100644 --- a/python-pillow.spec +++ b/python-pillow.spec @@ -25,7 +25,7 @@ Name: python-pillow Version: 2.4.0 -Release: 2%{?snap}%{?dist} +Release: 3%{?snap}%{?dist} Summary: Python image processing library # License: see http://www.pythonware.com/products/pil/license.htm @@ -38,6 +38,9 @@ Source0: https://github.com/python-imaging/Pillow/tarball/%{commit}/pytho # Fix ghostscript detection (upstream commit 82d7524add60d020a339503efe0559a11f89e238) Patch0: python-imaging-Pillow_ghostscript.patch +# Have the tempfile use a suffix with a dot +Patch1: python-pillow_tmpsuffix.patch + BuildRequires: tk-devel BuildRequires: libjpeg-devel @@ -209,6 +212,7 @@ PIL image wrapper for Qt. %prep %setup -q -n python-imaging-Pillow-%{shortcommit} %patch0 -p1 +%patch1 -p1 # Running test fails, see #921706#c38 rm -f Tests/test_file_eps.py @@ -361,6 +365,9 @@ popd %endif %changelog +* Tue Apr 22 2014 Sandro Mani - 2.4.0-3 +- Add patch: Have the tempfile use a suffix with a dot + * Thu Apr 17 2014 Sandro Mani - 2.4.0-2 - Enable Jpeg2000 support - Enable webp support also on s390* archs, bug #962091 is now fixed diff --git a/python-pillow_tmpsuffix.patch b/python-pillow_tmpsuffix.patch new file mode 100644 index 0000000..b4c3d64 --- /dev/null +++ b/python-pillow_tmpsuffix.patch @@ -0,0 +1,16 @@ +diff -rupN python-imaging-Pillow-72de37c/PIL/Image.py python-imaging-Pillow-72de37c-new/PIL/Image.py +--- python-imaging-Pillow-72de37c/PIL/Image.py 2014-04-02 00:31:55.000000000 +0200 ++++ python-imaging-Pillow-72de37c-new/PIL/Image.py 2014-04-22 13:52:20.469372348 +0200 +@@ -505,8 +505,11 @@ class Image: + + def _dump(self, file=None, format=None): + import tempfile, os ++ suffix = '' ++ if format: ++ suffix = '.' + format + if not file: +- f, file = tempfile.mkstemp(format or '') ++ f, file = tempfile.mkstemp(suffix) + os.close(f) + + self.load()