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

Find invalid escape sequences (regular expression) in regular strings #118

Closed
pfuntner opened this issue Sep 21, 2024 · 1 comment
Closed

Comments

@pfuntner
Copy link
Owner

In ae6d2d3 I fixed a problem in git-pulls where the script had a few regular strings with regular expression escape sequences. Since I had upgraded my system and was now using Python 3.12.3 (I'm not sure what I was using prior to the upgrade), the strings were generating warnings:

/home/mrbruno/bin/git-pulls:147: SyntaxWarning: invalid escape sequence '\s'

The solution is to do one of the following:

  • turn the string into an r-string
  • escaping backslashes

I would prefer not to find these piecemeal but I'm not sure how to find them otherwise. There may be an existing tool or I might have to write something.

@pfuntner
Copy link
Owner Author

I created find-invalid-escapes via 00419d0 and it seems to work well.

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

1 participant