提交 89c3df96 编写于 作者: L Lukáš Doktor

varianter: Use astring.ENCODING when encoding fingerprint

The fingerprint might contain unicode characters, let's use
"astring.ENCODING" to avoid EncodeErrors.
Signed-off-by: NLukáš Doktor <ldoktor@redhat.com>
上级 f102dfa9
......@@ -50,7 +50,7 @@ def generate_variant_id(variant):
variant = sorted(variant, key=lambda x: x.path)
fingerprint = "\n".join(_.fingerprint() for _ in variant)
return ("-".join(node.name for node in variant) + '-' +
hashlib.sha1(fingerprint.encode()).hexdigest()[:4])
hashlib.sha1(fingerprint.encode(astring.ENCODING)).hexdigest()[:4])
def variant_to_str(variant, verbosity, out_args=None, debug=False):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册