From 562875eda610b0322819def25f2d27af1bf9469a Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Sun, 25 Apr 2021 10:37:28 +0000 Subject: [PATCH] Decode bytes to str (fetch.py) (fixes #291) --- lib/adapter/git_adapter.py | 2 +- lib/fetch.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/adapter/git_adapter.py b/lib/adapter/git_adapter.py index b8a8d29..0ce4d31 100644 --- a/lib/adapter/git_adapter.py +++ b/lib/adapter/git_adapter.py @@ -134,7 +134,7 @@ class GitRepositoryAdapter(RepositoryAdapter): #pylint: disable=abstract-meth """ local_repository_dir = cls.local_repository_location() state_filename = os.path.join(local_repository_dir, '.cached_revision') - open(state_filename, 'w').write(state) + open(state_filename, 'wb').write(state) @classmethod def get_state(cls): diff --git a/lib/fetch.py b/lib/fetch.py index 7d57fd3..df85aea 100644 --- a/lib/fetch.py +++ b/lib/fetch.py @@ -136,6 +136,7 @@ def _update_adapter(adptr): updates = [] if cmd: errorcode, output = _run_cmd(cmd) + output = output.decode("utf-8") if errorcode: _log("\nERROR:\n---\n" + output + "\n---\nCould not get list of pages to be updated: %s" % adptr) return False