twitter-api-client icon indicating copy to clipboard operation
twitter-api-client copied to clipboard

Python 3.12 and raw/regex warnings

Open reagle opened this issue 1 year ago • 1 comments

/Users/reagle/.pyenv/versions/3.12.1/lib/python3.12/site-packages/twitter/constants.py:64: SyntaxWarning: invalid escape sequence '\d'
  'UserMedia': '^tweet-\d+$',

Other language changes

A backslash-character pair that is not a valid escape sequence now generates a SyntaxWarning, instead of DeprecationWarning. For example, re.compile("\d+.\d+") now emits a SyntaxWarning ("\d" is an invalid escape sequence, use raw strings for regular expression: re.compile(r"\d+.\d+")). In a future Python version, SyntaxError will eventually be raised, instead of SyntaxWarning. (Contributed by Victor Stinner in gh-98401.)

reagle avatar Jan 05 '24 13:01 reagle

This is supposedly easily addressed with pyupgrade.

reagle avatar Jan 05 '24 13:01 reagle