1
1
mirror of https://github.com/chubin/cheat.sh.git synced 2024-11-28 20:28:39 +03:00

Decode bytes to str (fetch.py) (fixes #291)

This commit is contained in:
Igor Chubin 2021-04-25 10:37:28 +00:00
parent 74876d6d94
commit 562875eda6
2 changed files with 2 additions and 1 deletions

View File

@ -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):

View File

@ -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