py3: read sqlite3 data as bytes
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 11 Jul 2019 12:19:49 -0700
changeset 4736 9e0d35d2f7d4
parent 4735 168c270e8347
child 4737 46c990705a96
py3: read sqlite3 data as bytes The py2 and py3 docs ([1] and [2]) disagree how to get bytes output, but it seems obvious that this should be "bytes" to be compatible with both. [1] https://docs.python.org/2/library/sqlite3.html#sqlite3.Connection.text_factory [2] https://docs.python.org/3/library/sqlite3.html#sqlite3.Connection.text_factory
hgext3rd/evolve/obsdiscovery.py
hgext3rd/evolve/stablerangecache.py
--- a/hgext3rd/evolve/obsdiscovery.py	Thu Jul 11 12:11:43 2019 -0700
+++ b/hgext3rd/evolve/obsdiscovery.py	Thu Jul 11 12:19:49 2019 -0700
@@ -495,7 +495,7 @@
             return None
         con = sqlite3.connect(encoding.strfromlocal(self._path), timeout=30,
                               isolation_level="IMMEDIATE")
-        con.text_factory = str
+        con.text_factory = bytes
         return con
 
     @util.propertycache
--- a/hgext3rd/evolve/stablerangecache.py	Thu Jul 11 12:11:43 2019 -0700
+++ b/hgext3rd/evolve/stablerangecache.py	Thu Jul 11 12:19:49 2019 -0700
@@ -237,7 +237,7 @@
             return None
         con = sqlite3.connect(encoding.strfromlocal(self._path), timeout=30,
                               isolation_level="IMMEDIATE")
-        con.text_factory = str
+        con.text_factory = bytes
         return con
 
     @util.propertycache