trevorhobenshield / twitter-api-client

Implementation of X/Twitter v1, v2, and GraphQL APIs
https://pypi.org/project/twitter-api-client
MIT License
1.58k stars 214 forks source link

Python 3.12 and raw/regex warnings #163

Open reagle opened 10 months ago

reagle commented 10 months ago
/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 commented 10 months ago

This is supposedly easily addressed with pyupgrade.