Skip to content

Py 3.9 failures: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren' #583

@QuLogic

Description

@QuLogic

When running on Python 3.9, tests fail with the above error.

Traceback (most recent call last):
  File "/usr/lib64/python3.9/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/builddir/build/BUILDROOT/ocrmypdf-10.1.0-1.fc33.x86_64/usr/lib/python3.9/site-packages/ocrmypdf/_sync.py", line 214, in exec_page_sync
    ocr_out = render_hocr_page(hocr_out, page_context)
  File "/builddir/build/BUILDROOT/ocrmypdf-10.1.0-1.fc33.x86_64/usr/lib/python3.9/site-packages/ocrmypdf/_pipeline.py", line 612, in render_hocr_page
    hocrtransform.to_pdf(
  File "/builddir/build/BUILDROOT/ocrmypdf-10.1.0-1.fc33.x86_64/usr/lib/python3.9/site-packages/ocrmypdf/hocrtransform.py", line 191, in to_pdf
    elemtxt = self._get_element_text(elem).rstrip()
  File "/builddir/build/BUILDROOT/ocrmypdf-10.1.0-1.fc33.x86_64/usr/lib/python3.9/site-packages/ocrmypdf/hocrtransform.py", line 112, in _get_element_text
    for child in element.getchildren():
AttributeError: 'xml.etree.ElementTree.Element' object has no attribute 'getchildren'

There are about 15 failures, but I think they all end in this same traceback.

To Reproduce

pytest -ra -n auto

Here is a build log for 9.8.2, but it also fails locally for me with 10.1.0.

System

  • OS: Fedora Rawhide
  • OCRmyPDF Version: 9.8.2/10.1.0
  • How did you install ocrmypdf? Not installed; building a package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions