66b169ccf2
Resolves #1246459 Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
45 lines
1.6 KiB
Diff
45 lines
1.6 KiB
Diff
From ed7aaffdcac4f29cd513cd4c1086339512320a1c Mon Sep 17 00:00:00 2001
|
|
From: Jakub Filak <jfilak@redhat.com>
|
|
Date: Fri, 24 Jul 2015 13:47:15 +0200
|
|
Subject: [PATCH] pass encoded Unicode to hashlib.sha1.update()
|
|
|
|
Python 3 compatibility commit.
|
|
|
|
Related: rhbz#1246459
|
|
|
|
Signed-off-by: Jakub Filak <jfilak@redhat.com>
|
|
---
|
|
src/plugins/abrt-action-check-oops-for-hw-error.in | 2 +-
|
|
src/plugins/abrt-action-generate-machine-id | 2 +-
|
|
2 files changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
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 400ed99..1695ddb 100644
|
|
--- a/src/plugins/abrt-action-check-oops-for-hw-error.in
|
|
+++ b/src/plugins/abrt-action-check-oops-for-hw-error.in
|
|
@@ -88,7 +88,7 @@ if __name__ == "__main__":
|
|
oops_hash = hashlib.sha1()
|
|
with open("backtrace", "r") as btfile:
|
|
for line in btfile:
|
|
- oops_hash.update(line)
|
|
+ oops_hash.update(line.encode())
|
|
|
|
with open_or_die("uuid", "w") as f:
|
|
f.write(oops_hash.hexdigest())
|
|
diff --git a/src/plugins/abrt-action-generate-machine-id b/src/plugins/abrt-action-generate-machine-id
|
|
index 1005b2c..63b5c93 100644
|
|
--- a/src/plugins/abrt-action-generate-machine-id
|
|
+++ b/src/plugins/abrt-action-generate-machine-id
|
|
@@ -63,7 +63,7 @@ def generate_machine_id_dmidecode():
|
|
data = dmixp.xpathEval(k)
|
|
for d in data:
|
|
# Update the hash as we find the fields we are looking for
|
|
- machine_id.update(d.get_content())
|
|
+ machine_id.update(d.get_content().encode())
|
|
|
|
del dmixp
|
|
del xmldoc
|
|
--
|
|
2.4.6
|
|
|