From e7672e5b48687f75c08c360ee86f71ec43566512 Mon Sep 17 00:00:00 2001 From: Rodney Ewing Date: Wed, 14 Aug 2013 10:58:31 -0700 Subject: [PATCH] use a tmp_pdf filename --- mediagoblin/media_types/pdf/processing.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mediagoblin/media_types/pdf/processing.py b/mediagoblin/media_types/pdf/processing.py index 8294fbe2..17a3246c 100644 --- a/mediagoblin/media_types/pdf/processing.py +++ b/mediagoblin/media_types/pdf/processing.py @@ -288,15 +288,17 @@ class CommonPdfProcessor(MediaProcessor): """ Store the pdf. If the file is not a pdf, make it a pdf """ + tmp_pdf = self.orig_filename + unoconv = where('unoconv') Popen(executable=unoconv, args=[unoconv, '-v', '-f', 'pdf', self.orig_filename]).wait() - if not os.path.exists(self.pdf_filename): + if not os.path.exists(tmp_pdf): _log.debug('unoconv failed to convert file to pdf') raise BadMediaFail() - store_public(self.entry, 'pdf', self.pdf_filename, + store_public(self.entry, 'pdf', tmp_pdf, self.name_builder.fill('{basename}.pdf')) return self.workbench.local_file( -- 2.25.1