diff --git a/src/rez/cli/release.py b/src/rez/cli/release.py index f04282a15..92436edc8 100644 --- a/src/rez/cli/release.py +++ b/src/rez/cli/release.py @@ -82,7 +82,7 @@ def command(opts, parser, extra_arg_groups=None): if config.prompt_release_message and not release_msg and not opts.no_message: from hashlib import sha1 - h = sha1(working_dir).hexdigest() + h = sha1(working_dir.encode("utf8")).hexdigest() filename = "rez-release-message-%s.txt" % h filepath = os.path.join(config.tmpdir, filename) diff --git a/src/rez/resolver.py b/src/rez/resolver.py index f72b918d6..30b92ceab 100644 --- a/src/rez/resolver.py +++ b/src/rez/resolver.py @@ -69,7 +69,7 @@ def __init__(self, context, package_requests, package_paths, package_filter=None # store hash of package orderers. This is used in the memcached key if package_orderers: sha1s = ''.join(x.sha1 for x in package_orderers) - self.package_orderers_hash = sha1(sha1s).hexdigest() + self.package_orderers_hash = sha1(sha1s.encode("utf8")).hexdigest() else: self.package_orderers_hash = '' diff --git a/src/rez/utils/sourcecode.py b/src/rez/utils/sourcecode.py index 508f6a1d6..2906660ab 100644 --- a/src/rez/utils/sourcecode.py +++ b/src/rez/utils/sourcecode.py @@ -312,7 +312,7 @@ def load_module(self, name, package): if not os.path.exists(filepath): return None - with open(filepath) as f: + with open(filepath, "rb") as f: txt = f.read().strip() hash_str = sha1(txt).hexdigest()