[pypy-commit] pypy multiphase: fix crash when non-ascii extension cannot be found

rlamy pypy.commits at gmail.com
Mon Aug 14 10:39:56 EDT 2017


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: multiphase
Changeset: r92144:8c278da05b4c
Date: 2017-08-14 16:39 +0200
http://bitbucket.org/pypy/pypy/changeset/8c278da05b4c/

Log:	fix crash when non-ascii extension cannot be found

diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -1523,7 +1523,7 @@
         else:
             look_for = also_look_for
     msg = u"function %s not found in library %s" % (
-        unicode(look_for), space.unicode_w(space.newfilename(path)))
+        look_for.decode('utf-8'), space.unicode_w(space.newfilename(path)))
     w_path = space.newfilename(path)
     raise_import_error(space, space.newunicode(msg), w_name, w_path)
 


More information about the pypy-commit mailing list