8000 Fix deprecated Python string literal escape sequence by Nathan-Fenner · Pull Request #296 · sqlalchemy-redshift/sqlalchemy-redshift · GitHub
[go: up one dir, main page]

Skip to content

Fix deprecated Python string literal escape sequence #296

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Nathan-Fenner
Copy link
@Nathan-Fenner Nathan-Fenner commented Jan 2, 2024

These regular expressions are intending to "escape" the - so that it's not treated as a range inside of the [ ... ] regex character class-- but Python sees this as a string literal containing the escape sequence \-.

Starting in Python 3.12, this is a hard error, while 3.11 produces a deprecation warning. The correct syntax uses \\-.

I assume the # noqa comments were suppressing a static check which identified this as a problem.

This PR doesn't cause any change in behavior, except for suppressing the SyntaxError/Warning generated by the invalid string literal.

Todos

  • MIT compatible
  • Tests
  • Documentation
  • Updated CHANGES.rst

@emarx
Copy link
emarx commented Jun 6, 2024

Hi all! Is it possible to merge this PR? As is, we're having trouble using this library

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.

2 participants
0