|
From: <mi...@us...> - 2013-05-16 20:38:46
|
Revision: 7662
http://sourceforge.net/p/docutils/code/7662
Author: milde
Date: 2013-05-16 20:38:43 +0000 (Thu, 16 May 2013)
Log Message:
-----------
Fix [ 210 ] Python 3.3 checks CVS syntax only if "strict" is True.
Modified Paths:
--------------
trunk/docutils/HISTORY.txt
trunk/docutils/docutils/parsers/rst/directives/tables.py
trunk/docutils/test/test_parsers/test_rst/test_directives/test_tables.py
Modified: trunk/docutils/HISTORY.txt
===================================================================
--- trunk/docutils/HISTORY.txt 2013-05-07 10:52:59 UTC (rev 7661)
+++ trunk/docutils/HISTORY.txt 2013-05-16 20:38:43 UTC (rev 7662)
@@ -35,6 +35,10 @@
- Apply [ 3599485 ] node source/line information for sphinx translation.
+* docutils/parsers/rst/directives/tables.py
+
+ - Fix [ 210 ] Python 3.3 checks CVS syntax only if "strict" is True.
+
* docutils/parsers/rst/states.py
- Fix [ 157 ] Line block parsing doesn't like system message.
Modified: trunk/docutils/docutils/parsers/rst/directives/tables.py
===================================================================
--- trunk/docutils/docutils/parsers/rst/directives/tables.py 2013-05-07 10:52:59 UTC (rev 7661)
+++ trunk/docutils/docutils/parsers/rst/directives/tables.py 2013-05-16 20:38:43 UTC (rev 7662)
@@ -164,6 +164,7 @@
quotechar = '"'
doublequote = True
skipinitialspace = True
+ strict = True
lineterminator = '\n'
quoting = csv.QUOTE_MINIMAL
@@ -189,6 +190,7 @@
escapechar = '\\'
doublequote = False
skipinitialspace = True
+ strict = True
lineterminator = '\n'
quoting = csv.QUOTE_MINIMAL
Modified: trunk/docutils/test/test_parsers/test_rst/test_directives/test_tables.py
===================================================================
--- trunk/docutils/test/test_parsers/test_rst/test_directives/test_tables.py 2013-05-07 10:52:59 UTC (rev 7661)
+++ trunk/docutils/test/test_parsers/test_rst/test_directives/test_tables.py 2013-05-16 20:38:43 UTC (rev 7662)
@@ -10,7 +10,7 @@
from __init__ import DocutilsTestSupport
-import os
+import os, sys
import csv
from docutils.parsers.rst.directives import tables
@@ -32,6 +32,10 @@
else:
unichr_exception_string = str(unichr_exception)
+csv_eod_error_str = "unexpected end of data"
+if sys.version_info < (3,3):
+ csv_eod_error_str = "newline inside string"
+
def null_bytes():
import csv
csv_data = open(utf_16_csv, 'rb').read()
@@ -760,12 +764,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
-"""],
+""" % csv_eod_error_str],
["""\
.. csv-table:: bad CSV header data
:header: "bad", \"csv, data
@@ -777,13 +781,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
-"""],
+""" % csv_eod_error_str],
["""\
.. csv-table:: bad encoding
:file: %s
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|