Skip to content

Commit

Permalink
add unicode convert
Browse files Browse the repository at this point in the history
  • Loading branch information
BinamB committed Jul 12, 2022
1 parent 0aa3d45 commit c480e0c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fence/sync/sync_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,9 @@ def _match_pattern(filepath, id_patterns, encrypted=True):
if encrypted:
pattern += ".enc"
pattern += "$"
pattern = pattern.encode().decode(
"unicode_escape"
) # when converting from yaml, python reads it as Python string literal. So "\" turns into "\\" which messes with the regex match
if re.match(pattern, os.path.basename(filepath)):
return True
return False
Expand Down

0 comments on commit c480e0c

Please sign in to comment.