[PATCH] D68800: [LNT] Python 3 support: adapt csv reader open

Przemyslaw Wirkus via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 07:49:48 PST 2019


PrzemekWirkus added inline comments.


================
Comment at: lnt/tests/nt.py:774-777
+    if sys.version_info[0] < 3:
+        report_file = open(report_path, 'rb')
+    else:
+        report_file = open(report_path, 'r', newline='')
----------------
Can you verify that you should rather use mode == 'U' for universal mode?

https://docs.python.org/release/3.2/library/functions.html#open

See table below the Python 3 open function instead of newline == ''.

I'm not an expert in this area.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68800/new/

https://reviews.llvm.org/D68800





More information about the llvm-commits mailing list