Skip to content

SyntaxWarning: invalid escape sequence '\g' #3

@GianlucaFicarelli

Description

@GianlucaFicarelli

Hello, I noticed that a SyntaxWarning is printed with python >= 3.12:

To reproduce:

python src/admonitions/admonition.py

admonitions/src/admonitions/admonition.py:29: SyntaxWarning: invalid escape sequence '\g'
  return re.sub(starts_with_angle, "    \g<1>", gh_body)

caused by:

return re.sub(starts_with_angle, " \g<1>", gh_body)

This is showed also when compiling the .pyc, although it's not showed anymore when importing the pyc previously generated.

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