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

1.18.14 changed capitalization of deprecated getTextlength to getTextLength (capital L) #1085

Closed
cbm755 opened this issue Jun 8, 2021 · 7 comments
Assignees
Labels

Comments

@cbm755
Copy link
Contributor

cbm755 commented Jun 8, 2021

In 1.18.12 and 1.18.12:

AttributeError: module 'fitz' has no attribute 'get_text_length'

But in 1.18.14:

AttributeError: module 'fitz' has no attribute 'getTextLength'

This is the usual problem we've discussed before: its hard to downstream users to have a minimum supported version while also supporting the latest version.

@cbm755
Copy link
Contributor Author

cbm755 commented Jun 8, 2021

Downstream example: https://gitlab.com/plom/plom/-/merge_requests/948 where we currently use a minimum value of

    "pymupdf>=1.18.8",

We either: bump our min value but then distro users must upgrade their pymupdf (which is honestly not that big a deal! :-)

Anyway, let me know if this was intentional and we'll bump of min dep or if accidental and can expect a 1.18.15?

@JorjMcKie
Copy link
Collaborator

JorjMcKie commented Jun 9, 2021

By no means intentional! On the contrary, I am aware this is an unpleasant change overall, so I want to make it as smooth and gentle as possible
But I don't understand how / where can your observation happen:

Python 3.8.5 (default, Jan 27 2021, 15:41:15)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.23.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import fitz
In [2]: fitz.getTextLength("hello")
Out[2]: 23.23199987411499
In [3]: print(fitz.__doc__)

PyMuPDF 1.18.14: Python bindings for the MuPDF 1.18.0 library.
Version date: 2021-06-01 08:11:38.
Built for Python 3.8 on linux (64-bit).

In [4]:

@JorjMcKie
Copy link
Collaborator

As we discussed earlier: Deprecation warning will start being issud in version 1.19.0.
Even that is not set in stone ...

@cbm755
Copy link
Contributor Author

cbm755 commented Jun 9, 2021

how strange! I will dig....

@cbm755
Copy link
Contributor Author

cbm755 commented Jun 9, 2021

I figured it out!

  • In 1.18.13, it is called fitz.getTextlength with a little "l" (and get_text_length is not present)

  • In 1.18.14, there is a deprecation message for fitz.getTextLength with a capital "L" (and as expected get_text_length is present)

@cbm755 cbm755 changed the title 1.18.14 forces snake case 'get_text_length' w/o deprecation time 1.18.14 changed capitalization of deprecated getTextlength to getTextLength (capital L) Jun 9, 2021
@JorjMcKie
Copy link
Collaborator

WTF - a typo in the alias definition!

@JorjMcKie
Copy link
Collaborator

Fixed in new version.

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

No branches or pull requests

2 participants