[Python-apps-commits] r8911 - in packages/pdfposter/trunk/debian (3 files)
valhalla-guest at users.alioth.debian.org
valhalla-guest at users.alioth.debian.org
Thu Jun 28 14:14:48 UTC 2012
Date: Thursday, June 28, 2012 @ 14:14:47
Author: valhalla-guest
Revision: 8911
Graceful failure on non PDF input (#569552)
Added:
packages/pdfposter/trunk/debian/patches/graceful_failure_on_non_pdf.diff
Modified:
packages/pdfposter/trunk/debian/changelog
packages/pdfposter/trunk/debian/patches/series
Modified: packages/pdfposter/trunk/debian/changelog
===================================================================
--- packages/pdfposter/trunk/debian/changelog 2012-06-28 01:28:36 UTC (rev 8910)
+++ packages/pdfposter/trunk/debian/changelog 2012-06-28 14:14:47 UTC (rev 8911)
@@ -7,6 +7,7 @@
* debian/control: bump Standards-Version to 3.9.3
* Switch to dh_python
* Switch to format 3.0 (quilt)
+ * Fail gracefully with non PDF input (Closes: #569552)
-- Elena Grandi <elena.valhalla at gmail.com> Wed, 27 Jun 2012 17:02:42 +0200
Added: packages/pdfposter/trunk/debian/patches/graceful_failure_on_non_pdf.diff
===================================================================
--- packages/pdfposter/trunk/debian/patches/graceful_failure_on_non_pdf.diff (rev 0)
+++ packages/pdfposter/trunk/debian/patches/graceful_failure_on_non_pdf.diff 2012-06-28 14:14:47 UTC (rev 8911)
@@ -0,0 +1,23 @@
+Description: Fail gracefully with non-PDF input.
+Forwarded: yes (via email)
+Bug-Debian: http://bugs.debian.org/569552
+Author: Elena Grandi <elena.valhalla at gmail.com>
+--- a/pdftools/pdfposter/cmd.py
++++ b/pdftools/pdfposter/cmd.py
+@@ -25,6 +25,7 @@
+
+ from . import main, __version__, DEFAULT_MEDIASIZE, papersizes, DecryptionError
+ import re
++from pyPdf.utils import PdfReadError
+
+ # pattern for parsing user textual box spec
+ pat_box = re.compile(r'''
+@@ -121,6 +122,8 @@
+ main(opts, *args)
+ except DecryptionError, e:
+ raise SystemExit(str(e))
++ except PdfReadError:
++ parser.error('Only well formed PDF files are supported as input.')
+
+
+ if __name__ == '__main__':
Modified: packages/pdfposter/trunk/debian/patches/series
===================================================================
--- packages/pdfposter/trunk/debian/patches/series 2012-06-28 01:28:36 UTC (rev 8910)
+++ packages/pdfposter/trunk/debian/patches/series 2012-06-28 14:14:47 UTC (rev 8911)
@@ -1 +1,2 @@
do_include_namespace_init.diff
+graceful_failure_on_non_pdf.diff
More information about the Python-apps-commits
mailing list