Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invalid escape sequence" errors when run with python 3.12.0 #89

Closed
brzzdev opened this issue Nov 6, 2023 · 2 comments
Closed

"Invalid escape sequence" errors when run with python 3.12.0 #89

brzzdev opened this issue Nov 6, 2023 · 2 comments

Comments

@brzzdev
Copy link

brzzdev commented Nov 6, 2023

invalid escape sequence '\{' for file_path_placeholder = re.compile('\{\}')

invalid escape sequence '\d' for diff_pat = re.compile('^:(\d+) (\d+) ([a-f0-9]+) ([a-f0-9]+) ([A-Z])(\d+)?\t([^\t]+)(?:\t([^\t]+))?$')

@herrernst
Copy link

me too. works with python 3.11.

benlaverriere added a commit to benlaverriere/git-format-staged that referenced this issue Feb 27, 2024
As of python/cpython#98401 (released in Python 3.12.0), invalid escape sequences emit louder warnings, as described in hallettj#89. This patch uses raw strings for compiled regexes to suppress the warnings.
@hallettj
Copy link
Owner

hallettj commented Feb 27, 2024

Thanks for the reports! I've reproduced the error, and I'll work on a fix.

Edit: It turns out @benlaverriere is already on it

hallettj pushed a commit that referenced this issue Feb 27, 2024
As of python/cpython#98401 (released in Python 3.12.0), invalid escape sequences emit louder warnings, as described in #89. This patch uses raw strings for compiled regexes to suppress the warnings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants