diff --git a/git/config.py b/git/config.py index cd2f10f98..7d962276e 100644 --- a/git/config.py +++ b/git/config.py @@ -169,7 +169,7 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje # They must be compatible to the LockFile interface. # A suitable alternative would be the BlockingLockFile t_lock = LockFile - re_comment = re.compile('^\s*[#;]') + re_comment = re.compile(r'^\s*[#;]') #} END configuration diff --git a/git/remote.py b/git/remote.py index e5480d0e4..60319ce14 100644 --- a/git/remote.py +++ b/git/remote.py @@ -208,7 +208,7 @@ class FetchInfo(object): NEW_TAG, NEW_HEAD, HEAD_UPTODATE, TAG_UPDATE, REJECTED, FORCED_UPDATE, \ FAST_FORWARD, ERROR = [1 << x for x in range(8)] - re_fetch_result = re.compile('^\s*(.) (\[?[\w\s\.$@]+\]?)\s+(.+) -> ([^\s]+)( \(.*\)?$)?') + re_fetch_result = re.compile(r'^\s*(.) (\[?[\w\s\.$@]+\]?)\s+(.+) -> ([^\s]+)( \(.*\)?$)?') _flag_map = {'!': ERROR, '+': FORCED_UPDATE, @@ -391,7 +391,7 @@ def __init__(self, repo, name): def __getattr__(self, attr): """Allows to call this instance like - remote.special( \*args, \*\*kwargs) to call git-remote special self.name""" + remote.special( \\*args, \\*\\*kwargs) to call git-remote special self.name""" if attr == "_config_reader": return super(Remote, self).__getattr__(attr) diff --git a/git/test/lib/helper.py b/git/test/lib/helper.py index 7d9f6b957..729c76a4f 100644 --- a/git/test/lib/helper.py +++ b/git/test/lib/helper.py @@ -200,7 +200,7 @@ def git_daemon_launched(base_path, ip, port): and setting the environment variable GIT_PYTHON_TEST_GIT_DAEMON_PORT to """) if is_win: - msg += textwrap.dedent(""" + msg += textwrap.dedent(r""" On Windows, the `git-daemon.exe` must be in PATH. diff --git a/git/test/test_git.py b/git/test/test_git.py index 3ab82b02e..3c8b6f828 100644 --- a/git/test/test_git.py +++ b/git/test/test_git.py @@ -91,7 +91,7 @@ def test_it_transforms_kwargs_into_git_command_arguments(self): self.assertEqual(set(['-s', '-t']), set(res)) def test_it_executes_git_to_shell_and_returns_result(self): - assert_match('^git version [\d\.]{2}.*$', self.git.execute(["git", "version"])) + assert_match(r'^git version [\d\.]{2}.*$', self.git.execute(["git", "version"])) def test_it_accepts_stdin(self): filename = fixture_path("cat_file_blob") diff --git a/git/test/test_index.py b/git/test/test_index.py index 071ac623f..e8d38a09a 100644 --- a/git/test/test_index.py +++ b/git/test/test_index.py @@ -411,7 +411,7 @@ def _count_existing(self, repo, files): # END num existing helper @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(), - """FIXME: File "C:\projects\gitpython\git\test\test_index.py", line 642, in test_index_mutation + """FIXME: File "C:\\projects\\gitpython\\git\\test\\test_index.py", line 642, in test_index_mutation self.assertEqual(fd.read(), link_target) AssertionError: '!\xff\xfe/\x00e\x00t\x00c\x00/\x00t\x00h\x00a\x00t\x00\x00\x00' != '/etc/that' diff --git a/git/test/test_repo.py b/git/test/test_repo.py index 755d31d26..86019b73a 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -416,7 +416,7 @@ def test_blame_complex_revision(self, git): self.assertEqual(len(res[0][1]), 83, "Unexpected amount of parsed blame lines") @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(), - """FIXME: File "C:\projects\gitpython\git\cmd.py", line 671, in execute + """FIXME: File "C:\\projects\\gitpython\\git\\cmd.py", line 671, in execute raise GitCommandError(command, status, stderr_value, stdout_value) GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git add 1__��ava verb��ten 1_test _myfile 1_test_other_file diff --git a/git/test/test_submodule.py b/git/test/test_submodule.py index 0a6c48807..9e79a72ca 100644 --- a/git/test/test_submodule.py +++ b/git/test/test_submodule.py @@ -423,10 +423,10 @@ def test_base_bare(self, rwrepo): self._do_base_tests(rwrepo) @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """ - File "C:\projects\gitpython\git\cmd.py", line 559, in execute + File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute raise GitCommandNotFound(command, err) git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid') - cmdline: git clone -n --shared -v C:\projects\gitpython\.git Users\appveyor\AppData\Local\Temp\1\tmplyp6kr_rnon_bare_test_root_module""") # noqa E501 + cmdline: git clone -n --shared -v C:\\projects\\gitpython\\.git Users\\appveyor\\AppData\\Local\\Temp\\1\\tmplyp6kr_rnon_bare_test_root_module""") # noqa E501 @with_rw_repo(k_subm_current, bare=False) def test_root_module(self, rwrepo): # Can query everything without problems @@ -664,7 +664,7 @@ def test_add_empty_repo(self, rwdir): # end for each checkout mode @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(), - """FIXME: ile "C:\projects\gitpython\git\cmd.py", line 671, in execute + """FIXME: ile "C:\\projects\\gitpython\\git\\cmd.py", line 671, in execute raise GitCommandError(command, status, stderr_value, stdout_value) GitCommandError: Cmd('git') failed due to: exit code(128) cmdline: git add 1__Xava verbXXten 1_test _myfile 1_test_other_file 1_XXava-----verbXXten diff --git a/git/test/test_tree.py b/git/test/test_tree.py index ab85bc9c6..5fd4d760b 100644 --- a/git/test/test_tree.py +++ b/git/test/test_tree.py @@ -24,7 +24,7 @@ class TestTree(TestBase): @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """ - File "C:\projects\gitpython\git\cmd.py", line 559, in execute + File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute raise GitCommandNotFound(command, err) git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid') cmdline: git cat-file --batch-check""") @@ -57,7 +57,7 @@ def test_serializable(self): # END for each item in tree @skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """ - File "C:\projects\gitpython\git\cmd.py", line 559, in execute + File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute raise GitCommandNotFound(command, err) git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid') cmdline: git cat-file --batch-check""")