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

Calling the next attribute of an Annot raises a "No attribute .parent" warning #3131

Closed
jn-chrn opened this issue Feb 5, 2024 · 2 comments
Closed

Comments

@jn-chrn
Copy link

jn-chrn commented Feb 5, 2024

Description of the bug

When reading annotations from a PDF page, we sometimes need the next attribute of Annot. However, when using this attribute, the following message appears in the terminal:

No attribute .parent: type(self)=<class 'fitz.Annot'> id(self)=139712888949840: have set id(self.parent)=139712932742416.

This occurs in version 1.23.21, but not in version 1.22.5.

The object itself seems to be accessible.

How to reproduce the bug

Using the following code returns the warning above when running it:

import fitz

doc = fitz.open()
page = doc.new_page()

page.add_line_annot((0, 0), (1, 1))
page.add_line_annot((1, 0), (0, 1))

first_annot, _ = page.annots()
first_annot.next.type

PyMuPDF version

1.23.21

Operating system

Linux

Python version

3.11

@JorjMcKie
Copy link
Collaborator

This is just an unsolicited warning ... will be removed in (one of the) next versions.

julian-smith-artifex-com added a commit to ArtifexSoftware/PyMuPDF-julian that referenced this issue Feb 6, 2024
julian-smith-artifex-com added a commit to ArtifexSoftware/PyMuPDF-julian that referenced this issue Feb 10, 2024
@julian-smith-artifex-com
Copy link
Collaborator

Fixed in 1.23.23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants