Skip to content

Commit

Permalink
Merge pull request #1370 from jessie-murray/fix-escape-sequences
Browse files Browse the repository at this point in the history
cleanup: fixes regex escape warnings in S3Uri.py, FileLists.py
  • Loading branch information
fviard committed Sep 10, 2024
2 parents 22949ba + dd8908d commit 7369a19
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion S3/FileLists.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def _get_filelist_remote(remote_uri, recursive = True):
uri_str = uri.uri()
## Wildcards used in remote URI?
## If yes we'll need a bucket listing...
wildcard_split_result = re.split("\*|\?", uri_str, maxsplit=1)
wildcard_split_result = re.split(r"\*|\?", uri_str, maxsplit=1)

if len(wildcard_split_result) == 2:
## If wildcards found
Expand Down
4 changes: 2 additions & 2 deletions S3/S3Uri.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def httpurl_to_s3uri(http_url):

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

class S3UriFile(S3Uri):
type = "file"
_re = re.compile("^(\w+://)?(.*)", re.UNICODE)
_re = re.compile(r"^(\w+://)?(.*)", re.UNICODE)
def __init__(self, string):
match = self._re.match(string)
groups = match.groups()
Expand Down

0 comments on commit 7369a19

Please sign in to comment.