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

Deprecation warning due to invalid escape sequences #44

Open
tirkarthi opened this issue Apr 24, 2020 · 2 comments
Open

Deprecation warning due to invalid escape sequences #44

tirkarthi opened this issue Apr 24, 2020 · 2 comments

Comments

@tirkarthi
Copy link
Contributor

Deprecation warning due to invalid escape sequences. Using raw strings or escaping them again helps in resolving this. Check https://github.com/asottile/pyupgrade/ for automatic fix of this.

find . -iname '*.py' | grep -Ev 'setup|rdf4|tool' | xargs -P4 -I{} python3.8 -Wall -m py_compile {}
./tests/extension/test_app_extension.py:43: DeprecationWarning: invalid escape sequence \w
  re.compile('/test_compiled_subdomain_\w*'): {
./tests/extension/test_app_extension.py:44: DeprecationWarning: invalid escape sequence \d
  'origins': re.compile("http://example\d+.com")
./tests/core/helper_tests.py:90: DeprecationWarning: invalid escape sequence \w
  self.assertTrue(probably_regex("http://[\w].example.com"))
./tests/core/helper_tests.py:91: DeprecationWarning: invalid escape sequence \w
  self.assertTrue(probably_regex("http://\w+.example.com"))
@ashleysommer
Copy link
Owner

Hi @tirkarthi
Is this on python 3.8?
This is a section of code straight from Flask-CORS, untouched from when I ported it to sanic. I might be able to make some changes to get rid of the warning.

@tirkarthi
Copy link
Contributor Author

I tested it on 3.8 but 3.7 also emits warnings. I didn't know it was vendored from flask-cors. I have a PR open for this upstream corydolphin/flask-cors#260 . Feel free to close this if you are planning to vendor it once upstream is fixed. Thanks.

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

2 participants