1 |
On Wed, 6 Aug 2014 18:54:22 +0200 |
2 |
Michał Górny <mgorny@g.o> wrote: |
3 |
|
4 |
> Fixes: https://bugs.gentoo.org/show_bug.cgi?id=519124 |
5 |
> --- |
6 |
> pym/portage/localization.py | 5 +++-- |
7 |
> 1 file changed, 3 insertions(+), 2 deletions(-) |
8 |
> |
9 |
> diff --git a/pym/portage/localization.py b/pym/portage/localization.py |
10 |
> index e4d87b6..7d30b59 100644 |
11 |
> --- a/pym/portage/localization.py |
12 |
> +++ b/pym/portage/localization.py |
13 |
> @@ -5,7 +5,7 @@ |
14 |
> import locale |
15 |
> import math |
16 |
> |
17 |
> -from portage import _unicode_decode |
18 |
> +from portage import _encodings, _unicode_decode |
19 |
> |
20 |
> # We define this to make the transition easier for us. |
21 |
> def _(mystr): |
22 |
> @@ -36,4 +36,5 @@ def localized_size(num_bytes): |
23 |
> |
24 |
> # always round up, so that small files don't end up as '0 |
25 |
> KiB' num_kib = math.ceil(num_bytes / 1024) |
26 |
> - return locale.format('%d', num_kib, grouping=True) + ' KiB' |
27 |
> + formatted_num = locale.format('%d', num_kib, grouping=True) |
28 |
> + return (_unicode_decode(formatted_num, |
29 |
> encoding=_encodings['stdio']) + ' KiB') |
30 |
|
31 |
|
32 |
DOH, repliied to the wrong one... this is the one I meant. |
33 |
|
34 |
-- |
35 |
Brian Dolbec <dolsen> |