From e13d28abbce0b5ad04579971f3f1ff49d0601240 Mon Sep 17 00:00:00 2001 From: Nicola Lamacchia Date: Sun, 14 Mar 2021 16:13:13 +0100 Subject: [PATCH] adb-sync: convert bytes to string in log lines --- adb-sync | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/adb-sync b/adb-sync index 3b4eaf6..ef03243 100755 --- a/adb-sync +++ b/adb-sync @@ -628,7 +628,8 @@ class FileSyncer(object): for name, s in self.src_only[i]: src_name = self.src[i] + name dst_name = self.dst[i] + name - logging.info('%s: %r', self.push[i], dst_name) + logging.info('%s: %r', self.push[i], + dst_name.decode('utf-8', 'replace')) if stat.S_ISDIR(s.st_mode): if not self.dry_run: self.dst_fs[i].makedirs(dst_name) @@ -863,7 +864,9 @@ def main() -> None: return for i in range(len(localpaths)): - logging.info('Sync: local %r, remote %r', localpaths[i], remotepaths[i]) + logging.info('Sync: local %r, remote %r', + localpaths[i].decode('utf-8', 'replace'), + remotepaths[i].decode('utf-8', 'replace')) syncer = FileSyncer(adb, localpaths[i], remotepaths[i], local_to_remote, remote_to_local, preserve_times, delete_missing, allow_overwrite, allow_replace, copy_links, dry_run)