diff options
author | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-10-06 18:32:02 +0000 |
---|---|---|
committer | Thomas Preud'homme <thomasp@graphcore.ai> | 2019-10-06 18:32:02 +0000 |
commit | 6e8705a3aa848dc265aa0faf774e33d9769be1b1 (patch) | |
tree | 08ef06fcc25deef252ca18f0f46676b1219ba34d | |
parent | 8e292858c6e3bb244402324a8f4f5e61c5eba129 (diff) |
[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
git-svn-id: https://llvm.org/svn/llvm-project/lnt/trunk@373861 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lnt/lnttool/import_report.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lnt/lnttool/import_report.py b/lnt/lnttool/import_report.py index 1912537..de6b98a 100644 --- a/lnt/lnttool/import_report.py +++ b/lnt/lnttool/import_report.py @@ -3,8 +3,8 @@ import click @click.command("importreport", short_help="import simple space separated " "data into a report to submit.") -@click.argument("input", type=click.File('rb'), default="-", required=False) -@click.argument("output", type=click.File('wb'), default="report.json", +@click.argument("input", type=click.File('r'), default="-", required=False) +@click.argument("output", type=click.File('w'), default="report.json", required=False) @click.option("--testsuite", "suite", default="nts", show_default=True, required=True, help="short name of the test suite to submit to") |