Skip to content

Commit

Permalink
fix old verions
Browse files Browse the repository at this point in the history
  • Loading branch information
liormizr committed Jul 3, 2024
1 parent f015748 commit d322584
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions s3path/old_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def make_uri(self, path):
uri = super().make_uri(path)
return uri.replace('file:///', 's3://')

def compile_pattern_parts(self, prefix, pattern, bucket):
def compile_pattern_parts(self, path, prefix, pattern, bucket):
pattern = self.sep.join((
'',
bucket,
Expand All @@ -73,7 +73,7 @@ def compile_pattern_parts(self, prefix, pattern, bucket):
new_regex_pattern += f'{self.sep}*(?s:{part.replace("**", ".*")})'
continue
if '*' == part:
new_regex_pattern += f'{self._path._flavour.sep}(?s:[^/]+)'
new_regex_pattern += f'{path._flavour.sep}(?s:[^/]+)'
continue
new_regex_pattern += f'{self.sep}{fnmatch.translate(part)[:-2]}'
new_regex_pattern += r'/*\Z'
Expand Down Expand Up @@ -710,7 +710,7 @@ def __init__(self, path, *, pattern):
self._prefix, pattern = self._prefix_splitter(pattern)
self._full_keys = self._calculate_full_or_just_folder(pattern)
self._target_level = self._calculate_pattern_level(pattern)
self.match = self._path._flavour.compile_pattern_parts(self._prefix, pattern, path.bucket)
self.match = self._path._flavour.compile_pattern_parts(self._path, self._prefix, pattern, path.bucket)

def select(self):
for target in self._deep_cached_dir_scan():
Expand Down

0 comments on commit d322584

Please sign in to comment.