fix AttributeError with insertTextbox #10
Loading…
Reference in a new issue
No description provided.
Delete branch "thp/plakativ:insert_textbox"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thanks for the useful tool! On Ubuntu 24.04 with Python 3.12, I'm getting the following error when trying to render a PDF (via
pip install plakativ
):Changing the code to use
insert_textbox()
instead ofinsertTextbox()
seems to fix the issue for me. I tried grep'ing around forinsertTextbox()
vsinsert_textbox()
in thecpython
(tkinter) andtk
(https://github.com/tcltk/tk) sources, but didn't find anything, so not sure when the change took place and if there is a need for special-casing this code to be compatible with older versions (of Python? of Tk?).The Tk and Python 3 packages installed on my system:
For the record, this also happens with Plakativ installed via
apt
0.5.2-1 from the Ubuntu 24.04 repos.To reproduce, I needed to open a PDF, then tick the following "Output options":
And then hit "Save PDF".
Hi, thank you for your contribution. The pymupdf project is continuously breaking its api, converting functions from
snake_case
naming toCamelCase
. Similar fixes have been performed in commitsd6d0a6ea06
(in June 2022) orfab6925674
(in October 2023). Apparently, now is the turn ofinsertTextbox
. Could you please change your MR so that it does something similar as the other commits I cited? I.e. that you write:Thanks!
hasattr()
-guarding all pymupdf CamelCase → sanke_case renamings sounds like a nightmare. I'd be prepared to bet this is not what upstream wanted, and they probably expect you to bump the pymupdf requirement instead.As in josch/img2pdf#202 (comment), I respect your wish for backwards compatibility and agree this may be convenient for packagers / end users, but in the case of pymupdf you might be tilting at windmills...
Anyway, thanks a lot for this project and your commitment to OSS!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.