archey3 icon indicating copy to clipboard operation
archey3 copied to clipboard

SyntaxWarning: invalid escape sequence '\s'

Open Aster89 opened this issue 9 months ago • 5 comments

Has something recently changed in Python? I've not consciously changed anything on my system that could affect archey3 the way I describe below.

Whenever I execute archey3 I get this warning before the usual output:

/usr/bin/archey3:332: SyntaxWarning: invalid escape sequence '\s'
  info = [re.sub("\s\s+", "", line) for line in line.split('  ') if\
/usr/bin/archey3:697: SyntaxWarning: invalid escape sequence '\w'
  DISPLAY_PARSING_REGEX = "(?P<func>\w+)\((|(?P<args>[\w, /]+))\)"

the lines are these https://github.com/lclarkmichalek/archey3/blob/ac687529ec6208954f09c29f01760c66f73b1d10/archey3#L332-L333 and this https://github.com/lclarkmichalek/archey3/blob/ac687529ec6208954f09c29f01760c66f73b1d10/archey3#L697 and prepending r to the first "string" of both lines solves the problem.

I can make a PR if this project is still alive.

Aster89 avatar May 08 '24 18:05 Aster89