#9565 Python 3.12 SyntaxWarning
Closed: fixed 9 months ago by frenaud. Opened 9 months ago 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

9 months ago

master:

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

ipa-4-11:

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

ipa-4-10:

  • bcf6aba 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)

9 months ago

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

Log in to comment on this ticket.

Metadata