Skip to content

Commit

Permalink
Fixes text encoding issues in output handling during clones
Browse files Browse the repository at this point in the history
When a dataset name includes special characters there can sometimes
be issues handling kart clone output that causes error messages
to be displayed and the repos are not added to the manager.

Despite this, the repository is cloned successfully on disk and can
be manually added.

This change allows for unexpected encoding issues that don't impact
on the normal operation of the plugin to be ignored.
  • Loading branch information
hamishcampbell committed Dec 16, 2024
1 parent 9630494 commit c456757
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions koordinates/core/kart_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def on_stdout(self, ba):
"""
Called when the kart process emits messages on stdout
"""
val = ba.data().decode('UTF-8')
val = ba.data().decode('UTF-8', errors='replace')
self._stdout_buffer += val

if self._stdout_buffer.endswith('\n') or self._stdout_buffer.endswith(
Expand Down Expand Up @@ -182,7 +182,7 @@ def short_result_description(self) -> str:
).format(self.title)

def on_stdout(self, ba):
val = ba.data().decode('UTF-8')
val = ba.data().decode('UTF-8', errors='replace')

counting_regex = re.compile(r'.*Counting objects:?\s*(\d+)%.*')
receiving_regex = re.compile(r'.*Receiving objects:?\s*(\d+)%.*')
Expand Down

0 comments on commit c456757

Please sign in to comment.