From e2b44bd7a7478792be47c98086f5c91d0da283e2 Mon Sep 17 00:00:00 2001 From: ayleph Date: Fri, 4 Dec 2015 02:02:02 -0500 Subject: [PATCH] Fix issue 983 PDF UnicodeDecodeError Parse PDF lines as unicode to prevent UnicodeDecodeError when a non-ASCII character is encountered. --- mediagoblin/media_types/pdf/processing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediagoblin/media_types/pdf/processing.py b/mediagoblin/media_types/pdf/processing.py index f6d10a5f..ac4bab6d 100644 --- a/mediagoblin/media_types/pdf/processing.py +++ b/mediagoblin/media_types/pdf/processing.py @@ -207,7 +207,7 @@ def pdf_info(original): _log.debug('pdfinfo could not read the pdf file.') raise BadMediaFail() - lines = [l.decode() for l in lines] + lines = [l.decode('utf-8', 'replace') for l in lines] info_dict = dict([[part.strip() for part in l.strip().split(':', 1)] for l in lines if ':' in l]) -- 2.25.1