tests/test_cache.py and Python >= 3.12: SyntaxWarning: invalid escape sequence '\w'

Open Beginner friendly
#1,445 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
72/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
testing-qa

Research direction

Open tests/test_cache.py around line 150 and reproduce the warning with Python 3.12 or newer. Inspect the string containing the invalid \w escape, then run the relevant cache tests and confirm the SyntaxWarning no longer appears.

Written by the indexing model from the issue text.

Description

tests/test_cache.py yields the following syntax warning starting with Python 3.12 (tested using Lark 1.2.1):

/path/to/lark/tests/test_cache.py:150: SyntaxWarning: invalid escape sequence '\w'

See https://github.com/lark-parser/lark/actions/runs/10367391039/job/28698690278 for an example.

Dominant language
Python
Stars
6k
Forks
523
Avg merge
3d 22h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lark-parser/lark

All issues in lark-parser/lark

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.