Skip to content

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

@Ferdi265

Description

@Ferdi265

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions