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

Fix invalid escape sequences #1321

Merged
merged 1 commit into from Dec 13, 2023
Merged

Fix invalid escape sequences #1321

merged 1 commit into from Dec 13, 2023

Conversation

sterliakov
Copy link
Contributor

@sterliakov sterliakov commented Dec 13, 2023

Description

Resolve DeprecationWarning's emitted for invalid escape sequences in python 3.11 and newer.

Fixes Issues

Relates to #1293.

This fixes py3.11+ compatibility that arises from invalid escape literals in strings. Raw strings should be used for regexes and other strings that contain legitimate backslahes.

Python library reference.
Or on SO, if you prefer.

I have made sure that no other instances of this error are present in codebase (via ruff check . --select W605, here's this rule)

Unit test coverage

This issue should be addressed at the linter level. Ready to contribute a linting solution to catch this if authors are ready to accept some linting pipeline (which would be a good thing to do).

Known breaking changes/behaviors

This change is fully backwards-compatible. Sorry for whitespace removed on autosave, I hope it was not so important for you, guys...

@AngledLuffa AngledLuffa merged commit 6383581 into stanfordnlp:dev Dec 13, 2023
@AngledLuffa
Copy link
Collaborator

Awesome, thanks for the contribution

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

Successfully merging this pull request may close these issues.

None yet

2 participants