#9467 Mitigate deprecations included in python 3.13+
Opened a year ago by rcritten. Modified a year ago

Request for enhancement

It is proposed to update Fedora 41 to Python 3.13, https://discussion.fedoraproject.org/t/f41-change-proposal-python-3-13-system-wide/92897

With this comes a lot of deprecations, mostly warnings that apply to IPA.
https://docs.python.org/dev/whatsnew/3.13.html#what-s-new-in-python-3-13

Some of these are depreciated in 3.14 and beyond. We already took care of the datetime utcnow deprecation.

From a quickie glance this includes:

  • optparse
  • features in argparse: The type, choices, and metavar parameters
  • collections.abc
  • xml.etree.ElementTree

I may have missed some.


  • optparse has been deprecated for ages. It's now officially soft-deprecated. That basically means it's not going to be removed, but there is no feature development either. FreeIPA can safely continue to use it.
  • argparse deprecation only affects BooleanOptionalAction (which implements --foo / --no-foo magic for booleans).
  • xml.etree.ElementTree.Element.__bool__ is deprecated, so you cannot do if element any more.
  • collections.abc.ByteString is deprecated

Thanks, I was hoping you'd chime in with clarifications :-)
I included everything I noticed in the future deprecations with imports we used to be on the safe side.

One more issue with 3.12:

# ipa-server-install --help
/usr/lib/python3.12/site-packages/ipaserver/custodia/__init__.py:3: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('ipaserver.custodia')`.
Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
  __import__('pkg_resources').declare_namespace(__name__)

master:

  • 5e17c13 Remove ipaserver.custodia.init.py

ipa-4-11:

  • 35640f4 Remove ipaserver.custodia.init.py

Log in to comment on this ticket.

Metadata