git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jelle van der Waa <jelle@vdwaa.nl>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>,
	Todd Zullinger <tmz@pobox.com>,
	Jelle van der Waa <jelle@vdwaa.nl>
Subject: [PATCH 3/3] contrib: hg-to-git: convert data to bytes for os.write
Date: Mon,  1 Apr 2019 20:52:08 +0200	[thread overview]
Message-ID: <20190401185208.17031-4-jelle@vdwaa.nl> (raw)
In-Reply-To: <20190401185208.17031-1-jelle@vdwaa.nl>

From: Jelle van der Waa <jelle@vdwaa.nl>

In Python 3 os.write wants bytes instead of a string, decode the str in
to bytes.

Signed-off-by: Jelle van der Waa <jelle@vdwaa.nl>
---
 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


      parent reply	other threads:[~2019-04-01 18:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-01 18:52 [PATCH 0/3] Make hg-to-git contrib script Python 3 compatible Jelle van der Waa
2019-04-01 18:52 ` [PATCH 1/3] contrib: hg-to-git: make print python " Jelle van der Waa
2019-04-01 18:52 ` [PATCH 2/3] contrib: hg-to-git: has_key is removed in Python 3 Jelle van der Waa
2019-04-01 18:52 ` Jelle van der Waa [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190401185208.17031-4-jelle@vdwaa.nl \
    --to=jelle@vdwaa.nl \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=tmz@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).