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

Support pikepdf 6.0+ #102

Merged
merged 6 commits into from
Sep 30, 2022
Merged

Support pikepdf 6.0+ #102

merged 6 commits into from
Sep 30, 2022

Conversation

sjustas
Copy link
Contributor

@sjustas sjustas commented Sep 30, 2022

PikePdf 6.0.0 introduced stricter checks against copying objects from another pdf.

This PR fixes merging test failure, see https://github.com/zopefoundation/z3c.rml/actions/runs/3077053438

Error in test runTest (z3c.rml.tests.test_rml.tag-mergePage)
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/case.py", line 591, in run
    self._callTestMethod(testMethod)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
    method()
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/tests/test_rml.py", line 69, in runTest
    rml2pdf.go(self._inPath, self._outPath)
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/rml2pdf.py", line 77, in go
    doc.process(outputFile)
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/document.py", line 764, in process
    tempOutput = processor.process(tempOutput)
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/page.py", line 62, in process
    mergePage(toMerge, page, input1, name)
  File "/home/runner/work/z3c.rml/z3c.rml/src/z3c/rml/page.py", line 41, in mergePage
    mainPage.MediaBox = layerPage.MediaBox
  File "/home/runner/work/z3c.rml/z3c.rml/.tox/py310/lib/python3.10/site-packages/pikepdf/_methods.py", line 1112, in __setattr__
    setattr(self.obj, name, value)
pikepdf._qpdf.ForeignObjectError: Attempting to add an object from a different pikepdf.Pdf. Use pikepdf.copy_foreign to add objects from another file.

Added some tests to increase coverage.

@agroszer agroszer merged commit 939fbd0 into zopefoundation:master Sep 30, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants