[PATCH] D68919: [LNT] Python 3 support: import LNT report as text

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 12 15:46:32 PDT 2019


thopre created this revision.
thopre added reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls.
thopre added a parent revision: D68863: [LNT] Python 3 support: don't assume order of cmake args.
thopre added a child revision: D68920: [LNT] Python 3 support: specify how to sort dict.

As per LNT documentation, all fields in the JSON that is a LNT report
file format are strings. Yet, the code responsible for adding a new ru
in LNT database reads the Flask data property holding the corresponding
LNT report file format which default to returning binary data. The code
then fail when invoking lnt.util.ImportData.import_from_string due to
using methods related to strings. This commit changes the access to the
data to using the property's getter with the as_text parameter set to
True, thereby requesting from Flask to return the data as a string.


https://reviews.llvm.org/D68919

Files:
  lnt/server/ui/api.py


Index: lnt/server/ui/api.py
===================================================================
--- lnt/server/ui/api.py
+++ lnt/server/ui/api.py
@@ -306,7 +306,7 @@
         """Add a new run into the lnt database"""
         session = request.session
         db = request.get_db()
-        data = request.data
+        data = request.get_data(as_text=True)
         select_machine = request.values.get('select_machine', 'match')
         merge = request.values.get('merge', None)
         result = lnt.util.ImportData.import_from_string(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68919.224760.patch
Type: text/x-patch
Size: 540 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191012/c28987ed/attachment.bin>


More information about the llvm-commits mailing list