Merge pull request #349 from kovacsbalu/fix-paste-encoding

Fix #314
This commit is contained in:
Thirion Aurélien 2019-05-16 14:30:33 +02:00 committed by GitHub
commit 9c6a1ea8ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,7 +125,15 @@ class Paste(object):
""" """
try:
paste = self.cache.get(self.p_path) paste = self.cache.get(self.p_path)
except UnicodeDecodeError:
paste = None
except Exception as e:
print("ERROR in: " + self.p_path)
print(e)
paste = None
if paste is None: if paste is None:
try: try:
with gzip.open(self.p_path, 'r') as f: with gzip.open(self.p_path, 'r') as f: