Skip to content

asan_symbolize.py: SyntaxWarning reported by Python 3.12 re. invalid escape sequences #97815

Open
@moha-gh

Description

@moha-gh

When using compiler-rt/lib/asan/scripts/asan_symbolize.py with Python 3.12, two syntax warnings concerning invalid escape sequences are being reported:

[...]/asan_symbolize.py:319: SyntaxWarning: invalid escape sequence '\('
  match = re.match("^(.*) \(in (.*)\) \((.*:\d*)\)$", atos_line)
[...]/asan_symbolize.py:544: SyntaxWarning: invalid escape sequence '\('
  "^( *#([0-9]+) *)(0x[0-9a-f]+) *(?:in *.+)? *\((.*)\+(0x[0-9a-f]+)\)

This is caused by a change in behaviour in Python 3.12 to eventually make such things syntax errors (see release notes).

I'd be happy to file a PR to fix this, but I'm not sure how the regexes are supposed to look / why the invalid escape sequences have been added in the first place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions