#255 rst2odt traceback with python 3.4

repository
closed-fixed
None
5
2014-07-07
2014-04-17
No

Hello,

I get a report from users[1] that rst2odt recently traceback. I guess that python3.4 remove ElementInterface from xml.etree.ElementTree ( are not public interface).

Thanks,

[1] https://bugs.archlinux.org/task/39918

Discussion

  • We're trying to update to 3.4 in Fedora and seeing the following test errors which seem related:

    ======================================================================
    ERROR: test_odt_basic (test_writers.test_odt.DocutilsOdtTestCase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/test3/test_writers/test_odt.py", line 154, in test_odt_basic
        self.process_test('odt_basic.txt', 'odt_basic.odt',
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/test3/test_writers/test_odt.py", line 105, in process_test
        settings_overrides=settings_overrides)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 414, in publish_string
        enable_exit_status=enable_exit_status)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 657, in publish_programmatically
        pub.set_components(reader_name, parser_name, writer_name)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 99, in set_components
        self.set_writer(writer_name)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 88, in set_writer
        writer_class = writers.get_writer_class(writer_name)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/writers/__init__.py", line 137, in get_writer_class
        module = __import__(writer_name, globals(), locals(), level=1)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/writers/odf_odt/__init__.py", line 91, in <module>
        class _ElementInterfaceWrapper(etree._ElementInterface):
    AttributeError: 'module' object has no attribute '_ElementInterface'
    ======================================================================
    ERROR: test_odt_custom_headfoot (test_writers.test_odt.DocutilsOdtTestCase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/test3/test_writers/test_odt.py", line 173, in test_odt_custom_headfoot
        settings_overrides=settings_overrides,
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/test3/test_writers/test_odt.py", line 105, in process_test
        settings_overrides=settings_overrides)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 414, in publish_string
        enable_exit_status=enable_exit_status)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 657, in publish_programmatically
        pub.set_components(reader_name, parser_name, writer_name)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 99, in set_components
        self.set_writer(writer_name)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 88, in set_writer
        writer_class = writers.get_writer_class(writer_name)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/writers/__init__.py", line 137, in get_writer_class
        module = __import__(writer_name, globals(), locals(), level=1)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/writers/odf_odt/__init__.py", line 91, in <module>
        class _ElementInterfaceWrapper(etree._ElementInterface):
    AttributeError: 'module' object has no attribute '_ElementInterface'
    ======================================================================
    ERROR: test_odt_tables1 (test_writers.test_odt.DocutilsOdtTestCase)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/test3/test_writers/test_odt.py", line 161, in test_odt_tables1
        self.process_test('odt_tables1.txt', 'odt_tables1.odt',
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/test3/test_writers/test_odt.py", line 105, in process_test
        settings_overrides=settings_overrides)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 414, in publish_string
        enable_exit_status=enable_exit_status)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 657, in publish_programmatically
        pub.set_components(reader_name, parser_name, writer_name)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 99, in set_components
        self.set_writer(writer_name)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/core.py", line 88, in set_writer
        writer_class = writers.get_writer_class(writer_name)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/writers/__init__.py", line 137, in get_writer_class
        module = __import__(writer_name, globals(), locals(), level=1)
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/build/lib/docutils/writers/odf_odt/__init__.py", line 91, in <module>
        class _ElementInterfaceWrapper(etree._ElementInterface):
    AttributeError: 'module' object has no attribute '_ElementInterface'
    ======================================================================
    FAIL: test_empty (test_nodes.ElementTests)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/builddir/build/BUILD/python3-python-docutils-0.11-2.fc21/test3/test_nodes.py", line 95, in test_empty
        self.assertEqual(str(element), '<Element mark="\\u2022"/>')
    AssertionError: '<Element mark="\u2022"/>' != '<Element mark="\\u2022"/>'
    - <Element mark="\u2022"/>
    ?                ^
    + <Element mark="\u2022"/>
    ?                ^^^^^^
    ----------------------------------------------------------------------
    Ran 1242 tests in 10.044s
    FAILED (failures=1, errors=3)
    
     
  • Just tested with current svn trunk and it works. Sorry for the noise. Time for a release?

     
  • Tried last patch with no success.

    $ rst2odt
    Traceback (most recent call last):
    File "/usr/bin/rst2odt", line 19, in <module>
    from docutils.writers.odf_odt import Writer, Reader
    File "/usr/lib/python3.4/site-packages/docutils/writers/odf_odt/init.py", line 91, in <module>
    class _ElementInterfaceWrapper(etree._ElementInterface):
    AttributeError: 'module' object has no attribute '_ElementInterface'

     
  • tried on macosx10.6 without patch (svn rev 7749)::

    python3.4 setup.py build
    PYTHONPATH=build/lib python3.4 test3/alltests.py
    
    Testing Docutils 0.12 [repository] with Python 3.4.0a2 on 2014-06-03 at 10:54:28
    Ran 1241 tests in 8.898s
    
    OK
    

    and with 3.2 and 3.3::

    rm -rf build test3
    python3.2 setup.py build
    mkdir 3.2; mv build test3 3.2; cd 3.2
    PYTHONPATH=build/lib python3.2 test3/alltests.py
    

    both test runs pass (except two tests looking for HISTORY.txt and
    docutils/writers/html4css1/html4css1.css.

    and with 3.4.1

    what now ?

     
    • assigned_to: engelbert gruber
     
  • any update on this?

     
  • i guess it should be closed.

    1. the original report was a false alarm
    2. i could not reproduce
    3. sebastian tried the last patch but did not say that it fails without

    ?

     
  • Engelbert,

    Since the first report you got the python traceback, showing an "Attribute Error".
    My last try, with the patch, fail too and you got the traceback, with the same "Attribute Error".

    Why are you telling that the first report was a false alarm?

    Btw, the last 0.12 version fix this issue. I agree, that we can close this one.

    Thanks

     
  • hei sebastian, sorry for any inconvenience, but

    1. orion filed a traceback but also posted that it was fixxed in svn trunk.
    2. i could not reproduce it

    that is two reasons for closing it.

    But I want to really (no joke) thank you for the confirmation, that it works with 0.12, because it really helps. thanks

     
    • status: open --> closed-fixed