Fix strings containing deprecated illegal escape sequences #648
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Python 3.6 and above has deprecated illegal string escape sequences. Escape sequences are preceded by a
'\'
and valid ones are "\n\t\r" etc. Illegal ones are not in the list https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals.Previous to Python 3.6 these illegal sequences were ignored and the
'\'
was left in place. Pylint has been noting these for a while now.This PR corrects these sequences in Gramps. I used
find . -name "*.py" | xargs -t -n 1 python3 -Wd -m py_compile 2>&1 | grep Depre
to locate the failing strings.
I've done this work in gramps50 branch, as I expect it to live for a while.
Same thing for addons see gramps-project/addons-source#161