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

update_link(): AttributeError: 'Page' object has no attribute 'super' #3070

Closed
ghost opened this issue Jan 21, 2024 · 2 comments
Closed

update_link(): AttributeError: 'Page' object has no attribute 'super' #3070

ghost opened this issue Jan 21, 2024 · 2 comments
Labels
fix developed release schedule to be determined

Comments

@ghost
Copy link

ghost commented Jan 21, 2024

Description of the bug

Hi!, i have an error when i try to modify an url in a pdf. the error disappear when you remove the ".super()"

Traceback

This is the complete traceback I see:

Traceback (most recent call last):
  File "test.py", line 328, in <module>
    Send_Accessing_Message(user, response_message)
  File "test.py", line 240, in Send_Accessing_Message
    pdf[0].update_link(links[0])
  File "C:\Users\computer_name\AppData\Local\pypoetry\Cache\virtualenvs\main-S6_UyEDV-py3.8\lib\site-packages\fitz\utils.py", line 1716, in update_link
    page.parent.update_object(lnk["xref"], annot, page=page)
  File "C:\Users\computer_name\AppData\Local\pypoetry\Cache\virtualenvs\main-S6_UyEDV-py3.8\lib\site-packages\fitz\__init__.py", line 5615, in update_object
    JM_refresh_links( mupdf.pdf_page_from_fz_page(page.super()))
AttributeError: 'Page' object has no attribute 'super'

How to reproduce the bug

poetry run python test.py

test.py

import fitz
# update the link
with fitz.open("modify-url.pdf") as pdf:
  links = pdf[0].get_links()
  links[0]['uri'] = "https://www.ddg.gg"
  pdf[0].update_link(links[0])
  pdf.save("output.pdf")

modify-url.pdf

PyMuPDF version

1.23.16

Operating system

Windows

Python version

3.12

@ghost ghost changed the title AttributeError: 'Page' object has no attribute 'super' update_link(): AttributeError: 'Page' object has no attribute 'super' Jan 21, 2024
@julian-smith-artifex-com
Copy link
Collaborator

Thanks for reporting this.

I have a fix in my tree which we'll hopefully release in the next day or two.

@julian-smith-artifex-com
Copy link
Collaborator

Fixed in 1.23.17.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix developed release schedule to be determined
Projects
None yet
Development

No branches or pull requests

1 participant