[LNT] r373861 - [LNT] Python 3 support: fix text/binary confusion in importreport

Thomas Preud'homme via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 6 11:32:02 PDT 2019


Author: thopre
Date: Sun Oct  6 11:32:02 2019
New Revision: 373861

URL: http://llvm.org/viewvc/llvm-project?rev=373861&view=rev
Log:
[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

Modified:
    lnt/trunk/lnt/lnttool/import_report.py

Modified: lnt/trunk/lnt/lnttool/import_report.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/lnttool/import_report.py?rev=373861&r1=373860&r2=373861&view=diff
==============================================================================
--- lnt/trunk/lnt/lnttool/import_report.py (original)
+++ lnt/trunk/lnt/lnttool/import_report.py Sun Oct  6 11:32:02 2019
@@ -3,8 +3,8 @@ import click
 
 @click.command("importreport", short_help="import simple space separated "
                "data into a report to submit.")
- at click.argument("input", type=click.File('rb'), default="-", required=False)
- at click.argument("output", type=click.File('wb'), default="report.json",
+ at click.argument("input", type=click.File('r'), default="-", required=False)
+ at 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")




More information about the llvm-commits mailing list