commit:     b83c5e476dc69780ff66c0b252ee2e34830cd98d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  3 17:14:11 2015 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Sun Oct  4 21:14:21 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b83c5e47

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

Reply via email to