#9483 Fixes: Python warnings in ipa-replica-manage
Closed: fixed a year ago by frenaud. Opened a year ago by jsf9k.

Issue

When I run ipa-replica-manage I see the following Python warnings on Fedora 39 (which uses Python 3.12.0):

/usr/sbin/ipa-replica-manage:393: SyntaxWarning: invalid escape sequence '\{'
  data = re.match('\{replica (\d+) (ldap://.*:\d+)\}(\s+\w+\s+\w*){0,1}', ruv)
/usr/sbin/ipa-replica-manage:721: SyntaxWarning: invalid escape sequence '\d'
  (re.sub(':\d+', '', x), y)
/usr/sbin/ipa-replica-manage:726: SyntaxWarning: invalid escape sequence '\d'
  (re.sub(':\d+', '', x), y)

Steps to Reproduce

  1. Run an ipa-replica-manage command such as ipa-replica-manage dnarange-show.
  2. Observe the Python warnings above.

Actual behavior

/usr/sbin/ipa-replica-manage:393: SyntaxWarning: invalid escape sequence '\{'
  data = re.match('\{replica (\d+) (ldap://.*:\d+)\}(\s+\w+\s+\w*){0,1}', ruv)
/usr/sbin/ipa-replica-manage:721: SyntaxWarning: invalid escape sequence '\d'
  (re.sub(':\d+', '', x), y)
/usr/sbin/ipa-replica-manage:726: SyntaxWarning: invalid escape sequence '\d'
  (re.sub(':\d+', '', x), y)

Expected behavior

No Python warnings.

Version/Release/Distribution

$ rpm -q freeipa-server freeipa-client ipa-server ipa-client 389-ds-base pki-ca krb5-server
freeipa-server-4.11.0-7.fc39.x86_64
freeipa-client-4.11.0-7.fc39.x86_64
package ipa-server is not installed
package ipa-client is not installed
389-ds-base-2.4.3-1.fc39.x86_64
package pki-ca is not installed
krb5-server-1.21.2-2.fc39.x86_64

I created https://github.com/freeipa/freeipa/pull/7077 to address this issue. I'm unable to assign the issue to myself, so feel free to do so if you think that is appropriate.

Metadata Update from @frenaud:
- Custom field on_review adjusted to https://github.com/freeipa/freeipa/pull/7077
- Issue assigned to jsf9k

a year ago

master:

  • c63fe92 Fixes: Python SyntaxWarnings about invalid escape sequences

ipa-4-11:

  • 60dfcb0 Fixes: Python SyntaxWarnings about invalid escape sequences

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

a year ago

Log in to comment on this ticket.

Metadata