summaryrefslogtreecommitdiff
path: root/systemd
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-05-16 00:38:39 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-07-05 14:19:20 -0400
commit98f187ea6486ea110bec62212d946325c589f996 (patch)
treecaf46659481ced4878bd7998918984a280496e2d /systemd
parentd9e0a12c2a9f7bf8843d8a9b969fb30f558df66b (diff)
downloadpython-systemd-98f187ea6486ea110bec62212d946325c589f996.tar.gz
systemd-python: do not attempt to convert str to bytes
Bug-spotted-by: Steven Hiscocks <steven-systemd@hiscocks.me.uk>
Diffstat (limited to 'systemd')
-rw-r--r--systemd/journal.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/systemd/journal.py b/systemd/journal.py
index 9ef1ede..8fd1bb3 100644
--- a/systemd/journal.py
+++ b/systemd/journal.py
@@ -55,6 +55,9 @@ def _convert_realtime(t):
def _convert_timestamp(s):
return _datetime.datetime.fromtimestamp(int(s) / 1000000)
+def _convert_trivial(x):
+ return x
+
if _sys.version_info >= (3,):
def _convert_uuid(s):
return _uuid.UUID(s.decode())
@@ -87,6 +90,7 @@ DEFAULT_CONVERTERS = {
'__REALTIME_TIMESTAMP': _convert_realtime,
'_SOURCE_MONOTONIC_TIMESTAMP': _convert_source_monotonic,
'__MONOTONIC_TIMESTAMP': _convert_monotonic,
+ '__CURSOR': _convert_trivial,
'COREDUMP': bytes,
'COREDUMP_PID': int,
'COREDUMP_UID': int,