Skip to content

Commit eba9b6d

Browse files
author
Thomas Preud'homme
committed
[LNT] Python 3 support: fix text/binary confusion in importreport
lnt importreport currently fails in Python 3 because it opens the input and output file in binary mode. Yet, as per documentation, this tools converts "*text based* key value pairs into a LNT json report file". The JSON file is output using the json module which expects a file opened in text mode so this commit changes the mode of both the input and output file to text. Reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls Reviewed By: hubert.reinterpretcast Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D68224 llvm-svn: 373861
1 parent af26dea commit eba9b6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lnt/lnttool/import_report.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
@click.command("importreport", short_help="import simple space separated "
55
"data into a report to submit.")
6-
@click.argument("input", type=click.File('rb'), default="-", required=False)
7-
@click.argument("output", type=click.File('wb'), default="report.json",
6+
@click.argument("input", type=click.File('r'), default="-", required=False)
7+
@click.argument("output", type=click.File('w'), default="report.json",
88
required=False)
99
@click.option("--testsuite", "suite", default="nts", show_default=True,
1010
required=True, help="short name of the test suite to submit to")

0 commit comments

Comments
 (0)