Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests break with reportlab >= 4.3 #127

Open
icemac opened this issue Mar 5, 2025 · 1 comment
Open

Tests break with reportlab >= 4.3 #127

icemac opened this issue Mar 5, 2025 · 1 comment

Comments

@icemac
Copy link
Member

icemac commented Mar 5, 2025

PROBLEM REPORT

What I did:

Run the tests with reportlab 4.3.0 in GHA.

What I expect to happen:

Green tests.

What actually happened:

KeyError: 'Times'

Details

Error in test runTest (z3c.rml.tests.test_rml.text-not-in-tags.runTest)
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/unittest/case.py", line 57, in testPartExecutor
    yield
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/unittest/case.py", line 623, in run
    self._callTestMethod(testMethod)
  File "/opt/hostedtoolcache/Python/3.11.11/x64/lib/python3.11/unittest/case.py", line 579, in _callTestMethod
    if method() is not None:
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/tests/test_rml.py", line 65, in runTest
    rml2pdf.go(self._inPath, self._outPath)
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/rml2pdf.py", line 55, in go
    return go(xmlFile, outputFileName, outDir, dtdDir)
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/rml2pdf.py", line 68, in go
    return go(xmlFile, outputFile, outDir, dtdDir)
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/rml2pdf.py", line 78, in go
    doc.process(outputFile)
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/document.py", line 757, in process
    self.doc.multiBuild(
  File "/home/runner/work/z3c.rml/z3c.rml/.tox/py[31](https://github.com/zopefoundation/z3c.rml/actions/runs/13615260159/job/38057514659#step:6:32)1/lib/python3.11/site-packages/reportlab/platypus/doctemplate.py", line 1170, in multiBuild
    self.build(tempStory, **buildKwds)
  File "/home/runner/work/z3c.rml/z3c.rml/.tox/py311/lib/python3.11/site-packages/reportlab/platypus/doctemplate.py", line 1083, in build
    self.handle_flowable(flowables)
  File "/home/runner/work/z3c.rml/z3c.rml/.tox/py311/lib/python3.11/site-packages/reportlab/platypus/doctemplate.py", line 9[32](https://github.com/zopefoundation/z3c.rml/actions/runs/13615260159/job/38057514659#step:6:33), in handle_flowable
    if frame.add(f, canv, trySplit=self.allowSplitting):
  File "/home/runner/work/z3c.rml/z3c.rml/.tox/py311/lib/python3.11/site-packages/reportlab/platypus/frames.py", line 158, in _add
    w, h = flowable.wrap(aW, h)
  File "/home/runner/work/z3c.rml/z3c.rml/.tox/py311/lib/python3.11/site-packages/reportlab/platypus/paragraph.py", line 1864, in wrap
    blPara = self.breakLines(self._wrapWidths)
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/paraparser.py", line 311, in breakLines
    result = super().breakLines(*args, **kwargs)
  File "/home/runner/work/z3c.rml/z3c.rml/.tox/py311/lib/python3.11/site-packages/reportlab/platypus/paragraph.py", line 2049, in breakLines
    shaping = bool(getFont(style.fontName).isShaped)
  File "/home/runner/work/z3c.rml/z3c.rml/.tox/py311/lib/python3.11/site-packages/reportlab/pdfbase/pdfmetrics.py", line 700, in getFont
    return findFontAndRegister(fontName)
  File "/home/runner/work/z3c.rml/z3c.rml/.tox/py311/lib/python3.11/site-packages/reportlab/pdfbase/pdfmetrics.py", line 682, in findFontAndRegister
    face = getTypeFace(fontName)
  File "/home/runner/work/z3c.rml/z3c.rml/.tox/py311/lib/python3.11/site-packages/reportlab/pdfbase/pdfmetrics.py", line 6[39](https://github.com/zopefoundation/z3c.rml/actions/runs/13615260159/job/38057514659#step:6:40), in getTypeFace
    return _typefaces[faceName]
KeyError: 'Times'

See also https://github.com/zopefoundation/z3c.rml/actions/runs/13615260159/job/38057514659

What version of Python and Zope/Addons I am using:

  • Any supported Python version
  • master branch of z3c.rml
icemac added a commit that referenced this issue Mar 5, 2025
@icemac
Copy link
Member Author

icemac commented Mar 5, 2025

In #128 I am forcing reportlab < 4.3 to get tests green again. I know this is not a future proof solution but it helps for the moment until one of the people actully maintaining this libary has time to look into it.

CC @agroszer @regebro

icemac added a commit that referenced this issue Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant