Mercurial > evolve
changeset 4736:9e0d35d2f7d4
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 11 Jul 2019 12:19:49 -0700 |
parents | 168c270e8347 |
children | 46c990705a96 |
files | hgext3rd/evolve/obsdiscovery.py hgext3rd/evolve/stablerangecache.py |
diffstat | 2 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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