The SystemD documentation of sd_journal_open() says:
The second argument is a flags field, which may consist of the following flags ORed together:
See: https://www.freedesktop.org/software/systemd/man/latest/sd_journal_open.html
But the JournalOpenMode._missing_ disallows any ORed value:
|
@classmethod |
|
def _missing_(cls, value) -> 'JournalOpenMode': |
|
if value == SD_JOURNAL_SYSTEM_ONLY: |
|
warnings.warn( |
|
"The JournalOpenMode.SYSTEM_ONLY is deprecated and the alias of " |
|
"JournalOpenMode.SYSTEM in the systemd library.", |
|
DeprecationWarning, |
|
stacklevel=2 |
|
) |
|
return cls.SYSTEM |
|
raise ValueError(f"{value} is not a valid open mode") |
SystemD defines SD_JOURNAL_SYSTEM_ONLY to be the same as SD_JOURNAL_SYSTEM anyway, rendering the _missing_() method useless for that case:
https://github.com/systemd/systemd/blob/49eb2d50b4328956b0d8fdf173425e2029b7d5ee/src/systemd/sd-journal.h#L74
Except it breaks ORing! I currently hack-fix this bug in my code with this line:
del JournalOpenMode._missing_
I suggest to just remove that method.
The SystemD documentation of
sd_journal_open()says:See: https://www.freedesktop.org/software/systemd/man/latest/sd_journal_open.html
But the
JournalOpenMode._missing_disallows any ORed value:cysystemd/cysystemd/reader.pyx
Lines 147 to 157 in 36424aa
SystemD defines
SD_JOURNAL_SYSTEM_ONLYto be the same asSD_JOURNAL_SYSTEManyway, rendering the_missing_()method useless for that case:https://github.com/systemd/systemd/blob/49eb2d50b4328956b0d8fdf173425e2029b7d5ee/src/systemd/sd-journal.h#L74
Except it breaks ORing! I currently hack-fix this bug in my code with this line:
I suggest to just remove that method.