Fix strings containing deprecated illegal escape sequences (#648)
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.
This commit is contained in:
@@ -222,7 +222,7 @@ class buildbase(GObject.GObject):
|
||||
os.makedirs(mo_dir)
|
||||
#TODO: find a better way to handle different platforms
|
||||
if sys.platform == 'win32':
|
||||
po_files = glob.glob(po_dir + "\*.po")
|
||||
po_files = glob.glob(po_dir + r"\*.po")
|
||||
# no longer using python msgfmt as it doesn't handle plurals (april 2010)
|
||||
# msgfmtCmd = path.normpath(path.join(sys.prefix, "Tools/i18n/msgfmt.py") )
|
||||
|
||||
|
@@ -138,7 +138,8 @@ def ScanDependencyFileForErrors(fname):
|
||||
parts = line[pthend_idx:].split()
|
||||
OK = False
|
||||
if dirname.startswith(os.path.join(sysroot, 'winsxs').lower()) \
|
||||
or dirname.startswith(os.path.join(sys.prefix, 'lib\site-packages\gtk-2.0').lower()):
|
||||
or dirname.startswith(os.path.join(
|
||||
sys.prefix, r'lib\site-packages\gtk-2.0').lower()):
|
||||
OK = True
|
||||
|
||||
for pth in acceptablePaths:
|
||||
|
@@ -139,7 +139,7 @@ def writeLauncher(language, langcode, runtimepath, grampspath):
|
||||
@rem During the boot process of GRAMPS there is a check for an environment variable
|
||||
@rem called GRAMPSHOME. Without this environment variable GRAMPS uses the default
|
||||
@rem windows path as the location to save all configuration files:
|
||||
@rem <system drive>\<userpath>\<application data>\gramps
|
||||
@rem <system drive>\\<userpath>\\<application data>\\gramps
|
||||
@rem If required, uncomment GRAMPSHOME line and edit to suit your use.
|
||||
''')
|
||||
lines.append('\n@rem set the path for GRAMPS configuration files')
|
||||
|
@@ -133,7 +133,8 @@ def ScanDependencyFileForErrors(fname):
|
||||
parts = line[pthend_idx:].split()
|
||||
OK = False
|
||||
if dirname.startswith(os.path.join(sysroot, 'winsxs').lower()) \
|
||||
or dirname.startswith(os.path.join(sys.prefix, 'lib\site-packages\gtk-2.0').lower()):
|
||||
or dirname.startswith(os.path.join(
|
||||
sys.prefix, r'lib\site-packages\gtk-2.0').lower()):
|
||||
OK = True
|
||||
|
||||
for pth in acceptablePaths:
|
||||
|
Reference in New Issue
Block a user