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

Invalid escape sequences in Regexes cause SyntaxWarnings in Python >=3.12 #75

Open
Ferdi265 opened this issue Apr 28, 2024 · 0 comments

Comments

@Ferdi265
Copy link

When using latexrun with Python 3.12 and up, this gets printed every run:

/usr/bin/latexrun:1214: SyntaxWarning: invalid escape sequence '\w'
  if lookingatre('(Package |Class |LaTeX |pdfTeX )?(\w+ )?warning: ', re.I):
/usr/bin/latexrun:1353: SyntaxWarning: invalid escape sequence '\.'
  m2 = self.__lookingatre('l\.[0-9]+ ')
/usr/bin/latexrun:1849: SyntaxWarning: invalid escape sequence '\d'
  m2 = re.match("BibTeX subsystem: (.*?), line (\d+), (.*)$", m.group(1))

This is caused by invalid escape sequences in regexes. The solution is to use raw strings for these regexes as well.

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

1 participant