From 7a4635b80819a2dd64bac83ac17de5a0e088da58 Mon Sep 17 00:00:00 2001 From: Matej Habrnal Date: Jul 22 2015 16:34:11 +0000 Subject: Use gettext instead of lgettext in all python scripts Resolves: #1245600 Signed-off-by: Matej Habrnal --- diff --git a/0001-use-gettext-instead-of-lgettext-in-all-python-script.patch b/0001-use-gettext-instead-of-lgettext-in-all-python-script.patch new file mode 100644 index 0000000..4eeb7d4 --- /dev/null +++ b/0001-use-gettext-instead-of-lgettext-in-all-python-script.patch @@ -0,0 +1,146 @@ +From 6cac02cec6f457e4ab4edca8cebe2cda8dc4061d Mon Sep 17 00:00:00 2001 +From: Matej Habrnal +Date: Wed, 22 Jul 2015 15:22:31 +0200 +Subject: [PATCH] use gettext instead of lgettext in all python scripts + +This is related to the transition from Python2 to Python3. + +lgettext returns an array of bytes but we require string (because of Python3). +Without this patch the scripts exit with 'TypeError' exception ('must be str, +not bytes'). + +Related to rhbz#1245600 + +Signed-off-by: Matej Habrnal +--- + src/daemon/abrt-handle-upload.in | 2 +- + src/plugins/abrt-action-analyze-core.in | 2 +- + src/plugins/abrt-action-analyze-vmcore.in | 2 +- + src/plugins/abrt-action-check-oops-for-alt-component.in | 2 +- + src/plugins/abrt-action-check-oops-for-hw-error.in | 2 +- + src/plugins/abrt-action-install-debuginfo.in | 2 +- + src/plugins/abrt-action-perform-ccpp-analysis.in | 2 +- + src/plugins/abrt-action-ureport | 2 +- + src/plugins/abrt-gdb-exploitable | 2 +- + 9 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/src/daemon/abrt-handle-upload.in b/src/daemon/abrt-handle-upload.in +index dc630bc..3db6561 100755 +--- a/src/daemon/abrt-handle-upload.in ++++ b/src/daemon/abrt-handle-upload.in +@@ -18,7 +18,7 @@ GETTEXT_PROGNAME = "abrt" + import locale + import gettext + +-_ = lambda x: gettext.lgettext(x) ++_ = lambda x: gettext.gettext(x) + + def init_gettext(): + try: +diff --git a/src/plugins/abrt-action-analyze-core.in b/src/plugins/abrt-action-analyze-core.in +index 486994a..448bdab 100644 +--- a/src/plugins/abrt-action-analyze-core.in ++++ b/src/plugins/abrt-action-analyze-core.in +@@ -12,7 +12,7 @@ GETTEXT_PROGNAME = "@PACKAGE@" + import locale + import gettext + +-_ = lambda x: gettext.lgettext(x) ++_ = lambda x: gettext.gettext(x) + + + verbose = 0 +diff --git a/src/plugins/abrt-action-analyze-vmcore.in b/src/plugins/abrt-action-analyze-vmcore.in +index c3ae071..c91737f 100644 +--- a/src/plugins/abrt-action-analyze-vmcore.in ++++ b/src/plugins/abrt-action-analyze-vmcore.in +@@ -14,7 +14,7 @@ GETTEXT_PROGNAME = "abrt" + import locale + import gettext + +-_ = lambda x: gettext.lgettext(x) ++_ = lambda x: gettext.gettext(x) + + def init_gettext(): + try: +diff --git a/src/plugins/abrt-action-check-oops-for-alt-component.in b/src/plugins/abrt-action-check-oops-for-alt-component.in +index 3dce42e..b5152c1 100644 +--- a/src/plugins/abrt-action-check-oops-for-alt-component.in ++++ b/src/plugins/abrt-action-check-oops-for-alt-component.in +@@ -9,7 +9,7 @@ import re + + GETTEXT_PROGNAME = "abrt" + +-_ = gettext.lgettext ++_ = gettext.gettext + + tags = [ + "WARNING:", +diff --git a/src/plugins/abrt-action-check-oops-for-hw-error.in b/src/plugins/abrt-action-check-oops-for-hw-error.in +index ff8ff5d..400ed99 100644 +--- a/src/plugins/abrt-action-check-oops-for-hw-error.in ++++ b/src/plugins/abrt-action-check-oops-for-hw-error.in +@@ -9,7 +9,7 @@ import re + + GETTEXT_PROGNAME = "abrt" + +-_ = gettext.lgettext ++_ = gettext.gettext + + def file_has_string(filename, string): + try: +diff --git a/src/plugins/abrt-action-install-debuginfo.in b/src/plugins/abrt-action-install-debuginfo.in +index ed453df..f70ebcd 100644 +--- a/src/plugins/abrt-action-install-debuginfo.in ++++ b/src/plugins/abrt-action-install-debuginfo.in +@@ -26,7 +26,7 @@ GETTEXT_PROGNAME = "abrt" + import locale + import gettext + +-_ = lambda x: gettext.lgettext(x) ++_ = lambda x: gettext.gettext(x) + + def init_gettext(): + try: +diff --git a/src/plugins/abrt-action-perform-ccpp-analysis.in b/src/plugins/abrt-action-perform-ccpp-analysis.in +index fd75fd4..c25de96 100644 +--- a/src/plugins/abrt-action-perform-ccpp-analysis.in ++++ b/src/plugins/abrt-action-perform-ccpp-analysis.in +@@ -19,7 +19,7 @@ from reportclient import (ask_yes_no_yesforever, + + GETTEXT_PROGNAME = "abrt" + +-_ = gettext.lgettext ++_ = gettext.gettext + + def handle_event(event_name, problem_dir): + """Helper function handling a single event +diff --git a/src/plugins/abrt-action-ureport b/src/plugins/abrt-action-ureport +index 1c63749..75e5c62 100755 +--- a/src/plugins/abrt-action-ureport ++++ b/src/plugins/abrt-action-ureport +@@ -17,7 +17,7 @@ GETTEXT_PROGNAME = "abrt" + import locale + import gettext + +-_ = lambda x: gettext.lgettext(x) ++_ = lambda x: gettext.gettext(x) + + def init_gettext(): + try: +diff --git a/src/plugins/abrt-gdb-exploitable b/src/plugins/abrt-gdb-exploitable +index cfdf293..758c4c5 100755 +--- a/src/plugins/abrt-gdb-exploitable ++++ b/src/plugins/abrt-gdb-exploitable +@@ -14,7 +14,7 @@ import locale + import gdb + + GETTEXT_PROGNAME = "abrt" +-_ = gettext.lgettext ++_ = gettext.gettext + + def init_gettext(): + try: +-- +2.4.6 + diff --git a/abrt.spec b/abrt.spec index 0681ab3..d4b20b7 100644 --- a/abrt.spec +++ b/abrt.spec @@ -49,7 +49,7 @@ Summary: Automatic bug detection and reporting tool Name: abrt Version: 2.6.2 -Release: 1%{?dist} +Release: 2%{?dist} License: GPLv2+ Group: Applications/System URL: https://abrt.readthedocs.org/ @@ -59,6 +59,7 @@ Patch0: disable-OpenGPGCheck-in-Fedora-Rawhide.patch # git format-patch %%{Version} --topo-order -N -M; # i=1; for p in `ls 0*.patch`; do printf "Patch%04d: %s\n" $i $p; ((i++)); done +Patch0001: 0001-use-gettext-instead-of-lgettext-in-all-python-script.patch # '%%autosetup -S git' -> git BuildRequires: git @@ -1045,6 +1046,10 @@ killall abrt-dbus >/dev/null 2>&1 || : %config(noreplace) %{_sysconfdir}/profile.d/abrt-console-notification.sh %changelog +* Wed Jul 22 2015 Matej Habrnal 2.6.2-2 +- use gettext instead of lgettext in all python scripts +- Resolves: #1245600 + * Fri Jul 17 2015 Jakub Filak 2.6.2-1 - switch to Python 3 - reassign components of certain Kernel oopses to xorg-x11-drv-*