Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxWarning: invalid escape sequence '\s' #53

Open
Aster89 opened this issue May 8, 2024 · 5 comments
Open

SyntaxWarning: invalid escape sequence '\s' #53

Aster89 opened this issue May 8, 2024 · 5 comments

Comments

@Aster89
Copy link

Aster89 commented May 8, 2024

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

archey3/archey3

Lines 332 to 333 in ac68752

info = [re.sub("\s\s+", "", line) for line in line.split(' ') if\
line]

and this

archey3/archey3

Line 697 in ac68752

DISPLAY_PARSING_REGEX = "(?P<func>\w+)\((|(?P<args>[\w, /]+))\)"

and prepending r to the first "string" of both lines solves the problem.

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

@vEnhance
Copy link

vEnhance commented May 8, 2024

The SyntaxWarning is new to Python 3.12 and I've been getting the same warning too.

I agree a PR here would make sense (with the obvious disclaimer that I'm not the maintainer of the package, just a fellow user).

@Aster89
Copy link
Author

Aster89 commented May 8, 2024

@vEnhance , let's wait for some of the maintainers to reply.

@HorlogeSkynet
Copy link

@vEnhance , let's wait for some of the maintainers to reply.

It's very unlikely. This project has been abandoned for a while now (see #47).
I (modestly) invite you to check out HorlogeSkynet/archey4, which is actively maintained (and compatible against Python 3.12).

Bye 👋

@eduarddejong
Copy link

I noticed it too (actually I was questioning what the old .archey3.cfg file was doing in my user home folder, and if I could clean things up, and that made me searching further for this thing on my system).
Running it gave the same errors for me. Copying the script from /usr/bin to another folder and then fixing it clearly helped (I just duplicated the backslashes, but adding the r for raw string is actually even better), but I don't plan to keep it.

Turns out in my case, it was also still sitting on my Arch Linux system, but in the case I have installed it from the official Arch repos (no idea), it's no longer there either.
This may be the case for other people as well.
But maybe it was just from AUR. I see that currently both archey3 and archey4 are available on the AUR.

@vEnhance
Copy link

It used to be in the main repository but got orphaned and then dropped down to AUR about six weeks ago:
https://lists.archlinux.org/archives/list/aur-general@lists.archlinux.org/thread/MHVWGPV6VEC7KRDYYMQHKGHTO6JJH7NS/
Because of this, there's actually now both archey3 and archey3-git in AUR, which is probably confusing things further :)

A few weeks ago I actually adopted the AUR package and then patched the issue at https://aur.archlinux.org/cgit/aur.git/tree/py312-syntax-warning.patch?h=archey3, but it would of course be better to have that change merged upstream. But that requires the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants