pdf/processing: fix non pdf regression, copy correct file
authorAlon Levy <alon@pobox.com>
Fri, 27 Dec 2013 00:35:27 +0000 (18:35 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Fri, 27 Dec 2013 00:35:27 +0000 (18:35 -0600)
mediagoblin/media_types/pdf/processing.py

index 4dd894d849c85121ec1ab11a46def6e6f070e0c8..a000007a36d89fb323e4eb6855e0ff96dcfbb202 100644 (file)
@@ -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')