#410 imghdr is deprecated
Opened a month ago by keeper-of-the-keys. Modified 19 days ago

imghdr was deprecated in Python 3.11 and removed in Python 3.13 which is the Python version in use on Fedora 41.
https://peps.python.org/pep-0594/#imghdr

It is used in util/config.py by the function name_from_image() which is in turn called by url_from_image() which is called by Image.__init__(), Image.set_value(), Image.import_value().

Image is used in providers/saml2/admin.py and providers/saml2/provider.py

As a quick workaround I commented the import out and had name_from_image return None for all cases, I was however unable to assess the true impact of these changes due to the sqlalchemy issue mentioned in #404.

mod_wsgi (pid=1208): Failed to exec Python script file '/usr/libexec/ipsilon/ipsilon'.
mod_wsgi (pid=1208): Exception occurred processing WSGI script '/usr/libexec/ipsilon/ipsilon'.
Traceback (most recent call last):
File "/usr/libexec/ipsilon/ipsilon", line 22, in <module>
    from ipsilon.root import Root
  File "/usr/lib/python3.13/site-packages/ipsilon/root.py", line 6, in <module>
    from ipsilon.login.common import Login
  File "/usr/lib/python3.13/site-packages/ipsilon/login/common.py", line 7, in <module>
    from ipsilon.util.config import ConfigHelper
  File "/usr/lib/python3.13/site-packages/ipsilon/util/config.py", line 7, in <module>
    import imghdr
ModuleNotFoundError: No module named 'imghdr'

After applying @abompard's patches from #408 to util/data.py it seems that images (ie. logos for the different clients) stop working.

Log in to comment on this ticket.

Metadata