Skip to content

Commit cee7a53

Browse files
scopxavfernandez
authored andcommitted
Python 3.6 invalid escape sequence deprecation fixes
1 parent 1ce8109 commit cee7a53

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

pip/commands/completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
set -lx COMP_WORDS (commandline -o) ""
3232
set -lx COMP_CWORD (math (contains -i -- (commandline -t) $COMP_WORDS)-1)
3333
set -lx PIP_AUTO_COMPLETE 1
34-
string split \ -- (eval $COMP_WORDS[1])
34+
string split \\ -- (eval $COMP_WORDS[1])
3535
end
3636
complete -fa "(__fish_complete_pip)" -c pip
3737
"""}

pip/commands/install.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(self, *args, **kw):
7777
dest='use_user_site',
7878
action='store_true',
7979
help="Install to the Python user install directory for your "
80-
"platform. Typically ~/.local/, or %APPDATA%\Python on "
80+
"platform. Typically ~/.local/, or %APPDATA%\\Python on "
8181
"Windows. (See the Python documentation for site.USER_BASE "
8282
"for full details.)")
8383
cmd_opts.add_option(

pip/utils/appdirs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def user_cache_dir(appname):
6060

6161

6262
def user_data_dir(appname, roaming=False):
63-
"""
63+
r"""
6464
Return full path to the user-specific data dir for this application.
6565
6666
"appname" is the name of application.
@@ -145,7 +145,7 @@ def user_config_dir(appname, roaming=True):
145145
# for the discussion regarding site_config_dirs locations
146146
# see <https://github.com/pypa/pip/issues/1733>
147147
def site_config_dirs(appname):
148-
"""Return a list of potential user-shared config dirs for this application.
148+
r"""Return a list of potential user-shared config dirs for this application.
149149
150150
"appname" is the name of application.
151151

pip/utils/encoding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
(codecs.BOM_UTF32_LE, 'utf32-le'),
1414
]
1515

16-
ENCODING_RE = re.compile(b'coding[:=]\s*([-\w.]+)')
16+
ENCODING_RE = re.compile(br'coding[:=]\s*([-\w.]+)')
1717

1818

1919
def auto_decode(data):

pip/vcs/git.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def obtain(self, dest):
155155
def get_url(self, location):
156156
"""Return URL of the first remote encountered."""
157157
remotes = self.run_command(
158-
['config', '--get-regexp', 'remote\..*\.url'],
158+
['config', '--get-regexp', r'remote\..*\.url'],
159159
show_stdout=False, cwd=location)
160160
remotes = remotes.splitlines()
161161
found_remote = remotes[0]

pip/vcs/subversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from pip.vcs import vcs, VersionControl
1313

1414
_svn_xml_url_re = re.compile('url="([^"]+)"')
15-
_svn_rev_re = re.compile('committed-rev="(\d+)"')
15+
_svn_rev_re = re.compile(r'committed-rev="(\d+)"')
1616
_svn_url_re = re.compile(r'URL: (.+)')
1717
_svn_revision_re = re.compile(r'Revision: (.+)')
1818
_svn_info_xml_rev_re = re.compile(r'\s*revision="(\d+)"')

pip/wheel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ def _get_script_text(entry):
412412
}
413413

414414
maker._get_script_text = _get_script_text
415-
maker.script_template = """# -*- coding: utf-8 -*-
415+
maker.script_template = r"""# -*- coding: utf-8 -*-
416416
import re
417417
import sys
418418

tests/functional/test_completion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_completion_for_fish(script):
4646
set -lx COMP_WORDS (commandline -o) ""
4747
set -lx COMP_CWORD (math (contains -i -- (commandline -t) $COMP_WORDS)-1)
4848
set -lx PIP_AUTO_COMPLETE 1
49-
string split \ -- (eval $COMP_WORDS[1])
49+
string split \\ -- (eval $COMP_WORDS[1])
5050
end
5151
complete -fa "(__fish_complete_pip)" -c pip"""
5252

tests/unit/test_req.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_no_reuse_existing_build_dir(self, data):
5151
finder = PackageFinder([data.find_links], [], session=PipSession())
5252
assert_raises_regexp(
5353
PreviousBuildDirError,
54-
"pip can't proceed with [\s\S]*%s[\s\S]*%s" %
54+
r"pip can't proceed with [\s\S]*%s[\s\S]*%s" %
5555
(req, build_dir.replace('\\', '\\\\')),
5656
reqset.prepare_files,
5757
finder,
@@ -187,7 +187,7 @@ def test_unsupported_hashes(self, data):
187187
r"Can't verify hashes for these file:// requirements because they "
188188
r"point to directories:\n"
189189
r" file://.*{sep}data{sep}packages{sep}FSPkg "
190-
"\(from -r file \(line 2\)\)".format(sep=sep),
190+
r"\(from -r file \(line 2\)\)".format(sep=sep),
191191
reqset.prepare_files,
192192
finder)
193193

0 commit comments

Comments
 (0)