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" DeprecationWarnings with Python 3.6 #646

Closed
The-Compiler opened this issue Jan 8, 2017 · 3 comments

Comments

@The-Compiler
Copy link
Contributor

commented Jan 8, 2017

I get these while running my project's testsuite with all warnings turned on and Python 3.6:

.../jinja2/nodes.py:716: DeprecationWarning: invalid escape sequence \s
         """
       
.../jinja2/runtime.py:111: DeprecationWarning: invalid escape sequence \s
         """
       
.../jinja2/lexer.py:294: DeprecationWarning: invalid escape sequence \s
         """
       
.../jinja2/lexer.py:503: DeprecationWarning: invalid escape sequence \-
         (c('(?:\-%s\s*|%s)%s' % (
       
.../jinja2/lexer.py:511: DeprecationWarning: invalid escape sequence \-
         (c('\-%s\s*|%s' % (
       
.../jinja2/lexer.py:518: DeprecationWarning: invalid escape sequence \s
         (c('(.*?)((?:\s*%s\-|%s)\s*endraw\s*(?:\-%s\s*|%s%s))' % (

It looks like it's mostly \s in (non-raw) docstrings and \- in regexes. For some odd reason I can't reproduce this when running pylint's testsuite with pytest-warnings though, so I don't know if there's more.

@ThiefMaster

This comment has been minimized.

Copy link
Member

commented Jan 8, 2017

I think those strings should be r'...' raw strings to avoid exactly such warnings

@ThiefMaster

This comment has been minimized.

Copy link
Member

commented Jan 8, 2017

FWIW, I don't think any \ is needed for the - - outside [] the dash has no special meaning.

@mitsuhiko mitsuhiko closed this in be16786 Jan 8, 2017

@MartinThoma

This comment has been minimized.

Copy link

commented Nov 19, 2018

pip3 install jinja --user --upgrade solved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.