support unicode chars in export to stdout

This commit is contained in:
Felix Lohmeier 2019-08-21 16:47:21 +02:00
parent 41c1e618bb
commit 18a4d68b5c
1 changed files with 3 additions and 2 deletions

View File

@ -168,7 +168,8 @@ def export(project_id, output_file=None, export_format=None):
if not export_format:
export_format = 'tsv'
if not output_file:
sys.stdout.write(project.export(export_format=export_format).read())
sys.stdout.write(project.export(
export_format=export_format).read().decode('UTF-8'))
else:
ext = os.path.splitext(output_file)[1][1:]
if ext:
@ -264,7 +265,7 @@ def templating(project_id,
if not splitToFiles:
if not output_file:
sys.stdout.write(project.export_templating(
**templateconfig).read())
**templateconfig).read().decode('UTF-8'))
else:
with open(output_file, 'wb') as f:
f.write(project.export_templating(**templateconfig).read())