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

imghdr used in cover will be removed in python 3.13 #44

Open
clach04 opened this issue Jan 14, 2023 · 4 comments
Open

imghdr used in cover will be removed in python 3.13 #44

clach04 opened this issue Jan 14, 2023 · 4 comments

Comments

@clach04
Copy link

clach04 commented Jan 14, 2023

https://github.com/kevinhendricks/KindleUnpack/blob/master/lib/mobi_cover.py#L11

From https://docs.python.org/3/library/imghdr.html

Deprecated since version 3.11, will be removed in version 3.13: The imghdr module is deprecated (see PEP 594 for details and alternatives).

@clach04 clach04 changed the title imghdr used in cover wi imghdr used in cover will be removed in python 3.13 Jan 14, 2023
@clach04
Copy link
Author

clach04 commented Jan 14, 2023

None of the suggested replacements in the PEP support python 2. Could adopt imghdr into projector add additional checks to existing code for types we care about.

I do have a project https://github.com/clach04/magic-fork which might be suitable .

@kevinhendricks
Copy link
Owner

We will keep it in mind but we still have plenty of time since it was just deprecated in 3.11.

filetype might be an option.

We may decide to remove python2 support since all work on kfx input seems to be python3 only.

@kevinhendricks
Copy link
Owner

Also, since the current python lib imghdr.py is a simple self-contained module we may just decide to include a version of it as part of kindleunpack.

@NebularNerd
Copy link

Another alternative is PureMagic, imghdr support was recently built into it. You should be able to use it as a drop-in replacement without modification.

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

No branches or pull requests

3 participants