py3: sqlite3.connect() expects str arguments
authorMartin von Zweigbergk <martinvonz@google.com>
Thu, 11 Jul 2019 12:11:43 -0700
changeset 4735 168c270e8347
parent 4734 6b101bbd907a
child 4736 9e0d35d2f7d4
py3: sqlite3.connect() expects str arguments
hgext3rd/evolve/obsdiscovery.py
hgext3rd/evolve/stablerangecache.py
--- a/hgext3rd/evolve/obsdiscovery.py	Fri Jul 12 23:00:11 2019 -0700
+++ b/hgext3rd/evolve/obsdiscovery.py	Thu Jul 11 12:11:43 2019 -0700
@@ -22,6 +22,7 @@
 import weakref
 
 from mercurial import (
+    encoding,
     error,
     exchange,
     extensions,
@@ -492,7 +493,8 @@
             util.makedirs(self._vfs.dirname(self._path))
         except OSError:
             return None
-        con = sqlite3.connect(self._path, timeout=30, isolation_level="IMMEDIATE")
+        con = sqlite3.connect(encoding.strfromlocal(self._path), timeout=30,
+                              isolation_level="IMMEDIATE")
         con.text_factory = str
         return con
 
--- a/hgext3rd/evolve/stablerangecache.py	Fri Jul 12 23:00:11 2019 -0700
+++ b/hgext3rd/evolve/stablerangecache.py	Thu Jul 11 12:11:43 2019 -0700
@@ -14,6 +14,7 @@
 import time
 
 from mercurial import (
+    encoding,
     error,
     localrepo,
     node as nodemod,
@@ -234,7 +235,8 @@
             util.makedirs(self._vfs.dirname(self._path))
         except OSError:
             return None
-        con = sqlite3.connect(self._path, timeout=30, isolation_level="IMMEDIATE")
+        con = sqlite3.connect(encoding.strfromlocal(self._path), timeout=30,
+                              isolation_level="IMMEDIATE")
         con.text_factory = str
         return con