Skip to content
Snippets Groups Projects
Commit 3987b201 authored by Václav Bartoš's avatar Václav Bartoš
Browse files

warden_filer: compatibility with Python3

parent 79fd808f
No related branches found
No related tags found
No related merge requests found
......@@ -187,7 +187,7 @@ def receiver(config, wclient, sdir, oneshot):
nf = sdir.newfile()
with nf.f as f:
data = json.dumps(event)
f.write(data)
f.write(data.encode('utf-8'))
nf.moveto(sdir.incoming)
count_ok += 1
except Exception as e:
......@@ -297,7 +297,7 @@ def sender(config, wclient, sdir, oneshot):
continue # Silently go to next filename, somebody else might have interfered
try:
with nf.open("rb") as fd:
data = fd.read()
data = fd.read().decode('utf-8')
event = json.loads(data)
if not match_event(event, **filt):
wclient.logger.debug("Unmatched event: %s" % data)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment