[Python-modules-commits] r24389 - in packages/python-docutils/trunk/debian (3 files)

jwilk at users.alioth.debian.org jwilk at users.alioth.debian.org
Wed May 15 17:33:24 UTC 2013


    Date: Wednesday, May 15, 2013 @ 17:33:23
  Author: jwilk
Revision: 24389

Add patch to make the CSV parser stricter.

Added:
  packages/python-docutils/trunk/debian/patches/strict-csv-parser.diff
Modified:
  packages/python-docutils/trunk/debian/changelog
  packages/python-docutils/trunk/debian/patches/series

Modified: packages/python-docutils/trunk/debian/changelog
===================================================================
--- packages/python-docutils/trunk/debian/changelog	2013-05-15 16:57:47 UTC (rev 24388)
+++ packages/python-docutils/trunk/debian/changelog	2013-05-15 17:33:23 UTC (rev 24389)
@@ -1,9 +1,14 @@
 python-docutils (0.10-3) UNRELEASED; urgency=low
 
+  [ Dmitry Shachnev ]
   * Rename debian/x-rst.xml to debian/docutils.xml.
 
- -- Dmitry Shachnev <mitya57 at gmail.com>  Tue, 14 May 2013 18:53:48 +0400
+  [ Jakub Wilk ]
+  * Add patch (strict-csv-parser.diff) to make the CSV parser stricter
+    (closes: #692286).
 
+ -- Jakub Wilk <jwilk at debian.org>  Wed, 15 May 2013 19:32:03 +0200
+
 python-docutils (0.10-2) unstable; urgency=low
 
   * Upload to unstable.

Modified: packages/python-docutils/trunk/debian/patches/series
===================================================================
--- packages/python-docutils/trunk/debian/patches/series	2013-05-15 16:57:47 UTC (rev 24388)
+++ packages/python-docutils/trunk/debian/patches/series	2013-05-15 17:33:23 UTC (rev 24389)
@@ -1,3 +1,4 @@
+strict-csv-parser.diff
 math-output-html.diff
 fix-buildhtml-progress.diff
 iepngfix-license.diff

Added: packages/python-docutils/trunk/debian/patches/strict-csv-parser.diff
===================================================================
--- packages/python-docutils/trunk/debian/patches/strict-csv-parser.diff	                        (rev 0)
+++ packages/python-docutils/trunk/debian/patches/strict-csv-parser.diff	2013-05-15 17:33:23 UTC (rev 24389)
@@ -0,0 +1,72 @@
+Description: make the CSV parser stricter
+ Make the CSV parser stricter. Update the tests so that they take into that
+ CSV syntax error message may vary with Python version.
+Author: Jakub Wilk <jwilk at debian.org>
+Forwarded: yes
+Bug: http://sourceforge.net/p/docutils/bugs/210/
+Bug-Debian: http://bugs.debian.org/692286 
+
+--- a/docutils/parsers/rst/directives/tables.py
++++ b/docutils/parsers/rst/directives/tables.py
+@@ -166,6 +166,7 @@
+         skipinitialspace = True
+         lineterminator = '\n'
+         quoting = csv.QUOTE_MINIMAL
++        strict = True
+ 
+         def __init__(self, options):
+             if 'delim' in options:
+@@ -191,6 +192,7 @@
+         skipinitialspace = True
+         lineterminator = '\n'
+         quoting = csv.QUOTE_MINIMAL
++        strict = True
+ 
+     def check_requirements(self):
+         pass
+--- a/test/test_parsers/test_rst/test_directives/test_tables.py
++++ b/test/test_parsers/test_rst/test_directives/test_tables.py
+@@ -42,6 +42,12 @@
+ 
+ null_bytes_exception = DocutilsTestSupport.exception_data(null_bytes)[0]
+ 
++def unexpected_eod():
++    reader = csv.reader(['"\n'], strict=1)
++    reader.next()
++
++unexpected_eod_exception = DocutilsTestSupport.exception_data(unexpected_eod)[0]
++
+ totest = {}
+ 
+ totest['table'] = [
+@@ -760,12 +766,12 @@
+     <system_message level="3" line="1" source="test data" type="ERROR">
+         <paragraph>
+             Error with CSV data in "csv-table" directive:
+-            newline inside string
++            %s
+         <literal_block xml:space="preserve">
+             .. csv-table:: bad CSV data
+             \n\
+                "bad", \"csv, data
+-"""],
++""" % unexpected_eod_exception],
+ ["""\
+ .. csv-table:: bad CSV header data
+    :header: "bad", \"csv, data
+@@ -777,13 +783,13 @@
+     <system_message level="3" line="1" source="test data" type="ERROR">
+         <paragraph>
+             Error with CSV data in "csv-table" directive:
+-            newline inside string
++            %s
+         <literal_block xml:space="preserve">
+             .. csv-table:: bad CSV header data
+                :header: "bad", \"csv, data
+             \n\
+                good, csv, data
+-"""],
++""" % unexpected_eod_exception],
+ ["""\
+ .. csv-table:: bad encoding
+    :file: %s




More information about the Python-modules-commits mailing list