Closed vielfarbig closed 1 year ago
Apologies for not replying earlier.
This looks more like a problem in the PyCharm debugger, than in PyMuPDF itself.
Perhaps the debugger does not work well with the SWIG-generated code that PyMuPDF uses.
I've just tried stepping through the example with the pdb.py
python debugger, and it worked fine.
Apologies for not replying earlier.
No problem.
I've just tried stepping through the example with the
pdb.py
python debugger, and it worked fine.
Ok, than its probably due to PyCharm.
I would also say, keep it in mind, if running into something similar. Also I don't need it to be 'fixed' at the moment, so its fine.
Describe the bug (mandatory)
The following code runs fine with normal execution, but it gives an Exception for "'NoneType' object is not callable" while debugging when stepping through the for loop.
I could think that it is related to https://github.com/pymupdf/PyMuPDF/issues/1605 but not the same. I also found no alternative giving an Exception with debugging.
To Reproduce (mandatory)
Explain the steps to reproduce the behavior, For example, include a minimal code snippet, example files, etc.
Step through the following for loop with debugger:
I've used a simple pdf, generated with LibreOffice with "export as pdf" and Okular (pdf viewer/editor) to add the rect annotation: testfile.pdf
It gives the following Exception:
Expected behavior (optional)
Describe what you expected to happen (if not obvious).
Give not the Exception, but print only the annotations while debugging as in normal execution
Screenshots (optional)
If applicable, add screenshots to help explain your problem.
Your configuration (mandatory)
For example, the output of
print(sys.version, "\n", sys.platform, "\n", fitz.__doc__)
would be sufficient (for the first two bullets).PyMuPDF newly installed with
pip install PyMuPDF
on Ubuntu 20.04.5Using PyCharm 2022.3 (Professional Edition) (Build #PY-223.7571.203) Debugger
Additional context (optional)
Add any other context about the problem here.