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

Fix strings containing deprecated illegal escape sequences #648

Merged
merged 1 commit into from
Sep 4, 2018

Conversation

prculley
Copy link
Contributor

@prculley prculley commented Aug 9, 2018

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

@prculley prculley added the bug label Aug 9, 2018
@codecov-io
Copy link

Codecov Report

Merging #648 into maintenance/gramps50 will not change coverage.
The diff coverage is 33.57%.

Impacted file tree graph

@@                  Coverage Diff                  @@
##           maintenance/gramps50     #648   +/-   ##
=====================================================
  Coverage                 42.37%   42.37%           
=====================================================
  Files                      1065     1065           
  Lines                    142320   142320           
=====================================================
  Hits                      60301    60301           
  Misses                    82019    82019
Impacted Files Coverage Δ
gramps/plugins/importer/importxml.py 64.9% <ø> (ø) ⬆️
gramps/gen/utils/db.py 30.57% <ø> (ø) ⬆️
gramps/gen/display/name.py 57.1% <ø> (ø) ⬆️
gramps/gen/lib/place.py 87.42% <ø> (ø) ⬆️
gramps/gen/datehandler/_date_hr.py 68.18% <0%> (ø) ⬆️
gramps/gen/datehandler/_date_lt.py 55.17% <0%> (ø) ⬆️
gramps/gen/datehandler/_date_zh_CN.py 74.19% <0%> (ø) ⬆️
gramps/plugins/tool/reorderids.py 0% <0%> (ø) ⬆️
gramps/gen/datehandler/_date_uk.py 65.21% <0%> (ø) ⬆️
gramps/gen/datehandler/_date_pl.py 55.47% <0%> (ø) ⬆️
... and 33 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 414aac4...c7f0be7. Read the comment docs.

@sam-m888 sam-m888 merged commit f3b5f75 into gramps-project:maintenance/gramps50 Sep 4, 2018
@sam-m888
Copy link
Member

sam-m888 commented Sep 4, 2018

Thank you

@prculley prculley deleted the strings branch September 4, 2018 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants