Add patch: Have the tempfile use a suffix with a dot

This commit is contained in:
Sandro Mani 2014-04-22 14:03:04 +02:00
parent 6e75ca33c9
commit c98c21db2d
2 changed files with 24 additions and 1 deletions

View File

@ -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 <manisandro@gmail.com> - 2.4.0-3
- Add patch: Have the tempfile use a suffix with a dot
* Thu Apr 17 2014 Sandro Mani <manisandro@gmail.com> - 2.4.0-2
- Enable Jpeg2000 support
- Enable webp support also on s390* archs, bug #962091 is now fixed

View File

@ -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()