ClusterLabs / fence-agents

Fence agents
101 stars 155 forks source link

Python SyntaxWarning messages from regular expressions #570

Closed RobertCElliott closed 3 months ago

RobertCElliott commented 4 months ago

The Python interpreter now expects an r prefix around strings that contain regular expression special characters, so some of the programs are now noisy.

$ fence_redfish --help
/usr/share/fence/fencing.py:617: SyntaxWarning: invalid escape sequence '\.'
  docs["longdesc"] = re.sub("\\\\f[BPIR]|\.P|\.TP|\.br\n", "", docs["longdesc"])
/usr/share/fence/fencing.py:652: SyntaxWarning: invalid escape sequence '\s'
  shortdesc = re.sub(".*\s\s+", "", opt["help"][31:])
/usr/share/fence/fencing.py:1275: SyntaxWarning: invalid escape sequence '\s'
  os.environ.update(line.partition('=')[::2] for line in output.decode("utf-8").split('\0') if not re.match("^\s*$", line))
Usage:
        fence_redfish [options]
...
oalbrigt commented 4 months ago

Which python version is giving these errors?

RobertCElliott commented 4 months ago

Which python version is giving these errors?

The history for handling this language change is apparently:

Fedora 39 has Python 3.12.2.