Commit 20fa9f55 authored by Ozzie Isaacs's avatar Ozzie Isaacs

Fix encoding errors on windows while downloading logbooks

parent 616cc201
...@@ -22,10 +22,6 @@ import glob ...@@ -22,10 +22,6 @@ import glob
import zipfile import zipfile
import json import json
from io import BytesIO from io import BytesIO
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import os import os
...@@ -38,9 +34,9 @@ log = logger.create() ...@@ -38,9 +34,9 @@ log = logger.create()
def assemble_logfiles(file_name): def assemble_logfiles(file_name):
log_list = sorted(glob.glob(file_name + '*'), reverse=True) log_list = sorted(glob.glob(file_name + '*'), reverse=True)
wfd = StringIO() wfd = BytesIO()
for f in log_list: for f in log_list:
with open(f, 'r') as fd: with open(f, 'rb') as fd:
shutil.copyfileobj(fd, wfd) shutil.copyfileobj(fd, wfd)
wfd.seek(0) wfd.seek(0)
if int(__version__.split('.')[0]) < 2: if int(__version__.split('.')[0]) < 2:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment