Skip to content

Commit

Permalink
Decode to latin-1 to fix some some decoding errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tpoveda committed Apr 22, 2021
1 parent add8aa7 commit d52b3b0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions artella/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,14 @@ def status(self, file_paths, include_remote=False):
file_paths = utils.force_list(file_paths, remove_duplicates=True)
result = list()

# Make sure that paths are clean
file_paths = [utils.clean_path(file_path) for file_path in file_paths]

for file_path in file_paths:
try:
file_path = file_path.decode('utf-8')
except UnicodeDecodeError:
file_path = file_path.decode('latin-1')
uri_path = path_to_uri(file_path) if not is_uri_path(file_path) else file_path
uri_parts = urlparse(uri_path)
params = urlencode({'handle': uri_parts.path, 'include-remote': str(bool(include_remote)).lower()})
Expand Down

0 comments on commit d52b3b0

Please sign in to comment.