#210 More tests failures with Python 3.3

sandbox
closed-fixed
nobody
None
5
2013-05-16
2012-11-02
Dmitry Shachnev
No

[ Note that I'm using 20121021 snapshot from python 3.3 branch. ]

Full log is here: http://paste.ubuntu.com/1327088/.

One of failing tests:

======================================================================
FAIL: test_parsers/test_rst/test_directives/test_tables.py: totest['csv-table'][18]; test_parser (DocutilsTestSupport.ParserTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/tmp.aJx8sUfgDT/tree0t-python3-docutils-testtmp/adttmp/test/DocutilsTestSupport.py", line 456, in test_parser
self.compare_output(self.input, output, self.expected)
File "/tmp/tmp.aJx8sUfgDT/tree0t-python3-docutils-testtmp/adttmp/test/DocutilsTestSupport.py", line 227, in compare_output
raise error
File "/tmp/tmp.aJx8sUfgDT/tree0t-python3-docutils-testtmp/adttmp/test/DocutilsTestSupport.py", line 214, in compare_output
self.assertEqual(output, expected)
File "/tmp/tmp.aJx8sUfgDT/tree0t-python3-docutils-testtmp/adttmp/test/DocutilsTestSupport.py", line 119, in assertEqual
raise self.failureException(msg or '%s != %s' % _format_str(first, second))
AssertionError: '''\ <document source="test data">
<table>
<title>
bad CSV data
<tgroup cols="2">
<colspec colwidth="50">
<colspec colwidth="50">
<tbody>
<row>
<entry>
<paragraph>
bad
<entry>
<paragraph>
csv, data''' != '''\ <document source="test data">
<system_message level="3" line="1" source="test data" type="ERROR">
<paragraph>
Error with CSV data in "csv-table" directive:
newline inside string
<literal_block xml:space="preserve">
.. csv-table:: bad CSV data
\n\ "bad", "csv, data'''

Discussion

  • Jakub Wilk
    Jakub Wilk
    2013-05-12

    test_tables failures are still reproducible with Python 3.3.1, both with Docutils 0.10 and svn snapshot (r7661):

    ======================================================================
    FAIL: test_parsers/test_rst/test_directives/test_tables.py: totest['csv-table'][18]; test_parser (DocutilsTestSupport.ParserTestCase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/jwilk/docutils-0.10/test3/DocutilsTestSupport.py", line 473, in test_parser
        self.compare_output(self.input, output, self.expected)
      File "/home/jwilk/docutils-0.10/test3/DocutilsTestSupport.py", line 244, in compare_output
        raise error
      File "/home/jwilk/docutils-0.10/test3/DocutilsTestSupport.py", line 231, in compare_output
        self.assertEqual(output, expected)
      File "/home/jwilk/docutils-0.10/test3/DocutilsTestSupport.py", line 123, in assertEqual
        msg or '%s != %s' % _format_str(first, second))
    AssertionError: '''\
    <document source="test data">
        <table>
            <title>
                bad CSV data
            <tgroup cols="2">
                <colspec colwidth="50">
                <colspec colwidth="50">
                <tbody>
                    <row>
                        <entry>
                            <paragraph>
                                bad
                        <entry>
                            <paragraph>
                                csv, data''' != '''\
    <document source="test data">
        <system_message level="3" line="1" source="test data" type="ERROR">
            <paragraph>
                Error with CSV data in "csv-table" directive:
                newline inside string
            <literal_block xml:space="preserve">
                .. csv-table:: bad CSV data
                \n\
                   "bad", "csv, data'''
    
    ======================================================================
    FAIL: test_parsers/test_rst/test_directives/test_tables.py: totest['csv-table'][19]; test_parser (DocutilsTestSupport.ParserTestCase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/home/jwilk/docutils-0.10/test3/DocutilsTestSupport.py", line 473, in test_parser
        self.compare_output(self.input, output, self.expected)
      File "/home/jwilk/docutils-0.10/test3/DocutilsTestSupport.py", line 244, in compare_output
        raise error
      File "/home/jwilk/docutils-0.10/test3/DocutilsTestSupport.py", line 231, in compare_output
        self.assertEqual(output, expected)
      File "/home/jwilk/docutils-0.10/test3/DocutilsTestSupport.py", line 123, in assertEqual
        msg or '%s != %s' % _format_str(first, second))
    AssertionError: '''\
    <document source="test data">
        <table>
            <title>
                bad CSV header data
            <tgroup cols="3">
                <colspec colwidth="33">
                <colspec colwidth="33">
                <colspec colwidth="33">
                <thead>
                    <row>
                        <entry>
                            <paragraph>
                                bad
                        <entry>
                            <paragraph>
                                csv, data
                        <entry>
                <tbody>
                    <row>
                        <entry>
                            <paragraph>
                                good
                        <entry>
                            <paragraph>
                                csv
                        <entry>
                            <paragraph>
                                data''' != '''\
    <document source="test data">
        <system_message level="3" line="1" source="test data" type="ERROR">
            <paragraph>
                Error with CSV data in "csv-table" directive:
                newline inside string
            <literal_block xml:space="preserve">
                .. csv-table:: bad CSV header data
                   :header: "bad", "csv, data
                \n\
                   good, csv, data'''
    
    ----------------------------------------------------------------------
    
     
  • Jakub Wilk
    Jakub Wilk
    2013-05-13

    I believe this is caused a bug in Python: http://bugs.python.org/issue16013
    I don't think there's much that can be done about in on the Docutils side. This ticket should be probably closed.

     
    • Jakub Wilk
      Jakub Wilk
      2013-05-13

      Actually, ignore my previous comment. issue16013 is fixed in Python 3.3.1.

      Apparently the problem is that currently the csv module ignores CSV syntax errors. You need to pass strict=1 to the reader to get the old behavior.

       
  • Jakub Wilk
    Jakub Wilk
    2013-05-15

    Patch attached.

     
  • Günter Milde
    Günter Milde
    2013-05-16

    Fixed. Thanks for the report, analysis, and patch.

     
  • Günter Milde
    Günter Milde
    2013-05-16

    • status: open --> closed-fixed
    • Group: --> sandbox
     
  • Jakub Wilk
    Jakub Wilk
    2013-05-16

    I should have mentioned that 3.3 is not the only version that is affected, as http://bugs.python.org/issue16013 has been backported to other branches. More specifically, these are the versions in which the patch was introduced:

    • 2.7.4
    • 3.2.4
    • 3.3.1