From 86d5c5c3894f58895f31287081cdd146f5fe00f7 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Mon, 7 Apr 2014 16:01:49 -0700 Subject: [PATCH] Have the tempfile use a suffix with a dot --- PIL/Image.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PIL/Image.py b/PIL/Image.py index 40a467d12..359aae716 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -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()