From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 54DBE138827 for ; Sat, 3 Oct 2015 17:58:21 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 43FB021C02B; Sat, 3 Oct 2015 17:58:20 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id B886521C00D for ; Sat, 3 Oct 2015 17:58:19 +0000 (UTC) Received: from [192.168.0.13] (ip174-67-205-96.oc.oc.cox.net [174.67.205.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 8688133D3CF for ; Sat, 3 Oct 2015 17:58:18 +0000 (UTC) Subject: Re: [gentoo-portage-dev] [PATCH] repoman/argparser.py: _unicode_decode the commitmsg (bug 562108) To: gentoo-portage-dev@lists.gentoo.org References: <20151003103440.7f9b3d35.dolsen@gentoo.org> From: Zac Medico X-Enigmail-Draft-Status: N1110 Message-ID: <56101737.7080206@gentoo.org> Date: Sat, 3 Oct 2015 10:58:15 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <20151003103440.7f9b3d35.dolsen@gentoo.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Archives-Salt: 8ab2ec3d-7481-494b-bab2-4135c8a4a40e X-Archives-Hash: c7cd0ff606a487a1ae32746f1ed8a7e3 On 10/03/2015 10:34 AM, Brian Dolbec wrote: > From 87ff1532e65e64c86fa80437944bda223aff3d93 Mon Sep 17 00:00:00 2001 > From: Brian Dolbec > Date: Sat, 3 Oct 2015 10:14:11 -0700 > Subject: [PATCH] repoman/argparser.py: _unicode_decode the commitmsg (bug > 562108) > > Force utf-8 for the comit message to prevent a possible traceback. > X-Gentoo-bug: 562108 > X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=562108 > --- > pym/repoman/argparser.py | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/pym/repoman/argparser.py b/pym/repoman/argparser.py > index 85e261d..0f34ed0 100644 > --- a/pym/repoman/argparser.py > +++ b/pym/repoman/argparser.py > @@ -1,4 +1,3 @@ > -# -*- coding:utf-8 -*- > # repoman: Argument parser > # Copyright 2007-2014 Gentoo Foundation > # Distributed under the terms of the GNU General Public License v2 > @@ -11,6 +10,7 @@ import sys > # import our initialized portage instance > from repoman._portage import portage > > +from portage import _unicode_decode > from portage import util > from portage.util._argparse import ArgumentParser > > @@ -211,6 +211,9 @@ def parse_args(argv, qahelp, repoman_default_opts): > logger = logging.getLogger() > logger.setLevel(logger.getEffectiveLevel() + 10) > > + if opts.mode == 'commit' and opts.commitmsg: > + opts.commitmsg = _unicode_decode(opts.commitmsg) > + > if opts.mode == 'commit' and not (opts.force or opts.pretend): > if opts.ignore_masked: > opts.ignore_masked = False > Looks good. The rest of the commit message handling uses unicode, so this patch makes it consistent. None of the other arguments can contain free-form text like this, so they don't need explicit decoding. -- Thanks, Zac