From: Noel Power Date: Thu, 22 Mar 2018 12:35:11 +0000 (+0000) Subject: python selftest: enabled samba.tests.s3registry to run with py3 X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=1734655bf805342ce4b2a33c78729b681846da52 python selftest: enabled samba.tests.s3registry to run with py3 Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/python/samba/samba3/__init__.py b/python/samba/samba3/__init__.py index ff28da49881f..323953857d50 100644 --- a/python/samba/samba3/__init__.py +++ b/python/samba/samba3/__init__.py @@ -19,7 +19,7 @@ __docformat__ = "restructuredText" -REGISTRY_VALUE_PREFIX = "SAMBA_REGVAL" +REGISTRY_VALUE_PREFIX = b"SAMBA_REGVAL" REGISTRY_DB_VERSION = 1 import os @@ -79,7 +79,7 @@ class Registry(DbDatabase): def keys(self): """Return list with all the keys.""" - return [k.rstrip("\x00") for k in self.db.iterkeys() if not k.startswith(REGISTRY_VALUE_PREFIX)] + return [k.rstrip(b"\x00") for k in self.db if not k.startswith(REGISTRY_VALUE_PREFIX)] def subkeys(self, key): """Retrieve the subkeys for the specified key. @@ -87,12 +87,12 @@ class Registry(DbDatabase): :param key: Key path. :return: list with key names """ - data = self.db.get("%s\x00" % key) + data = self.db.get(b"%s\x00" % key) if data is None: return [] (num, ) = struct.unpack("