[PATCH] D68105: [LNT] Python 3 support: fix report version literal

Thomas Preud'homme via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 14:33:54 PDT 2019


thopre created this revision.
thopre added reviewers: cmatthews, hubert.reinterpretcast, kristof.beyls.

The upgrade_1_to_2 module stores a __report_version__ string literal in
the Parameter column of the Run table which is declared as binary data.
This does not work in Python 3 where strings/text and binary are
different things. This commit changes it for a binary literal instead
(introduced in Python 2.6).


https://reviews.llvm.org/D68105

Files:
  lnt/server/db/migrations/upgrade_1_to_2.py


Index: lnt/server/db/migrations/upgrade_1_to_2.py
===================================================================
--- lnt/server/db/migrations/upgrade_1_to_2.py
+++ lnt/server/db/migrations/upgrade_1_to_2.py
@@ -39,7 +39,7 @@
     logger.info("updating runs")
     all_runs = session.query(Run).\
         filter(sqlalchemy.not_(Run.Parameters.like(
-                '%["__report_version__"%'))).all()
+                b'%["__report_version__"%'))).all()
     for i, run in enumerate(all_runs):
         if i % 1000 == 999:
             logger.info("update run %d of %d" % (i + 1, len(all_runs)))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68105.222028.patch
Type: text/x-patch
Size: 601 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190926/280ef9f6/attachment.bin>


More information about the llvm-commits mailing list