Index: mod_python.py
===================================================================
--- mod_python.py (revision 7609)
+++ mod_python.py (working copy)
@@ -200,9 +200,12 @@
return storage.get('style', None).file.read()
def _read_style_gzip(storage):
- style = StringIO(urllib.unquote_plus(storage.get('style', None).file.read()))
- return gzip.GzipFile(fileobj=style, mode='r').read()
-
+ data = storage.get('style', None).file.read()
+ try:
+ return gzip.GzipFile(fileobj=StringIO(urllib.unquote_plus(data)), mode='r').read()
+ except gzip.zlib.error:
+ return gzip.GzipFile(fileobj=StringIO(data), mode='r').read()
+
@accepts('POST')
@check_session
def refresh(req):