Skip to content
Snippets Groups Projects
Commit b81d252c authored by Pavel Kácha's avatar Pavel Kácha
Browse files

LaBrea: Open log with safe encoding - avoid bytes -> str errors

parent 5183c922
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import time
import optparse
import signal
import uuid
import codecs
import json
import socket
import resource
......@@ -210,7 +211,7 @@ class FileWatcher(object):
def open(self):
try:
self.f = open(self.filename, "r")
self.f = codecs.open(self.filename, "r", encoding="ISO-8859-1")
st = os.fstat(self.f.fileno())
self.inode, self.size = st.st_ino, st.st_size
except IOError:
......@@ -662,7 +663,7 @@ def main():
if opts.oneshot:
signal.signal(signal.SIGINT, terminate_me)
signal.signal(signal.SIGTERM, terminate_me)
files = [open(arg) for arg in args]
files = [codecs.open(arg, "r", encoding="ISO-8859-1") for arg in args]
else:
daemonize(
pidfile=opts.pid,
......
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