public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/
Date: Fri, 14 Feb 2020 18:13:13 +0000 (UTC)	[thread overview]
Message-ID: <1581703783.c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c.zmedico@gentoo> (raw)

commit:     c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 14 18:04:53 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Fri Feb 14 18:09:43 2020 +0000
URL:        https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=c6d2400d

revdep-rebuild: encode Popen args as utf-8 bytes (bug 709610)

Prevent this Popen exception:

UnicodeEncodeError: 'ascii' codec can't encode character '\xe8' in position 20: ordinal not in range(128)

Bug: https://bugs.gentoo.org/709610#c0
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 pym/gentoolkit/revdep_rebuild/stuff.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pym/gentoolkit/revdep_rebuild/stuff.py b/pym/gentoolkit/revdep_rebuild/stuff.py
index 3b0a980..002eb4b 100644
--- a/pym/gentoolkit/revdep_rebuild/stuff.py
+++ b/pym/gentoolkit/revdep_rebuild/stuff.py
@@ -19,6 +19,7 @@ def call_program(args):
 	@param, args: arument list to pass to subprocess
 	@return str
 	'''
+	args = [arg if isinstance(arg, bytes) else arg.encode('utf-8') for arg in args]
 	subp = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
 	stdout, stderr = subp.communicate()
 	stdout = stdout.decode('utf-8')


             reply	other threads:[~2020-02-14 18:13 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 18:13 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-07-09  1:49 [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/revdep_rebuild/ Mike Gilbert
2019-08-19  3:41 Zac Medico
2019-08-19  3:41 Zac Medico
2017-05-05 19:38 Paul Varner
2017-03-10 17:31 Zac Medico
2016-12-29 21:36 Jason Donenfeld
2016-09-15 15:05 Brian Dolbec
2016-09-15 15:05 Brian Dolbec
2016-08-15 21:06 Paul Varner
2016-06-09 19:38 Slawek Lis
2016-05-18 15:41 Brian Dolbec
2016-05-18 15:41 Brian Dolbec
2016-05-18 15:14 Brian Dolbec
2016-05-18  6:10 Brian Dolbec
2016-02-25 21:26 Brian Dolbec
2016-01-18  0:00 Jason Donenfeld
2015-12-20  2:05 Brian Dolbec
2015-12-16 17:53 Brian Dolbec

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

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

  git send-email \
    --in-reply-to=1581703783.c6d2400dccc2b5334bfab5f82f1a8bf1ab38f06c.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox