🐛 Remove zero length .gz in case of error
Otherwise the page won't load at all because the js/css/less files are taken from the gz versions which are empty. Introduced by #3497 TODO: Fix gzip encoding under Python 2 (gzip.compress doesn't exist)
This commit is contained in:
1 parent
40a0913fa4
commit
5ad06bc602
1 file changed
+6
@@ -7,6 +7,7 @@ __copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms
|
||||
|
||||
import logging
|
||||
import gzip
|
||||
import os
|
||||
import re
|
||||
|
||||
try:
|
||||
@@ -129,6 +130,11 @@ class GzipFile(Filter):
|
||||
logging.getLogger(__name__).exception("Error writing gzipped "
|
||||
"output of {} to {}".format(output_path,
|
||||
gzipped_output_path))
|
||||
try:
|
||||
os.remove(gzipped_output_path)
|
||||
except Exception:
|
||||
logging.getLogger(__name__).exception("Error removing broken "
|
||||
".gz from {}".format(gzipped_output_path))
|
||||
|
||||
|
||||
class ChainedHunk(BaseHunk):
|
||||
|
||||
Reference in new issue
Block a user