#9565 Python 3.12 SyntaxWarning
Closed: fixed by frenaud. Opened by janneblomqvist.

On a system with python 3.12 installing the python ipaclient package (this is on Ubuntu 24.04 using the distro packages) produces the warnings:

Setting up python3-ipaclient (4.10.2-2) ...
/usr/lib/python3/dist-packages/ipaclient/remote_plugins/2_164/automember.py:19: SyntaxWarning: invalid escape sequence '.'
doc = ("""
/usr/lib/python3/dist-packages/ipaclient/remote_plugins/2_164/group.py:19: SyntaxWarning: invalid escape sequence '\D'
doc =
("""
/usr/lib/python3/dist-packages/ipaclient/remote_plugins/2_164/hbactest.py:19: SyntaxWarning: invalid escape sequence '\A'
doc = ("""
/usr/lib/python3/dist-packages/ipaclient/remote_plugins/2_164/trust.py:19: SyntaxWarning: invalid escape sequence '\D'
doc =
("""
/usr/lib/python3/dist-packages/ipaclient/remote_plugins/2_49/automember.py:19: SyntaxWarning: invalid escape sequence '.'
doc = ("""
/usr/lib/python3/dist-packages/ipaclient/remote_plugins/2_49/group.py:19: SyntaxWarning: invalid escape sequence '\D'
doc =
("""
/usr/lib/python3/dist-packages/ipaclient/remote_plugins/2_49/trust.py:19: SyntaxWarning: invalid escape sequence '\D'
doc = _("""

Looking at upstream, e.g. https://github.com/freeipa/freeipa/blob/master/ipaclient/remote_plugins/2_164/automember.py that file has last been updated 8 years ago and looks identical to the Ubuntu packaged version.


Thanks. I submitted https://github.com/freeipa/freeipa/pull/7297 to solve it. Let me know if this helps -- we currently don't have Python 3.12 in CI.

Metadata Update from @abbra:
- Issue assigned to abbra

master:

  • ca6604b58be0448e45b2a68d03d4f8dacbceab7b Use raw strings for Python 3 compatibility in old API client code

ipa-4-11:

  • 2e6fa62f95480e51b6a8da7100c105086e05c2fb Use raw strings for Python 3 compatibility in old API client code

ipa-4-10:

  • bcf6aba942c8ffa763d266bd84c540466129efa7 Use raw strings for Python 3 compatibility in old API client code

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Thanks for the quick fix! I can verify that manually applying the patches fixes the issue.

Metadata