1 |
On 10/03/2015 10:34 AM, Brian Dolbec wrote: |
2 |
> From 87ff1532e65e64c86fa80437944bda223aff3d93 Mon Sep 17 00:00:00 2001 |
3 |
> From: Brian Dolbec <dolsen@g.o> |
4 |
> Date: Sat, 3 Oct 2015 10:14:11 -0700 |
5 |
> Subject: [PATCH] repoman/argparser.py: _unicode_decode the commitmsg (bug |
6 |
> 562108) |
7 |
> |
8 |
> Force utf-8 for the comit message to prevent a possible traceback. |
9 |
> X-Gentoo-bug: 562108 |
10 |
> X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=562108 |
11 |
> --- |
12 |
> pym/repoman/argparser.py | 5 ++++- |
13 |
> 1 file changed, 4 insertions(+), 1 deletion(-) |
14 |
> |
15 |
> diff --git a/pym/repoman/argparser.py b/pym/repoman/argparser.py |
16 |
> index 85e261d..0f34ed0 100644 |
17 |
> --- a/pym/repoman/argparser.py |
18 |
> +++ b/pym/repoman/argparser.py |
19 |
> @@ -1,4 +1,3 @@ |
20 |
> -# -*- coding:utf-8 -*- |
21 |
> # repoman: Argument parser |
22 |
> # Copyright 2007-2014 Gentoo Foundation |
23 |
> # Distributed under the terms of the GNU General Public License v2 |
24 |
> @@ -11,6 +10,7 @@ import sys |
25 |
> # import our initialized portage instance |
26 |
> from repoman._portage import portage |
27 |
> |
28 |
> +from portage import _unicode_decode |
29 |
> from portage import util |
30 |
> from portage.util._argparse import ArgumentParser |
31 |
> |
32 |
> @@ -211,6 +211,9 @@ def parse_args(argv, qahelp, repoman_default_opts): |
33 |
> logger = logging.getLogger() |
34 |
> logger.setLevel(logger.getEffectiveLevel() + 10) |
35 |
> |
36 |
> + if opts.mode == 'commit' and opts.commitmsg: |
37 |
> + opts.commitmsg = _unicode_decode(opts.commitmsg) |
38 |
> + |
39 |
> if opts.mode == 'commit' and not (opts.force or opts.pretend): |
40 |
> if opts.ignore_masked: |
41 |
> opts.ignore_masked = False |
42 |
> |
43 |
|
44 |
Looks good. |
45 |
|
46 |
The rest of the commit message handling uses unicode, so this patch |
47 |
makes it consistent. None of the other arguments can contain free-form |
48 |
text like this, so they don't need explicit decoding. |
49 |
-- |
50 |
Thanks, |
51 |
Zac |