Closed cbm755 closed 1 month ago
The box details don't matter too much. Here's an updated version that shows the file is actually written, and contains the text. Not sure if this is harmful or just cosmetic.
import fitz
print(fitz.version)
doc = fitz.open()
page = doc.new_page()
r = fitz.Rect(10, 10, 300, 300)
tw = fitz.TextWriter(page.rect)
print("\nabout to fill the textbox\n")
excess = tw.fill_textbox(r, "blah blah blah blah")
print(excess)
tw.write_text(page, color=(0, 0, 0))
print("\nhello, we got here")
doc.save("foo.pdf")
Still true in 1.24.4
Thanks for this, i've reproduced it. Investigating some more now.
It turns out that this is a change of a diagnostic, not a change in behaviour.
I've disabled the diagnostic in my tree so it'll won't appear in a future release.
Fixed in 1.24.5.
Description of the bug
On 1.24.3 (but not on 1.24.2)
fill_textbox
generates some kind of exceptions that print to the screen but do not raise in Python.How to reproduce the bug
Here's a MWE:
On my Fedora 39 system, this gives:
I've also seen this on Ubuntu 22.04.
PyMuPDF version
1.24.3
Operating system
Linux
Python version
3.12