Skip to content

Commit 32da7fe

Browse files
scopByron
authored andcommitted
Python 3.6 invalid escape sequence deprecation fixes
https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior
1 parent 39335e6 commit 32da7fe

File tree

8 files changed

+12
-12
lines changed

8 files changed

+12
-12
lines changed

git/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class GitConfigParser(with_metaclass(MetaParserBuilder, cp.RawConfigParser, obje
169169
# They must be compatible to the LockFile interface.
170170
# A suitable alternative would be the BlockingLockFile
171171
t_lock = LockFile
172-
re_comment = re.compile('^\s*[#;]')
172+
re_comment = re.compile(r'^\s*[#;]')
173173

174174
#} END configuration
175175

git/remote.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class FetchInfo(object):
208208
NEW_TAG, NEW_HEAD, HEAD_UPTODATE, TAG_UPDATE, REJECTED, FORCED_UPDATE, \
209209
FAST_FORWARD, ERROR = [1 << x for x in range(8)]
210210

211-
re_fetch_result = re.compile('^\s*(.) (\[?[\w\s\.$@]+\]?)\s+(.+) -> ([^\s]+)( \(.*\)?$)?')
211+
re_fetch_result = re.compile(r'^\s*(.) (\[?[\w\s\.$@]+\]?)\s+(.+) -> ([^\s]+)( \(.*\)?$)?')
212212

213213
_flag_map = {'!': ERROR,
214214
'+': FORCED_UPDATE,
@@ -391,7 +391,7 @@ def __init__(self, repo, name):
391391

392392
def __getattr__(self, attr):
393393
"""Allows to call this instance like
394-
remote.special( \*args, \*\*kwargs) to call git-remote special self.name"""
394+
remote.special( \\*args, \\*\\*kwargs) to call git-remote special self.name"""
395395
if attr == "_config_reader":
396396
return super(Remote, self).__getattr__(attr)
397397

git/test/lib/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ def git_daemon_launched(base_path, ip, port):
200200
and setting the environment variable GIT_PYTHON_TEST_GIT_DAEMON_PORT to <port>
201201
""")
202202
if is_win:
203-
msg += textwrap.dedent("""
203+
msg += textwrap.dedent(r"""
204204
205205
On Windows,
206206
the `git-daemon.exe` must be in PATH.

git/test/test_git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_it_transforms_kwargs_into_git_command_arguments(self):
9191
self.assertEqual(set(['-s', '-t']), set(res))
9292

9393
def test_it_executes_git_to_shell_and_returns_result(self):
94-
assert_match('^git version [\d\.]{2}.*$', self.git.execute(["git", "version"]))
94+
assert_match(r'^git version [\d\.]{2}.*$', self.git.execute(["git", "version"]))
9595

9696
def test_it_accepts_stdin(self):
9797
filename = fixture_path("cat_file_blob")

git/test/test_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ def _count_existing(self, repo, files):
411411
# END num existing helper
412412

413413
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(),
414-
"""FIXME: File "C:\projects\gitpython\git\test\test_index.py", line 642, in test_index_mutation
414+
"""FIXME: File "C:\\projects\\gitpython\\git\\test\\test_index.py", line 642, in test_index_mutation
415415
self.assertEqual(fd.read(), link_target)
416416
AssertionError: '!<symlink>\xff\xfe/\x00e\x00t\x00c\x00/\x00t\x00h\x00a\x00t\x00\x00\x00'
417417
!= '/etc/that'

git/test/test_repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def test_blame_complex_revision(self, git):
416416
self.assertEqual(len(res[0][1]), 83, "Unexpected amount of parsed blame lines")
417417

418418
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(),
419-
"""FIXME: File "C:\projects\gitpython\git\cmd.py", line 671, in execute
419+
"""FIXME: File "C:\\projects\\gitpython\\git\\cmd.py", line 671, in execute
420420
raise GitCommandError(command, status, stderr_value, stdout_value)
421421
GitCommandError: Cmd('git') failed due to: exit code(128)
422422
cmdline: git add 1__��ava verb��ten 1_test _myfile 1_test_other_file

git/test/test_submodule.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -423,10 +423,10 @@ def test_base_bare(self, rwrepo):
423423
self._do_base_tests(rwrepo)
424424

425425
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """
426-
File "C:\projects\gitpython\git\cmd.py", line 559, in execute
426+
File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute
427427
raise GitCommandNotFound(command, err)
428428
git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid')
429-
cmdline: git clone -n --shared -v C:\projects\gitpython\.git Users\appveyor\AppData\Local\Temp\1\tmplyp6kr_rnon_bare_test_root_module""") # noqa E501
429+
cmdline: git clone -n --shared -v C:\\projects\\gitpython\\.git Users\\appveyor\\AppData\\Local\\Temp\\1\\tmplyp6kr_rnon_bare_test_root_module""") # noqa E501
430430
@with_rw_repo(k_subm_current, bare=False)
431431
def test_root_module(self, rwrepo):
432432
# Can query everything without problems
@@ -664,7 +664,7 @@ def test_add_empty_repo(self, rwdir):
664664
# end for each checkout mode
665665

666666
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and Git.is_cygwin(),
667-
"""FIXME: ile "C:\projects\gitpython\git\cmd.py", line 671, in execute
667+
"""FIXME: ile "C:\\projects\\gitpython\\git\\cmd.py", line 671, in execute
668668
raise GitCommandError(command, status, stderr_value, stdout_value)
669669
GitCommandError: Cmd('git') failed due to: exit code(128)
670670
cmdline: git add 1__Xava verbXXten 1_test _myfile 1_test_other_file 1_XXava-----verbXXten

git/test/test_tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
class TestTree(TestBase):
2525

2626
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """
27-
File "C:\projects\gitpython\git\cmd.py", line 559, in execute
27+
File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute
2828
raise GitCommandNotFound(command, err)
2929
git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid')
3030
cmdline: git cat-file --batch-check""")
@@ -57,7 +57,7 @@ def test_serializable(self):
5757
# END for each item in tree
5858

5959
@skipIf(HIDE_WINDOWS_KNOWN_ERRORS and sys.version_info[:2] == (3, 5), """
60-
File "C:\projects\gitpython\git\cmd.py", line 559, in execute
60+
File "C:\\projects\\gitpython\\git\\cmd.py", line 559, in execute
6161
raise GitCommandNotFound(command, err)
6262
git.exc.GitCommandNotFound: Cmd('git') not found due to: OSError('[WinError 6] The handle is invalid')
6363
cmdline: git cat-file --batch-check""")

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy