Skip to content

Commit

Permalink
Fix encoding errors on windows while downloading logbooks
Browse files Browse the repository at this point in the history
  • Loading branch information
OzzieIsaacs committed Jul 12, 2021
1 parent 616cc20 commit 20fa9f5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cps/debug_info.py
Expand Up @@ -22,10 +22,6 @@
import zipfile
import json
from io import BytesIO
try:
from StringIO import StringIO
except ImportError:
from io import StringIO

import os

Expand All @@ -38,9 +34,9 @@

def assemble_logfiles(file_name):
log_list = sorted(glob.glob(file_name + '*'), reverse=True)
wfd = StringIO()
wfd = BytesIO()
for f in log_list:
with open(f, 'r') as fd:
with open(f, 'rb') as fd:
shutil.copyfileobj(fd, wfd)
wfd.seek(0)
if int(__version__.split('.')[0]) < 2:
Expand Down

0 comments on commit 20fa9f5

Please sign in to comment.