From ace2e6f9d1cca58bcf2c055e81981385f2caa1d4 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 10 Aug 2013 10:28:45 +0200 Subject: [PATCH] encode code to bytes before hashing it --- Cython/Compiler/Code.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cython/Compiler/Code.py b/Cython/Compiler/Code.py index 2a0213c..4577c55 100644 --- a/Cython/Compiler/Code.py +++ b/Cython/Compiler/Code.py @@ -1542,7 +1542,7 @@ class CCodeWriter(object): include_dir = self.globalstate.common_utility_include_dir if include_dir and len(code) > 1024: include_file = "%s_%s.h" % ( - name, hashlib.md5(code).hexdigest()) + name, hashlib.md5(code.encode('utf8')).hexdigest()) path = os.path.join(include_dir, include_file) if not os.path.exists(path): tmp_path = '%s.tmp%s' % (path, os.getpid()) -- 2.7.4