Skip to content

Commit 7369a19

Browse files
authored
Merge pull request #1370 from jessie-murray/fix-escape-sequences
cleanup: fixes regex escape warnings in S3Uri.py, FileLists.py
2 parents 22949ba + dd8908d commit 7369a19

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

S3/FileLists.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ def _get_filelist_remote(remote_uri, recursive = True):
522522
uri_str = uri.uri()
523523
## Wildcards used in remote URI?
524524
## If yes we'll need a bucket listing...
525-
wildcard_split_result = re.split("\*|\?", uri_str, maxsplit=1)
525+
wildcard_split_result = re.split(r"\*|\?", uri_str, maxsplit=1)
526526

527527
if len(wildcard_split_result) == 2:
528528
## If wildcards found

S3/S3Uri.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def httpurl_to_s3uri(http_url):
119119

120120
# Worst case scenario, we would like to be able to match something like
121121
# my.website.com.s3-fips.dualstack.us-west-1.amazonaws.com.cn
122-
m = re.match("(.*\.)?s3(?:\-[^\.]*)?(?:\.dualstack)?(?:\.[^\.]*)?\.amazonaws\.com(?:\.cn)?$",
122+
m = re.match(r"(.*\.)?s3(?:\-[^\.]*)?(?:\.dualstack)?(?:\.[^\.]*)?\.amazonaws\.com(?:\.cn)?$",
123123
hostname, re.IGNORECASE | re.UNICODE)
124124
if not m:
125125
raise ValueError("Unable to parse URL: %s" % http_url)
@@ -167,7 +167,7 @@ def uri(self):
167167

168168
class S3UriFile(S3Uri):
169169
type = "file"
170-
_re = re.compile("^(\w+://)?(.*)", re.UNICODE)
170+
_re = re.compile(r"^(\w+://)?(.*)", re.UNICODE)
171171
def __init__(self, string):
172172
match = self._re.match(string)
173173
groups = match.groups()

0 commit comments

Comments
 (0)