From 6e8705a3aa848dc265aa0faf774e33d9769be1b1 Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Sun, 6 Oct 2019 18:32:02 +0000 Subject: [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 --- lnt/lnttool/import_report.py | 4 ++-- 1 file 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") -- cgit v1.2.3