Gentoo Archives: gentoo-portage-dev

From: Alec Warner <antarus@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] emerge: Don't die when the user has an invalid locale setting
Date: Tue, 05 Aug 2014 19:23:46
Message-Id: CAAr7Pr98aa0zQqmMMw3GcjKoPdvTKvJLeEccZPHR8QeuZ3B1fg@mail.gmail.com
In Reply to: [gentoo-portage-dev] [PATCH] emerge: Don't die when the user has an invalid locale setting by Mike Gilbert
1 On Mon, Aug 4, 2014 at 12:45 PM, Mike Gilbert <floppym@g.o> wrote:
2
3 > ---
4 > pym/_emerge/main.py | 5 ++++-
5 > 1 file changed, 4 insertions(+), 1 deletion(-)
6 >
7 > diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
8 > index 1a920f7..722da84 100644
9 > --- a/pym/_emerge/main.py
10 > +++ b/pym/_emerge/main.py
11 > @@ -999,7 +999,10 @@ def emerge_main(args=None):
12 > args = portage._decode_argv(args)
13 >
14 > # Use system locale.
15 > - locale.setlocale(locale.LC_ALL, '')
16 > + try:
17 > + locale.setlocale(locale.LC_ALL, '')
18 > + except locale.Error as e:
19 > + print(e)
20 >
21
22 Portage has its own output functions (writemsg?)
23 You need to decide if this should be printed even if -q is passed, should
24 it be colorized, etc...
25
26 -A
27
28
29 >
30 > # Disable color until we're sure that it should be enabled (after
31 > # EMERGE_DEFAULT_OPTS has been parsed).
32 > --
33 > 2.0.4
34 >
35 >
36 >

Replies