diff --git a/setup.cfg b/setup.cfg index b2da05b43..64514cfc9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -6,7 +6,7 @@ python_files = testsuite/*.py # with existing code. if you want to change them, you should first fix all # flake8 failures that appear with your change. ignore = E122,E123,E125,E126,E127,E128,E226,E402,E722,E731,E741,F401,F405,F811, - W504,W605 + W504 # line length long term target: 120 max-line-length = 255 exclude = build,dist,.git,.idea,.cache,.tox,docs/conf.py diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 62b9b82b2..d43d88374 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -2166,7 +2166,7 @@ class Archiver: `Fnmatch `_, selector `fm:` This is the default style for ``--exclude`` and ``--exclude-from``. - These patterns use a variant of shell pattern syntax, with '\*' matching + These patterns use a variant of shell pattern syntax, with '\\*' matching any number of characters, '?' matching any single character, '[...]' matching any single character specified, including ranges, and '[!...]' matching any character not specified. For the purpose of these patterns, @@ -2177,7 +2177,7 @@ class Archiver: from the start of the full path to just before a path separator. Except for the root path, paths will never end in the path separator when matching is attempted. Thus, if a given pattern ends in a path - separator, a '\*' is appended before matching is attempted. + separator, a '\\*' is appended before matching is attempted. Shell-style patterns, selector `sh:` This is the default style for ``--pattern`` and ``--patterns-from``. @@ -2252,7 +2252,7 @@ class Archiver: # The contents of directories in '/home' are not backed up when their name # ends in '.tmp' - $ borg create --exclude 're:^/home/[^/]+\.tmp/' backup / + $ borg create --exclude 're:^/home/[^/]+\\.tmp/' backup / # Load exclusions from file $ cat >exclude.txt < 100: # Limit file names to some reasonable length. Most file systems # limit them to 255 [unit of choice]; due to variations in unicode diff --git a/src/borg/testsuite/key.py b/src/borg/testsuite/key.py index bb6b7ce35..5ba6fb52c 100644 --- a/src/borg/testsuite/key.py +++ b/src/borg/testsuite/key.py @@ -34,7 +34,7 @@ class TestKey: /cXJq7jrqmrJ1phd6dg4SHAM/i+hubadZoS6m25OQzYAW09wZD/phG8OVa698Z5ed3HTaT SmrtgJL3EoOKgUI9d6BLE4dJdBqntifo""".strip() - keyfile2_cdata = unhexlify(re.sub('\W', '', """ + keyfile2_cdata = unhexlify(re.sub(r'\W', '', """ 0055f161493fcfc16276e8c31493c4641e1eb19a79d0326fad0291e5a9c98e5933 00000000000003e8d21eaf9b86c297a8cd56432e1915bb """)) diff --git a/src/borg/testsuite/patterns.py b/src/borg/testsuite/patterns.py index ff447888f..5806ff69b 100644 --- a/src/borg/testsuite/patterns.py +++ b/src/borg/testsuite/patterns.py @@ -229,13 +229,13 @@ def test_invalid_unicode_pattern(pattern): "", "# EOF"], ["/more/data", "/home", " #/wsfoobar"]), - (["re:.*"], []), - (["re:\s"], ["/data/something00.txt", "/more/data", "/home"]), + ([r"re:.*"], []), + ([r"re:\s"], ["/data/something00.txt", "/more/data", "/home"]), ([r"re:(.)(\1)"], ["/more/data", "/home", "\tstart/whitespace", "/whitespace/end\t"]), (["", "", "", "# This is a test with mixed pattern styles", # Case-insensitive pattern - "re:(?i)BAR|ME$", + r"re:(?i)BAR|ME$", "", "*whitespace*", "fm:*/something00*"],