Another fix for commafy() (bug #984167/bug #1076954 comment #21).

Resolves: rhbz#984167 rhbz#1076954
This commit is contained in:
Tim Waugh 2014-07-09 10:51:09 +01:00
parent 7e228058b1
commit d54088ddce
2 changed files with 14 additions and 6 deletions

View File

@ -1,12 +1,17 @@
diff -up hplip-3.14.4/base/utils.py.codec hplip-3.14.4/base/utils.py
--- hplip-3.14.4/base/utils.py.codec 2014-04-16 11:30:46.409807494 +0100
+++ hplip-3.14.4/base/utils.py 2014-04-16 11:31:43.947158693 +0100
@@ -463,7 +463,7 @@ def sort_dict_by_value(d):
diff -up hplip-3.14.6/base/utils.py.codec hplip-3.14.6/base/utils.py
--- hplip-3.14.6/base/utils.py.codec 2014-07-09 10:35:11.813576899 +0100
+++ hplip-3.14.6/base/utils.py 2014-07-09 10:43:20.786495160 +0100
@@ -463,7 +463,12 @@ def sort_dict_by_value(d):
def commafy(val):
- return locale.format("%d", val, grouping=True).decode(locale.getpreferredencoding())
+ return locale.format("%d", val, grouping=True).decode(locale.getlocale(locale.LC_NUMERIC)[1])
+ format = locale.format("%d", val, grouping=True)
+ encoding = locale.getlocale(locale.LC_NUMERIC)[1]
+ if encoding == None:
+ return format
+
+ return format.decode(encoding)
def format_bytes(s, show_bytes=False):

View File

@ -7,7 +7,7 @@
Summary: HP Linux Imaging and Printing Project
Name: hplip
Version: 3.14.6
Release: 2%{?dist}
Release: 3%{?dist}
License: GPLv2+ and MIT
Url: http://hplip.sourceforge.net/
@ -482,6 +482,9 @@ rm -f %{buildroot}%{_sysconfdir}/xdg/autostart/hplip-systray.desktop
%postun libs -p /sbin/ldconfig
%changelog
* Wed Jul 9 2014 Tim Waugh <twaugh@redhat.com> - 3.14.6-3
- Another fix for commafy() (bug #984167/bug #1076954 comment #21).
* Tue Jun 17 2014 Jiri Popelka <jpopelka@redhat.com> - 3.14.6-2
- Fix parsing of avahi-daemon output (bug #1096939).