cheetah3
cheetah3 copied to clipboard
A bunch of DeprecationWarnings when running in development mode
We try to use Python's development mode to get early warnings about stuff in our code. However we're also getting these DeprecationWarnings from Cheetah:
/opt/thinlinc/modules/Cheetah/Template.py:142: DeprecationWarning: invalid escape sequence \*
'''
/opt/thinlinc/modules/Cheetah/Template.py:1617: DeprecationWarning: invalid escape sequence \*
"""Compile the template. This method is automatically called by
/opt/thinlinc/modules/Cheetah/Template.py:1728: DeprecationWarning: invalid escape sequence \*
"""Method for importing web transaction variables in bulk.
/opt/thinlinc/modules/Cheetah/Template.py:1984: DeprecationWarning: invalid escape sequence \d
re.search('[ \t]*File.*line (\d+)', formatedExc).group(1))
/opt/thinlinc/modules/Cheetah/Template.py:2025: DeprecationWarning: invalid escape sequence \d
cheetahPosMatch = re.search('line (\d+), col (\d+)', formatedExc)
/opt/thinlinc/modules/Cheetah/Template.py:2035: DeprecationWarning: invalid escape sequence \d
cheetahPosMatch = re.search('line (\d+), col (\d+)',
/opt/thinlinc/modules/Cheetah/SettingsManager.py:19: DeprecationWarning: invalid escape sequence \(
'[\(]*' + Number + r'[ \t]*\+[ \t]*' + Number + '[\)]*')
/opt/thinlinc/modules/Cheetah/SettingsManager.py:19: DeprecationWarning: invalid escape sequence \)
'[\(]*' + Number + r'[ \t]*\+[ \t]*' + Number + '[\)]*')
/opt/thinlinc/modules/Cheetah/Parser.py:464: DeprecationWarning: invalid escape sequence \*
+ r'(?P<REFRESH_CACHE>\*' + interval + '\*)'
/opt/thinlinc/modules/Cheetah/Parser.py:557: DeprecationWarning: invalid escape sequence \$
"""Unescape any escaped Cheetah \$vars in the string.
/opt/thinlinc/modules/Cheetah/SourceReader.py:8: DeprecationWarning: invalid escape sequence \s
ENCODINGsearch = re.compile("coding[=:]\s*([-\w.]+)").search
Not sure if they indicate a real issue, but it would be nice to get rid of them to make development mode easier to use.
Python version? Cheetah version? How have you installed Cheetah?
Seen on Fedora 32, so python3-3.8.6-1.fc32.x86_64. Cheetah commit a6fb302197444eb5bc42f74da5d272eeb97582d7, manually copied in to a directory in $PYTHONPATH.
Python 3.6 added a DeprecationWarning for invalid escape sequences. The affected strings should probably be changed to raw strings. There appears to be a Flake8 rule for this.
The error code was disabled in 6758df2. Don't forget to remove it from setup.cfg in your pull request.
I've finished migration yo Github Actions. Your pull request will be automatically tested.
It looks like this was fixed in 31a907d?
I tested the 3.3.3 release, and I'm not getting any more warnings here. Seems to be resolved. :)
Thank you for testing and reporting!