changeset 3064:d62fceccff22

core (tools/utils): fixed hex conversion in getRepositoryData following Python 3 port
author Goffi <goffi@goffi.org>
date Mon, 21 Oct 2019 23:52:25 +0200
parents 84bb63e1e4c4
children f8e3789912d0
files sat/tools/utils.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/sat/tools/utils.py	Mon Oct 21 23:06:30 2019 +0200
+++ b/sat/tools/utils.py	Mon Oct 21 23:52:25 2019 +0200
@@ -213,8 +213,8 @@
         else:
             os.chdir(os.path.abspath(os.path.dirname(repos_root)))
         try:
-            with open(".hg/dirstate") as hg_dirstate:
-                hg_data["node"] = hg_dirstate.read(20).encode("hex")
+            with open(".hg/dirstate", 'rb') as hg_dirstate:
+                hg_data["node"] = hg_dirstate.read(20).hex()
                 hg_data["node_short"] = hg_data["node"][:12]
         except IOError:
             log.debug("Can't access repository data")