Use a dgettext function returning strings instead of bytes

Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
This commit is contained in:
Matej Habrnal 2015-07-22 18:20:42 +02:00
parent 8a12a49d27
commit 80acf9fdce
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,29 @@
From f09c07c847bb5be6f749d102143e8b43a1a00b7c Mon Sep 17 00:00:00 2001
From: Matej Habrnal <mhabrnal@redhat.com>
Date: Wed, 22 Jul 2015 15:54:03 +0200
Subject: [PATCH] Use a dgettext function returning strings instead of bytes
ldgettext returns an array of bytes in system encoding and this, together with
Python3, causes troubles.
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
---
src/client-python/reportclient/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/client-python/reportclient/__init__.py b/src/client-python/reportclient/__init__.py
index 7b59586..43afc53 100644
--- a/src/client-python/reportclient/__init__.py
+++ b/src/client-python/reportclient/__init__.py
@@ -36,7 +36,7 @@ GETTEXT_PROGNAME = "libreport"
import locale
import gettext
-_ = lambda x: gettext.ldgettext(GETTEXT_PROGNAME, x)
+_ = lambda x: gettext.dgettext(GETTEXT_PROGNAME, x)
def init_gettext():
try:
--
2.4.6

View File

@ -7,7 +7,7 @@
Summary: Generic library for reporting various problems Summary: Generic library for reporting various problems
Name: libreport Name: libreport
Version: 2.6.2 Version: 2.6.2
Release: 1%{?dist} Release: 2%{?dist}
License: GPLv2+ License: GPLv2+
Group: System Environment/Libraries Group: System Environment/Libraries
URL: https://abrt.readthedocs.org/ URL: https://abrt.readthedocs.org/
@ -16,6 +16,7 @@ Source1: autogen.sh
# git format-patch %%{Version} -N -M --topo-order # git format-patch %%{Version} -N -M --topo-order
# i=0; for p in `ls 0*.patch`; do printf "Patch%04d: %s\n" $i $p; ((i++)); done # i=0; for p in `ls 0*.patch`; do printf "Patch%04d: %s\n" $i $p; ((i++)); done
Patch0001: 0001-Use-a-dgettext-function-returning-strings-instead-of.patch
# git is need for '%%autosetup -S git' which automatically applies all the # git is need for '%%autosetup -S git' which automatically applies all the
# patches above. Please, be aware that the patches must be generated # patches above. Please, be aware that the patches must be generated
@ -732,6 +733,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
%changelog %changelog
* Wed Jul 22 2015 Matej Habrnal <mhabrnal@redhat.com> 2.6.2-2
- Use a dgettext function returning strings instead of bytes
* Fri Jul 17 2015 Jakub Filak <jfilak@redhat.com> 2.6.2-1 * Fri Jul 17 2015 Jakub Filak <jfilak@redhat.com> 2.6.2-1
- avoid starvation in processes concurrently accessing a dump directory - avoid starvation in processes concurrently accessing a dump directory
- bugzilla: Add check for extra-cc file - bugzilla: Add check for extra-cc file