From 2b554195008a6e8e7d3a6134ac99957e329ae894 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Mon, 27 May 2013 14:22:20 +0200 Subject: [PATCH] Don't give the gzip storage a filename at all. --- compressor/storage.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compressor/storage.py b/compressor/storage.py index c902706..16419a8 100644 --- a/compressor/storage.py +++ b/compressor/storage.py @@ -67,15 +67,13 @@ class GzipCompressorFileStorage(CompressorFileStorage): """ def save(self, filename, content): filename = super(GzipCompressorFileStorage, self).save(filename, content) - # workaround for http://bugs.python.org/issue13664 - name = os.path.basename(filename).encode('latin1', 'replace') orig_path = self.path(filename) compressed_path = '%s.gz' % orig_path f_in = open(orig_path, 'rb') f_out = open(compressed_path, 'wb') try: - f_out = gzip.GzipFile(name, fileobj=f_out) + f_out = gzip.GzipFile(fileobj=f_out) f_out.write(f_in.read()) finally: f_out.close()