From: Alon Levy Date: Fri, 27 Dec 2013 00:35:27 +0000 (-0600) Subject: pdf/processing: fix non pdf regression, copy correct file X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0021c06886555ef6bde728e3684263cd50c79af6;p=mediagoblin.git pdf/processing: fix non pdf regression, copy correct file --- diff --git a/mediagoblin/media_types/pdf/processing.py b/mediagoblin/media_types/pdf/processing.py index 4dd894d8..a000007a 100644 --- a/mediagoblin/media_types/pdf/processing.py +++ b/mediagoblin/media_types/pdf/processing.py @@ -316,11 +316,13 @@ class CommonPdfProcessor(MediaProcessor): """ Store the pdf. If the file is not a pdf, make it a pdf """ - tmp_pdf = self.process_filename + tmp_pdf = os.path.splitext(self.process_filename)[0] + '.pdf' unoconv = where('unoconv') + args = [unoconv, '-v', '-f', 'pdf', self.process_filename] + _log.debug('calling %s' % repr(args)) Popen(executable=unoconv, - args=[unoconv, '-v', '-f', 'pdf', self.process_filename]).wait() + args=args).wait() if not os.path.exists(tmp_pdf): _log.debug('unoconv failed to convert file to pdf')