changeset 4735:168c270e8347

py3: sqlite3.connect() expects str arguments
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 11 Jul 2019 12:11:43 -0700
parents 6b101bbd907a
children 9e0d35d2f7d4
files hgext3rd/evolve/obsdiscovery.py hgext3rd/evolve/stablerangecache.py
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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