Blob Blame History Raw
From 6cac02cec6f457e4ab4edca8cebe2cda8dc4061d Mon Sep 17 00:00:00 2001
From: Matej Habrnal <mhabrnal@redhat.com>
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 <mhabrnal@redhat.com>
---
 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