From: Jelle van der Waa Date: Mon, 01 Apr 2019 18:52:08 GMT Subject: [PATCH 3/3] contrib: hg-to-git: convert data to bytes for os.write Message-ID: <20190401185208.17031-4-jelle@vdwaa.nl> In-Reply-To: <20190401185208.17031-1-jelle@vdwaa.nl> From: Jelle van der Waa In Python 3 os.write wants bytes instead of a string, decode the str in to bytes. Signed-off-by: Jelle van der Waa --- contrib/hg-to-git/hg-to-git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py index d504624c63..26c7300011 100755 --- a/contrib/hg-to-git/hg-to-git.py +++ b/contrib/hg-to-git/hg-to-git.py @@ -178,7 +178,7 @@ def getgitenv(user, date): #get comment (fdcomment, filecomment) = tempfile.mkstemp() csetcomment = os.popen('hg log -r %d --template "{desc}"' % cset).read().strip() - os.write(fdcomment, csetcomment) + os.write(fdcomment, csetcomment.encode()) os.close(fdcomment) print('-----------------------------------------') -- 2.21.0