From: wangbiao Date: Fri, 1 Mar 2024 05:26:57 +0000 (+0900) Subject: gbp/git/vfs.py:fix initial_value must be str or None, not bytes X-Git-Tag: debian/0.9.36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2646b085ee87854748be50a4f8ad1280845c3b8f;p=tools%2Fgit-buildpackage.git gbp/git/vfs.py:fix initial_value must be str or None, not bytes Change-Id: I2855cfd6b6fb10b0bce863ddc3af57f83e158d89 Signed-off-by: wangbiao --- diff --git a/gbp/git/vfs.py b/gbp/git/vfs.py index 6f10442a..7504ef7c 100644 --- a/gbp/git/vfs.py +++ b/gbp/git/vfs.py @@ -29,8 +29,10 @@ class GitVfs(object): """ def __init__(self, content): self._iter = iter - self._data = io.StringIO(content) - + try: + self._data = io.StringIO(content.decode()) + except UnicodeDecodeError: + self._data = io.StringIO(content.decode("iso-8859-1")) def readline(self): return self._data.readline()