Compare commits

..

1 Commits

Author SHA1 Message Date
Jonathan Wright 8f50dadeaf Fix issue with invalid utf-8 chars in needs-restarting
Signed-off-by: Jonathan Wright <jonathan@almalinux.org>
2023-08-14 10:08:03 -05:00
1 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
From 6539ae56dc5993bfb0a72fed97a7f7fda2c3ce61 Mon Sep 17 00:00:00 2001
From 7860463eb5ccc844f1d580edd7f12496fb6923b3 Mon Sep 17 00:00:00 2001
From: Jonathan Wright <jonathan@almalinux.org>
Date: Mon, 14 Aug 2023 09:55:12 -0500
Subject: [PATCH] fixes error with handling invalid utf-8 chars in
@ -6,8 +6,8 @@ Subject: [PATCH] fixes error with handling invalid utf-8 chars in
---
plugins/needs_restarting.py | 2 +-
tests/test_needs_restarting.py | 12 ++++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
tests/test_needs_restarting.py | 13 +++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/plugins/needs_restarting.py b/plugins/needs_restarting.py
index 1fedb73..d8ab0bc 100644
@ -23,7 +23,7 @@ index 1fedb73..d8ab0bc 100644
except EnvironmentError:
logger.warning("Failed to read PID %d's smaps.", pid)
diff --git a/tests/test_needs_restarting.py b/tests/test_needs_restarting.py
index 0ad70a5..5bfcc4d 100644
index 0ad70a5..c021e06 100644
--- a/tests/test_needs_restarting.py
+++ b/tests/test_needs_restarting.py
@@ -1,3 +1,4 @@
@ -31,15 +31,18 @@ index 0ad70a5..5bfcc4d 100644
# Copyright (C) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
@@ -22,6 +23,7 @@ from __future__ import unicode_literals
@@ -20,8 +21,10 @@ from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
+from unittest.mock import patch
import needs_restarting
import tests.support
+import tempfile
DEL_FILE = '3dcf000000-3dcf032000 r-xp 00000000 08:02 140759 ' \
' /usr/lib64/libXfont.so.1.4.1;5408628d (deleted)'
@@ -46,6 +48,16 @@ class NeedsRestartingTest(tests.support.TestCase):
@@ -46,6 +49,16 @@ class NeedsRestartingTest(tests.support.TestCase):
self.assertTrue(ofile.deleted)
self.assertEqual(ofile.name, '/usr/lib64/libXfont.so.1.4.1;5408628d')