freelawproject / courtlistener

A fully-searchable and accessible archive of court data including growing repositories of opinions, oral arguments, judges, judicial financial records, and federal filings.
https://www.courtlistener.com
Other
538 stars 148 forks source link

Fix SyntaxWarnings on regexes #3561

Open mlissner opened 9 months ago

mlissner commented 9 months ago

Python 3.12 is revealing a few syntax warnings whenever we start things up:

/opt/courtlistener/cl/people_db/lookup_utils.py:331: SyntaxWarning: invalid escape sequence '\s'
  "(((Van|VAN|De|DE|Da|DA)\s)?[A-Z][\w\-'']{2,}(\s(IV|I|II|III|V|Jr\.|JR\.|Sr\.|SR\.))?),",
/usr/local/lib/python3.12/site-packages/judge_pics/search.py:37: SyntaxWarning: invalid escape sequence '\d'
  matching_path = re.sub("[\d-]+", " ", path).strip()

There's another for usaddress that I just filed a PR for, and another for scorched, which we will be getting rid of soon and can ignore, but the ones above are in our code and we should fix them.

mlissner commented 1 month ago

Partially fixed here: https://github.com/freelawproject/judge-pics/pull/23