ensure the reader is really closed before reopen (preventing leaks if some handles or whatever are still open)

pull/3927/merge
sebres 2025-03-30 06:03:51 +02:00
parent 994a0b69da
commit f49d50b8fd
1 changed files with 1 additions and 0 deletions

View File

@ -126,6 +126,7 @@ class FilterSystemd(JournalFilter): # pragma: systemd no cover
try:
# workaround for gh-3929 (no journal descriptor after rotation),
# to reopen journal we'd simply invoke inherited init again:
self.__journal.close()
ja = self.__jrnlargs
super(journal.Reader, self.__journal).__init__(ja.get('flags', 0), ja.get('path'), ja.get('files'), ja.get('namespace'))
except: