Author: Philip Jenvey <pjen...@underboss.org> Branch: py3k Changeset: r65677:191650bed89e Date: 2013-07-25 17:02 -0700 http://bitbucket.org/pypy/pypy/changeset/191650bed89e/
Log: path of least resistance: workaround dlerror returning junk messages under ll2ctypes on the buildbot diff --git a/pypy/module/_rawffi/interp_rawffi.py b/pypy/module/_rawffi/interp_rawffi.py --- a/pypy/module/_rawffi/interp_rawffi.py +++ b/pypy/module/_rawffi/interp_rawffi.py @@ -5,6 +5,7 @@ from pypy.objspace.std.stringtype import getbytevalue from rpython.rlib.clibffi import * +from rpython.rlib.objectmodel import we_are_translated from rpython.rtyper.lltypesystem import lltype, rffi from rpython.rtyper.tool import rffi_platform from rpython.rlib.unroll import unrolling_iterable @@ -142,7 +143,13 @@ space.wrap("not supported by libffi")) def wrap_dlopenerror(space, e, filename): - msg = e.msg if e.msg else 'unspecified error' + if e.msg: + # dlerror can return garbage messages under ll2ctypes (not + # we_are_translated()), so repr it to avoid potential problems + # converting to unicode later + msg = e.msg if we_are_translated() else repr(e.msg) + else: + msg = 'unspecified error' return operationerrfmt(space.w_OSError, 'Cannot load library %s: %s', filename, msg) _______________________________________________ pypy-commit mailing list pypy-commit@python.org http://mail.python.org/mailman/listinfo/pypy-commit