Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH 2/2] emerge: call setlocale() to enable system locale.
Date: Sat, 29 Mar 2014 18:45:46
Message-Id: 1396118729-14451-2-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH 1/2] Use a localized size formatting function and ISO/IEC prefixes. by "Michał Górny"
1 This is necessary so that the size formatting function (and possibly
2 other locale-dependant functions in the future) respect the system
3 locale rather than using the 'C' locale.
4 ---
5 pym/_emerge/main.py | 4 ++++
6 1 file changed, 4 insertions(+)
7
8 diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
9 index cfe1332..eddb16c 100644
10 --- a/pym/_emerge/main.py
11 +++ b/pym/_emerge/main.py
12 @@ -3,6 +3,7 @@
13
14 from __future__ import print_function
15
16 +import locale
17 import platform
18 import sys
19
20 @@ -984,6 +985,9 @@ def emerge_main(args=None):
21
22 args = portage._decode_argv(args)
23
24 + # Use system locale.
25 + locale.setlocale(locale.LC_ALL, '')
26 +
27 # Disable color until we're sure that it should be enabled (after
28 # EMERGE_DEFAULT_OPTS has been parsed).
29 portage.output.havecolor = 0
30 --
31 1.9.1

Replies