virt_test/bin/python testrunner/runner.py --logfile=testrun.log --config=pypy/testrunner_cfg.py '--config=~/machine_cfg.py' --root=pypy --timeout=4000 in dir /build_dir/own-linux-x86-32/build (timeout 4000 secs) watching logfiles {'pytestLog': 'testrun.log'} argv: ['virt_test/bin/python', 'testrunner/runner.py', '--logfile=testrun.log', '--config=pypy/testrunner_cfg.py', '--config=~/machine_cfg.py', '--root=pypy', '--timeout=4000'] environment: AUDITWHEEL_ARCH=i686 AUDITWHEEL_PLAT=manylinux2014_i686 AUDITWHEEL_POLICY=manylinux2014 DEVTOOLSET_ROOTPATH=/opt/rh/devtoolset-10/root HOME=/home/buildslave HOSTNAME=ffc60fde56a7 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 LD_LIBRARY_PATH=/usr/local/lib:/opt/rh/devtoolset-10/root/usr/lib:/opt/rh/devtoolset-10/root/usr/lib/dyninst LOGNAME=buildslave PATH=/python27_virt/bin:/opt/rh/devtoolset-10/root/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig PWD=/build_dir/own-linux-x86-32/build PYPYCHERRYPICK= PYPY_LOCALBASE=/usr/local PYPY_MAKE_PORTABLE=1 PYTHONPATH=.: SHELL=/bin/bash SHLVL=3 SSL_CERT_FILE=/opt/_internal/certs.pem TERM=xterm TMPDIR=/build_dir/tmp/pytest USER=buildslave _=/usr/bin/linux32 using PTY: False using config pypy/testrunner_cfg.py using config /home/buildslave/machine_cfg.py running 4 parallel test workers setting MAKEFLAGS to ' ' (space) -- config/test -- interpreter/astcompiler/test -- interpreter/pyparser/test -- interpreter/test -- module/__builtin__/test -- module/__pypy__/test -- module/_ast/test -- module/_cffi_backend/test -- module/_codecs/test -- module/_continuation/test -- module/_cppyy/test -- module/_csv/test -- module/_demo/test -- module/_file/test -- module/_io/test -- module/_jitlog/test -- module/_locale/test -- module/_lsprof/test -- module/_md5/test -- module/_minimal_curses/test -- module/_multibytecodec/test -- module/_multiprocessing/test -- module/_pypyjson/test -- module/_random/test -- module/_rawffi/alt/test -- module/_rawffi/test -- module/_sha/test -- module/_socket/test -- module/_sre/test -- module/_vmprof/test -- module/_warnings/test -- module/_weakref/test -- module/_winreg/test -- module/array/test -- module/binascii/test -- module/bz2/test -- module/cStringIO/test -- module/cmath/test -- module/cpyext/test/test_abstract.py -- module/cpyext/test/test_api.py -- module/cpyext/test/test_arraymodule.py -- module/cpyext/test/test_boolobject.py -- module/cpyext/test/test_borrow.py -- module/cpyext/test/test_bufferobject.py -- module/cpyext/test/test_bytearrayobject.py -- module/cpyext/test/test_bytesobject.py -- module/cpyext/test/test_capsule.py -- module/cpyext/test/test_cell.py -- module/cpyext/test/test_classobject.py -- module/cpyext/test/test_codecs.py -- module/cpyext/test/test_complexobject.py -- module/cpyext/test/test_cpyext.py -- module/cpyext/test/test_datetime.py -- module/cpyext/test/test_dictobject.py -- module/cpyext/test/test_eval.py -- module/cpyext/test/test_fileobject.py -- module/cpyext/test/test_floatobject.py -- module/cpyext/test/test_frameobject.py -- module/cpyext/test/test_funcobject.py -- module/cpyext/test/test_genobject.py -- module/cpyext/test/test_getargs.py -- module/cpyext/test/test_import.py -- module/cpyext/test/test_intobject.py -- module/cpyext/test/test_iterator.py -- module/cpyext/test/test_listobject.py -- module/cpyext/test/test_longobject.py -- module/cpyext/test/test_mapping.py -- module/cpyext/test/test_marshal.py -- module/cpyext/test/test_memoryobject.py -- module/cpyext/test/test_methodobject.py -- module/cpyext/test/test_misc.py -- module/cpyext/test/test_module.py -- module/cpyext/test/test_ndarrayobject.py -- module/cpyext/test/test_number.py -- module/cpyext/test/test_object.py -- module/cpyext/test/test_pycobject.py -- module/cpyext/test/test_pyerrors.py -- module/cpyext/test/test_pyfile.py -- module/cpyext/test/test_pysignals.py -- module/cpyext/test/test_pystate.py -- module/cpyext/test/test_pystrtod.py -- module/cpyext/test/test_sequence.py -- module/cpyext/test/test_setobject.py -- module/cpyext/test/test_sliceobject.py -- module/cpyext/test/test_structseq.py -- module/cpyext/test/test_sysmodule.py -- module/cpyext/test/test_thread.py -- module/cpyext/test/test_traceback.py -- module/cpyext/test/test_translate.py -- module/cpyext/test/test_tupleobject.py -- module/cpyext/test/test_typeobject.py -- module/cpyext/test/test_unicodeobject.py -- module/cpyext/test/test_userslots.py -- module/cpyext/test/test_version.py -- module/cpyext/test/test_weakref.py -- module/crypt/test -- module/errno/test -- module/exceptions/test -- module/faulthandler/test -- module/fcntl/test -- module/gc/test -- module/imp/test -- module/itertools/test -- module/marshal/test -- module/math/test -- module/micronumpy/test -- module/mmap/test -- module/operator/test -- module/parser/test -- module/posix/test -- module/pwd/test -- module/pyexpat/test -- module/pypyjit/test -- module/select/test -- module/signal/test -- module/struct/test -- module/sys/test -- module/termios/test -- module/test_lib_pypy -- module/thread/test -- module/time/test -- module/unicodedata/test -- module/zipimport/test -- module/zlib/test -- objspace/fake/test -- objspace/std/test -- objspace/test -- sandbox/test -- tool/bench/test -- tool/memusage/test -- tool/pytest/test -- tool/release/test -- tool/test -- total: 133 to run ++ 22:00:26 starting config/test [1 started in total] ++ 22:00:26 starting interpreter/astcompiler/test [2 started in total] ++ 22:00:26 starting interpreter/pyparser/test [3 started in total] ++ 22:00:26 starting interpreter/test [4 started in total] __ config/test [1 done in total, somefailed=False] ____________________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 157 items / 1 skipped config/test/test_pypyoption.py ............................................................................................................................................................. ==================== 157 passed, 1 skipped in 7.33 seconds ===================== ++ 22:00:35 starting module/__builtin__/test [5 started in total] __ interpreter/pyparser/test [2 done in total, somefailed=False] ______________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.py rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 119 items interpreter/pyparser/test/test_automata.py ... interpreter/pyparser/test/test_future.py ..................................... interpreter/pyparser/test/test_gendfa.py . interpreter/pyparser/test/test_metaparser.py ............... interpreter/pyparser/test/test_parser.py ............. interpreter/pyparser/test/test_parsestring.py ......... interpreter/pyparser/test/test_pyparse.py .................................... interpreter/pyparser/test/test_pytokenizer.py ..... ========================= 119 passed in 17.36 seconds ========================== ++ 22:00:47 starting module/__pypy__/test [6 started in total] __ module/__pypy__/test [3 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 68 items module/__pypy__/test/test_builders.py ..... module/__pypy__/test/test_bytebuffer.py .. module/__pypy__/test/test_debug.py ....... module/__pypy__/test/test_identitydict.py ...... module/__pypy__/test/test_intop.py ........... module/__pypy__/test/test_locals2fast.py ..... module/__pypy__/test/test_magic.py .....s. module/__pypy__/test/test_newmemoryview.py ... module/__pypy__/test/test_os.py . module/__pypy__/test/test_signal.py ....s module/__pypy__/test/test_special.py ..........s.s module/__pypy__/test/test_time.py ... ==================== 64 passed, 4 skipped in 23.95 seconds ===================== ++ 22:01:14 starting module/_ast/test [7 started in total] __ module/__builtin__/test [4 done in total, somefailed=True] _________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 305 items module/__builtin__/test/apptest_compile.py ........ module/__builtin__/test/test_abstractinst.py ............ module/__builtin__/test/test_apply.py ... module/__builtin__/test/test_builtin.py ..............................................s..................... module/__builtin__/test/test_classobj.py ........................................F..F............... module/__builtin__/test/test_descriptor.py .......................... module/__builtin__/test/test_filter.py ........... module/__builtin__/test/test_functional.py ................................................. module/__builtin__/test/test_minmax.py .......................... module/__builtin__/test/test_range.py ........................ module/__builtin__/test/test_rawinput.py ... module/__builtin__/test/test_reduce.py .... module/__builtin__/test/test_vars.py ... module/__builtin__/test/test_zip.py ......... =================================== FAILURES =================================== ___________________________ AppTestOldstyle.test_del ___________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf47c2f44>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_del'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7aa732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a444cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_del'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a444cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_del'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf47d9464> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4783c4c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4783c4c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf47e0f54> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4783c2c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4783c2c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_del'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_del'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_del'>, space = StdObjSpace target = <function test_del at 0xf477b304> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47756cc>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47756cc>,) w_func = <Function test_del> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47756cc> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_del> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47756cc>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_del> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47756cc>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9 pycode = <code object test_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c7cb6c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00g\x00\x00\x89\x00\x00d\x02\x00f\x00\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...00\xca\x00\x00\x01\xcc\x18\x00\x88\x00\x00d\x04\x00d\x04\x00g\x02\x00k\x02\x00s\xce\x00t\x02\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c7cb6c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00g\x00\x00\x89\x00\x00d\x02\x00f\x00\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...00\xca\x00\x00\x01\xcc\x18\x00\x88\x00\x00d\x04\x00d\x04\x00g\x02\x00k\x02\x00s\xce\x00t\x02\x00\x82\x01\x00d\x00\x00S' next_instr = 64L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c7cb6c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...32/build/pypy/module/__builtin__/test/test_classobj.py:668]', line 1> at line 9 nameindex = 1, ignored = (64L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4c98e0c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4c98e0c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4c98e0c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _________________________ AppTestOldstyle.test_weakref _________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf47c2d4c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7aa732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a444cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a444cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4c4075c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf426a4ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf426a4ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf45d5e8c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42600cc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf42600cc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_weakref'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_weakref'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_weakref'>, space = StdObjSpace target = <function test_weakref at 0xf4635f44> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47756cc>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47756cc>,) w_func = <Function test_weakref> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47756cc> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_weakref> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47756cc>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_weakref> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47756cc>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_weakref, file '[/build_dir/own-linux-x86-32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9 pycode = <code object test_weakref, file '[/build_dir/own-linux-x86-32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c7cb6c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00f\x00\x00d\x03\x00\x84\x00\x00\x83\x...xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\x97\x00t\x03\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c7cb6c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00f\x00\x00d\x03\x00\x84\x00\x00\x83\x...xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\x97\x00t\x03\x00\x82\x01\x00d\x00\x00S' next_instr = 103L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c7cb6c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...32/build/pypy/module/__builtin__/test/test_classobj.py:725]', line 1> at line 9 nameindex = 4, ignored = (103L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4c98e0c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4c98e0c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4c98e0c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/__builtin__/test/test_classobj.py::AppTestOldstyle::()::test_del FAIL module/__builtin__/test/test_classobj.py::AppTestOldstyle::()::test_weakref =============== 2 failed, 302 passed, 1 skipped in 37.60 seconds =============== ++ 22:01:19 starting module/_cffi_backend/test [8 started in total] __ interpreter/astcompiler/test [5 done in total, somefailed=False] ___________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 447 items interpreter/astcompiler/test/apptest_misc.py . interpreter/astcompiler/test/test_ast.py ....... interpreter/astcompiler/test/test_astbuilder.py ..................................................... interpreter/astcompiler/test/test_compiler.py .......................................................................................................................................................................................................................................................................................................................................................................... interpreter/astcompiler/test/test_misc.py . interpreter/astcompiler/test/test_symtable.py ....................... ========================= 447 passed in 59.93 seconds ========================== ++ 22:01:28 starting module/_codecs/test [9 started in total] __ module/_ast/test [6 done in total, somefailed=False] _______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 36 items module/_ast/test/test_ast.py .................................... ========================== 36 passed in 16.49 seconds ========================== ++ 22:01:32 starting module/_continuation/test [10 started in total] __ module/_codecs/test [7 done in total, somefailed=False] ____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 65 items module/_codecs/test/test_codecs.py ................................................................ module/_codecs/test/test_ztranslation.py . ========================== 65 passed in 26.00 seconds ========================== ++ 22:01:56 starting module/_cppyy/test [11 started in total] __ module/_continuation/test [8 done in total, somefailed=False] ______________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 52 items / 2 skipped module/_continuation/test/test_generator.py .... module/_continuation/test/test_greenlet.py ............................ module/_continuation/test/test_zpickle.py .................... ==================== 52 passed, 2 skipped in 71.04 seconds ===================== ++ 22:02:52 starting module/_csv/test [12 started in total] __ module/_csv/test [9 done in total, somefailed=False] _______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 23 items module/_csv/test/test_dialect.py ......... module/_csv/test/test_reader.py ......... module/_csv/test/test_writer.py .... module/_csv/test/test_ztranslation.py . ========================== 23 passed in 10.86 seconds ========================== ++ 22:03:04 starting module/_demo/test [13 started in total] __ module/_demo/test [10 done in total, somefailed=False] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 3 items module/_demo/test/test_import.py .. module/_demo/test/test_sieve.py . =========================== 3 passed in 6.59 seconds =========================== ++ 22:03:12 starting module/_file/test [14 started in total] __ module/_cffi_backend/test [11 done in total, somefailed=True] ______________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 466 items module/_cffi_backend/test/test_c.py ....................................................................................s.....................F.....................F........s.....s.......................s..Exception KeyError: (<C object Array of Char {'nolength': True} at 0xf40623f8>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf47e2bac>> ignored F........FException KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '9', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf4037d0c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '8', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf4037dec>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '7', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf403740c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '6', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf40376ac>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '5', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf403712c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '4', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf403744c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '3', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf403738c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '2', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf3c92e6c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '1', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf458134c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '0', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf3c926ec>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '9', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf59f2cac>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '8', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf493406c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '7', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf4a0a80c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '6', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf4934b0c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '5', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf4884ccc>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '4', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf44e51ac>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '3', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf4037a6c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '2', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf59c05cc>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '1', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf403780c>> ignored Exception KeyError: (<array [ 'h', 'i', ' ', 't', 'h', 'e', 'r', 'e', ' ', '0', '\x00' ]>,) in <bound method W_CDataNewStd.__del__ of <pypy.module._cffi_backend.cdataobj.W_CDataNewStd object at 0xf4037b6c>> ignored F..............F.s........................s...... module/_cffi_backend/test/test_fastpath.py .................. module/_cffi_backend/test/test_ffi_obj.py ..............................F.............. module/_cffi_backend/test/test_file.py s.. module/_cffi_backend/test/test_parse_c_type.py ..............s... module/_cffi_backend/test/test_re_python.py .................... module/_cffi_backend/test/test_recompiler.py .........................................................................................s..s............................... module/_cffi_backend/test/test_unicode_literals.py ....... module/_cffi_backend/test/test_wchar_helper.py . module/_cffi_backend/test/test_ztranslation.py s =================================== FAILURES =================================== ____________________________ AppTestC.test_weakref _____________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4641e64>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a2a32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf44c2f2c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf462404c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf462404c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4373964> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4624dec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4624dec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_weakref'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_weakref'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_weakref'>, space = StdObjSpace target = <function test_weakref at 0xf42c5f7c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) w_func = <Function test_weakref> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_weakref> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_weakref> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_weakref, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 pycode = <code object test_weakref, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 21L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_weakref>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 dropvalues = 2, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_weakref>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 dropvalues = 2, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) > return self._flat_pycall(code, nargs, frame, dropvalues) interpreter/function.py:174: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_weakref> code = <code object test_weakref, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 1793> nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:320]', line 1> at line 3 dropvalues = 2 @jit.unroll_safe def _flat_pycall(self, code, nargs, frame, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:201: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 1793> at line 1804 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 1793> at line 1804 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 1793> at line 1804 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 1793> at line 1804 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 1793> at line 1804 pycode = <code object test_weakref, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 1793> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 1793> at line 1804 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00d\x02\x00\x83\x01\x00}\x01\x00t\x02\x00|\x01\x00\x83\x01\x00}\x02\x00|\x...x00|\x03\x00\xcb\x00\x00D]\x0c\x00}\x06\x00d\x00\x00^\x02\x00q\xd9\x00k\x02\x00r\xf2\x00Pq\x9d\x00q\x9d\x00Wd\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 1793> at line 1804 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00d\x02\x00\x83\x01\x00}\x01\x00t\x02\x00|\x01\x00\x83\x01\x00}\x02\x00|\x...x00|\x03\x00\xcb\x00\x00D]\x0c\x00}\x06\x00d\x00\x00^\x02\x00q\xd9\x00k\x02\x00r\xf2\x00Pq\x9d\x00q\x9d\x00Wd\x00\x00S' next_instr = 181L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref,...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 1793> at line 1804 nameindex = 9, ignored = (181L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ________________________ AppTestC.test_keepalive_struct ________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf404ea3c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keepalive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keepalive_struct'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a2a32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keepalive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keepalive_struct'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keepalive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keepalive_struct'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keepalive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3bb2464> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf493e7ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf493e7ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keepalive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4174b6c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf459ea0c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf459ea0c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keepalive_struct'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_keepalive_struct'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_keepalive_struct'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_keepalive_struct'>, space = StdObjSpace target = <function test_keepalive_struct at 0xf3bdfe2c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) w_func = <Function test_keepalive_struct> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_keepalive_struct> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_keepalive_struct> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_keepalive_struct, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 pycode = <code object test_keepalive_struct, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 21L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_keepalive_struct>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 dropvalues = 2, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_keepalive_struct>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 dropvalues = 2, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) > return self._flat_pycall(code, nargs, frame, dropvalues) interpreter/function.py:174: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_keepalive_struct> code = <code object test_keepalive_struct, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 2303> nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:386]', line 1> at line 3 dropvalues = 2 @jit.unroll_safe def _flat_pycall(self, code, nargs, frame, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:201: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 2303> at line 2321 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 2303> at line 2321 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 2303> at line 2321 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 2303> at line 2321 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 2303> at line 2321 pycode = <code object test_keepalive_struct, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 2303> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 2303> at line 2321 co_code = 't\x00\x00d\x01\x00\x83\x01\x00}\x00\x00t\x01\x00|\x00\x00\x83\x01\x00}\x01\x00t\x02\x00|\x00\x00d\x02\x00t\x03\x00d\x...\x02\x00sE\x01t\x06\x00\x82\x01\x00\xcc\x15\x00|\x03\x00j\x07\x00d\n\x00k\x02\x00s]\x01t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 2303> at line 2321 co_code = 't\x00\x00d\x01\x00\x83\x01\x00}\x00\x00t\x01\x00|\x00\x00\x83\x01\x00}\x01\x00t\x02\x00|\x00\x00d\x02\x00t\x03\x00d\x...\x02\x00sE\x01t\x06\x00\x82\x01\x00\xcc\x15\x00|\x03\x00j\x07\x00d\n\x00k\x02\x00s]\x01t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 270L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keepaliv...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 2303> at line 2321 nameindex = 11, ignored = (270L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ________________________ AppTestC.test_buffer_keepalive ________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf3f328b4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_buffer_keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_buffer_keepalive'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a2a32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_buffer_keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_buffer_keepalive'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_buffer_keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_buffer_keepalive'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_buffer_keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3f41234> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf403732c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf403732c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_buffer_keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3f4ef7c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40370cc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf40370cc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_buffer_keepalive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_buffer_keepalive'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_buffer_keepalive'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_buffer_keepalive'>, space = StdObjSpace target = <function test_buffer_keepalive at 0xf3f57764> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) w_func = <Function test_buffer_keepalive> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_buffer_keepalive> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_buffer_keepalive> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_buffer_keepalive, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 pycode = <code object test_buffer_keepalive, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 21L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_buffer_keepalive>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 dropvalues = 2, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_buffer_keepalive>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 dropvalues = 2, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) > return self._flat_pycall(code, nargs, frame, dropvalues) interpreter/function.py:174: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_buffer_keepalive> code = <code object test_buffer_keepalive, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3101> nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:512]', line 1> at line 3 dropvalues = 2 @jit.unroll_safe def _flat_pycall(self, code, nargs, frame, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:201: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3101> at line 3108 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3101> at line 3108 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3101> at line 3108 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3101> at line 3108 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3101> at line 3108 pycode = <code object test_buffer_keepalive, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3101> next_instr = 52 ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3101> at line 3108 co_code = 't\x00\x00t\x01\x00d\x01\x00\x83\x01\x00\x83\x01\x00}\x00\x00t\x02\x00|\x00\x00d\x00\x00\x83\x02\x00}\x01\x00g\x00\x00...d\x00|\x06\x00\x1et\x05\x00d\x05\x00|\x03\x00\x16\x83\x01\x00k\x02\x00s\xbd\x00t\n\x00\x82\x01\x00q\x8d\x00Wd\x00\x00S' next_instr = 52 ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3101> at line 3108 co_code = 't\x00\x00t\x01\x00d\x01\x00\x83\x01\x00\x83\x01\x00}\x00\x00t\x02\x00|\x00\x00d\x00\x00\x83\x02\x00}\x01\x00g\x00\x00...d\x00|\x06\x00\x1et\x05\x00d\x05\x00|\x03\x00\x16\x83\x01\x00k\x02\x00s\xbd\x00t\n\x00\x82\x01\x00q\x8d\x00Wd\x00\x00S' next_instr = 124L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_buffer_k...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3101> at line 3108 nameindex = 9, ignored = (124L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ___________________________ AppTestC.test_new_handle ___________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf3bb98b4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a2a32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3e17dec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4855dcc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4855dcc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3e172ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48556ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48556ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_new_handle'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_new_handle'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_new_handle'>, space = StdObjSpace target = <function test_new_handle at 0xf3dc0e9c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) w_func = <Function test_new_handle> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_new_handle> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_new_handle> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_new_handle, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 pycode = <code object test_new_handle, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 21L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_new_handle>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 dropvalues = 2, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_new_handle>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 dropvalues = 2, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) > return self._flat_pycall(code, nargs, frame, dropvalues) interpreter/function.py:174: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_new_handle> code = <code object test_new_handle, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3223> nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:539]', line 1> at line 3 dropvalues = 2 @jit.unroll_safe def _flat_pycall(self, code, nargs, frame, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:201: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3223> at line 3237 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3223> at line 3237 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3223> at line 3237 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3223> at line 3237 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3223> at line 3237 pycode = <code object test_new_handle, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3223> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3223> at line 3237 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00t\x02\x00\x83\x00\x00\x83\x01\x00}\x01\x00t\x01\x00t\x03\x00d\x02\x00\x8...07\x00\x82\x01\x00t\x0e\x00\xc9\x0f\x00t\x10\x00t\x08\x00t\t\x00|\x02\x00d\n\x00\x83\x02\x00\xca\x03\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3223> at line 3237 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00t\x02\x00\x83\x00\x00\x83\x01\x00}\x01\x00t\x01\x00t\x03\x00d\x02\x00\x8...07\x00\x82\x01\x00t\x0e\x00\xc9\x0f\x00t\x10\x00t\x08\x00t\t\x00|\x02\x00d\n\x00\x83\x02\x00\xca\x03\x00\x01d\x00\x00S' next_instr = 244L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3223> at line 3237 nameindex = 12, ignored = (244L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ________________________ AppTestC.test_new_handle_cycle ________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf3c5c2cc>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle_cycle'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a2a32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle_cycle'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_new_handle_cycle'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3c3ccfc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ndle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a2586c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a2586c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ndle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3c3cd24> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ndle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a2532c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a2532c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ndle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_new_handle_cycle'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_new_handle_cycle'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_new_handle_cycle'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_new_handle_cycle'>, space = StdObjSpace target = <function test_new_handle_cycle at 0xf3dc2374> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) w_func = <Function test_new_handle_cycle> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_new_handle_cycle> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_new_handle_cycle> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_new_handle_cycle, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 pycode = <code object test_new_handle_cycle, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 21L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_new_handle_cycle>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 dropvalues = 2, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_new_handle_cycle>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 dropvalues = 2, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) > return self._flat_pycall(code, nargs, frame, dropvalues) interpreter/function.py:174: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_new_handle_cycle> code = <code object test_new_handle_cycle, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3248> nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:542]', line 1> at line 3 dropvalues = 2 @jit.unroll_safe def _flat_pycall(self, code, nargs, frame, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:201: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3248> at line 3259 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3248> at line 3259 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3248> at line 3259 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3248> at line 3259 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3248> at line 3259 pycode = <code object test_new_handle_cycle, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3248> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3248> at line 3259 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00t\x02\x00\x83\x00\x00\x83\x01\x00}\x01\x00d\x02\x00t\x03\x00f\x01\x00d\x...\xca\x00\x00\x01qk\x00qk\x00W\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00s\xb5\x00t\n\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3248> at line 3259 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00t\x01\x00t\x02\x00\x83\x00\x00\x83\x01\x00}\x01\x00d\x02\x00t\x03\x00f\x01\x00d\x...\xca\x00\x00\x01qk\x00qk\x00W\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00s\xb5\x00t\n\x00\x82\x01\x00d\x00\x00S' next_instr = 146L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_new_hand...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3248> at line 3259 nameindex = 9, ignored = (146L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError __________________ AppTestC.test_from_buffer_not_str_unicode ___________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf3f5ffb4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>, ...ticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a2a32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>, ...ticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>, ...ticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3ddf0a4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...tr_unicode'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3a667ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3a667ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...tr_unicode'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf40d602c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...tr_unicode'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3a66acc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3a66acc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...tr_unicode'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_from_buffer_not_str_unicode'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_from_buffer_not_str_unicode'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_from_buffer_not_str_unicode'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_from_buffer_not_str_unicode'>, space = StdObjSpace target = <function test_from_buffer_not_str_unicode at 0xf3ccddbc> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) w_func = <Function test_from_buffer_not_str_unicode> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_from_buffer_not_str_unicode> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_from_buffer_not_str_unicode> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf478768c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_from_buffer_not_str_unicode, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 pycode = <code object test_from_buffer_not_str_unicode, file '[/build_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 21L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 oparg = 0, ignored = (21L,), n_args = 0, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_from_buffer_not_str_unicode> nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 dropvalues = 2, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_from_buffer_not_str_unicode>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 dropvalues = 2, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) > return self._flat_pycall(code, nargs, frame, dropvalues) interpreter/function.py:174: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_from_buffer_not_str_unicode> code = <code object test_from_buffer_not_str_unicode, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3706> nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ild_dir/tmp/pytest/usession-main-377/test_c/_test_c.py:587]', line 1> at line 3 dropvalues = 2 @jit.unroll_safe def _flat_pycall(self, code, nargs, frame, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:201: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3706> at line 3712 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3706> at line 3712 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3706> at line 3712 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3706> at line 3712 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3706> at line 3712 pycode = <code object test_from_buffer_not_str_unicode, file '/build_dir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3706> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3706> at line 3712 co_code = 't\x00\x00d\x01\x00\x83\x01\x00}\x00\x00t\x01\x00|\x00\x00\x83\x01\x00}\x01\x00t\x02\x00|\x01\x00d\x00\x00\x83\x02\x00...}\x07\x00\xcc\x1a\x00|\x06\x00|\x07\x00\x19|\x03\x00|\x07\x00\x19k\x02\x00sR\x02t\x04\x00\x82\x01\x00q/\x02Wd\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3706> at line 3712 co_code = 't\x00\x00d\x01\x00\x83\x01\x00}\x00\x00t\x01\x00|\x00\x00\x83\x01\x00}\x01\x00t\x02\x00|\x01\x00d\x00\x00\x83\x02\x00...}\x07\x00\xcc\x1a\x00|\x06\x00|\x07\x00\x19|\x03\x00|\x07\x00\x19k\x02\x00sR\x02t\x04\x00\x82\x01\x00q/\x02Wd\x00\x00S' next_instr = 102L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4cba3cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_from_buf...ir/tmp/pytest/usession-main-377/test_c/_all_test_c.py', line 3706> at line 3712 nameindex = 6, ignored = (102L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4df3cac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ______________________ AppTestFFIObj.test_ffi_gc_disable _______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf3d457d4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_ffi_gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_ffi_gc_disable'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a2a32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_ffi_gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_ffi_gc_disable'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69c668c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_ffi_gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_ffi_gc_disable'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_ffi_gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf392fe14> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf38f042c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf38f042c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_ffi_gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3e3c464> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf38f09ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf38f09ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_ffi_gc_disable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_ffi_gc_disable'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_ffi_gc_disable'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_ffi_gc_disable'>, space = StdObjSpace target = <function test_ffi_gc_disable at 0xf390ff7c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3e056cc>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3e056cc>,) w_func = <Function test_ffi_gc_disable> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3e056cc> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_ffi_gc_disable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3e056cc>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_ffi_gc_disable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3e056cc>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_ffi_gc_disable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9 pycode = <code object test_ffi_gc_disable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf577dfcc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00}\x02\x00|\x02\x00\xc9\x02\x00d\x02\x00d\x03\x00...\x00\xca\x00\x00\x01q\xe1\x00W\xcc\x15\x00\x88\x00\x00d\x08\x00g\x01\x00k\x02\x00s#\x01t\x07\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf577dfcc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00\xca\x00\x00}\x02\x00|\x02\x00\xc9\x02\x00d\x02\x00d\x03\x00...\x00\xca\x00\x00\x01q\xe1\x00W\xcc\x15\x00\x88\x00\x00d\x08\x00g\x01\x00k\x02\x00s#\x01t\x07\x00\x82\x01\x00d\x00\x00S' next_instr = 148L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf577dfcc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_ffi_gc_d...2/build/pypy/module/_cffi_backend/test/test_ffi_obj.py:395]', line 1> at line 9 nameindex = 6, ignored = (148L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf3e1c0ac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf3e1c0ac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf3e1c0ac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_weakref FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_keepalive_struct FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_buffer_keepalive FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_new_handle FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_new_handle_cycle FAIL module/_cffi_backend/test/test_c.py::AppTestC::()::test_from_buffer_not_str_unicode FAIL module/_cffi_backend/test/test_ffi_obj.py::AppTestFFIObj::()::test_ffi_gc_disable ============== 7 failed, 448 passed, 11 skipped in 123.71 seconds ============== ++ 22:03:29 starting module/_io/test [15 started in total] __ module/_cppyy/test [12 done in total, somefailed=True] _____________________ [platform:WARNING] cc1plus: warning: command-line option ‘-Wno-discarded-qualifiers’ is valid for C/ObjC but not for C++ [platform:WARNING] cc1plus: warning: command-line option ‘-Wno-duplicate-decl-specifier’ is valid for C/ObjC but not for C++ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 191 items module/_cppyy/test/test_advancedcpp.py sssssssssssssssssssssssss module/_cppyy/test/test_boost.py sssss module/_cppyy/test/test_cpp11features.py s.s module/_cppyy/test/test_cppyy.py .....FFFFFF module/_cppyy/test/test_crossing.py ssss module/_cppyy/test/test_datatypes.py .......sssssssssssssss module/_cppyy/test/test_fragile.py sssssssssssss module/_cppyy/test/test_helper.py ...... module/_cppyy/test/test_operators.py sssssss module/_cppyy/test/test_overloads.py sssssss module/_cppyy/test/test_pythonify.py ..FFFsssssssssssss module/_cppyy/test/test_pythonization.py .ssssss module/_cppyy/test/test_regression.py ss module/_cppyy/test/test_stltypes.py sssssssssssssssssssssssss module/_cppyy/test/test_templates.py sssssssssssssssssssssssssssssssss module/_cppyy/test/test_zjit.py sss =================================== FAILURES =================================== __________________________ AppTestCPPYY.test05_memory __________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf3587f7c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05_memory'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79d632c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf597b3ec>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05_memory'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf597b3ec>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05_memory'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3102dc4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf311490c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf311490c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf31e9cfc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf311486c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf311486c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05_memory'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test05_memory'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test05_memory'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test05_memory'>, space = StdObjSpace target = <function test05_memory at 0xf313948c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c>,) w_func = <Function test05_memory> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test05_memory> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test05_memory> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test05_memory, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18 pycode = <code object test05_memory, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3d048cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00j\x02\x00}\x03\x00\xcc\x1e\x00|\x03\...1e\x00|\x03\x00\xc9\x03\x00d\x03\x00\xca\x01\x00\x83\x00\x00d\x04\x00k\x02\x00s\xd2\x01t\x04\x00\x82\x01\x00d\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3d048cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00j\x02\x00}\x03\x00\xcc\x1e\x00|\x03\...1e\x00|\x03\x00\xc9\x03\x00d\x03\x00\xca\x01\x00\x83\x00\x00d\x04\x00k\x02\x00s\xd2\x01t\x04\x00\x82\x01\x00d\x02\x00S' next_instr = 219L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3d048cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05_memory...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:129]', line 1> at line 18 nameindex = 6, ignored = (219L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4763c8c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4763c8c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4763c8c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _________________________ AppTestCPPYY.test05a_memory2 _________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf31a8924>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05a_memory2'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79d632c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf597b3ec>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05a_memory2'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf597b3ec>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test05a_memory2'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf308af54> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...5a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf30247ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf30247ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...5a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf308aeb4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...5a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf30246ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf30246ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...5a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test05a_memory2'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test05a_memory2'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test05a_memory2'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test05a_memory2'>, space = StdObjSpace target = <function test05a_memory2 at 0xf2ca9f44> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c>,) w_func = <Function test05a_memory2> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test05a_memory2> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test05a_memory2> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test05a_memory2, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15 pycode = <code object test05a_memory2, file '[/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3d048cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00j\x02\x00}\x03\x00\xcc\x1e\x00|\x03\...00k\x02\x00s\xc7\x00t\x04\x00\x82\x01\x00|\x03\x00\xc9\x03\x00d\x07\x00\xca\x01\x00d\x04\x00\x83\x01\x00\x01d\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3d048cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00j\x02\x00}\x03\x00\xcc\x1e\x00|\x03\...00k\x02\x00s\xc7\x00t\x04\x00\x82\x01\x00|\x03\x00\xc9\x03\x00d\x07\x00\xca\x01\x00d\x04\x00\x83\x01\x00\x01d\x02\x00S' next_instr = 162L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf3d048cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test05a_memor...ux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:161]', line 1> at line 15 nameindex = 9, ignored = (162L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4763c8c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4763c8c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4763c8c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ______________________ AppTestCPPYY.test06_method_double _______________________ self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c> def test06_method_double(self): """Test passing of a double and returning of double on a method.""" import _cppyy t = self.example01 e = self.instantiate(t, 13) res = t.get_overload("addDataToDouble")(e, 16) assert round(res-29, 8) == 0. e.__destruct__() e = self.instantiate(t, -13) res = t.get_overload("addDataToDouble")(e, 16) assert round(res-3, 8) == 0. e.__destruct__() > assert t.get_overload("getCount")() == 0 E (application-level) AssertionError: assert 1 == 0 E + where 1 = <CPPStaticOverload object at 0xf31c92ac>() E + where <CPPStaticOverload object at 0xf31c92ac> = <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf344372c>>('getCount') E + where <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf344372c>> = <CPPClassDecl object at 0xf344372c>.get_overload [/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:182]:17: AssertionError ____________________ AppTestCPPYY.test07_method_constcharp _____________________ self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c> def test07_method_constcharp(self): """Test passing of a C string and returning of a C string on a method.""" import _cppyy t = self.example01 e = self.instantiate(t, 42) res = t.get_overload("addDataToAtoi")(e, "13") assert res == 55 res = t.get_overload("addToStringValue")(e, "12") # TODO: this leaks assert res == "54" res = t.get_overload("addToStringValue")(e, "-12") # TODO: this leaks assert res == "30" e.__destruct__() > assert t.get_overload("getCount")() == 0 E (application-level) AssertionError: assert 1 == 0 E + where 1 = <CPPStaticOverload object at 0xf31c92ac>() E + where <CPPStaticOverload object at 0xf31c92ac> = <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf344372c>>('getCount') E + where <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf344372c>> = <CPPClassDecl object at 0xf344372c>.get_overload [/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:200]:16: AssertionError __________________ AppTestCPPYY.test08_pass_object_by_pointer __________________ self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c> def test08_pass_object_by_pointer(self): """Test passing of an instance as an argument.""" import _cppyy t1 = self.example01 t2 = self.payload pl = self.instantiate(t2, 3.14) assert round(t2.get_overload("getData")(pl)-3.14, 8) == 0 t1.get_overload("staticSetPayload")(pl, 41.) assert t2.get_overload("getData")(pl) == 41. e = self.instantiate(t1, 50) t1.get_overload("setPayload")(e, pl); assert round(t2.get_overload("getData")(pl)-50., 8) == 0 e.__destruct__() pl.__destruct__() > assert t1.get_overload("getCount")() == 0 E (application-level) AssertionError: assert 1 == 0 E + where 1 = <CPPStaticOverload object at 0xf31c92ac>() E + where <CPPStaticOverload object at 0xf31c92ac> = <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf344372c>>('getCount') E + where <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf344372c>> = <CPPClassDecl object at 0xf344372c>.get_overload [/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:217]:19: AssertionError _________________ AppTestCPPYY.test09_return_object_by_pointer _________________ self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf34c1f8c> def test09_return_object_by_pointer(self): """Test returning of an instance as an argument.""" import _cppyy t1 = self.example01 t2 = self.payload pl1 = self.instantiate(t2, 3.14) assert round(t2.get_overload("getData")(pl1)-3.14, 8) == 0 pl2 = t1.get_overload("staticCyclePayload")(pl1, 38.) assert t2.get_overload("getData")(pl2) == 38. e = self.instantiate(t1, 50) pl2 = t1.get_overload("cyclePayload")(e, pl1); assert round(t2.get_overload("getData")(pl2)-50., 8) == 0 e.__destruct__() pl1.__destruct__() > assert t1.get_overload("getCount")() == 0 E (application-level) AssertionError: assert 1 == 0 E + where 1 = <CPPStaticOverload object at 0xf31c92ac>() E + where <CPPStaticOverload object at 0xf31c92ac> = <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf344372c>>('getCount') E + where <bound method CPPClassDecl.get_overload of <CPPClassDecl object at 0xf344372c>> = <CPPClassDecl object at 0xf344372c>.get_overload [/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_cppyy.py:237]:19: AssertionError _______________ AppTestPYTHONIFY.test03_constructing_and_calling _______________ self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf204db2c> def test03_constructing_and_calling(self): """Test object and method calls.""" import _cppyy example01_class = _cppyy.gbl.example01 > assert example01_class.getCount() == 0 E (application-level) AssertionError: assert 1 == 0 E + where 1 = <CPPStaticOverload object at 0xf31c92ac>() E + where <CPPStaticOverload object at 0xf31c92ac> = <CPPStaticOverload object at 0xf31c92ac> E + where <CPPStaticOverload object at 0xf31c92ac> = <class 'cppyy.gbl.example01'>.getCount [/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_pythonify.py:68]:5: AssertionError ______________ AppTestPYTHONIFY.test04_passing_object_by_pointer _______________ self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf204db2c> def test04_passing_object_by_pointer(self): import _cppyy example01_class = _cppyy.gbl.example01 payload_class = _cppyy.gbl.payload e = example01_class(14) pl = payload_class(3.14) assert round(pl.getData()-3.14, 8) == 0 example01_class.staticSetPayload(pl, 41.) assert pl.getData() == 41. example01_class.staticSetPayload(pl, 43.) assert pl.getData() == 43. e.staticSetPayload(pl, 45.) assert pl.getData() == 45. e.setPayload(pl) assert round(pl.getData()-14., 8) == 0 pl.__destruct__() e.__destruct__() > assert example01_class.getCount() == 0 E (application-level) AssertionError: assert 1 == 0 E + where 1 = <CPPStaticOverload object at 0xf31c92ac>() E + where <CPPStaticOverload object at 0xf31c92ac> = <CPPStaticOverload object at 0xf31c92ac> E + where <CPPStaticOverload object at 0xf31c92ac> = <class 'cppyy.gbl.example01'>.getCount [/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_pythonify.py:117]:22: AssertionError _____________ AppTestPYTHONIFY.test05_returning_object_by_pointer ______________ self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf204db2c> def test05_returning_object_by_pointer(self): import _cppyy example01_class = _cppyy.gbl.example01 payload_class = _cppyy.gbl.payload pl = payload_class(3.14) assert round(pl.getData()-3.14, 8) == 0 pl2 = example01_class.staticCyclePayload(pl, 38.) assert pl2.getData() == 38. e = example01_class(14) pl2 = e.cyclePayload(pl) assert round(pl2.getData()-14., 8) == 0 pl.__destruct__() e.__destruct__() > assert example01_class.getCount() == 0 E (application-level) AssertionError: assert 1 == 0 E + where 1 = <CPPStaticOverload object at 0xf31c92ac>() E + where <CPPStaticOverload object at 0xf31c92ac> = <CPPStaticOverload object at 0xf31c92ac> E + where <CPPStaticOverload object at 0xf31c92ac> = <class 'cppyy.gbl.example01'>.getCount [/build_dir/own-linux-x86-32/build/pypy/module/_cppyy/test/test_pythonify.py:140]:19: AssertionError =========================== short test summary info ============================ FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test05_memory FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test05a_memory2 FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test06_method_double FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test07_method_constcharp FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test08_pass_object_by_pointer FAIL module/_cppyy/test/test_cppyy.py::AppTestCPPYY::()::test09_return_object_by_pointer FAIL module/_cppyy/test/test_pythonify.py::AppTestPYTHONIFY::()::test03_constructing_and_calling FAIL module/_cppyy/test/test_pythonify.py::AppTestPYTHONIFY::()::test04_passing_object_by_pointer FAIL module/_cppyy/test/test_pythonify.py::AppTestPYTHONIFY::()::test05_returning_object_by_pointer ============== 9 failed, 22 passed, 160 skipped in 104.65 seconds ============== ++ 22:04:00 starting module/_jitlog/test [16 started in total] __ module/_jitlog/test [13 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/_jitlog/test/test__jitlog.py . =========================== 1 passed in 6.22 seconds =========================== ++ 22:04:06 starting module/_locale/test [17 started in total] __ module/_locale/test [14 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 14 items module/_locale/test/test_locale.py ssssssssssssss ========================== 14 skipped in 4.93 seconds ========================== ++ 22:04:12 starting module/_lsprof/test [18 started in total] __ module/_lsprof/test [15 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 6 items module/_lsprof/test/test_cprofile.py ...... =========================== 6 passed in 7.08 seconds =========================== ++ 22:04:20 starting module/_md5/test [19 started in total] __ interpreter/test [16 done in total, somefailed=True] _______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 772 items interpreter/test/apptest_class.py ............... interpreter/test/apptest_exec.py ............................ interpreter/test/apptest_function.py ........................s.............................. interpreter/test/apptest_generator.py ......................F........... interpreter/test/apptest_nestedscope.py ............. interpreter/test/apptest_pyframe.py ............................. interpreter/test/apptest_raise.py ..................... interpreter/test/test_app_main.py ....ssssssssssssssssssssssssss.sssssss.............s...s..s...... interpreter/test/test_appinterp.py ............. interpreter/test/test_argument.py ................................... interpreter/test/test_buffer.py .. interpreter/test/test_cellfamily.py ....... interpreter/test/test_code.py ........ interpreter/test/test_compiler.py ......................................................................................................................... interpreter/test/test_descrtypecheck.py .. interpreter/test/test_error.py .......... interpreter/test/test_exceptcomp.py ........... interpreter/test/test_exec.py . interpreter/test/test_executioncontext.py ................ interpreter/test/test_extmodules.py . interpreter/test/test_function.py .......... interpreter/test/test_gateway.py ........................................ss............ interpreter/test/test_generator.py . interpreter/test/test_interpreter.py .......................... interpreter/test/test_main.py .... interpreter/test/test_mixedmodule.py ...... interpreter/test/test_module.py ........ interpreter/test/test_objspace.py .............................. interpreter/test/test_pycode.py . interpreter/test/test_pyframe.py .. interpreter/test/test_reverse_debugging.py .. interpreter/test/test_special.py .. interpreter/test/test_syntax.py .................................................................... interpreter/test/test_targetpypy.py .. interpreter/test/test_typedef.py ....F.......F..... interpreter/test/test_unicodehelper.py .......... interpreter/test/test_zpy.py ...... interpreter/test/test_zzpickle_and_slow.py ...............s................... =================================== FAILURES =================================== ____________________________ test_close_on_collect _____________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4ecfed4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_close_on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_close_on_collect'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a5dc6c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a170ac>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_close_on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_close_on_collect'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a170ac>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_close_on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_close_on_collect'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_close_on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4ed98c4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4e4f28c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4e4f28c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_close_on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4ed91e4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4e4f22c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4e4f22c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_close_on_collect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestFunction 'test_close_on_collect'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_close_on_collect'> def runtest(self): target = self.w_obj space = target.space self.check_run(space, target) > self.execute_appex(space, target) tool/pytest/apptest2.py:85: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_close_on_collect'>, space = StdObjSpace w_func = <Function test_close_on_collect> def execute_appex(self, space, w_func): space.getexecutioncontext().set_sys_exc_info(None) sig = w_func.code._signature if sig.varargname or sig.kwargname: raise ValueError( 'Test functions may not use *args or **kwargs') args_w = self.get_fixtures(space, sig.argnames) try: > space.call_function(w_func, *args_w) tool/pytest/apptest2.py:114: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_close_on_collect>, args_w = () nargs = 0, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_close_on_collect>, args_w = () gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_close_on_collect, file '/build_dir/own-linux-x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223 pycode = <code object test_close_on_collect, file '/build_dir/own-linux-x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf56b84ac> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00\x87\x00\x00f\x01\x00d\x02\x00\x86\x00\x00\x89\x00\x00\x88\x00\x00\x83\x00\x00}\x...x04\x00\xc9\x0b\x00|\x06\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x02\x00\x04}\x04\x00}\x03\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf56b84ac> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00\x87\x00\x00f\x01\x00d\x02\x00\x86\x00\x00\x89\x00\x00\x88\x00\x00\x83\x00\x00}\x...x04\x00\xc9\x0b\x00|\x06\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x02\x00\x04}\x04\x00}\x03\x00d\x00\x00S' next_instr = 55L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf56b84ac> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_close_on...x86-32/build/pypy/interpreter/test/apptest_generator.py', line 213> at line 223 nameindex = 2, ignored = (55L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf575260c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf575260c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf575260c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _______________________ TestTypeDef.test_subclass_cache ________________________ self = <pypy.interpreter.test.test_typedef.TestTypeDef instance at 0xf3cccecc> def test_subclass_cache(self): # check that we don't create more than 6 subclasses of a # given W_XxxObject (instead of the 16 that follow from # all combinations) space = self.space sources = [] for hasdict in [False, True]: for wants_slots in [False, True]: for needsdel in [False, True]: for weakrefable in [False, True]: print 'Testing case', hasdict, wants_slots, print needsdel, weakrefable slots = [] checks = [] if hasdict: slots.append('__dict__') checks.append('x.foo=5; x.__dict__') else: checks.append('raises(AttributeError, "x.foo=5");' 'raises(AttributeError, "x.__dict__")') if wants_slots: slots.append('a') checks.append('x.a=5; assert X.a.__get__(x)==5') else: checks.append('') if weakrefable: slots.append('__weakref__') checks.append('import _weakref;_weakref.ref(x)') else: checks.append('') if needsdel: methodname = '__del__' checks.append('X();X();X();' 'import gc;gc.collect();' 'assert seen') else: methodname = 'spam' checks.append('assert "Del" not in irepr') assert len(checks) == 4 space.appexec([], """(): seen = [] class X(list): __slots__ = %r def %s(self): seen.append(1) x = X() import __pypy__ irepr = __pypy__.internal_repr(x) print irepr %s %s %s %s """ % (slots, methodname, checks[0], checks[1], > checks[2], checks[3])) interpreter/test/test_typedef.py:128: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ interpreter/baseobjspace.py:1479: in appexec return self.call_args(w_func, args) objspace/descroperation.py:186: in call_args return w_obj.call_args(args) interpreter/function.py:68: in call_args w_res = self.getcode().funcrun(self, args) interpreter/pycode.py:223: in funcrun return frame.run() interpreter/pyframe.py:253: in run return self.execute_frame() interpreter/pyframe.py:290: in execute_frame raise self._convert_unexpected_exception(e) interpreter/pyframe.py:943: in _convert_unexpected_exception operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:286: in execute_frame executioncontext) interpreter/pyopcode.py:63: in dispatch next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: in handle_bytecode next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:356: in dispatch_bytecode self.LOOKUP_METHOD(oparg, next_instr) objspace/std/callmethod.py:63: in LOOKUP_METHOD w_value = w_obj.getdictvalue(space, name) interpreter/mixedmodule.py:93: in getdictvalue return self._load_lazily(space, name) interpreter/mixedmodule.py:103: in _load_lazily w_value = loader(space) interpreter/mixedmodule.py:182: in ifileloader d[name] = __import__(pkgroot+'.'+name, None, None, [name]) module/gc/interp_gc.py:4: in <module> from pypy.module.gc.hook import W_GcCollectStepStats module/gc/hook.py:2: in <module> from rpython.memory.gc import incminimark _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ----------------------------- Captured stdout call ----------------------------- Testing case False False False False Testing case False False False True Testing case False False True False ________________________ AppTestTypeDef.test_destructor ________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf3c72bfc>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_destructor'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a5dc6c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a170ac>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_destructor'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a170ac>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_destructor'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3df2914> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3cca88c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3cca88c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3e11b6c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3e8a72c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3e8a72c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_destructor'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_destructor'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_destructor'>, space = StdObjSpace target = <function test_destructor at 0xf3c69bc4> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3d7484c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3d7484c>,) w_func = <Function test_destructor> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3d7484c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_destructor> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3d7484c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_destructor> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf3d7484c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_destructor, file '[/build_dir/own-linux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12 pycode = <code object test_destructor, file '[/build_dir/own-linux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c6f44c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00g\x00\x00\x89\x01\x00d\x02\x00t\x02\x00f\x...00s\xbd\x00t\x08\x00\x82\x01\x00t\t\x00t\n\x00\x88\x00\x00j\x06\x00|\x04\x00d\t\x00d\x06\x00\x83\x05\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c6f44c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00g\x00\x00\x89\x01\x00d\x02\x00t\x02\x00f\x...00s\xbd\x00t\x08\x00\x82\x01\x00t\t\x00t\n\x00\x88\x00\x00j\x06\x00|\x04\x00d\t\x00d\x06\x00\x83\x05\x00\x01d\x00\x00S' next_instr = 128L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c6f44c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...ux-x86-32/build/pypy/interpreter/test/test_typedef.py:335]', line 1> at line 12 nameindex = 7, ignored = (128L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4c8e38c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4c8e38c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4c8e38c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL interpreter/test/apptest_generator.py::test_close_on_collect FAIL interpreter/test/test_typedef.py::TestTypeDef::()::test_subclass_cache FAIL interpreter/test/test_typedef.py::AppTestTypeDef::()::test_destructor ============== 3 failed, 729 passed, 40 skipped in 240.19 seconds ============== ++ 22:04:32 starting module/_minimal_curses/test [20 started in total] __ module/_md5/test [17 done in total, somefailed=False] ______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 6 items module/_md5/test/test_md5.py .s.... ===================== 5 passed, 1 skipped in 10.04 seconds ===================== ++ 22:04:33 starting module/_multibytecodec/test [21 started in total] __ module/_minimal_curses/test [18 done in total, somefailed=False] ___________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 6 items module/_minimal_curses/test/test_curses.py sss... ===================== 3 passed, 3 skipped in 16.12 seconds ===================== ++ 22:04:49 starting module/_multiprocessing/test [22 started in total] __ module/_multibytecodec/test [19 done in total, somefailed=False] ___________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 51 items module/_multibytecodec/test/test_app_codecs.py ................ module/_multibytecodec/test/test_app_incremental.py ............ module/_multibytecodec/test/test_app_stream.py ..... module/_multibytecodec/test/test_c_codecs.py ................s module/_multibytecodec/test/test_translation.py . ==================== 50 passed, 1 skipped in 27.50 seconds ===================== ++ 22:05:05 starting module/_pypyjson/test [23 started in total] __ module/_pypyjson/test [20 done in total, somefailed=False] _________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 42 items / 1 skipped module/_pypyjson/test/test__pypyjson.py .......................................... ===================== 42 passed, 1 skipped in 9.33 seconds ===================== ++ 22:05:15 starting module/_random/test [24 started in total] __ module/_random/test [21 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 14 items module/_random/test/test_random.py ............. module/_random/test/test_ztranslation.py . ========================== 14 passed in 20.39 seconds ========================== ++ 22:05:39 starting module/_rawffi/alt/test [25 started in total] __ module/_rawffi/alt/test [22 done in total, somefailed=False] _______________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 73 items module/_rawffi/alt/test/test_ffitype.py ..... module/_rawffi/alt/test/test_funcptr.py ..................................ssssss.s module/_rawffi/alt/test/test_struct.py ............... module/_rawffi/alt/test/test_type_converter.py ........... ==================== 66 passed, 7 skipped in 11.78 seconds ===================== ++ 22:05:54 starting module/_rawffi/test [26 started in total] __ module/_io/test [23 done in total, somefailed=True] ________________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 200 items module/_io/test/apptest_bytesio.py ...FF....... module/_io/test/apptest_io.py ........F....................... module/_io/test/apptest_stringio.py ......................... module/_io/test/apptest_textio.py .............F............. module/_io/test/test_bufferedio.py .......................................................F...................... module/_io/test/test_fileio.py ...................... module/_io/test/test_interp_textio.py .... =================================== FAILURES =================================== __________________________________ test_write __________________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4ddfdbc>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_write'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a7c32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_write'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_write'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf50d7dec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d9a86c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d9a86c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4dd77fc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d9a7ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d9a7ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_write'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestFunction 'test_write'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_write'> def runtest(self): target = self.w_obj space = target.space self.check_run(space, target) > self.execute_appex(space, target) tool/pytest/apptest2.py:85: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_write'>, space = StdObjSpace w_func = <Function test_write> def execute_appex(self, space, w_func): space.getexecutioncontext().set_sys_exc_info(None) sig = w_func.code._signature if sig.varargname or sig.kwargname: raise ValueError( 'Test functions may not use *args or **kwargs') args_w = self.get_fixtures(space, sig.argnames) try: > space.call_function(w_func, *args_w) tool/pytest/apptest2.py:114: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_write>, args_w = (), nargs = 0 Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_write>, args_w = () gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_write, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38 pycode = <code object test_write, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf527c7cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38 co_code = 't\x00\x00\xc9\x01\x00\xca\x00\x00}\x00\x00|\x00\x00j\x02\x00}\x01\x00d\x01\x00}\x02\x00|\x01\x00|\x02\x00\x83\x01\x00...00\x82\x01\x00d\x00\x00\x04}\x01\x00\x04}\x02\x00\x04}\x03\x00}\x0b\x00|\x00\x00\xc9\x12\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf527c7cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38 co_code = 't\x00\x00\xc9\x01\x00\xca\x00\x00}\x00\x00|\x00\x00j\x02\x00}\x01\x00d\x01\x00}\x02\x00|\x01\x00|\x02\x00\x83\x01\x00...00\x82\x01\x00d\x00\x00\x04}\x01\x00\x04}\x02\x00\x04}\x03\x00}\x0b\x00|\x00\x00\xc9\x12\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 881L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf527c7cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write, f...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 32> at line 38 nameindex = 16, ignored = (881L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf5307c8c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf5307c8c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf5307c8c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError __________________________________ test_read ___________________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4b9c10c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_read'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a7c32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_read'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_read'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4cc6e14> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4e4ed0c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4e4ed0c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4cc6d74> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4ce5eac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4ce5eac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_read'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestFunction 'test_read'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_read'> def runtest(self): target = self.w_obj space = target.space self.check_run(space, target) > self.execute_appex(space, target) tool/pytest/apptest2.py:85: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_read'>, space = StdObjSpace w_func = <Function test_read> def execute_appex(self, space, w_func): space.getexecutioncontext().set_sys_exc_info(None) sig = w_func.code._signature if sig.varargname or sig.kwargname: raise ValueError( 'Test functions may not use *args or **kwargs') args_w = self.get_fixtures(space, sig.argnames) try: > space.call_function(w_func, *args_w) tool/pytest/apptest2.py:114: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_read>, args_w = (), nargs = 0 Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_read>, args_w = () gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_read, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45 pycode = <code object test_read, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf527c7cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45 co_code = 't\x00\x00\xc9\x01\x00d\x01\x00\xca\x01\x00}\x00\x00|\x00\x00j\x02\x00}\x01\x00|\x01\x00\x83\x00\x00}\x02\x00d\x01\x00...1\x00d\x00\x00\x04}\x01\x00\x04}\x02\x00\x04}\x04\x00\x04}\t\x00}\x08\x00|\x00\x00\xc9\r\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf527c7cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45 co_code = 't\x00\x00\xc9\x01\x00d\x01\x00\xca\x01\x00}\x00\x00|\x00\x00j\x02\x00}\x01\x00|\x01\x00\x83\x00\x00}\x02\x00d\x01\x00...1\x00d\x00\x00\x04}\x01\x00\x04}\x02\x00\x04}\x04\x00\x04}\t\x00}\x08\x00|\x00\x00\xc9\r\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 271L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf527c7cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read, fi...inux-x86-32/build/pypy/module/_io/test/apptest_bytesio.py', line 42> at line 45 nameindex = 12, ignored = (271L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf5307c8c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf5307c8c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf5307c8c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _______________________________ test_destructor ________________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4b2717c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_destructor'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a7c32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_destructor'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_destructor'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4c7efa4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a2a96c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a2a96c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf47dce3c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a2a9cc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a2a9cc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestFunction 'test_destructor'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_destructor'> def runtest(self): target = self.w_obj space = target.space self.check_run(space, target) > self.execute_appex(space, target) tool/pytest/apptest2.py:85: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_destructor'>, space = StdObjSpace w_func = <Function test_destructor> def execute_appex(self, space, w_func): space.getexecutioncontext().set_sys_exc_info(None) sig = w_func.code._signature if sig.varargname or sig.kwargname: raise ValueError( 'Test functions may not use *args or **kwargs') args_w = self.get_fixtures(space, sig.argnames) try: > space.call_function(w_func, *args_w) tool/pytest/apptest2.py:114: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_destructor>, args_w = (), nargs = 0 Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_destructor>, args_w = () gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_destructor, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108 pycode = <code object test_destructor, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f178c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\x01g\x00\x00\x89\x01\x00d\x02\x00|\x00\x00j\x01...\x00t\n\x00t\x04\x00\xc9\x0b\x00|\x05\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x03\x00}\x02\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f178c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\x01g\x00\x00\x89\x01\x00d\x02\x00|\x00\x00j\x01...\x00t\n\x00t\x04\x00\xc9\x0b\x00|\x05\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x03\x00}\x02\x00d\x00\x00S' next_instr = 87L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf50f178c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...wn-linux-x86-32/build/pypy/module/_io/test/apptest_io.py', line 93> at line 108 nameindex = 3, ignored = (87L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf50daccc> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf50daccc> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf50daccc> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _______________________________ test_destructor ________________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf41a387c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_destructor'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a7c32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_destructor'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_destructor'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf42734b4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3d665ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3d665ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4bb6d24> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3d663cc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3d663cc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestFunction 'test_destructor'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_destructor'> def runtest(self): target = self.w_obj space = target.space self.check_run(space, target) > self.execute_appex(space, target) tool/pytest/apptest2.py:85: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_destructor'>, space = StdObjSpace w_func = <Function test_destructor> def execute_appex(self, space, w_func): space.getexecutioncontext().set_sys_exc_info(None) sig = w_func.code._signature if sig.varargname or sig.kwargname: raise ValueError( 'Test functions may not use *args or **kwargs') args_w = self.get_fixtures(space, sig.argnames) try: > space.call_function(w_func, *args_w) tool/pytest/apptest2.py:114: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_destructor>, args_w = (), nargs = 0 Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_destructor>, args_w = () gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_destructor, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150 pycode = <code object test_destructor, file '/build_dir/own-linux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51046cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150 co_code = 'g\x00\x00\x89\x00\x00d\x01\x00t\x00\x00j\x01\x00f\x01\x00\x87\x00\x00f\x01\x00d\x02\x00\x86\x00\x00\x83\x00\x00Y}\x00...\x00t\x0c\x00t\x06\x00\xc9\r\x00|\x07\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x05\x00}\x04\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51046cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150 co_code = 'g\x00\x00\x89\x00\x00d\x01\x00t\x00\x00j\x01\x00f\x01\x00\x87\x00\x00f\x01\x00d\x02\x00\x86\x00\x00\x83\x00\x00Y}\x00...\x00t\x0c\x00t\x06\x00\xc9\r\x00|\x07\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x05\x00}\x04\x00d\x00\x00S' next_instr = 101L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51046cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...nux-x86-32/build/pypy/module/_io/test/apptest_textio.py', line 140> at line 150 nameindex = 5, ignored = (101L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4ffee4c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4ffee4c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4ffee4c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ____________________ AppTestBufferedWriter.test_destructor _____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf27f1c6c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_destructor'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a7c32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_destructor'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a194cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_destructor'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf49073ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf242ad6c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf242ad6c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3969644> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf1920aac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf1920aac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_destructor'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_destructor'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_destructor'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_destructor'>, space = StdObjSpace target = <function test_destructor at 0xf27e833c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf2586ccc>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf2586ccc>,) w_func = <Function test_destructor> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf2586ccc> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_destructor> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf2586ccc>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_destructor> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf2586ccc>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_destructor, file '[/build_dir/own-linux-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16 pycode = <code object test_destructor, file '[/build_dir/own-linux-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bb022c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00g\x00\x00\x89\x01\x00d\x02\x00|\x01\x00j\x01\x00f\x01\x00\x87\x00\x00\x87\x01\x00...0\x00\x01\xcc\x1b\x00\x88\x01\x00d\x05\x00d\x06\x00d\x07\x00g\x03\x00k\x02\x00s\x87\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bb022c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00g\x00\x00\x89\x01\x00d\x02\x00|\x01\x00j\x01\x00f\x01\x00\x87\x00\x00\x87\x01\x00...0\x00\x01\xcc\x1b\x00\x88\x01\x00d\x05\x00d\x06\x00d\x07\x00g\x03\x00k\x02\x00s\x87\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 101L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4bb022c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_destruct...-x86-32/build/pypy/module/_io/test/test_bufferedio.py:362]', line 1> at line 16 nameindex = 5, ignored = (101L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf3d9fd8c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf3d9fd8c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf3d9fd8c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/_io/test/apptest_bytesio.py::test_write FAIL module/_io/test/apptest_bytesio.py::test_read FAIL module/_io/test/apptest_io.py::test_destructor FAIL module/_io/test/apptest_textio.py::test_destructor FAIL module/_io/test/test_bufferedio.py::AppTestBufferedWriter::()::test_destructor ==================== 5 failed, 195 passed in 180.50 seconds ==================== ++ 22:06:38 starting module/_sha/test [27 started in total] __ module/_rawffi/test [24 done in total, somefailed=True] ____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 83 items module/_rawffi/test/apptest_rawffi.py . module/_rawffi/test/test__rawffi.py .....s.............................................s..........s..n: 2 Arg 0: 3 Arg 1: 15 .FF module/_rawffi/test/test_exit.py . module/_rawffi/test/test_nested.py ...... module/_rawffi/test/test_struct.py ... module/_rawffi/test/test_tracker.py ... module/_rawffi/test/test_ztranslation.py . =================================== FAILURES =================================== ___________________ AppTestAutoFree.test_structure_autofree ____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4a44f7c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_structure_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_structure_autofree'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a4332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69e04cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_structure_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_structure_autofree'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69e04cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_structure_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_structure_autofree'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_structure_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf49f1c84> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...e_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49ffe0c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49ffe0c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...e_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_structure_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf49f17ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...e_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49ff96c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49ff96c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...e_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_structure_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_structure_autofree'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_structure_autofree'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_structure_autofree'>, space = StdObjSpace target = <function test_structure_autofree at 0xf49e74fc> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a2f90c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a2f90c>,) w_func = <Function test_structure_autofree> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a2f90c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_structure_autofree> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a2f90c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_structure_autofree> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a2f90c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_structure_autofree, file '[/build_dir/own-linux-x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3 pycode = <code object test_structure_autofree, file '[/build_dir/own-linux-x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf504fc2c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00\xca\x00\x00\x01|\x01\x0...ba\x00\xcc\x18\x00|\x04\x00|\x02\x00\xc9\x04\x00\xca\x00\x00k\x02\x00s\xb7\x00t\x08\x00\x82\x01\x00n\x00\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf504fc2c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00\xca\x00\x00\x01|\x01\x0...ba\x00\xcc\x18\x00|\x04\x00|\x02\x00\xc9\x04\x00\xca\x00\x00k\x02\x00s\xb7\x00t\x08\x00\x82\x01\x00n\x00\x00d\x00\x00S' next_instr = 30L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf504fc2c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_structur...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1303]', line 1> at line 3 nameindex = 2, ignored = (30L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf506adcc> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf506adcc> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf506adcc> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _____________________ AppTestAutoFree.test_array_autofree ______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4956684>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_array_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_array_autofree'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a4332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69e04cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_array_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_array_autofree'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69e04cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_array_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_array_autofree'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_array_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf48efdc4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...y_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48c156c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48c156c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...y_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_array_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf48efcfc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...y_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48c15ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48c15ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...y_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_array_autofree'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_array_autofree'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_array_autofree'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_array_autofree'>, space = StdObjSpace target = <function test_array_autofree at 0xf43a0064> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a2f90c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a2f90c>,) w_func = <Function test_array_autofree> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a2f90c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_array_autofree> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a2f90c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_array_autofree> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4a2f90c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_array_autofree, file '[/build_dir/own-linux-x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3 pycode = <code object test_array_autofree, file '[/build_dir/own-linux-x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf504fc2c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00\xca\x00\x00\x01y\x10\x0...\xcb\x00\xcc\x18\x00|\x03\x00|\x02\x00\xc9\x03\x00\xca\x00\x00k\x02\x00s\xc8\x00t\t\x00\x82\x01\x00n\x00\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf504fc2c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00\xca\x00\x00\x01y\x10\x0...\xcb\x00\xcc\x18\x00|\x03\x00|\x02\x00\xc9\x03\x00\xca\x00\x00k\x02\x00s\xc8\x00t\t\x00\x82\x01\x00n\x00\x00d\x00\x00S' next_instr = 30L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf504fc2c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_array_au...x86-32/build/pypy/module/_rawffi/test/test__rawffi.py:1319]', line 1> at line 3 nameindex = 2, ignored = (30L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf506adcc> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf506adcc> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf506adcc> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/_rawffi/test/test__rawffi.py::AppTestAutoFree::()::test_structure_autofree FAIL module/_rawffi/test/test__rawffi.py::AppTestAutoFree::()::test_array_autofree =============== 2 failed, 78 passed, 3 skipped in 49.34 seconds ================ ++ 22:06:45 starting module/_socket/test [28 started in total] __ module/_sha/test [25 done in total, somefailed=False] ______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 6 items module/_sha/test/test_sha.py .s.... ===================== 5 passed, 1 skipped in 12.69 seconds ===================== ++ 22:06:52 starting module/_sre/test [29 started in total] __ module/_multiprocessing/test [26 done in total, somefailed=False] __________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 24 items module/_multiprocessing/test/test_connection.py ..sss...... module/_multiprocessing/test/test_interp_semaphore.py . module/_multiprocessing/test/test_memory.py .. module/_multiprocessing/test/test_semaphore.py ....... module/_multiprocessing/test/test_win32.py ss module/_multiprocessing/test/test_ztranslation.py . ==================== 19 passed, 5 skipped in 152.77 seconds ==================== ++ 22:07:29 starting module/_vmprof/test [30 started in total] __ module/_file/test [27 done in total, somefailed=True] ______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 269 items module/_file/test/test_file.py .................FF......sss...... module/_file/test/test_file_extra.py ..................................................................................................................................................................ss..............ss..............ss..............ss..................... module/_file/test/test_large_file.py .s =================================== FAILURES =================================== _____________________ AppTestFile.test_exception_from_del ______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf5b56534>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_exception_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_exception_from_del'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a1532c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69b24cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_exception_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_exception_from_del'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69b24cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_exception_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_exception_from_del'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_exception_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4f5d5a4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...n_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4c98d4c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4c98d4c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...n_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_exception_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4d6fe8c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...n_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4c9810c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4c9810c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...n_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_exception_from_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_exception_from_del'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_exception_from_del'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_exception_from_del'>, space = StdObjSpace target = <function test_exception_from_del at 0xf4c38304> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c>,) w_func = <Function test_exception_from_del> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_exception_from_del> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_exception_from_del> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_exception_from_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10 pycode = <code object test_exception_from_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5062bac> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00d\x01\x00...00\x00j\x05\x00\x83\x01\x00|\x06\x00\xc9\x0e\x00\xca\x00\x00k\x06\x00s\xfa\x00t\x0f\x00\x82\x01\x00n\x00\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5062bac> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00d\x01\x00...00\x00j\x05\x00\x83\x01\x00|\x06\x00\xc9\x0e\x00\xca\x00\x00k\x06\x00s\xfa\x00t\x0f\x00\x82\x01\x00n\x00\x00d\x00\x00S' next_instr = 130L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5062bac> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_exceptio...inux-x86-32/build/pypy/module/_file/test/test_file.py:255]', line 1> at line 10 nameindex = 10, ignored = (130L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf522eaac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf522eaac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf522eaac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _______________________ AppTestFile.test_track_resources _______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4c74a74>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a1532c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69b24cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69b24cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4aa3874> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f41d8c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f41d8c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4aa33ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4e60e6c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4e60e6c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_track_resources'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_track_resources'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_track_resources'>, space = StdObjSpace target = <function test_track_resources at 0xf48a4304> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c>,) w_func = <Function test_track_resources> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_track_resources> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_track_resources> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_track_resources, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] return new_frame.run() elif nargs >= 1 and fast_natural_arity == Code.PASSTHROUGHARGS1: assert isinstance(code, gateway.BuiltinCodePassThroughArguments1) return code.funcrun_obj(self, args_w[0], Arguments(self.space, list(args_w[1:]))) > return self.call_args(Arguments(self.space, list(args_w))) interpreter/function.py:124: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_track_resources> args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c>]) def call_args(self, args): # delegate activation to code > w_res = self.getcode().funcrun(self, args) interpreter/function.py:68: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <code object test_track_resources, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> func = <Function test_track_resources> args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf5080f4c>]) def funcrun(self, func, args): frame = self.space.createframe(self, func.w_func_globals, func) sig = self._signature # speed hack fresh_frame = jit.hint(frame, access_directly=True, fresh_virtualizable=True) args.parse_into_scope(None, fresh_frame.locals_cells_stack_w, func.name, sig, func.defs_w) fresh_frame.init_cells() > return frame.run() interpreter/pycode.py:223: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 pycode = <code object test_track_resources, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5062bac> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x01\x00d\x01\x00d\x00\x00l\x02\x00\x89\x03\x00d\x...xca\x02\x00s\xfd\x00t\x07\x00\x82\x01\x00\xcc\x12\x00d\t\x00|\x03\x00k\x07\x00s\x12\x01t\x07\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5062bac> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x01\x00d\x01\x00d\x00\x00l\x02\x00\x89\x03\x00d\x...xca\x02\x00s\xfd\x00t\x07\x00\x82\x01\x00\xcc\x12\x00d\t\x00|\x03\x00k\x07\x00s\x12\x01t\x07\x00\x82\x01\x00d\x00\x00S' next_instr = 118L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5062bac> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: > self.CALL_FUNCTION(oparg, next_instr) interpreter/pyopcode.py:268: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 oparg = 2, next_instr = 118L def CALL_FUNCTION(self, oparg, next_instr): # XXX start of hack for performance if (oparg >> 8) & 0xff == 0: # Only positional arguments nargs = oparg & 0xff w_function = self.peekvalue(nargs) > w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1) interpreter/pyopcode.py:1233: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function fn>, nargs = 2 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 dropvalues = 3, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function fn>, nargs = 2 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 dropvalues = 3, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) return self._flat_pycall(code, nargs, frame, dropvalues) elif fast_natural_arity & Code.FLATPYCALL: natural_arity = fast_natural_arity & 0xff if natural_arity > nargs >= natural_arity - len(self.defs_w): assert isinstance(code, PyCode) return self._flat_pycall_defaults(code, nargs, frame, > natural_arity - nargs, dropvalues) interpreter/function.py:180: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function fn> code = <code object fn, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> nargs = 2 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 1> at line 23 defs_to_load = 1, dropvalues = 3 @jit.unroll_safe def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) ndefs = len(self.defs_w) start = ndefs - defs_to_load i = nargs for j in xrange(start, ndefs): new_frame.locals_cells_stack_w[i] = self.defs_w[j] i += 1 frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16 pycode = <code object fn, file '[/build_dir/own-linux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5062bac> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16 co_code = '\x88\x03\x00\xc9\x00\x00|\x00\x00\xca\x01\x00\x01\x88\x02\x00\xc9\x01\x00\x88\x02\x00j\x02\x00d\x01\x00\xca\x02\x00}\...\x00|\x05\x00\x88\x03\x00_\x04\x00\x88\x03\x00\xc9\x00\x00t\x07\x00\xca\x01\x00\x01X|\x04\x00\xc9\x08\x00\xca\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5062bac> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16 co_code = '\x88\x03\x00\xc9\x00\x00|\x00\x00\xca\x01\x00\x01\x88\x02\x00\xc9\x01\x00\x88\x02\x00j\x02\x00d\x01\x00\xca\x02\x00}\...\x00|\x05\x00\x88\x03\x00_\x04\x00\x88\x03\x00\xc9\x00\x00t\x07\x00\xca\x01\x00\x01X|\x04\x00\xc9\x08\x00\xca\x00\x00S' next_instr = 108L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf5062bac> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...inux-x86-32/build/pypy/module/_file/test/test_file.py:273]', line 5> at line 16 nameindex = 6, ignored = (108L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf522eaac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf522eaac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf522eaac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/_file/test/test_file.py::AppTestFile::()::test_exception_from_del FAIL module/_file/test/test_file.py::AppTestFile::()::test_track_resources ============== 2 failed, 255 passed, 12 skipped in 257.46 seconds ============== ++ 22:07:33 starting module/_warnings/test [31 started in total] __ module/_warnings/test [28 done in total, somefailed=False] _________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 12 items module/_warnings/test/apptest_warnings.py ........... module/_warnings/test/test_warnings.py . ========================== 12 passed in 14.27 seconds ========================== ++ 22:07:50 starting module/_weakref/test [32 started in total] __ module/_sre/test [29 done in total, somefailed=False] ______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 139 items module/_sre/test/test_app_sre.py ..............................................s...................................s.s.............................. module/_sre/test/test_sre_buf.py ........................ ==================== 136 passed, 3 skipped in 54.11 seconds ==================== ++ 22:07:51 starting module/_winreg/test [33 started in total] __ module/_winreg/test [30 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 0 items / 1 skipped ========================== 1 skipped in 0.03 seconds =========================== ++ 22:07:52 starting module/array/test [34 started in total] __ module/_vmprof/test [31 done in total, somefailed=True] ____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 7 items module/_vmprof/test/test__vmprof.py F.... module/_vmprof/test/test_direct.py .. =================================== FAILURES =================================== _______________________ AppTestVMProf.test_import_vmprof _______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf5a39ed4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_import_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_import_vmprof'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8c32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a286cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_import_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_import_vmprof'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a286cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_import_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_import_vmprof'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_import_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4fb520c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ort_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf5079aac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf5079aac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ort_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_import_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4fb51bc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ort_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf5079a6c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf5079a6c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ort_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_import_vmprof'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_import_vmprof'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_import_vmprof'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_import_vmprof'>, space = StdObjSpace target = <function test_import_vmprof at 0xf4ffa80c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4feba8c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4feba8c>,) w_func = <Function test_import_vmprof> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4feba8c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_import_vmprof> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4feba8c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_import_vmprof> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4feba8c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_import_vmprof, file '[/build_dir/own-linux-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): # indirection for the optional arguments > return my_execute_frame(self, w_inputvalue, operr) module/_vmprof/interp_vmprof.py:20: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ args = (<pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51, None, None) unique_id = 180, x = <* DEAD Struct vmprof_stack_s { c_next, c_value, c_kind }> def decorated_function(*args): unique_id = get_code_fn(*args)._vmprof_unique_id unique_id = rffi.cast(lltype.Signed, unique_id) # ^^^ removes the "known non-negative" hint for annotation # # Signals can occur at the two places (1) and (2), that will # have added a stack entry, but the function __vmprof_eval_vmprof # is not entered. This behaviour will swallow one Python stack frame # # Current fix: vmprof will discard this sample. (happens # very infrequently) # if not jit.we_are_jitted(): x = enter_code(unique_id) # (1) signal here try: > return func(*args) ../rpython/rlib/rvmprof/rvmprof.py:240: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51 pycode = <code object test_import_vmprof, file '[/build_dir/own-linux-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf505610c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51 co_code = 'e\x00\x00|\x00\x00j\x01\x00d\x01\x00\x83\x02\x00}\x01\x00|\x01\x00\xc9\x02\x00\xca\x00\x00}\x02\x00e\x00\x00|\x00\x00...\x00s\x9e\x01t\r\x00\x82\x01\x00\xcc\x16\x00|\x0c\x00|\n\x00d\r\x00\x17k\x05\x00s\xb7\x01t\r\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf505610c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51 co_code = 'e\x00\x00|\x00\x00j\x01\x00d\x01\x00\x83\x02\x00}\x01\x00|\x01\x00\xc9\x02\x00\xca\x00\x00}\x02\x00e\x00\x00|\x00\x00...\x00s\x9e\x01t\r\x00\x82\x01\x00\xcc\x16\x00|\x0c\x00|\n\x00d\r\x00\x17k\x05\x00s\xb7\x01t\r\x00\x82\x01\x00d\x00\x00S' next_instr = 147L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf505610c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_import_v...-x86-32/build/pypy/module/_vmprof/test/test__vmprof.py:15]', line 1> at line 51 nameindex = 9, ignored = (147L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf51fda0c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf51fda0c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf51fda0c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/_vmprof/test/test__vmprof.py::AppTestVMProf::()::test_import_vmprof ===================== 1 failed, 6 passed in 22.20 seconds ====================== ++ 22:07:52 starting module/binascii/test [35 started in total] __ module/_socket/test [32 done in total, somefailed=True] ____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 60 items module/_socket/test/test_sock_app.py ...............................F...........s.....s......... module/_socket/test/test_ztranslation.py . =================================== FAILURES =================================== ______________________ AppTestSocket.test_track_resources ______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4d08d84>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79b532c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69524cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69524cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_track_resources'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4d06f54> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d1776c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d1776c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4daa52c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d1766c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d1766c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_track_resources'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_track_resources'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_track_resources'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_track_resources'>, space = StdObjSpace target = <function test_track_resources at 0xf4ceeca4> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d3ba0c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d3ba0c>,) w_func = <Function test_track_resources> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d3ba0c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_track_resources> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d3ba0c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_track_resources> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d3ba0c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_track_resources, file '[/build_dir/own-linux-x86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 pycode = <code object test_track_resources, file '[/build_dir/own-linux-x86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4dd284c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x02\x00d\x01\x00d\x00\x00l\x02\x00\x89\x03\x00d\x...t\x05\x00t\x07\x00\x83\x02\x00}\x03\x00\xcc\x12\x00|\x03\x00d\x03\x00k\x02\x00s\xed\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4dd284c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x02\x00d\x01\x00d\x00\x00l\x02\x00\x89\x03\x00d\x...t\x05\x00t\x07\x00\x83\x02\x00}\x03\x00\xcc\x12\x00|\x03\x00d\x03\x00k\x02\x00s\xed\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 102L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4dd284c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: > self.CALL_FUNCTION(oparg, next_instr) interpreter/pyopcode.py:268: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 oparg = 2, next_instr = 102L def CALL_FUNCTION(self, oparg, next_instr): # XXX start of hack for performance if (oparg >> 8) & 0xff == 0: # Only positional arguments nargs = oparg & 0xff w_function = self.peekvalue(nargs) > w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1) interpreter/pyopcode.py:1233: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function fn>, nargs = 2 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 dropvalues = 3, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function fn>, nargs = 2 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 dropvalues = 3, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) return self._flat_pycall(code, nargs, frame, dropvalues) elif fast_natural_arity & Code.FLATPYCALL: natural_arity = fast_natural_arity & 0xff if natural_arity > nargs >= natural_arity - len(self.defs_w): assert isinstance(code, PyCode) return self._flat_pycall_defaults(code, nargs, frame, > natural_arity - nargs, dropvalues) interpreter/function.py:180: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function fn> code = <code object fn, file '[/build_dir/own-linux-x86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> nargs = 2 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_track_re...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 1> at line 23 defs_to_load = 1, dropvalues = 3 @jit.unroll_safe def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) ndefs = len(self.defs_w) start = ndefs - defs_to_load i = nargs for j in xrange(start, ndefs): new_frame.locals_cells_stack_w[i] = self.defs_w[j] i += 1 frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16 pycode = <code object fn, file '[/build_dir/own-linux-x86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4dd284c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16 co_code = '\x88\x03\x00\xc9\x00\x00|\x00\x00\xca\x01\x00\x01\x88\x00\x00\xc9\x01\x00\x88\x00\x00j\x02\x00\x88\x00\x00j\x03\x00d\...00\x00|\x05\x00\x88\x03\x00_\x05\x00\x88\x03\x00\xc9\x00\x00t\x08\x00\xca\x01\x00\x01X|\x04\x00\xc9\t\x00\xca\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4dd284c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16 co_code = '\x88\x03\x00\xc9\x00\x00|\x00\x00\xca\x01\x00\x01\x88\x00\x00\xc9\x01\x00\x88\x00\x00j\x02\x00\x88\x00\x00j\x03\x00d\...00\x00|\x05\x00\x88\x03\x00_\x05\x00\x88\x03\x00\xc9\x00\x00t\x08\x00\xca\x01\x00\x01X|\x04\x00\xc9\t\x00\xca\x00\x00S' next_instr = 114L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4dd284c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object fn, file '[/b...86-32/build/pypy/module/_socket/test/test_sock_app.py:401]', line 5> at line 16 nameindex = 7, ignored = (114L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4dda9ac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4dda9ac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4dda9ac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/_socket/test/test_sock_app.py::AppTestSocket::()::test_track_resources =============== 1 failed, 57 passed, 2 skipped in 65.35 seconds ================ ++ 22:07:58 starting module/bz2/test [36 started in total] __ module/binascii/test [33 done in total, somefailed=False] __________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 14 items module/binascii/test/test_binascii.py .............. ========================== 14 passed in 7.68 seconds =========================== ++ 22:08:01 starting module/cStringIO/test [37 started in total] __ module/cStringIO/test [34 done in total, somefailed=False] _________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 16 items module/cStringIO/test/test_interp_stringio.py ............... module/cStringIO/test/test_ztranslation.py . ========================== 16 passed in 15.75 seconds ========================== ++ 22:08:18 starting module/cmath/test [38 started in total] __ module/_weakref/test [35 done in total, somefailed=True] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 42 items module/_weakref/test/test_weakref.py F..FFFF.FF..FFFFFFF.sF.......FF...FF...... =================================== FAILURES =================================== __________________________ AppTestWeakref.test_simple __________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf7677144>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_simple'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_simple'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_simple'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5172414> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf51c658c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf51c658c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5172284> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf51c652c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf51c652c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_simple'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_simple'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_simple'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_simple'>, space = StdObjSpace target = <function test_simple at 0xf51630d4> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_simple> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_simple> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_simple> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_simple, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12 pycode = <code object test_simple, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x07\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\xd7\x00t\x04\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x07\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\xd7\x00t\x04\x00\x82\x01\x00d\x00\x00S' next_instr = 187L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_simple, ...-x86-32/build/pypy/module/_weakref/test/test_weakref.py:7]', line 1> at line 12 nameindex = 7, ignored = (187L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _________________________ AppTestWeakref.test_callback _________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf5038454>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf51403c4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b2790c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b2790c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf511a0f4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b2792c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b2792c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_callback'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_callback'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_callback'>, space = StdObjSpace target = <function test_callback at 0xf4f9b41c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_callback> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_callback> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_callback> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_callback, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13 pycode = <code object test_callback, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...b3\x00t\x05\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x03\x00d\x00\x00k\x08\x00s\xcb\x00t\x05\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...b3\x00t\x05\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x03\x00d\x00\x00k\x08\x00s\xcb\x00t\x05\x00\x82\x01\x00d\x00\x00S' next_instr = 151L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:31]', line 1> at line 13 nameindex = 6, ignored = (151L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ______________________ AppTestWeakref.test_callback_order ______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4f9b4c4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_order'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_order'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_order'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf50100cc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...back_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf50e8c8c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf50e8c8c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...back_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf50107ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...back_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf50e8fac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf50e8fac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...back_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_order'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_callback_order'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_callback_order'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_callback_order'>, space = StdObjSpace target = <function test_callback_order at 0xf4ad517c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_callback_order> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_callback_order> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_callback_order> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_callback_order, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14 pycode = <code object test_callback_order, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x05\x00d\x06\x00k\x02\x00s\xa7\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x05\x00d\x06\x00k\x02\x00s\xa7\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 139L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:47]', line 1> at line 14 nameindex = 4, ignored = (139L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ______________ AppTestWeakref.test_dont_callback_if_weakref_dead _______________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4ad5c34>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>...call__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>...call__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>...call__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf508ef7c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...akref_dead'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4fef56c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4fef56c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...akref_dead'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4ec207c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...akref_dead'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4fef5cc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4fef5cc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...akref_dead'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_callback_if_weakref_dead'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_dont_callback_if_weakref_dead'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_dont_callback_if_weakref_dead'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_dont_callback_if_weakref_dead'>, space = StdObjSpace target = <function test_dont_callback_if_weakref_dead at 0xf505f10c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_dont_callback_if_weakref_dead> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_dont_callback_if_weakref_dead> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_dont_callback_if_weakref_dead> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_dont_callback_if_weakref_dead, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14 pycode = <code object test_dont_callback_if_weakref_dead, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x07\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x03\x00d\x04\x00k\x02\x00s\xfc\x00t\x05\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x07\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x03\x00d\x04\x00k\x02\x00s\xfc\x00t\x05\x00\x82\x01\x00d\x00\x00S' next_instr = 178L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_cal...x86-32/build/pypy/module/_weakref/test/test_weakref.py:63]', line 1> at line 14 nameindex = 7, ignored = (178L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ________________ AppTestWeakref.test_callback_cannot_ressurect _________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf505fcdc>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_cannot_ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_cannot_ressurect'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_cannot_ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_cannot_ressurect'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_cannot_ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_cannot_ressurect'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_cannot_ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4ee7c34> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f2c58c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f2c58c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_cannot_ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf501a824> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f2c6ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f2c6ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_cannot_ressurect'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_callback_cannot_ressurect'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_callback_cannot_ressurect'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_callback_cannot_ressurect'>, space = StdObjSpace target = <function test_callback_cannot_ressurect at 0xf505133c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_callback_cannot_ressurect> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_callback_cannot_ressurect> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_callback_cannot_ressurect> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_callback_cannot_ressurect, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13 pycode = <code object test_callback_cannot_ressurect, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x03\x00d\x00\x00k\x08\x00s\xa4\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00\x88\x00\x00j\x03\x00d\x00\x00k\x08\x00s\xa4\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 136L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...x86-32/build/pypy/module/_weakref/test/test_weakref.py:82]', line 1> at line 13 nameindex = 5, ignored = (136L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _____________ AppTestWeakref.test_correct_weakrefcount_after_death _____________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf5051dbc>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_correct_weakrefcount_after_deat...l__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_correct_weakrefcount_after_death'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_correct_weakrefcount_after_deat...l__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_correct_weakrefcount_after_death'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_correct_weakrefcount_after_deat...l__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_correct_weakrefcount_after_death'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_correct_weakrefcount_after_death'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf50e3284> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...fter_death'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b4578c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b4578c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...fter_death'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_correct_weakrefcount_after_death'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf50e3b44> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...fter_death'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b4596c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b4596c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...fter_death'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_correct_weakrefcount_after_death'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_correct_weakrefcount_after_death'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_correct_weakrefcount_after_death'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_correct_weakrefcount_after_death'> space = StdObjSpace target = <function test_correct_weakrefcount_after_death at 0xf506cbc4> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_correct_weakrefcount_after_death> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_correct_weakrefcount_after_death> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_correct_weakrefcount_after_death> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_correct_weakrefcount_after_death, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10 pycode = <code object test_correct_weakrefcount_after_death, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\x01\xcc\x1b\x00|\x01\x00\xc9\x04\x00|\x04\x00\xca\x01\x00d\x05\x00k\x02\x00s\xc9\x00t\x05\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\x01\xcc\x1b\x00|\x01\x00\xc9\x04\x00|\x04\x00\xca\x01\x00d\x05\x00k\x02\x00s\xc9\x00t\x05\x00\x82\x01\x00d\x00\x00S' next_instr = 124L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_correct_...86-32/build/pypy/module/_weakref/test/test_weakref.py:110]', line 1> at line 10 nameindex = 6, ignored = (124L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _____________________ AppTestWeakref.test_weakref_equality _____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf506ce2c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_equality'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_equality'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_equality'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5172284> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...f_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49b456c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49b456c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...f_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5172414> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...f_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49b464c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49b464c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...f_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_equality'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_weakref_equality'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_weakref_equality'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_weakref_equality'>, space = StdObjSpace target = <function test_weakref_equality at 0xf4a40c34> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_weakref_equality> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_weakref_equality> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_weakref_equality> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_weakref_equality, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17 pycode = <code object test_weakref_equality, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\x00k\x02\x00r_\x01t\x04\x00\x82\x01\x00\xcc\x12\x00|\x06\x00g\x00\x00k\x03\x00st\x01t\x04\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\x00k\x02\x00r_\x01t\x04\x00\x82\x01\x00\xcc\x12\x00|\x06\x00g\x00\x00k\x03\x00st\x01t\x04\x00\x82\x01\x00d\x00\x00S' next_instr = 187L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:125]', line 1> at line 17 nameindex = 5, ignored = (187L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _________________________ AppTestWeakref.test_hashing __________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4d95cdc>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_hashing'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_hashing'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_hashing'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4f46fa4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4c95e2c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4c95e2c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5140234> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4c956cc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4c956cc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_hashing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_hashing'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_hashing'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_hashing'>, space = StdObjSpace target = <function test_hashing at 0xf5047c34> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_hashing> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_hashing> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_hashing> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_hashing, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10 pycode = <code object test_hashing, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...ca\x01\x00}\x05\x00|\x02\x00\xc9\x06\x00\xca\x00\x00\x01t\x07\x00t\x08\x00t\x04\x00|\x05\x00\x83\x03\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...ca\x01\x00}\x05\x00|\x02\x00\xc9\x06\x00\xca\x00\x00\x01t\x07\x00t\x08\x00t\x04\x00|\x05\x00\x83\x03\x00\x01d\x00\x00S' next_instr = 112L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_hashing,...86-32/build/pypy/module/_weakref/test/test_weakref.py:171]', line 1> at line 10 nameindex = 6, ignored = (112L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ___________________ AppTestWeakref.test_weakref_subclassing ____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf5022c34>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclassing'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclassing'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclassing'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5021f7c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ubclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d8c74c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d8c74c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ubclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5021194> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ubclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d8c70c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d8c70c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ubclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclassing'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_weakref_subclassing'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_weakref_subclassing'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_weakref_subclassing'>, space = StdObjSpace target = <function test_weakref_subclassing at 0xf504b5dc> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_weakref_subclassing> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_weakref_subclassing> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_weakref_subclassing> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_weakref_subclassing, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22 pycode = <code object test_weakref_subclassing, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...sz\x01t\x06\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x04\x00d\x0b\x00k\x02\x00s\x92\x01t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...sz\x01t\x06\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x04\x00d\x0b\x00k\x02\x00s\x92\x01t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 302L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:186]', line 1> at line 22 nameindex = 9, ignored = (302L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ___________________ AppTestWeakref.test_function_weakrefable ___________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4a28aac>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_function_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_function_weakrefable'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_function_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_function_weakrefable'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_function_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_function_weakrefable'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_function_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf50e3b44> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4eb650c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4eb650c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_function_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf50e307c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4eb65ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4eb65ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_function_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_function_weakrefable'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_function_weakrefable'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_function_weakrefable'>, space = StdObjSpace target = <function test_function_weakrefable at 0xf505fbfc> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_function_weakrefable> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_function_weakrefable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_function_weakrefable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_function_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8 pycode = <code object test_function_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00\x84\x00\x00}\x03\x00|\x01\x00\xc9\x...00\xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00ss\x00t\x03\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00\x84\x00\x00}\x03\x00|\x01\x00\xc9\x...00\xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00ss\x00t\x03\x00\x82\x01\x00d\x00\x00S' next_instr = 87L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_function...x86-32/build/pypy/module/_weakref/test/test_weakref.py:213]', line 1> at line 8 nameindex = 4, ignored = (87L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ____________________ AppTestWeakref.test_method_weakrefable ____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4adad4c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_method_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_method_weakrefable'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_method_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_method_weakrefable'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_method_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_method_weakrefable'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_method_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5010784> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d57eac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d57eac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_method_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf49d4e14> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d577ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4d577ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_method_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_method_weakrefable'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_method_weakrefable'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_method_weakrefable'>, space = StdObjSpace target = <function test_method_weakrefable at 0xf4f1479c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_method_weakrefable> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_method_weakrefable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_method_weakrefable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_method_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14 pycode = <code object test_method_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...cb\x00t\x05\x00\x82\x01\x00\xcc\x15\x00|\x07\x00\x83\x00\x00d\x00\x00k\x08\x00s\xe3\x00t\x05\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...cb\x00t\x05\x00\x82\x01\x00\xcc\x15\x00|\x07\x00\x83\x00\x00d\x00\x00k\x08\x00s\xe3\x00t\x05\x00\x82\x01\x00d\x00\x00S' next_instr = 175L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_method_w...86-32/build/pypy/module/_weakref/test/test_weakref.py:223]', line 1> at line 14 nameindex = 6, ignored = (175L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _____________________ AppTestWeakref.test_set_weakrefable ______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf5047a04>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_set_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_set_weakrefable'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_set_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_set_weakrefable'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_set_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_set_weakrefable'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_set_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4a20c84> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf485a06c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf485a06c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_set_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4a20c34> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf485a38c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf485a38c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_set_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_set_weakrefable'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_set_weakrefable'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_set_weakrefable'>, space = StdObjSpace target = <function test_set_weakrefable at 0xf4ad517c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_set_weakrefable> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_set_weakrefable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_set_weakrefable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_set_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7 pycode = <code object test_set_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00t\x02\x00d\x02\x00d\x03\x00d\x04\x00d\x05\x00...00\xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00s|\x00t\x04\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00t\x02\x00d\x02\x00d\x03\x00d\x04\x00d\x05\x00...00\xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00|\x04\x00\x83\x00\x00d\x00\x00k\x08\x00s|\x00t\x04\x00\x82\x01\x00d\x00\x00S' next_instr = 96L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_set_weak...x86-32/build/pypy/module/_weakref/test/test_weakref.py:240]', line 1> at line 7 nameindex = 5, ignored = (96L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError __________________ AppTestWeakref.test_generator_weakrefable ___________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4ad5b8c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_generator_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_generator_weakrefable'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_generator_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_generator_weakrefable'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_generator_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_generator_weakrefable'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_generator_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5102c5c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49a510c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49a510c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_generator_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5102cfc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49a524c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49a524c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_generator_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_generator_weakrefable'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_generator_weakrefable'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_generator_weakrefable'>, space = StdObjSpace target = <function test_generator_weakrefable at 0xf4f14684> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_generator_weakrefable> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_generator_weakrefable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_generator_weakrefable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_generator_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13 pycode = <code object test_generator_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00\x84\x00\x00}\x03\x00|\x03\x00d\x03\...xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\x07\x01t\x04\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00\x84\x00\x00}\x03\x00|\x03\x00d\x03\...xc9\x05\x00\xca\x00\x00\x01\xcc\x15\x00|\x05\x00\x83\x00\x00d\x00\x00k\x08\x00s\x07\x01t\x04\x00\x82\x01\x00d\x00\x00S' next_instr = 138L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_generato...86-32/build/pypy/module/_weakref/test/test_weakref.py:249]', line 1> at line 13 nameindex = 5, ignored = (138L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ________________ AppTestWeakref.test_weakref_subclass_with_del _________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4f14764>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclass_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclass_with_del'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclass_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclass_with_del'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclass_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_weakref_subclass_with_del'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclass_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5021c0c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...s_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48dea6c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48dea6c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...s_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclass_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf5021cfc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...s_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48ded2c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf48ded2c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...s_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_weakref_subclass_with_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_weakref_subclass_with_del'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_weakref_subclass_with_del'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_weakref_subclass_with_del'>, space = StdObjSpace target = <function test_weakref_subclass_with_del at 0xf4fcbaac> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_weakref_subclass_with_del> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_weakref_subclass_with_del> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_weakref_subclass_with_del> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_weakref_subclass_with_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13 pycode = <code object test_weakref_subclass_with_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00|\x01\x00j\x02\x00f\x01\x00\x87\x00\...8\x00|\x05\x00\xca\x01\x00d\x08\x00\x19\x83\x00\x00|\x05\x00k\x08\x00s\xd3\x00t\x06\x00\x82\x01\x00n\x00\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00|\x01\x00j\x02\x00f\x01\x00\x87\x00\...8\x00|\x05\x00\xca\x01\x00d\x08\x00\x19\x83\x00\x00|\x05\x00k\x08\x00s\xd3\x00t\x06\x00\x82\x01\x00n\x00\x00d\x00\x00S' next_instr = 125L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_weakref_...86-32/build/pypy/module/_weakref/test/test_weakref.py:270]', line 1> at line 13 nameindex = 5, ignored = (125L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _____________________ AppTestWeakref.test_type_weakrefable _____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4fb3d84>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_type_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_type_weakrefable'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_type_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_type_weakrefable'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_type_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_type_weakrefable'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_type_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4eac6bc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49c76ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49c76ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_type_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4eac8ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49c71ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49c71ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...eakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_type_weakrefable'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_type_weakrefable'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_type_weakrefable'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_type_weakrefable'>, space = StdObjSpace target = <function test_type_weakrefable at 0xf4e1f1b4> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) w_func = <Function test_type_weakrefable> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_type_weakrefable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_type_weakrefable> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf51c604c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_type_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5 pycode = <code object test_type_weakrefable, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00t\x03\x00\xca\x01\x00}\x...3\x00\x00t\x03\x00k\x08\x00sa\x00t\x04\x00\x82\x01\x00d\x00\x00S\x03\x00k\x08\x00sa\x00t\x04\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00t\x03\x00\xca\x01\x00}\x...3\x00\x00t\x03\x00k\x08\x00sa\x00t\x04\x00\x82\x01\x00d\x00\x00S\x03\x00k\x08\x00sa\x00t\x04\x00\x82\x01\x00d\x00\x00S' next_instr = 69L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_type_wea...x86-32/build/pypy/module/_weakref/test/test_weakref.py:334]', line 1> at line 5 nameindex = 5, ignored = (69L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ____________________ AppTestProxy.test_proxy_to_dead_object ____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf5047a04>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_to_dead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_to_dead_object'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_to_dead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_to_dead_object'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_to_dead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_to_dead_object'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_to_dead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf67fad4c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4ded38c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4ded38c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_to_dead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4eac0a4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4ded2ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4ded2ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_to_dead_object'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_proxy_to_dead_object'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_proxy_to_dead_object'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_proxy_to_dead_object'>, space = StdObjSpace target = <function test_proxy_to_dead_object at 0xf4e1f144> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) w_func = <Function test_proxy_to_dead_object> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_proxy_to_dead_object> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_proxy_to_dead_object> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_proxy_to_dead_object, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6 pycode = <code object test_proxy_to_dead_object, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...83\x02\x00\x01d\x00\x00S\x00|\x02\x00\xc9\x04\x00\xca\x00\x00\x01t\x05\x00t\x06\x00d\x04\x00\x83\x02\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...83\x02\x00\x01d\x00\x00S\x00|\x02\x00\xc9\x04\x00\xca\x00\x00\x01t\x05\x00t\x06\x00d\x04\x00\x83\x02\x00\x01d\x00\x00S' next_instr = 70L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_to...x86-32/build/pypy/module/_weakref/test/test_weakref.py:407]', line 1> at line 6 nameindex = 4, ignored = (70L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ____________________ AppTestProxy.test_proxy_with_callback _____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4ec072c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_with_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_with_callback'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_with_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_with_callback'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_with_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_proxy_with_callback'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_with_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4cb6dc4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...h_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4ffd28c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4ffd28c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...h_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_with_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4cb6cfc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...h_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4ffd14c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4ffd14c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...h_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_proxy_with_callback'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_proxy_with_callback'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_proxy_with_callback'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_proxy_with_callback'>, space = StdObjSpace target = <function test_proxy_with_callback at 0xf4f61d84> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) w_func = <Function test_proxy_with_callback> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_proxy_with_callback> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_proxy_with_callback> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_proxy_with_callback, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9 pycode = <code object test_proxy_with_callback, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00d\x05\x00\x83\x02\x00\x01\xcc\x15\x00\x88\x00\x00j\x07\x00|\x05\x00k\x08\x00s\x8a\x00t\x08\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00d\x05\x00\x83\x02\x00\x01\xcc\x15\x00\x88\x00\x00j\x07\x00|\x05\x00k\x08\x00s\x8a\x00t\x08\x00\x82\x01\x00d\x00\x00S' next_instr = 97L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_proxy_wi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:415]', line 1> at line 9 nameindex = 4, ignored = (97L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ______________________ AppTestProxy.test_callback_raises _______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf5051f0c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_raises'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_raises'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_callback_raises'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4ee78c4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ack_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b7ebac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b7ebac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ack_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4ee7f2c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ack_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b7ebcc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4b7ebcc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ack_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_callback_raises'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_callback_raises'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_callback_raises'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_callback_raises'>, space = StdObjSpace target = <function test_callback_raises at 0xf4ad5304> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) w_func = <Function test_callback_raises> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_callback_raises> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_callback_raises> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_callback_raises, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10 pycode = <code object test_callback_raises, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x06\x00\x83\x00\x00d\x00\x00k\x08\x00sw\x00t\x05\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...00\xc9\x04\x00\xca\x00\x00\x01\xcc\x15\x00|\x06\x00\x83\x00\x00d\x00\x00k\x08\x00sw\x00t\x05\x00\x82\x01\x00d\x00\x00S' next_instr = 91L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_callback...86-32/build/pypy/module/_weakref/test/test_weakref.py:484]', line 1> at line 10 nameindex = 4, ignored = (91L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ----------------------------- Captured stderr call ----------------------------- Exception NameError: "global name 'explode' is not defined" in weakref callback <function callback at 0xf4873dac> ignored ____________________________ AppTestProxy.test_init ____________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4f55454>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a8732c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a244cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_init'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4df9cac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f8362c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f8362c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4df9be4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f83b4c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f83b4c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_init'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_init'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_init'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_init'>, space = StdObjSpace target = <function test_init at 0xf4ddaa04> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) w_func = <Function test_init> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_init> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_init> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f7be8c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_init, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8 pycode = <code object test_init, file '[/build_dir/own-linux-x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00t\x03\x00\xca\x01\x00}\x...0S\x06\x00d\x02\x00d\x02\x00d\x02\x00d\x02\x00d\x02\x00\x83\x07\x00\x01|\x02\x00\xc9\x07\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00|\x01\x00\xc9\x02\x00t\x03\x00\xca\x01\x00}\x...0S\x06\x00d\x02\x00d\x02\x00d\x02\x00d\x02\x00d\x02\x00\x83\x07\x00\x01|\x02\x00\xc9\x07\x00\xca\x00\x00\x01d\x00\x00S' next_instr = 76L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b19ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_init, fi...x86-32/build/pypy/module/_weakref/test/test_weakref.py:496]', line 1> at line 8 nameindex = 7, ignored = (76L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf53821ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf53821ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_simple FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_callback FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_callback_order FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_dont_callback_if_weakref_dead FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_callback_cannot_ressurect FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_correct_weakrefcount_after_death FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_weakref_equality FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_hashing FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_weakref_subclassing FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_function_weakrefable FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_method_weakrefable FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_set_weakrefable FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_generator_weakrefable FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_weakref_subclass_with_del FAIL module/_weakref/test/test_weakref.py::AppTestWeakref::()::test_type_weakrefable FAIL module/_weakref/test/test_weakref.py::AppTestProxy::()::test_proxy_to_dead_object FAIL module/_weakref/test/test_weakref.py::AppTestProxy::()::test_proxy_with_callback FAIL module/_weakref/test/test_weakref.py::AppTestProxy::()::test_callback_raises FAIL module/_weakref/test/test_weakref.py::AppTestProxy::()::test_init =============== 19 failed, 22 passed, 1 skipped in 27.47 seconds =============== ++ 22:08:22 starting module/cpyext/test/test_abstract.py [39 started in total] __ module/cmath/test [36 done in total, somefailed=False] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 15 items module/cmath/test/test_cmath.py ............... ========================== 15 passed in 6.28 seconds =========================== ++ 22:08:25 starting module/cpyext/test/test_api.py [40 started in total] __ module/array/test [37 done in total, somefailed=True] ______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 49 items module/array/test/test_array.py ....................................s..F........ module/array/test/test_ztranslation.py . =================================== FAILURES =================================== ________________________ AppTestArray.test_subclass_del ________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf425ed14>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_del'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79ec32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69894cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_del'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69894cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_del'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf420ae3c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...bclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41fa88c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41fa88c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...bclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf420ad24> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...bclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41fa92c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41fa92c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...bclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_subclass_del'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_subclass_del'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_subclass_del'>, space = StdObjSpace target = <function test_subclass_del at 0xf420eb54> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4ffaf6c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4ffaf6c>,) w_func = <Function test_subclass_del> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4ffaf6c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_subclass_del> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4ffaf6c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_subclass_del> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4ffaf6c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_subclass_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12 pycode = <code object test_subclass_del, file '[/build_dir/own-linux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf509ffec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00g\x00\x00...8\x00s\xcc\x00t\x07\x00\x88\x00\x00d\x07\x00\x19\x83\x01\x00d\x07\x00k\x02\x00s\xcc\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf509ffec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00g\x00\x00...8\x00s\xcc\x00t\x07\x00\x88\x00\x00d\x07\x00\x19\x83\x01\x00d\x07\x00k\x02\x00s\xcc\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 128L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf509ffec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...nux-x86-32/build/pypy/module/array/test/test_array.py:919]', line 1> at line 12 nameindex = 5, ignored = (128L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf5251aac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf5251aac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf5251aac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/array/test/test_array.py::AppTestArray::()::test_subclass_del =============== 1 failed, 47 passed, 1 skipped in 53.02 seconds ================ ++ 22:08:50 starting module/cpyext/test/test_arraymodule.py [41 started in total] __ module/cpyext/test/test_api.py [38 done in total, somefailed=False] ________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 4 items module/cpyext/test/test_api.py .... ========================== 4 passed in 30.99 seconds =========================== ++ 22:09:09 starting module/cpyext/test/test_boolobject.py [42 started in total] __ module/cpyext/test/test_abstract.py [39 done in total, somefailed=False] ___ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 7 items module/cpyext/test/test_abstract.py ....... ========================== 7 passed in 48.27 seconds =========================== ++ 22:09:21 starting module/cpyext/test/test_borrow.py [43 started in total] __ module/bz2/test [40 done in total, somefailed=False] _______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 52 items module/bz2/test/test_bz2_compdecomp.py ..s...........s... module/bz2/test/test_bz2_file.py ................................. module/bz2/test/test_large.py s ==================== 49 passed, 3 skipped in 92.41 seconds ===================== ++ 22:09:32 starting module/cpyext/test/test_bufferobject.py [44 started in total] __ module/cpyext/test/test_boolobject.py [41 done in total, somefailed=False] _ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 4 items module/cpyext/test/test_boolobject.py .... ========================== 4 passed in 40.96 seconds =========================== ++ 22:10:00 starting module/cpyext/test/test_bytearrayobject.py [45 started in total] __ module/cpyext/test/test_borrow.py [42 done in total, somefailed=False] _____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 3 items module/cpyext/test/test_borrow.py ... ========================== 3 passed in 43.65 seconds =========================== ++ 22:10:19 starting module/cpyext/test/test_bytesobject.py [46 started in total] __ module/cpyext/test/test_bufferobject.py [43 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 4 items module/cpyext/test/test_bufferobject.py .... ========================== 4 passed in 54.66 seconds =========================== ++ 22:10:38 starting module/cpyext/test/test_capsule.py [47 started in total] __ module/cpyext/test/test_arraymodule.py [44 done in total, somefailed=True] _ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 17 items module/cpyext/test/test_arraymodule.py ..........x.....F =================================== FAILURES =================================== _______________ AppTestArrayModule.test_subclass_with_attribute ________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf392eed4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_with_attribute'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a9032c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf4d9cbcc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_with_attribute'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf4d9cbcc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_subclass_with_attribute'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf36aa1e4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf362decc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf362decc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf36aa3ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf362de8c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf362de8c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_subclass_with_attribute'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_subclass_with_attribute'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_subclass_with_attribute'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_subclass_with_attribute'>, space = StdObjSpace target = <function test_subclass_with_attribute at 0xf35f4f0c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf48fbb0c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf48fbb0c>,) w_func = <Function test_subclass_with_attribute> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf48fbb0c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_subclass_with_attribute> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf48fbb0c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_subclass_with_attribute> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf48fbb0c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_subclass_with_attribute, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8 pycode = <code object test_subclass_with_attribute, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c9f3ac> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8 co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00\xca\x00\x01}\x01\x00d\x03\x00|\x01\x00j\x01\x00f\x01\x00d\x04\x00\x84\x00\x00...cc\x15\x00|\x02\x00j\x05\x00t\x06\x00k\x02\x00sh\x00t\x07\x00\x82\x01\x00d\x00\x00S\x00t\x07\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c9f3ac> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8 co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00\xca\x00\x01}\x01\x00d\x03\x00|\x01\x00j\x01\x00f\x01\x00d\x04\x00\x84\x00\x00...cc\x15\x00|\x02\x00j\x05\x00t\x06\x00k\x02\x00sh\x00t\x07\x00\x82\x01\x00d\x00\x00S\x00t\x07\x00\x82\x01\x00d\x00\x00S' next_instr = 76L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c9f3ac> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: > self.LOAD_ATTR(oparg, next_instr) interpreter/pyopcode.py:340: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_subclass...6-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> at line 8 nameindex = 4, next_instr = 76L @always_inline def LOAD_ATTR(self, nameindex, next_instr): "obj.attributename" w_obj = self.popvalue() if not jit.we_are_jitted(): from pypy.objspace.std.mapdict import LOAD_ATTR_caching > w_value = LOAD_ATTR_caching(self.getcode(), w_obj, nameindex) interpreter/pyopcode.py:977: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pycode = <code object test_subclass_with_attribute, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> w_obj = <pypy.module.gc.moduledef.Module object at 0xf4c6f5ac>, nameindex = 4 @objectmodel.always_inline def LOAD_ATTR_caching(pycode, w_obj, nameindex): # this whole mess is to make the interpreter quite a bit faster; it's not # used if we_are_jitted(). entry = pycode._mapdict_caches[nameindex] map = w_obj._get_mapdict_map() if entry.is_valid_for_map(map) and entry.w_method is None: # everything matches, it's incredibly fast attr = entry.attr_wref() if attr is not None: return attr._direct_read(w_obj) > return LOAD_ATTR_slowpath(pycode, w_obj, nameindex, map) objspace/std/mapdict.py:1420: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pycode = <code object test_subclass_with_attribute, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_arraymodule.py:192]', line 1> w_obj = <pypy.module.gc.moduledef.Module object at 0xf4c6f5ac>, nameindex = 4 map = None @objectmodel.dont_inline def LOAD_ATTR_slowpath(pycode, w_obj, nameindex, map): space = pycode.space w_name = pycode.co_names_w[nameindex] if map is not None: w_type = map.terminator.w_cls w_descr = w_type.getattribute_if_not_from_object() if w_descr is not None: return space._handle_getattribute(w_descr, w_obj, w_name) version_tag = w_type.version_tag() if version_tag is not None: name = space.text_w(w_name) # We need to care for obscure cases in which the w_descr is # a MutableCell, which may change without changing the version_tag _, w_descr = w_type._pure_lookup_where_with_method_cache( name, version_tag) # attrname, attrkind = ("", INVALID) if w_descr is None: attrname, attrkind = (name, DICT) # common case: no such attr in the class elif isinstance(w_descr, MutableCell): pass # we have a MutableCell in the class: give up elif space.is_data_descr(w_descr): # we have a data descriptor, which means the dictionary value # (if any) has no relevance. from pypy.interpreter.typedef import Member if isinstance(w_descr, Member): # it is a slot -- easy case attrname, attrkind = ("slot", SLOTS_STARTING_FROM + w_descr.index) elif not space.type(w_descr).is_heaptype(): # There is a non-data descriptor in the class. This would mean # we use the dict entry, however, the class of w_descr could be # changed to add a __get__/__set__ without the cache noticing, # so we can only use the cache if w_descr is an instance of an # immutable type. see # test_load_attr_bug_class_name_turns_into_descriptor attrname = name attrkind = DICT # if attrkind != INVALID: attr = map.find_map_attr(attrname, attrkind) if attr is not None: # Note that if map.terminator is a DevolvedDictTerminator # or the class provides its own dict, not using mapdict, then: # map.find_map_attr will always return None if attrkind==DICT. _fill_cache(pycode, nameindex, map, version_tag, attr, valid_for_store=w_type.setattr_if_not_from_object() is None) return attr._direct_read(w_obj) if space.config.objspace.std.withmethodcachecounter: INVALID_CACHE_ENTRY.failure_counter += 1 > return space.getattr(w_obj, w_name) objspace/std/mapdict.py:1471: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4c6f5ac> w_name = W_BytesObject('collect') def getattr(self, w_obj, w_name): # an optional shortcut for performance w_type = self.type(w_obj) w_descr = w_type.getattribute_if_not_from_object() if w_descr is not None: return self._handle_getattribute(w_descr, w_obj, w_name) # fast path: XXX this is duplicating most of the logic # from the default __getattribute__ and the getattr() method... name = self.text_w(w_name) w_descr = w_type.lookup(name) e = None if w_descr is not None: w_get = None is_data = self.is_data_descr(w_descr) if is_data: w_get = self.lookup(w_descr, "__get__") if w_get is None: w_value = w_obj.getdictvalue(self, name) if w_value is not None: return w_value if not is_data: w_get = self.lookup(w_descr, "__get__") if w_get is not None: # __get__ is allowed to raise an AttributeError to trigger # use of __getattr__. try: return self.get_and_call_function(w_get, w_descr, w_obj, w_type) except OperationError as e: if not e.match(self, self.w_AttributeError): raise else: return w_descr else: > w_value = w_obj.getdictvalue(self, name) objspace/std/objspace.py:655: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4c6f5ac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4c6f5ac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ----------------------------- Captured stderr call ----------------------------- <function _Py_InitPyPyModule at 0xf4f9fb8c> DONE <function PyType_Ready at 0xf4f0ca3c> DONE <function PyType_Ready at 0xf4f0ca3c> DONE <function check at 0xf4f9f994> DONE <function PyModule_GetDict at 0xf4f9fc6c> DONE <function PyDict_SetItemString at 0xf4ec34fc> DONE <function check at 0xf4f9f994> DONE <function PyModule_GetDict at 0xf4f9fc6c> DONE <function PyDict_SetItemString at 0xf4ec34fc> DONE <function check at 0xf4f9f994> DONE <function PyModule_GetDict at 0xf4f9fc6c> DONE <function PyDict_SetItemString at 0xf4ec34fc> DONE =========================== short test summary info ============================ FAIL module/cpyext/test/test_arraymodule.py::AppTestArrayModule::()::test_subclass_with_attribute =============== 1 failed, 15 passed, 1 xfailed in 106.97 seconds =============== ++ 22:10:46 starting module/cpyext/test/test_cell.py [48 started in total] __ module/cpyext/test/test_bytearrayobject.py [45 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 6 items module/cpyext/test/test_bytearrayobject.py ...... ========================== 6 passed in 47.64 seconds =========================== ++ 22:10:59 starting module/cpyext/test/test_classobject.py [49 started in total] __ module/cpyext/test/test_capsule.py [46 done in total, somefailed=True] _____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/cpyext/test/test_capsule.py F =================================== FAILURES =================================== ______________________ AppTestCapsule.test_capsule_import ______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4cf03ac>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_capsule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_capsule_import'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a9332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf4d9ed2c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_capsule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_capsule_import'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf4d9ed2c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_capsule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_capsule_import'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_capsule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4266f04> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4204d0c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4204d0c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_capsule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf41f65f4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4204d4c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4204d4c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_capsule_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_capsule_import'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_capsule_import'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_capsule_import'>, space = StdObjSpace target = <function test_capsule_import at 0xf41f825c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf48b9dac>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf48b9dac>,) w_func = <Function test_capsule_import> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf48b9dac> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_capsule_import> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf48b9dac>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_capsule_import> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf48b9dac>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_capsule_import, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24 pycode = <code object test_capsule_import, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c9534c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24 co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00d\x03\x00g\x02\x00\xca\x02\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x04\x00\xca\x01\...\xcc\x18\x00|\x01\x00\xc9\x07\x00\xca\x00\x00d\x04\x00k\x02\x00st\x00t\x04\x00\x82\x01\x00|\x01\x00`\x03\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c9534c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24 co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00d\x03\x00g\x02\x00\xca\x02\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x04\x00\xca\x01\...\xcc\x18\x00|\x01\x00\xc9\x07\x00\xca\x00\x00d\x04\x00k\x02\x00st\x00t\x04\x00\x82\x01\x00|\x01\x00`\x03\x00d\x00\x00S' next_instr = 85L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c9534c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_capsule_...ux-x86-32/build/pypy/module/cpyext/test/test_capsule.py:4]', line 1> at line 24 nameindex = 6, ignored = (85L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4ce450c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4ce450c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4ce450c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ----------------------------- Captured stderr call ----------------------------- <function _Py_InitPyPyModule at 0xf4fa2bc4> DONE <function PyLong_AsVoidPtr at 0xf4f1d09c> DONE <function PyErr_Occurred at 0xf4f8748c> DONE <function PyErr_Occurred at 0xf4f8748c> DONE <function PyImport_ImportModule at 0xf4f74ca4> DONE <function check at 0xf4fa29cc> DONE <function PyModule_GetDict at 0xf4fa2ca4> DONE <function PyDict_SetItemString at 0xf4f28534> DONE <function PyErr_Occurred at 0xf4f8748c> DONE <function PyString_FromStringAndSize at 0xf4efa48c> DONE <function PyString_AS_STRING at 0xf4efa764> DONE <function PyString_AS_STRING at 0xf4efa764> DONE <function _PyString_Resize at 0xf4efa924> <function bytes_dealloc at 0xf4efa3ac> DONE DONE =========================== short test summary info ============================ FAIL module/cpyext/test/test_capsule.py::AppTestCapsule::()::test_capsule_import ========================== 1 failed in 40.72 seconds =========================== ++ 22:11:29 starting module/cpyext/test/test_codecs.py [50 started in total] __ module/cpyext/test/test_cell.py [47 done in total, somefailed=False] _______ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/cpyext/test/test_cell.py . ========================== 1 passed in 41.07 seconds =========================== ++ 22:11:38 starting module/cpyext/test/test_complexobject.py [51 started in total] __ module/cpyext/test/test_bytesobject.py [48 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 25 items module/cpyext/test/test_bytesobject.py ......................... ========================== 25 passed in 70.28 seconds ========================== ++ 22:11:39 starting module/cpyext/test/test_cpyext.py [52 started in total] __ module/cpyext/test/test_classobject.py [49 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 5 items module/cpyext/test/test_classobject.py ..... ========================== 5 passed in 41.67 seconds =========================== ++ 22:11:50 starting module/cpyext/test/test_datetime.py [53 started in total] __ module/cpyext/test/test_codecs.py [50 done in total, somefailed=False] _____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 2 items module/cpyext/test/test_codecs.py .. ========================== 2 passed in 33.91 seconds =========================== ++ 22:12:13 starting module/cpyext/test/test_dictobject.py [54 started in total] __ module/cpyext/test/test_complexobject.py [51 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 5 items module/cpyext/test/test_complexobject.py ..... ========================== 5 passed in 45.58 seconds =========================== ++ 22:12:36 starting module/cpyext/test/test_eval.py [55 started in total] __ module/cpyext/test/test_datetime.py [52 done in total, somefailed=False] ___ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 14 items module/cpyext/test/test_datetime.py .............. ========================== 14 passed in 66.74 seconds ========================== ++ 22:13:10 starting module/cpyext/test/test_fileobject.py [56 started in total] __ module/cpyext/test/test_cpyext.py [53 done in total, somefailed=False] _____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 27 items module/cpyext/test/test_cpyext.py ...s.........s............. ==================== 25 passed, 2 skipped in 81.07 seconds ===================== ++ 22:13:14 starting module/cpyext/test/test_floatobject.py [57 started in total] __ module/cpyext/test/test_dictobject.py [54 done in total, somefailed=False] _ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 18 items module/cpyext/test/test_dictobject.py .................. ========================== 18 passed in 67.71 seconds ========================== ++ 22:13:33 starting module/cpyext/test/test_frameobject.py [58 started in total] __ module/cpyext/test/test_eval.py [55 done in total, somefailed=False] _______ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 19 items module/cpyext/test/test_eval.py ................... ========================== 19 passed in 63.64 seconds ========================== ++ 22:13:56 starting module/cpyext/test/test_funcobject.py [59 started in total] __ module/cpyext/test/test_fileobject.py [56 done in total, somefailed=False] _ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/cpyext/test/test_fileobject.py . ========================== 1 passed in 40.12 seconds =========================== ++ 22:14:01 starting module/cpyext/test/test_genobject.py [60 started in total] __ module/cpyext/test/test_floatobject.py [57 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 15 items module/cpyext/test/test_floatobject.py ............... ========================== 15 passed in 59.90 seconds ========================== ++ 22:14:27 starting module/cpyext/test/test_getargs.py [61 started in total] __ module/cpyext/test/test_frameobject.py [58 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 2 items module/cpyext/test/test_frameobject.py .. ========================== 2 passed in 43.07 seconds =========================== ++ 22:14:32 starting module/cpyext/test/test_import.py [62 started in total] __ module/cpyext/test/test_genobject.py [59 done in total, somefailed=False] __ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/cpyext/test/test_genobject.py . ========================== 1 passed in 33.64 seconds =========================== ++ 22:14:46 starting module/cpyext/test/test_intobject.py [63 started in total] __ module/cpyext/test/test_funcobject.py [60 done in total, somefailed=False] _ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 7 items module/cpyext/test/test_funcobject.py ....... ========================== 7 passed in 39.09 seconds =========================== ++ 22:14:47 starting module/cpyext/test/test_iterator.py [64 started in total] __ module/cpyext/test/test_import.py [61 done in total, somefailed=False] _____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 6 items module/cpyext/test/test_import.py ...... ========================== 6 passed in 46.91 seconds =========================== ++ 22:15:30 starting module/cpyext/test/test_listobject.py [65 started in total] __ module/cpyext/test/test_getargs.py [62 done in total, somefailed=False] ____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 11 items module/cpyext/test/test_getargs.py ........... ========================== 11 passed in 61.68 seconds ========================== ++ 22:15:40 starting module/cpyext/test/test_longobject.py [66 started in total] __ module/cpyext/test/test_iterator.py [63 done in total, somefailed=False] ___ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 5 items module/cpyext/test/test_iterator.py ....in sq_inplace_repeat, n=3 . ========================== 5 passed in 46.20 seconds =========================== ++ 22:15:46 starting module/cpyext/test/test_mapping.py [67 started in total] __ module/cpyext/test/test_intobject.py [64 done in total, somefailed=False] __ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 10 items module/cpyext/test/test_intobject.py .......... ========================== 10 passed in 50.98 seconds ========================== ++ 22:15:51 starting module/cpyext/test/test_marshal.py [68 started in total] __ module/cpyext/test/test_listobject.py [65 done in total, somefailed=False] _ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 12 items module/cpyext/test/test_listobject.py ............ ========================== 12 passed in 53.00 seconds ========================== ++ 22:16:36 starting module/cpyext/test/test_memoryobject.py [69 started in total] __ module/cpyext/test/test_mapping.py [66 done in total, somefailed=False] ____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 6 items module/cpyext/test/test_mapping.py ...... ========================== 6 passed in 42.51 seconds =========================== ++ 22:16:37 starting module/cpyext/test/test_methodobject.py [70 started in total] __ module/cpyext/test/test_marshal.py [67 done in total, somefailed=False] ____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 2 items module/cpyext/test/test_marshal.py .. ========================== 2 passed in 46.87 seconds =========================== ++ 22:16:50 starting module/cpyext/test/test_misc.py [71 started in total] __ module/cpyext/test/test_longobject.py [68 done in total, somefailed=False] _ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 20 items module/cpyext/test/test_longobject.py .................... ========================== 20 passed in 61.75 seconds ========================== ++ 22:16:52 starting module/cpyext/test/test_module.py [72 started in total] __ module/cpyext/test/test_module.py [69 done in total, somefailed=False] _____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 2 items module/cpyext/test/test_module.py .. ========================== 2 passed in 37.91 seconds =========================== ++ 22:17:44 starting module/cpyext/test/test_ndarrayobject.py [73 started in total] __ module/cpyext/test/test_misc.py [70 done in total, somefailed=False] _______ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/cpyext/test/test_misc.py . ========================== 1 passed in 43.03 seconds =========================== ++ 22:17:48 starting module/cpyext/test/test_number.py [74 started in total] __ module/cpyext/test/test_memoryobject.py [71 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 8 items module/cpyext/test/test_memoryobject.py .....s.. ===================== 7 passed, 1 skipped in 61.52 seconds ===================== ++ 22:17:49 starting module/cpyext/test/test_object.py [75 started in total] __ module/cpyext/test/test_methodobject.py [72 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 11 items module/cpyext/test/test_methodobject.py ........... ========================== 11 passed in 69.49 seconds ========================== ++ 22:17:57 starting module/cpyext/test/test_pycobject.py [76 started in total] __ module/cpyext/test/test_pycobject.py [73 done in total, somefailed=True] ___ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/cpyext/test/test_pycobject.py F =================================== FAILURES =================================== __________________ AppTestStringObject.test_pycobject_import ___________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf765d144>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_pycobject_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pycobject_import'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a6d32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf4d79bac>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_pycobject_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pycobject_import'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf4d79bac>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_pycobject_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_pycobject_import'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_pycobject_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4242f04> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ect_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41dfe0c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41dfe0c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ect_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_pycobject_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf41d35f4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ect_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41dfe4c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf41dfe4c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ect_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_pycobject_import'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_pycobject_import'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_pycobject_import'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_pycobject_import'>, space = StdObjSpace target = <function test_pycobject_import at 0xf41da10c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47c89ac>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47c89ac>,) w_func = <Function test_pycobject_import> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47c89ac> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_pycobject_import> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47c89ac>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_pycobject_import> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf47c89ac>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_pycobject_import, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24 pycode = <code object test_pycobject_import, file '[/build_dir/own-linux-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c6b2cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24 co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00d\x03\x00g\x02\x00\xca\x02\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x04\x00\xca\x01\...\xcc\x18\x00|\x01\x00\xc9\x07\x00\xca\x00\x00d\x04\x00k\x02\x00st\x00t\x04\x00\x82\x01\x00|\x01\x00`\x03\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c6b2cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24 co_code = '|\x00\x00\xc9\x00\x00d\x01\x00d\x02\x00d\x03\x00g\x02\x00\xca\x02\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x04\x00\xca\x01\...\xcc\x18\x00|\x01\x00\xc9\x07\x00\xca\x00\x00d\x04\x00k\x02\x00st\x00t\x04\x00\x82\x01\x00|\x01\x00`\x03\x00d\x00\x00S' next_instr = 85L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4c6b2cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_pycobjec...-x86-32/build/pypy/module/cpyext/test/test_pycobject.py:5]', line 1> at line 24 nameindex = 6, ignored = (85L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4cbe4ec> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4cbe4ec> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4cbe4ec> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ----------------------------- Captured stderr call ----------------------------- <function _Py_InitPyPyModule at 0xf4f7cb8c> DONE <function PyLong_AsVoidPtr at 0xf4ef7064> DONE <function PyErr_Occurred at 0xf4f61454> DONE <function PyErr_Occurred at 0xf4f61454> DONE <function PyImport_ImportModule at 0xf4f4ec6c> DONE <function check at 0xf4f7c994> DONE <function PyModule_GetDict at 0xf4f7cc6c> DONE <function PyDict_SetItemString at 0xf4f014fc> DONE <function PyErr_Occurred at 0xf4f61454> DONE =========================== short test summary info ============================ FAIL module/cpyext/test/test_pycobject.py::AppTestStringObject::()::test_pycobject_import ========================== 1 failed in 45.72 seconds =========================== ++ 22:18:56 starting module/cpyext/test/test_pyerrors.py [77 started in total] __ module/cpyext/test/test_ndarrayobject.py [74 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 24 items module/cpyext/test/test_ndarrayobject.py ........................ ========================== 24 passed in 62.46 seconds ========================== ++ 22:18:57 starting module/cpyext/test/test_pyfile.py [78 started in total] __ module/cpyext/test/test_number.py [75 done in total, somefailed=False] _____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 11 items module/cpyext/test/test_number.py ..........got no exc got no exc got exc . ========================== 11 passed in 56.28 seconds ========================== ++ 22:19:01 starting module/cpyext/test/test_pysignals.py [79 started in total] __ module/cpyext/test/test_object.py [76 done in total, somefailed=False] _____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 35 items module/cpyext/test/test_object.py ........................s.......... ==================== 34 passed, 1 skipped in 78.05 seconds ===================== ++ 22:19:16 starting module/cpyext/test/test_pystate.py [80 started in total] __ module/cpyext/test/test_pyfile.py [77 done in total, somefailed=False] _____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 9 items module/cpyext/test/test_pyfile.py ....x.... ===================== 8 passed, 1 xfailed in 47.28 seconds ===================== ++ 22:19:55 starting module/cpyext/test/test_pystrtod.py [81 started in total] __ module/cpyext/test/test_pysignals.py [78 done in total, somefailed=False] __ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/cpyext/test/test_pysignals.py . ========================== 1 passed in 43.03 seconds =========================== ++ 22:20:00 starting module/cpyext/test/test_sequence.py [82 started in total] __ module/cpyext/test/test_pyerrors.py [79 done in total, somefailed=False] ___ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 27 items module/cpyext/test/test_pyerrors.py .........s.....s........s.. ==================== 24 passed, 3 skipped in 84.61 seconds ===================== ++ 22:20:30 starting module/cpyext/test/test_setobject.py [83 started in total] __ module/cpyext/test/test_pystate.py [80 done in total, somefailed=False] ____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 13 items module/cpyext/test/test_pystate.py ............. ========================== 13 passed in 79.22 seconds ========================== ++ 22:20:51 starting module/cpyext/test/test_sliceobject.py [84 started in total] __ module/cpyext/test/test_pystrtod.py [81 done in total, somefailed=False] ___ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 18 items module/cpyext/test/test_pystrtod.py .................. ========================== 18 passed in 42.24 seconds ========================== ++ 22:20:54 starting module/cpyext/test/test_structseq.py [85 started in total] __ module/cpyext/test/test_sequence.py [82 done in total, somefailed=False] ___ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 23 items module/cpyext/test/test_sequence.py ....................... ========================== 23 passed in 62.74 seconds ========================== ++ 22:21:12 starting module/cpyext/test/test_sysmodule.py [86 started in total] __ module/cpyext/test/test_setobject.py [83 done in total, somefailed=False] __ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 9 items module/cpyext/test/test_setobject.py ......... ========================== 9 passed in 46.16 seconds =========================== ++ 22:21:29 starting module/cpyext/test/test_thread.py [87 started in total] __ module/cpyext/test/test_structseq.py [84 done in total, somefailed=False] __ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/cpyext/test/test_structseq.py . ========================== 1 passed in 44.18 seconds =========================== ++ 22:21:52 starting module/cpyext/test/test_traceback.py [88 started in total] __ module/cpyext/test/test_sliceobject.py [85 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 6 items module/cpyext/test/test_sliceobject.py ...... ========================== 6 passed in 49.64 seconds =========================== ++ 22:21:56 starting module/cpyext/test/test_translate.py [89 started in total] __ module/cpyext/test/test_sysmodule.py [86 done in total, somefailed=False] __ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 3 items module/cpyext/test/test_sysmodule.py ... ========================== 3 passed in 48.30 seconds =========================== ++ 22:22:11 starting module/cpyext/test/test_tupleobject.py [90 started in total] __ module/cpyext/test/test_translate.py [87 done in total, somefailed=False] __ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/cpyext/test/test_translate.py . =========================== 1 passed in 4.87 seconds =========================== ++ 22:22:11 starting module/cpyext/test/test_typeobject.py [91 started in total] __ module/cpyext/test/test_thread.py [88 done in total, somefailed=False] _____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 4 items module/cpyext/test/test_thread.py .... ========================== 4 passed in 59.43 seconds =========================== ++ 22:22:41 starting module/cpyext/test/test_unicodeobject.py [92 started in total] __ module/cpyext/test/test_traceback.py [89 done in total, somefailed=False] __ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/cpyext/test/test_traceback.py . ========================== 1 passed in 37.18 seconds =========================== ++ 22:22:43 starting module/cpyext/test/test_userslots.py [93 started in total] __ module/cpyext/test/test_tupleobject.py [90 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 10 items module/cpyext/test/test_tupleobject.py .......... ========================== 10 passed in 64.91 seconds ========================== ++ 22:23:31 starting module/cpyext/test/test_version.py [94 started in total] __ module/cpyext/test/test_userslots.py [91 done in total, somefailed=False] __ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 6 items module/cpyext/test/test_userslots.py ...... ========================== 6 passed in 59.56 seconds =========================== ++ 22:23:56 starting module/cpyext/test/test_weakref.py [95 started in total] __ module/cpyext/test/test_unicodeobject.py [92 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 47 items module/cpyext/test/test_unicodeobject.py .............................s................. ==================== 46 passed, 1 skipped in 81.32 seconds ===================== ++ 22:24:16 starting module/crypt/test [96 started in total] __ module/crypt/test [93 done in total, somefailed=False] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items module/crypt/test/test_crypt.py . =========================== 1 passed in 6.37 seconds =========================== ++ 22:24:24 starting module/errno/test [97 started in total] __ module/cpyext/test/test_version.py [94 done in total, somefailed=False] ____ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 3 items module/cpyext/test/test_version.py ... ========================== 3 passed in 43.27 seconds =========================== ++ 22:24:29 starting module/exceptions/test [98 started in total] __ module/errno/test [95 done in total, somefailed=False] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 3 items module/errno/test/test_errno.py ... =========================== 3 passed in 6.05 seconds =========================== ++ 22:24:31 starting module/faulthandler/test [99 started in total] __ module/faulthandler/test [96 done in total, somefailed=False] ______________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 3 items module/faulthandler/test/test_faulthander.py .. module/faulthandler/test/test_ztranslation.py . ========================== 3 passed in 11.23 seconds =========================== ++ 22:24:43 starting module/fcntl/test [100 started in total] __ module/exceptions/test [97 done in total, somefailed=False] ________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 24 items module/exceptions/test/test_exc.py ..........s............. ==================== 23 passed, 1 skipped in 13.76 seconds ===================== ++ 22:24:44 starting module/gc/test [101 started in total] __ module/gc/test [98 done in total, somefailed=True] _________________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 13 items / 2 errors module/gc/test/test_app_referents.py .... module/gc/test/test_referents.py ........ module/gc/test/test_ztranslation.py F ==================================== ERRORS ==================================== _______________ ERROR collecting pypy/module/gc/test/test_gc.py ________________ ../_pytest/python.py:611: in _importtestmodule mod = self.fspath.pyimport(ensuresyspath=importmode) ../py/_path/local.py:650: in pyimport __import__(modname) module/gc/test/test_gc.py:6: in <module> from pypy.module.gc.interp_gc import StepCollector, W_GcCollectStepStats module/gc/interp_gc.py:4: in <module> from pypy.module.gc.hook import W_GcCollectStepStats module/gc/hook.py:2: in <module> from rpython.memory.gc import incminimark ../rpython/memory/gc/incminimark.py:70: in <module> from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ______________ ERROR collecting pypy/module/gc/test/test_hook.py _______________ ../_pytest/python.py:611: in _importtestmodule mod = self.fspath.pyimport(ensuresyspath=importmode) ../py/_path/local.py:650: in pyimport __import__(modname) module/gc/test/test_hook.py:3: in <module> from pypy.module.gc.hook import LowLevelGcHooks module/gc/hook.py:2: in <module> from rpython.memory.gc import incminimark ../rpython/memory/gc/incminimark.py:70: in <module> from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details =================================== FAILURES =================================== _______________________________ test_checkmodule _______________________________ def test_checkmodule(): # we need to ignore GcCollectStepStats, else checkmodule fails. I think # this happens because W_GcCollectStepStats.__init__ is only called from # GcCollectStepHookAction.perform() and the fake objspace doesn't know # about those: so, perform() is never annotated and the annotator thinks # W_GcCollectStepStats has no attributes > checkmodule('gc', ignore=['GcCollectStepStats']) module/gc/test/test_ztranslation.py:9: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ objspace/fake/checkmodule.py:23: in checkmodule seeobj_w.append(module._load_lazily(space, name)) interpreter/mixedmodule.py:103: in _load_lazily w_value = loader(space) interpreter/mixedmodule.py:182: in ifileloader d[name] = __import__(pkgroot+'.'+name, None, None, [name]) module/gc/interp_gc.py:4: in <module> from pypy.module.gc.hook import W_GcCollectStepStats module/gc/hook.py:2: in <module> from rpython.memory.gc import incminimark _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/gc/test/test_ztranslation.py::test_checkmodule ================ 1 failed, 12 passed, 2 error in 10.52 seconds ================= ++ 22:24:56 starting module/imp/test [102 started in total] __ module/fcntl/test [99 done in total, somefailed=False] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 8 items module/fcntl/test/test_fcntl.py ........ ========================== 8 passed in 15.16 seconds =========================== ++ 22:25:01 starting module/itertools/test [103 started in total] __ module/cpyext/test/test_weakref.py [100 done in total, somefailed=False] ___ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 5 items module/cpyext/test/test_weakref.py ..... ========================== 5 passed in 48.81 seconds =========================== ++ 22:25:02 starting module/marshal/test [104 started in total] __ module/marshal/test [101 done in total, somefailed=False] __________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 80 items module/marshal/test/test_marshal.py ................................................................... module/marshal/test/test_marshalimpl.py ............. ========================== 80 passed in 24.44 seconds ========================== ++ 22:25:30 starting module/math/test [105 started in total] __ module/math/test [102 done in total, somefailed=False] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 182 items module/math/test/test_direct.py ...................................................................................................................................................................... module/math/test/test_factorial.py .s module/math/test/test_math.py ..s......s.... ==================== 179 passed, 3 skipped in 16.53 seconds ==================== ++ 22:25:50 starting module/micronumpy/test [106 started in total] __ module/itertools/test [103 done in total, somefailed=True] _________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 73 items module/itertools/test/test_itertools.py .................F...................................................... module/itertools/test/test_ztranslation.py . =================================== FAILURES =================================== _________________________ AppTestItertools.test_islice _________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4f77f0c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_islice'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a6432c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a014cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_islice'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a014cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_islice'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf503d1bc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f8480c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f8480c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4fde504> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f84fac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4f84fac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...est_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_islice'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_islice'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_islice'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_islice'>, space = StdObjSpace target = <function test_islice at 0xf4f77374> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf50ec08c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf50ec08c>,) w_func = <Function test_islice> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf50ec08c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_islice> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf50ec08c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_islice> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf50ec08c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_islice, file '[/build_dir/own-linux-x86-32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52 pycode = <code object test_islice, file '[/build_dir/own-linux-x86-32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> next_instr = 549 ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf510168c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00g\x00\x00d\x02\x00\xca\x02\x00}\x02\x00t\x02\x00t\x03\x00|\x...0d\x00\x00k\x08\x00s\xcf\x03t\x05\x00\x82\x01\x00t\x02\x00t\x03\x00t\x04\x00|\x02\x00\x83\x03\x00\x01qH\x03Wd\x00\x00S' next_instr = 549 ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf510168c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00g\x00\x00d\x02\x00\xca\x02\x00}\x02\x00t\x02\x00t\x03\x00|\x...0d\x00\x00k\x08\x00s\xcf\x03t\x05\x00\x82\x01\x00t\x02\x00t\x03\x00t\x04\x00|\x02\x00\x83\x03\x00\x01qH\x03Wd\x00\x00S' next_instr = 947L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf510168c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_islice, ...32/build/pypy/module/itertools/test/test_itertools.py:204]', line 1> at line 52 nameindex = 12, ignored = (947L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf531ddac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf531ddac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf531ddac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/itertools/test/test_itertools.py::AppTestItertools::()::test_islice ===================== 1 failed, 72 passed in 50.62 seconds ===================== ++ 22:25:59 starting module/mmap/test [107 started in total] __ module/mmap/test [104 done in total, somefailed=False] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 43 items module/mmap/test/test_mmap.py ......................s..............ss.... ==================== 40 passed, 3 skipped in 40.42 seconds ===================== ++ 22:26:43 starting module/operator/test [108 started in total] __ module/operator/test [105 done in total, somefailed=False] _________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 27 items module/operator/test/test_operator.py .................. module/operator/test/test_tscmp.py ......... ========================== 27 passed in 10.38 seconds ========================== ++ 22:26:55 starting module/parser/test [109 started in total] __ module/parser/test [106 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 7 items module/parser/test/test_parser.py ....... =========================== 7 passed in 7.68 seconds =========================== ++ 22:27:06 starting module/posix/test [110 started in total] __ module/imp/test [107 done in total, somefailed=False] ______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 124 items module/imp/test/test_app.py ................ module/imp/test/test_import.py ..............................s.........................................................s................... =================== 122 passed, 2 skipped in 162.50 seconds ==================== ++ 22:27:43 starting module/pwd/test [111 started in total] __ module/pwd/test [108 done in total, somefailed=False] ______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 4 items module/pwd/test/test_pwd.py ... module/pwd/test/test_ztranslation.py . ========================== 4 passed in 17.74 seconds =========================== ++ 22:28:03 starting module/pyexpat/test [112 started in total] __ module/pyexpat/test [109 done in total, somefailed=False] __________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 21 items module/pyexpat/test/test_build.py . module/pyexpat/test/test_parser.py .................... ========================== 21 passed in 94.87 seconds ========================== ++ 22:29:45 starting module/pypyjit/test [113 started in total] __ module/posix/test [110 done in total, somefailed=True] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 108 items module/posix/test/test_posix2.py .............................FFF...............................s...........s.........s................s module/posix/test/test_posix_libfile.py ..FF module/posix/test/test_ztranslation.py . =================================== FAILURES =================================== ___________________________ AppTestPosix.test_popen ____________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4be4ca4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79de32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf697b4cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf697b4cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4a5970c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a000ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a000ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf493b7fc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a00b2c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4a00b2c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_popen'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_popen'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_popen'>, space = StdObjSpace target = <function test_popen at 0xf4a0e924> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>,) w_func = <Function test_popen> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_popen> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_popen> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_popen, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 pycode = <code object test_popen, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 co_code = '|\x00\x00j\x00\x00}\x01\x00x_\x00t\x01\x00d\x01\x00\x83\x01\x00D]Q\x00}\x02\x00|\x01\x00\xc9\x02\x00d\x02\x00\xca\x01...|\x03\x00\xc9\x05\x00\xca\x00\x00d\x00\x00k\x08\x00sg\x00t\x04\x00\x82\x01\x00q\x16\x00Wd\x00\x00Sq\x16\x00Wd\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 co_code = '|\x00\x00j\x00\x00}\x01\x00x_\x00t\x01\x00d\x01\x00\x83\x01\x00D]Q\x00}\x02\x00|\x01\x00\xc9\x02\x00d\x02\x00\xca\x01...|\x03\x00\xc9\x05\x00\xca\x00\x00d\x00\x00k\x08\x00sg\x00t\x04\x00\x82\x01\x00q\x16\x00Wd\x00\x00Sq\x16\x00Wd\x00\x00S' next_instr = 40L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 oparg = 1, ignored = (40L,), n_args = 1, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <BuiltinFunction popen>, nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 dropvalues = 3, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <BuiltinFunction popen>, nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 dropvalues = 3, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) return self._flat_pycall(code, nargs, frame, dropvalues) elif fast_natural_arity & Code.FLATPYCALL: natural_arity = fast_natural_arity & 0xff if natural_arity > nargs >= natural_arity - len(self.defs_w): assert isinstance(code, PyCode) return self._flat_pycall_defaults(code, nargs, frame, > natural_arity - nargs, dropvalues) interpreter/function.py:180: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <BuiltinFunction popen> code = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:494]', line 1> at line 4 defs_to_load = 2, dropvalues = 3 @jit.unroll_safe def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) ndefs = len(self.defs_w) start = ndefs - defs_to_load i = nargs for j in xrange(start, ndefs): new_frame.locals_cells_stack_w[i] = self.defs_w[j] i += 1 frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 pycode = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S' next_instr = 115L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 nameindex = 5, ignored = (115L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf515dd2c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf515dd2c> space = StdObjSpace, name = 'disable_finalizers' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf515dd2c> space = StdObjSpace, name = 'disable_finalizers' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _________________________ AppTestPosix.test_popen_with _________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4956a74>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_with'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79de32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf697b4cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_with'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf697b4cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_with'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf48c9d74> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf440f88c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf440f88c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf48c9374> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf440f7ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf440f7ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_with'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_popen_with'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_popen_with'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_popen_with'>, space = StdObjSpace target = <function test_popen_with at 0xf45e17d4> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>,) w_func = <Function test_popen_with> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_popen_with> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_popen_with> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_popen_with, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 pycode = <code object test_popen_with, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 co_code = '|\x00\x00j\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x01\x00\xca\x01\x00}\x02\x00|\x02\x00\x8f(\x00}\x03\x00|\x03\x00\xc9\x02\x00\xca\x00\x00}\x04\x00\xcc\x12\x00|\x04\x00d\x02\x00k\x02\x00sB\x00t\x03\x00\x82\x01\x00Wd\x00\x00QXd\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 co_code = '|\x00\x00j\x00\x00}\x01\x00|\x01\x00\xc9\x01\x00d\x01\x00\xca\x01\x00}\x02\x00|\x02\x00\x8f(\x00}\x03\x00|\x03\x00\xc9\x02\x00\xca\x00\x00}\x04\x00\xcc\x12\x00|\x04\x00d\x02\x00k\x02\x00sB\x00t\x03\x00\x82\x01\x00Wd\x00\x00QXd\x00\x00S' next_instr = 21L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 oparg = 1, ignored = (21L,), n_args = 1, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <BuiltinFunction popen>, nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 dropvalues = 3, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <BuiltinFunction popen>, nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 dropvalues = 3, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) return self._flat_pycall(code, nargs, frame, dropvalues) elif fast_natural_arity & Code.FLATPYCALL: natural_arity = fast_natural_arity & 0xff if natural_arity > nargs >= natural_arity - len(self.defs_w): assert isinstance(code, PyCode) return self._flat_pycall_defaults(code, nargs, frame, > natural_arity - nargs, dropvalues) interpreter/function.py:180: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <BuiltinFunction popen> code = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_wi...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:502]', line 1> at line 3 defs_to_load = 2, dropvalues = 3 @jit.unroll_safe def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) ndefs = len(self.defs_w) start = ndefs - defs_to_load i = nargs for j in xrange(start, ndefs): new_frame.locals_cells_stack_w[i] = self.defs_w[j] i += 1 frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 pycode = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S' next_instr = 115L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 nameindex = 5, ignored = (115L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf515dd2c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf515dd2c> space = StdObjSpace, name = 'disable_finalizers' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf515dd2c> space = StdObjSpace, name = 'disable_finalizers' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ______________________ AppTestPosix.test_popen_child_fds _______________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf489bf7c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_child_fds'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79de32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf697b4cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_child_fds'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf697b4cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_child_fds'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf498c8ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4399d2c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4399d2c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf427b57c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4399aec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf4399aec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_child_fds'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_popen_child_fds'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_popen_child_fds'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_popen_child_fds'>, space = StdObjSpace target = <function test_popen_child_fds at 0xf48248b4> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>,) w_func = <Function test_popen_child_fds> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_popen_child_fds> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_popen_child_fds> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4f1832c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_popen_child_fds, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 pycode = <code object test_popen_child_fds, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 co_code = '|\x00\x00j\x00\x00}\x01\x00t\x01\x00d\x01\x00\xc9\x02\x00|\x00\x00j\x03\x00d\x02\x00g\x02\x00\xca\x01\x00d\x03\x00\x8...\x01\x00n\x15\x00\xcc\x12\x00|\x04\x00d\x07\x00k\x02\x00s\x9d\x00t\t\x00\x82\x01\x00Wd\x00\x00QXWd\x00\x00QXd\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 co_code = '|\x00\x00j\x00\x00}\x01\x00t\x01\x00d\x01\x00\xc9\x02\x00|\x00\x00j\x03\x00d\x02\x00g\x02\x00\xca\x01\x00d\x03\x00\x8...\x01\x00n\x15\x00\xcc\x12\x00|\x04\x00d\x07\x00k\x02\x00s\x9d\x00t\t\x00\x82\x01\x00Wd\x00\x00QXWd\x00\x00QXd\x00\x00S' next_instr = 79L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 oparg = 1, ignored = (79L,), n_args = 1, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <BuiltinFunction popen>, nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 dropvalues = 3, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <BuiltinFunction popen>, nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 dropvalues = 3, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) return self._flat_pycall(code, nargs, frame, dropvalues) elif fast_natural_arity & Code.FLATPYCALL: natural_arity = fast_natural_arity & 0xff if natural_arity > nargs >= natural_arity - len(self.defs_w): assert isinstance(code, PyCode) return self._flat_pycall_defaults(code, nargs, frame, > natural_arity - nargs, dropvalues) interpreter/function.py:180: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <BuiltinFunction popen> code = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_ch...nux-x86-32/build/pypy/module/posix/test/test_posix2.py:509]', line 1> at line 4 defs_to_load = 2, dropvalues = 3 @jit.unroll_safe def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) ndefs = len(self.defs_w) start = ndefs - defs_to_load i = nargs for j in xrange(start, ndefs): new_frame.locals_cells_stack_w[i] = self.defs_w[j] i += 1 frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 pycode = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S' next_instr = 115L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4f3d92c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 nameindex = 5, ignored = (115L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf515dd2c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf515dd2c> space = StdObjSpace, name = 'disable_finalizers' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf515dd2c> space = StdObjSpace, name = 'disable_finalizers' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ___________________________ AppTestPosix.test_popen ____________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf41a5764>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79de32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf697b4cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf697b4cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4595f54> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf482ed6c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf482ed6c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4595f7c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf478b9ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf478b9ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_popen'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_popen'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_popen'>, space = StdObjSpace target = <function test_popen at 0xf45d98ec> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf416472c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf416472c>,) w_func = <Function test_popen> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf416472c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_popen> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf416472c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_popen> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf416472c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_popen, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 pycode = <code object test_popen, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00j\x01\x00\xc9\x02\x00d\x02\x00\xca\x01\x00r+\x00t\x03\x00d\x03\x00\x83\x...c9\x0c\x00\xca\x00\x00}\x08\x00\xcc\x16\x00|\x08\x00|\x07\x00\x18d\x0c\x00k\x05\x00s;\x01t\t\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00j\x01\x00\xc9\x02\x00d\x02\x00\xca\x01\x00r+\x00t\x03\x00d\x03\x00\x83\x...c9\x0c\x00\xca\x00\x00}\x08\x00\xcc\x16\x00|\x08\x00|\x07\x00\x18d\x0c\x00k\x05\x00s;\x01t\t\x00\x82\x01\x00d\x00\x00S' next_instr = 77L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 oparg = 1, ignored = (77L,), n_args = 1, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <BuiltinFunction popen>, nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 dropvalues = 3, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <BuiltinFunction popen>, nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 dropvalues = 3, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) return self._flat_pycall(code, nargs, frame, dropvalues) elif fast_natural_arity & Code.FLATPYCALL: natural_arity = fast_natural_arity & 0xff if natural_arity > nargs >= natural_arity - len(self.defs_w): assert isinstance(code, PyCode) return self._flat_pycall_defaults(code, nargs, frame, > natural_arity - nargs, dropvalues) interpreter/function.py:180: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <BuiltinFunction popen> code = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen, f...6-32/build/pypy/module/posix/test/test_posix_libfile.py:32]', line 1> at line 8 defs_to_load = 2, dropvalues = 3 @jit.unroll_safe def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) ndefs = len(self.defs_w) start = ndefs - defs_to_load i = nargs for j in xrange(start, ndefs): new_frame.locals_cells_stack_w[i] = self.defs_w[j] i += 1 frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 pycode = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S' next_instr = 115L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 nameindex = 5, ignored = (115L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4274c4c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4274c4c> space = StdObjSpace, name = 'disable_finalizers' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4274c4c> space = StdObjSpace, name = 'disable_finalizers' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ____________ AppTestPosix.test_popen_and_rebind_file_in___builtin__ ____________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf41a1c6c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___buil...: <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79de32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf697b4cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___buil...: <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf697b4cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___buil...: <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf453fa54> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._builtin__'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf452340c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf452340c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._builtin__'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf453f9b4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._builtin__'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf452350c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf452350c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._builtin__'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_popen_and_rebind_file_in___builtin__'> space = StdObjSpace target = <function test_popen_and_rebind_file_in___builtin__ at 0xf434b9cc> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf416472c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf416472c>,) w_func = <Function test_popen_and_rebind_file_in___builtin__> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf416472c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace w_func = <Function test_popen_and_rebind_file_in___builtin__> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf416472c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_popen_and_rebind_file_in___builtin__> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf416472c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_popen_and_rebind_file_in___builtin__, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 pycode = <code object test_popen_and_rebind_file_in___builtin__, file '[/build_dir/own-linux-x86-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00j\x01\x00\xc9\x02\x00d\x02\x00\xca\x01\x00r+\x00t\x03\x00d\x03\x00\x83\x...x00\x84\x00\x00|\x02\x00_\x06\x00|\x05\x00\xc9\x08\x00\xca\x00\x00\x01Wd\x00\x00|\x04\x00|\x02\x00_\x06\x00Xd\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00|\x01\x00j\x01\x00\xc9\x02\x00d\x02\x00\xca\x01\x00r+\x00t\x03\x00d\x03\x00\x83\x...x00\x84\x00\x00|\x02\x00_\x06\x00|\x05\x00\xc9\x08\x00\xca\x00\x00\x01Wd\x00\x00|\x04\x00|\x02\x00_\x06\x00Xd\x00\x00S' next_instr = 85L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: > self.CALL_METHOD(oparg, next_instr) interpreter/pyopcode.py:276: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 oparg = 1, ignored = (85L,), n_args = 1, n_kwargs = 0, w_self = None @jit.unroll_safe def CALL_METHOD(f, oparg, *ignored): # opargs contains the arg, and kwarg count, excluding the implicit 'self' n_args = oparg & 0xff n_kwargs = (oparg >> 8) & 0xff w_self = f.peekvalue_maybe_none(n_args + (2 * n_kwargs)) n = n_args + (w_self is not None) if not n_kwargs: w_callable = f.peekvalue(n_args + (2 * n_kwargs) + 1) w_result = f.space.call_valuestack( > w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args + 2) objspace/std/callmethod.py:96: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <BuiltinFunction popen>, nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 dropvalues = 3, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <BuiltinFunction popen>, nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 dropvalues = 3, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) return self._flat_pycall(code, nargs, frame, dropvalues) elif fast_natural_arity & Code.FLATPYCALL: natural_arity = fast_natural_arity & 0xff if natural_arity > nargs >= natural_arity - len(self.defs_w): assert isinstance(code, PyCode) return self._flat_pycall_defaults(code, nargs, frame, > natural_arity - nargs, dropvalues) interpreter/function.py:180: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <BuiltinFunction popen> code = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> nargs = 1 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_popen_an...-32/build/pypy/module/posix/test/test_posix_libfile.py:59]', line 1> at line 10 defs_to_load = 2, dropvalues = 3 @jit.unroll_safe def _flat_pycall_defaults(self, code, nargs, frame, defs_to_load, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) ndefs = len(self.defs_w) start = ndefs - defs_to_load i = nargs for j in xrange(start, ndefs): new_frame.locals_cells_stack_w[i] = self.defs_w[j] i += 1 frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:218: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 pycode = <code object popen, file '/build_dir/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 co_code = 'd\x01\x00d\x02\x00l\x00\x00\x89\x00\x00d\x01\x00d\x02\x00l\x01\x00}\x03\x00\x87\x00\x00f\x01\x00d\x03\x00\x86\x00\x00...1\x01}\x0b\x00\x01|\x04\x00|\x06\x00\x83\x01\x00\x01|\x04\x00|\x05\x00\x83\x01\x00\x01|\x0b\x00\x82\x01\x00Xd\x02\x00S' next_instr = 115L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45b2d8c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object popen, file '...r/own-linux-x86-32/build/pypy/module/posix/app_posix.py', line 155> at line 173 nameindex = 5, ignored = (115L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4274c4c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4274c4c> space = StdObjSpace, name = 'disable_finalizers' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4274c4c> space = StdObjSpace, name = 'disable_finalizers' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/posix/test/test_posix2.py::AppTestPosix::()::test_popen FAIL module/posix/test/test_posix2.py::AppTestPosix::()::test_popen_with FAIL module/posix/test/test_posix2.py::AppTestPosix::()::test_popen_child_fds FAIL module/posix/test/test_posix_libfile.py::AppTestPosix::()::test_popen FAIL module/posix/test/test_posix_libfile.py::AppTestPosix::()::test_popen_and_rebind_file_in___builtin__ =============== 5 failed, 99 passed, 4 skipped in 164.90 seconds =============== ++ 22:29:52 starting module/select/test [114 started in total] __ module/pypyjit/test [111 done in total, somefailed=False] __________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 29 items module/pypyjit/test/test_jit_hook.py ........s module/pypyjit/test/test_jit_not_in_trace.py .. module/pypyjit/test/test_jit_setup.py .... module/pypyjit/test/test_policy.py ............ module/pypyjit/test/test_pyframe.py . module/pypyjit/test/test_ztranslation.py . ==================== 28 passed, 1 skipped in 26.42 seconds ===================== ++ 22:30:13 starting module/signal/test [115 started in total] __ module/cpyext/test/test_typeobject.py [112 done in total, somefailed=False] ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 68 items module/cpyext/test/test_typeobject.py ...............s................................................s... ==================== 66 passed, 2 skipped in 518.08 seconds ==================== ++ 22:31:05 starting module/struct/test [116 started in total] __ module/select/test [113 done in total, somefailed=True] ____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 41 items module/select/test/test_epoll.py ........ module/select/test/test_kqueue.py sssss module/select/test/test_select.py .....FF.............FF..... module/select/test/test_ztranslation.py . =================================== FAILURES =================================== ___________________ AppTestSelectWithPipes.test_write_close ____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf49faed4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79c332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69604cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69604cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf499ba54> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49bc12c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49bc12c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf49a7fa4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49bc50c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf49bc50c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_write_close'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_write_close'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_write_close'>, space = StdObjSpace target = <function test_write_close at 0xf49b0e2c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4aecd2c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4aecd2c>,) w_func = <Function test_write_close> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4aecd2c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_write_close> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4aecd2c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_write_close> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4aecd2c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_write_close, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 pycode = <code object test_write_close, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4eec6ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00\xc9\x02\x00\xca\x00\x00\\\x02\x00}\...x00|\x07\x00|\x05\x00k\x02\x00s\xa1\x01t\x08\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x05\x00\xca\x00\x00\x01Xd\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4eec6ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00\xc9\x02\x00\xca\x00\x00\\\x02\x00}\...x00|\x07\x00|\x05\x00k\x02\x00s\xa1\x01t\x08\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x05\x00\xca\x00\x00\x01Xd\x02\x00S' next_instr = 114L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4eec6ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 nameindex = 7, ignored = (114L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4b24b0c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4b24b0c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4b24b0c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ___________________ AppTestSelectWithPipes.test_read_closed ____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4b29df4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79c332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69604cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69604cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4979f04> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf442e60c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf442e60c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4979f54> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf442eb2c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf442eb2c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_read_closed'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_read_closed'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_read_closed'>, space = StdObjSpace target = <function test_read_closed at 0xf45f7ca4> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4aecd2c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4aecd2c>,) w_func = <Function test_read_closed> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4aecd2c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_read_closed> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4aecd2c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_read_closed> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4aecd2c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_read_closed, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 pycode = <code object test_read_closed, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4eec6ec> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\\\x02\x00}\x02\x00}\x03\x00z\x85\x00|\x02\x00\x...\x00k\x02\x00n\x02\x00\x02\x01s\xa2\x00t\x05\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x02\x00\xca\x00\x00\x01Xd\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4eec6ec> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\\\x02\x00}\x02\x00}\x03\x00z\x85\x00|\x02\x00\x...\x00k\x02\x00n\x02\x00\x02\x01s\xa2\x00t\x05\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x02\x00\xca\x00\x00\x01Xd\x02\x00S' next_instr = 61L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf4eec6ec> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 nameindex = 4, ignored = (61L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4b24b0c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4b24b0c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4b24b0c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError __________________ AppTestSelectWithSockets.test_write_close ___________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4adc0d4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79c332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69604cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69604cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_write_close'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf43405cc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf45d294c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf45d294c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf43cc2d4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf45d2d2c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf45d2d2c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rite_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_write_close'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_write_close'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_write_close'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_write_close'>, space = StdObjSpace target = <function test_write_close at 0xf49b0ae4> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf432134c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf432134c>,) w_func = <Function test_write_close> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf432134c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_write_close> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf432134c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_write_close> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf432134c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_write_close, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 pycode = <code object test_write_close, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45ea32c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00\xc9\x02\x00\xca\x00\x00\\\x02\x00}\...x00|\x07\x00|\x05\x00k\x02\x00s\xa1\x01t\x08\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x05\x00\xca\x00\x00\x01Xd\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45ea32c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00d\x01\x00d\x02\x00l\x01\x00}\x02\x00|\x00\x00\xc9\x02\x00\xca\x00\x00\\\x02\x00}\...x00|\x07\x00|\x05\x00k\x02\x00s\xa1\x01t\x08\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x05\x00\xca\x00\x00\x01Xd\x02\x00S' next_instr = 114L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45ea32c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_write_cl...x-x86-32/build/pypy/module/select/test/test_select.py:104]', line 1> at line 16 nameindex = 7, ignored = (114L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4787f4c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4787f4c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4787f4c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError __________________ AppTestSelectWithSockets.test_read_closed ___________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf47ee764>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf79c332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69604cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69604cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_read_closed'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4551cd4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf396876c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf396876c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf432907c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf396894c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf396894c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ead_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_read_closed'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_read_closed'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_read_closed'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_read_closed'>, space = StdObjSpace target = <function test_read_closed at 0xf47e6a3c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf432134c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf432134c>,) w_func = <Function test_read_closed> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf432134c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_read_closed> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf432134c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_read_closed> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf432134c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_read_closed, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 pycode = <code object test_read_closed, file '[/build_dir/own-linux-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45ea32c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\\\x02\x00}\x02\x00}\x03\x00z\x85\x00|\x02\x00\x...\x00k\x02\x00n\x02\x00\x02\x01s\xa2\x00t\x05\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x02\x00\xca\x00\x00\x01Xd\x02\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45ea32c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 co_code = 'd\x01\x00d\x02\x00l\x00\x00}\x01\x00|\x00\x00\xc9\x01\x00\xca\x00\x00\\\x02\x00}\x02\x00}\x03\x00z\x85\x00|\x02\x00\x...\x00k\x02\x00n\x02\x00\x02\x01s\xa2\x00t\x05\x00\x82\x01\x00Wd\x02\x00|\x03\x00\xc9\x02\x00\xca\x00\x00\x01Xd\x02\x00S' next_instr = 61L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf45ea32c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_read_clo...x-x86-32/build/pypy/module/select/test/test_select.py:138]', line 1> at line 11 nameindex = 4, ignored = (61L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf4787f4c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4787f4c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf4787f4c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/select/test/test_select.py::AppTestSelectWithPipes::()::test_write_close FAIL module/select/test/test_select.py::AppTestSelectWithPipes::()::test_read_closed FAIL module/select/test/test_select.py::AppTestSelectWithSockets::()::test_write_close FAIL module/select/test/test_select.py::AppTestSelectWithSockets::()::test_read_closed =============== 4 failed, 32 passed, 5 skipped in 67.70 seconds ================ ++ 22:31:05 starting module/sys/test [117 started in total] __ module/signal/test [114 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 18 items module/signal/test/test_signal.py .................. ========================== 18 passed in 54.53 seconds ========================== ++ 22:31:11 starting module/termios/test [118 started in total] __ module/termios/test [115 done in total, somefailed=False] __________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 8 items module/termios/test/test_termios.py sssss... ===================== 3 passed, 5 skipped in 20.94 seconds ===================== ++ 22:31:35 starting module/test_lib_pypy [119 started in total] __ module/sys/test [116 done in total, somefailed=False] ______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 65 items module/sys/test/apptest_initpath.py . module/sys/test/test_encoding.py . module/sys/test/test_initpath.py ....... module/sys/test/test_sysmodule.py ...............................s.................... module/sys/test/test_version.py .... ==================== 64 passed, 1 skipped in 32.35 seconds ===================== ++ 22:31:43 starting module/thread/test [120 started in total] __ module/struct/test [117 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 41 items module/struct/test/test_struct.py ........................................ module/struct/test/test_ztranslation.py . ========================== 41 passed in 49.90 seconds ========================== ++ 22:31:56 starting module/time/test [121 started in total] __ module/time/test [118 done in total, somefailed=False] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 18 items module/time/test/test_time.py .................. ========================== 18 passed in 88.16 seconds ========================== ++ 22:33:31 starting module/unicodedata/test [122 started in total] __ module/thread/test [119 done in total, somefailed=True] ____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 48 items module/thread/test/test_fork.py s.. module/thread/test/test_gil.py ..FF module/thread/test/test_import_lock.py ..... module/thread/test/test_local.py F....F. module/thread/test/test_lock.py ................. module/thread/test/test_thread.py .F.......... =================================== FAILURES =================================== ______________________ TestUsingFramework.test_one_thread ______________________ self = <pypy.module.thread.test.test_gil.TestUsingFramework object at 0xf4d0ff6c> skew = 25000 def test_one_thread(self, skew=+1): from rpython.rlib.debug import debug_print if self.bigtest: N = 100000 skew *= 25000 else: N = 100 skew *= 25 space = FakeSpace() class State: pass state = State() def runme(main=False): j = 0 for i in range(N + [-skew, skew][main]): state.datalen1 += 1 # try to crash if the GIL is not state.datalen2 += 1 # correctly acquired state.data.append((thread.get_ident(), i)) state.datalen3 += 1 state.datalen4 += 1 assert state.datalen1 == len(state.data) assert state.datalen2 == len(state.data) assert state.datalen3 == len(state.data) assert state.datalen4 == len(state.data) debug_print(main, i, state.datalen4) rgil.yield_thread() assert i == j j += 1 def bootstrap(): try: runme() except Exception as e: assert 0 thread.gc_thread_die() my_gil_threadlocals = gil.GILThreadLocals(space) def f(): state.data = [] state.datalen1 = 0 state.datalen2 = 0 state.datalen3 = 0 state.datalen4 = 0 state.threadlocals = my_gil_threadlocals state.threadlocals.setup_threads(space) subident = thread.start_new_thread(bootstrap, ()) mainident = thread.get_ident() runme(True) still_waiting = 3000 while len(state.data) < 2*N: debug_print(len(state.data)) if not still_waiting: llop.debug_print(lltype.Void, "timeout. progress: " "%d of %d (= %f%%)" % \ (len(state.data), 2*N, 100*len(state.data)/(2.0*N))) raise ValueError("time out") still_waiting -= 1 if not we_are_translated(): rgil.release() time.sleep(0.1) if not we_are_translated(): rgil.acquire() debug_print("leaving!") i1 = i2 = 0 for tid, i in state.data: if tid == mainident: assert i == i1; i1 += 1 elif tid == subident: assert i == i2; i2 += 1 else: assert 0 assert i1 == N + skew assert i2 == N - skew return len(state.data) > fn = self.getcompiled(f, []) module/thread/test/test_gil.py:107: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../rpython/translator/c/test/test_boehm.py:40: in getcompiled thread=self.use_threads, **extra_options) ../rpython/translator/c/test/test_genc.py:124: in compile t.compile_c() ../rpython/translator/interactive.py:123: in compile_c self.driver.compile_c() ../rpython/translator/driver.py:108: in proc return self.proceed(backend_goal) ../rpython/translator/driver.py:568: in proceed result = self._execute(goals, task_skip = self._maybe_skip()) ../rpython/translator/tool/taskengine.py:114: in _execute res = self._do(goal, taskcallable, *args, **kwds) ../rpython/translator/driver.py:278: in _do res = func() ../rpython/translator/driver.py:435: in task_database_c database = cbuilder.build_database() ../rpython/translator/c/genc.py:102: in build_database self.config.translation.reverse_debugger) ../rpython/translator/c/database.py:64: in __init__ self.gctransformer = self.gcpolicy.gettransformer(translator, gchooks) ../rpython/translator/c/gc.py:452: in gettransformer return shadowstack.ShadowStackFrameworkGCTransformer(translator, gchooks) ../rpython/memory/gctransform/framework.py:132: in __init__ GCClass, GC_PARAMS = choose_gc_from_config(translator.config) ../rpython/memory/gc/base.py:593: in choose_gc_from_config globals(), locals(), [classname]) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import sys from rpython.memory.gc.semispace import SemiSpaceGC from rpython.memory.gc.semispace import GCFLAG_EXTERNAL, GCFLAG_FORWARDED from rpython.memory.gc.semispace import GC_HASH_TAKEN_ADDR > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/generation.py:5: SyntaxError ----------------------------- Captured stderr call ----------------------------- [flowgraph] (rpython.translator.c.test.test_genc:66)entry_point [translation:info] Annotating&simplifying... [c58163a22db8100] {translation-task starting annotate [translation:info] with policy: rpython.annotator.policy.AnnotatorPolicy [flowgraph] (pypy.module.thread.test.test_gil:71)f [flowgraph] (pypy.module.thread.gil:25)GILThreadLocals.setup_threads [flowgraph] (rpython.rlib.rgil:153)allocate [flowgraph] (rpython.rlib.rthread:130)start_new_thread [flowgraph] (rpython.rlib.rthread:99)ll_start_new_thread [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)RPyThreadStart [flowgraph] (?:6)wrapper [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_RPyThreadStart [flowgraph] (rpython.rlib.rgil:183)acquire_maybe_in_new_thread [flowgraph] (rpython.rlib.rgil:160)release [flowgraph] (rpython.rlib.rthread:124)get_or_make_ident [flowgraph] (rpython.rlib.rthread:356)get_or_make_raw [flowgraph] (rpython.rlib.rgil:171)acquire [flowgraph] (rpython.rlib.rthread:282)gc_thread_run [flowgraph] (pypy.module.thread.test.test_gil:64)bootstrap [flowgraph] (pypy.module.thread.test.test_gil:48)runme [flowgraph] (rpython.rlib.rposix:500)write [flowgraph] (rpython.rtyper.lltypesystem.rffi:1427)scoped_nonmovingbuffer.__init__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:1431)scoped_nonmovingbuffer.__enter__ [flowgraph] (rpython.rlib.rthread:114)get_ident [flowgraph] (rpython.rlib.rthread:349)getraw [flowgraph] (rpython.rtyper.lltypesystem.rffi:873)get_nonmovingbuffer_ll [flowgraph] (rpython.rlib.objectmodel:315)we_are_translated_to_c [flowgraph] (rpython.rlib.rthread:297)gc_thread_die [flowgraph] (rpython.rtyper.lltypesystem.rstr:116)copy_string_to_raw [flowgraph] (rpython.rtyper.lltypesystem.rstr:63)_get_raw_buf [flowgraph] (rpython.rlib.rgil:201)yield_thread [flowgraph] (rpython.rtyper.lltypesystem.rstr:57)_str_ofs [flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)write [flowgraph] (rpython.rtyper.lltypesystem.rffi:1433)scoped_nonmovingbuffer.__exit__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:937)free_nonmovingbuffer_ll [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_write [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rthread:349)getraw [flowgraph] (rpython.rlib.rthread:349)getraw [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rthread:364)setraw [flowgraph] (rpython.rlib.rthread:364)setraw [flowgraph] (rpython.rlib.rtime:282)sleep [flowgraph] (rpython.rtyper.lltypesystem.lltype:2296)scoped_alloc [flowgraph] (rpython.rtyper.lltypesystem.lltype:2280)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__init__ [flowgraph] (rpython.rtyper.lltypesystem.lltype:2286)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__enter__ [flowgraph] (rpython.flowspace.specialcase:76)rpython_print_item [flowgraph] (rpython.translator.c.test.test_genc:39)llrepr_out [flowgraph] (rpython.rtyper.lltypesystem.lltype:2289)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__exit__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:1362)setintfield [flowgraph] (rpython.rtyper.lltypesystem.rffi:1362)setintfield [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)select [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_select [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rposix:113)get_saved_errno [flowgraph] (rpython.flowspace.specialcase:95)rpython_print_newline [flowgraph] (rpython.flowspace.specialcase:85)rpython_print_end [flowgraph] (rpython.rlib.rposix:430)handle_posix_error [flowgraph] (rpython.rlib.rarithmetic:139)widen [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__make_wrapper_for_0 [flowgraph] (?:1)memo_offsetof_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (?:1)memo__sizeof_none_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (?:1)memo__make_scoped_allocator_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__should_widen_type_0 [c58163a42edd880] translation-task} [translation:info] usession directory: /build_dir/tmp/pytest/usession-main-501 [translation:info] already done: Annotating&simplifying [translation:info] RTyping... [c58163a432e3580] {translation-task starting rtype_lltype [flowgraph] (rpython.rtyper.rclass:1170)ll_runtime_type_info [flowgraph] (rpython.rtyper.rlist:588)ll_append [flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length [flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda> [flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:2)ll_arraycopy [flowgraph] (rpython.rlib.rgc:362)ll_arraycopy [flowgraph] (rpython.rlib.rgc:342)copy_item [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:2)_ll_list_resize_hint_really_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items [flowgraph] (?:1)memo__ll_prebuilt_empty_array_0 [flowgraph] (?:1)memo__contains_gcptr_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (rpython.rtyper.rrange:172)ll_rangenext_up [flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:218)ll_math_fmod [flowgraph] (rpython.rtyper.lltypesystem.rlist:357)ll_newemptylist [flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array [flowgraph] (?:1)memo__ll_prebuilt_empty_array_0 [flowgraph] (rpython.rtyper.rint:149)ll_str [flowgraph] (rpython.rtyper.lltypesystem.ll_str:13)ll_int2dec [flowgraph] (rpython.rtyper.lltypesystem.ll_str:7)ll_unsigned [flowgraph] (?:2)mallocstr [flowgraph] (rpython.rtyper.lltypesystem.rstr:36)mallocstr [flowgraph] (rpython.rtyper.rstr:425)ll_str [flowgraph] (?:1)memo_ll_constant_0 [flowgraph] (?:11)ll_join_strs_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rstr:785)<lambda> [flowgraph] (rpython.rlib.jit:294)loop_unrolling_heuristic [flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.llmemory:1037)cast_any_ptr [flowgraph] (rpython.rtyper.lltypesystem.rstr:78)copy_string_contents [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (?:2)ll_join_strs_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs [flowgraph] (rpython.rtyper.lltypesystem.rstr:1306)ll_strnext [flowgraph] (rpython.rtyper.rlist:572)ll_len [flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length [flowgraph] (rpython.rtyper.rlist:588)ll_append [flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda> [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:2)ll_arraycopy [flowgraph] (rpython.rlib.rgc:362)ll_arraycopy [flowgraph] (rpython.rlib.rgc:342)copy_item [flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items [flowgraph] (?:2)_ll_list_resize_hint_really_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (?:1)memo__contains_gcptr_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (?:1)memo__sizeof_none_0 [flowgraph] (rpython.rtyper.lltypesystem.rstr:350)ll_strlen [flowgraph] (rpython.rtyper.lltypesystem.rstr:1293)ll_striter [rtyper] specializing: 100 / 571 blocks (17%) [flowgraph] (?:11)ll_join_chars_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars [flowgraph] (rpython.rtyper.lltypesystem.rstr:821)<lambda> [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (?:2)ll_join_chars_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars [flowgraph] (?:11)ll_listdelslice_startonly_look_inside_iff [flowgraph] (rpython.rtyper.rlist:912)<lambda> [flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.rlist:539)ll_null_item [flowgraph] (rpython.rtyper.lltypesystem.rlist:295)_ll_list_resize_le [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:2)ll_listdelslice_startonly_trampoline [flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.rclass:870)ll_str [flowgraph] (rpython.rtyper.lltypesystem.rstr:425)ll_strconcat [flowgraph] (rpython.rtyper.lltypesystem.rstr:416)ll_length [flowgraph] (rpython.rtyper.lltypesystem.ll_str:47)ll_int2hex [flowgraph] (rpython.rtyper.lltypesystem.ll_str:7)ll_unsigned [flowgraph] (?:1)memo_conststr_0 [flowgraph] (?:1)memo_conststr_0 [flowgraph] (?:1)memo_conststr_0 [flowgraph] (?:1)memo_conststr_0 [flowgraph] (rpython.rtyper.lltypesystem.rlist:470)ll_listiter [flowgraph] (rpython.rtyper.rfloat:60)ll_str [flowgraph] (?:2)formatd [flowgraph] (rpython.rlib.rfloat:105)formatd [flowgraph] (rpython.rlib.rdtoa:290)dtoa_formatd [flowgraph] (rpython.rlib.rdtoa:248)dtoa [flowgraph] (rpython.rlib.objectmodel:397)revdb_flag_io_disabled [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)_PyPy_dg_dtoa [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)_PyPy_dg_freedtoa [flowgraph] (rpython.rlib.rdtoa:97)format_number [flowgraph] (rpython.rlib.rdtoa:82)format_nonfinite [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (rpython.rtyper.lltypesystem.rlist:476)ll_listnext [flowgraph] (rpython.rtyper.lltypesystem.rlist:372)ll_getitem_fast [rtyper] specializing: 200 / 855 blocks (23%) [flowgraph] (rpython.rtyper.lltypesystem.rlist:384)ll_fixed_newlist [flowgraph] (rpython.rtyper.rlist:726)ll_setitem_nonneg [flowgraph] (rpython.rtyper.lltypesystem.rlist:407)ll_fixed_setitem_fast [flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg [flowgraph] (rpython.rtyper.rlist:721)ll_getitem_foldable_nonneg [flowgraph] (rpython.rtyper.lltypesystem.rlist:402)ll_fixed_getitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rrange:70)ll_newrange [flowgraph] (rpython.rtyper.lltypesystem.rrange:91)ll_rangeiter [rtyper] specializing: 300 / 873 blocks (34%) [flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg [flowgraph] (rpython.rtyper.rlist:721)ll_getitem_foldable_nonneg [flowgraph] (rpython.rtyper.lltypesystem.rlist:402)ll_fixed_getitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rstr:860)ll_stringslice_startstop [flowgraph] (rpython.rtyper.lltypesystem.rstr:840)_ll_stringslice [flowgraph] (?:1)memo_emptystrfun_0 [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:275)ll_append_multiple_char [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:282)_ll_append_multiple_char [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:299)ll_jit_try_append_multiple_char [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:2)ll_grow_by [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:94)ll_grow_by [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:178)ll_append_char [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (rpython.rtyper.rint:434)ll_uint_py_div [rtyper] specializing: 400 / 947 blocks (42%) [flowgraph] (?:11)ll_build_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)ll_build [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)<lambda> [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:374)ll_fold_pieces [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:365)ll_shrink_final [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:346)ll_getlength [flowgraph] (?:2)ll_shrink_array [flowgraph] (rpython.rlib.rgc:468)ll_shrink_array [flowgraph] (?:2)ll_build_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)ll_build [flowgraph] (rpython.rtyper.lltypesystem.rstr:354)ll_stritem_nonneg [rtyper] specializing: 500 / 991 blocks (50%) [flowgraph] (rpython.rtyper.rstr:930)ll_lower_char [flowgraph] (rpython.rtyper.rint:525)ll_uint_py_mod [flowgraph] (rpython.rtyper.lltypesystem.rstr:362)ll_chr2str [rtyper] specializing: 600 / 1001 blocks (59%) [flowgraph] (rpython.rtyper.rstr:890)ll_char_isdigit [rtyper] specializing: 700 / 1004 blocks (69%) [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:445)ll_new [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:328)ll_append_charpsize [flowgraph] (rpython.rtyper.lltypesystem.rstr:145)copy_raw_to_string [rtyper] specializing: 800 / 1016 blocks (78%) [flowgraph] (rpython.rtyper.lltypesystem.rstr:1046)ll_contains [flowgraph] (rpython.rtyper.lltypesystem.rstr:856)ll_stringslice_startonly [rtyper] specializing: 900 / 1023 blocks (87%) [rtyper] specializing: 1000 / 1023 blocks (97%) [flowgraph] (rpython.rtyper.rbuiltin:240)ll_min [rtyper] -=- specialized 1025 blocks -=- [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)fmod [flowgraph] (rpython.rtyper.lltypesystem.rffi:2)ccall_fmod [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rfloat:567)_likely_raise [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)fabs [flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:98)ll_math_isinf [flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:91)ll_math_isnan [flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:106)ll_math_isfinite [rtyper] -=- specialized 46 more blocks -=- [rtyper] -=- specialized 9 more blocks -=- [flowgraph] (rpython.rtyper.rclass:1133)ll_issubclass [flowgraph] (rpython.rtyper.rclass:1130)ll_type [rtyper] -=- specialized 4 more blocks -=- [c58163ab0c2ea00] translation-task} [translation:info] usession directory: /build_dir/tmp/pytest/usession-main-501 [translation:info] already done: Annotating&simplifying [translation:info] already done: RTyping [translation:info] lltype back-end optimisations... [c58163ab0c87580] {translation-task starting backendopt_lltype [backendopt:removecasts] removed 6 cast_pointers in f [backendopt:removecasts] removed 1 cast_pointers in ll_start_new_thread__bootstrap [backendopt:removecasts] removed 1 cast_pointers in bootstrap [backendopt:removecasts] removed 5 cast_pointers in runme [backendopt:removecasts] removed 1 cast_pointers in _get_raw_buf__rpy_string [backendopt:removecasts] removed 3 cast_pointers in sleep [backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__write [backendopt:removecasts] removed 1 cast_pointers in ll_rangenext_up__rangePtr_Signed [backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v17___simple_call__function_ll [backendopt:removecasts] removed 1 cast_pointers in copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed [backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v21___simple_call__function_ll [backendopt:removecasts] removed 1 cast_pointers in ll_strnext__stringiterPtr [backendopt:removecasts] removed 2 cast_pointers in dtoa_formatd__Float_Char_Signed_Signed [backendopt:removecasts] removed 3 cast_pointers in dtoa__Float_Char_Signed_Signed_Signed_SomeList_Bool [backendopt:removecasts] removed 4 cast_pointers in format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool [backendopt:removecasts] removed 1 cast_pointers in format_nonfinite__arrayPtr_Signed_Signed_SomeList [backendopt:removecasts] removed 1 cast_pointers in ll_listnext__listiterPtr [backendopt:removecasts] removed 1 cast_pointers in _ll_stringslice__rpy_stringPtr_Signed_Signed [backendopt:removecasts] removed 1 cast_pointers in ll_grow_by__stringbuilderPtr_Signed [backendopt:removecasts] removed 1 cast_pointers in copy_raw_to_string__arrayPtr_rpy_stringPtr_Signed_Signed [backendopt:removecasts] removed 3 cast_pointers in _likely_raise [backendopt:inlining] phase with threshold factor: 32.4 [backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic [backendopt:inlining] 0.00 isconstant__v53___simple_call__function_is [backendopt:inlining] 0.00 ll_append_char__stringbuilderPtr_Char [backendopt:inlining] 0.00 _PyPy_dg_dtoa__Float_Signed_Signed_arrayPtr_arrayPtr_arrayPtr_star_6 [backendopt:inlining] 0.00 _get_raw_buf__rpy_string [backendopt:inlining] 0.00 isvirtual__v36___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v51___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v41___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v44___simple_call__function_is [backendopt:inlining] 0.00 fmod__Float_Float_star_2 [backendopt:inlining] 0.00 isconstant__v24___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v11___simple_call__function_is [backendopt:inlining] 0.00 memo_conststr_0 [backendopt:inlining] 0.00 gc_thread_run [backendopt:inlining] 0.00 _PyPy_dg_freedtoa__arrayPtr_star_1 [backendopt:inlining] 0.00 memo__sizeof_none_0 [backendopt:inlining] 0.00 memo_ll_constant_0 [backendopt:inlining] 0.00 isconstant__v18___simple_call__function_is [backendopt:inlining] 0.00 copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed [backendopt:inlining] 0.00 isconstant__v49___simple_call__function_is [backendopt:inlining] 0.00 fabs__Float_star_1 [backendopt:inlining] 0.00 isvirtual__v58___simple_call__function_is [backendopt:inlining] 0.00 conditional_call__v25___simple_call__function_co_star_3 [backendopt:inlining] 0.00 isconstant__v5___simple_call__function_isc [backendopt:inlining] 0.00 ll_unsigned__Unsigned [backendopt:inlining] 0.00 conditional_call__v7___simple_call__function_con_star_3 [backendopt:inlining] 0.00 ll_getitem_nonneg__dum_nocheckConst_ll_getitem_foldable_nonnegCons_arrayPtr_Signed [backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0 [backendopt:inlining] 0.00 isconstant__v30___simple_call__function_is [backendopt:inlining] 0.00 cast_any_ptr__Ptr_GcStruct_rpy_stringLlT_rpy_stringPtr [backendopt:inlining] 0.00 copy_raw_to_string__arrayPtr_rpy_stringPtr_Signed_Signed [backendopt:inlining] 0.00 isvirtual__v19___simple_call__function_is [backendopt:inlining] 0.00 ll_append_multiple_char__stringbuilderPtr_Char_Signed [backendopt:inlining] 0.00 isconstant__v35___simple_call__function_is [backendopt:inlining] 0.00 isvirtual__v42___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v6___simple_call__function_isc [backendopt:inlining] 0.00 ll_getlength__stringbuilderPtr [backendopt:inlining] 0.00 ll_getitem_nonneg__dum_nocheckConst_ll_getitem_foldable_nonnegCons_arrayPtr_Signed [backendopt:inlining] 0.00 isconstant__v48___simple_call__function_is [backendopt:inlining] 0.00 copy_string_to_raw [backendopt:inlining] 0.00 __exit____star_3 [backendopt:inlining] 0.00 write__Signed_arrayPtr_Signed_star_3 [backendopt:inlining] 0.00 scoped_nonmovingbuffer.__init__ [backendopt:inlining] 0.00 get_nonmovingbuffer_ll [backendopt:inlining] 0.00 ll_setitem_nonneg__dum_nocheckConst_arrayPtr_Signed_Signed [backendopt:inlining] 0.00 gc_thread_die [backendopt:inlining] 0.00 conditional_call__v55___simple_call__function_co_star_2 [backendopt:inlining] 0.00 isconstant__v29___simple_call__function_is [backendopt:inlining] 0.00 RPyThreadStart__bootstrapConst_star_1 [backendopt:inlining] 0.00 isconstant__v23___simple_call__function_is [backendopt:inlining] 0.00 memo__sizeof_none_0 [backendopt:inlining] 0.00 isconstant__v12___simple_call__function_is [backendopt:inlining] 0.00 select__Signed_arrayPtr_arrayPtr_arrayPtr_timevalPtr_star_5 [backendopt:inlining] 0.00 widen__int [backendopt:inlining] 0.00 memo_emptystrfun_0 [backendopt:inlining] 0.00 conditional_call__v47___simple_call__function_co_star_3 [backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0 [backendopt:inlining] 0.00 scoped_nonmovingbuffer.__enter__ [backendopt:inlining] 2.00 ll_length__listPtr [backendopt:inlining] 2.00 getraw [backendopt:inlining] 2.00 ll_length__listPtr [backendopt:inlining] 2.00 ll_strlen__rpy_stringPtr [backendopt:inlining] 2.00 getraw [backendopt:inlining] 2.00 setraw [backendopt:inlining] 2.00 setraw [backendopt:inlining] 2.00 ll_items__listPtr [backendopt:inlining] 2.00 ll_items__listPtr [backendopt:inlining] 2.00 ll_uint_py_mod__Unsigned_Unsigned [backendopt:inlining] 2.00 ll_uint_py_div__Unsigned_Unsigned [backendopt:inlining] 2.00 ll_fixed_newlist__GcArray_SignedLlT_Signed [backendopt:inlining] 2.00 ll_math_isnan__Float [backendopt:inlining] 2.00 ll_length__rpy_stringPtr [backendopt:inlining] 2.00 ll_unsigned__Signed [backendopt:inlining] 2.00 get_or_make_raw [backendopt:inlining] 2.00 getraw [backendopt:inlining] 2.00 ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__enter__ [backendopt:inlining] 4.00 ll_min__Unsigned_Unsigned [backendopt:inlining] 4.00 ll_stritem_nonneg__rpy_stringPtr_Signed [backendopt:inlining] 4.00 ll_math_isfinite__Float [backendopt:inlining] 4.00 ll_fixed_getitem_fast__arrayPtr_Signed [backendopt:inlining] 4.00 ll_fixed_getitem_fast__arrayPtr_Signed [backendopt:inlining] 4.00 ll_fixed_setitem_fast__arrayPtr_Signed_Signed [backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed [backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed [backendopt:inlining] 4.00 __exit____star_3 [backendopt:inlining] 4.00 setintfield__timevalPtr_c_tv_sec_Signed [backendopt:inlining] 4.00 setintfield__timevalPtr_c_tv_usec_Signed [backendopt:inlining] 5.00 release [backendopt:inlining] 2.00 get_saved_errno [backendopt:inlining] 5.00 allocate [backendopt:inlining] 2.00 get_ident [backendopt:inlining] 2.00 get_or_make_ident [backendopt:inlining] 5.50 ll_math_isinf__Float [backendopt:inlining] 6.00 _str_ofs__rpy_string [backendopt:inlining] 6.00 ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__init__ [backendopt:inlining] 7.00 mallocstr__Signed [backendopt:inlining] 4.00 ll_getitem_foldable_nonneg__arrayPtr_Signed [backendopt:inlining] 2.00 ll_len__listPtr [backendopt:inlining] 7.00 ll_str__IntegerR_SignedConst_Signed [backendopt:inlining] 7.00 ll_shrink_array__rpy_stringPtr_Signed [backendopt:inlining] 4.00 ll_getitem_foldable_nonneg__arrayPtr_Signed [backendopt:inlining] 7.00 ll_build_look_inside_iff__stringbuilderPtr [backendopt:inlining] 7.00 ll_listdelslice_startonly_look_inside_iff__listPtr_Signed [backendopt:inlining] 7.00 start_new_thread__bootstrap [backendopt:inlining] 7.00 rpython_print_newline [backendopt:inlining] 7.00 llrepr_out__int [backendopt:inlining] 7.50 ll_char_isdigit__Char [backendopt:inlining] 7.50 mallocstr__Signed [backendopt:inlining] 8.00 ll_newrange__Ptr_GcStruct_rangeLlT_Signed_Signed [backendopt:inlining] 8.00 ll_listiter__Ptr_GcStruct_listiterLlT_listPtr [backendopt:inlining] 8.00 ll_newemptylist__GcStruct_listLlT [backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool [backendopt:inlining] 9.00 ll_join_strs_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT [backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool [backendopt:inlining] 9.00 ll_join_chars_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT [backendopt:inlining] 9.00 ll_str__FloatR_FloatConst_Float [backendopt:inlining] 9.00 formatd__Float_Char_Signed_Signed [backendopt:inlining] 9.00 formatd__Float_Char_Signed_Signed [backendopt:inlining] 4.00 ll_str__StringR_Ptr_GcStruct_rpy_strin_rpy_stringPtr [backendopt:inlining] 9.50 ll_chr2str__Char [backendopt:inlining] 7.00 acquire [backendopt:inlining] 10.75 GILThreadLocals.setup_threads [backendopt:inlining] 10.75 ll_lower_char__Char [backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed [backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed [backendopt:inlining] 11.00 ll_stringslice_startonly__rpy_stringPtr_Signed [backendopt:inlining] 6.00 ll_getitem_fast__listPtr_Signed [backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_GCREFPtr [backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_Char [backendopt:inlining] 12.00 ll_rangeiter__Ptr_GcStruct_rangeLlT_rangePtr [backendopt:inlining] 12.00 ll_striter__rpy_stringPtr [backendopt:inlining] 9.00 acquire_maybe_in_new_thread [backendopt:inlining] 12.50 ll_rangenext_up__rangePtr_Signed [backendopt:inlining] 12.00 scoped_alloc__timeval_False [backendopt:inlining] 13.00 free_nonmovingbuffer_ll [backendopt:inlining] 9.00 ll_listdelslice_startonly__v40___simple_call__function_ll [backendopt:inlining] 9.00 ll_listdelslice_startonly__v46___simple_call__function_ll [backendopt:inlining] 12.00 bootstrap [backendopt:inlining] 15.50 ll_strnext__stringiterPtr [backendopt:inlining] 17.00 ll_contains__rpy_stringPtr_Char [backendopt:inlining] 4.00 loop_unrolling_heuristic__v16___simple_call__function_lo [backendopt:inlining] 18.12 ll_stringslice_startstop__rpy_stringPtr_Signed_Signed [backendopt:inlining] 19.00 ll_shrink_final__stringbuilderPtr [backendopt:inlining] 21.00 ccall_fmod [backendopt:inlining] 22.00 ll_shrink_array__rpy_stringPtr_Signed [backendopt:inlining] 19.00 ll_listnext__listiterPtr [backendopt:inlining] 17.00 ll_append__listPtr_Char [backendopt:inlining] 17.00 ll_append__listPtr_GCREFPtr [backendopt:inlining] 19.25 _errno_after__v62___simple_call__function__e [backendopt:inlining] 19.25 _errno_after__v1___simple_call__function__er [backendopt:inlining] 19.25 _errno_after__v3___simple_call__function__er [backendopt:inlining] 26.16 ll_join_chars__v33___simple_call__function_ll [backendopt:inlining] 26.16 ll_join_chars__v38___simple_call__function_ll [backendopt:inlining] 27.50 ll_new__Signed [backendopt:inlining] 27.50 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed [backendopt:inlining] 30.25 handle_posix_error__write [backendopt:inlining] 31.87 _errno_before__v61___simple_call__function__e [backendopt:inlining] 31.87 _errno_before__v0___simple_call__function__er [backendopt:inlining] 31.87 _errno_before__v2___simple_call__function__er [backendopt:inlining] inlined 334 callsites. [backendopt:malloc] starting malloc removal [backendopt:malloc] 2 simple mallocs removed in 'f' [backendopt:malloc] 2 simple mallocs removed in 'll_start_new_thread__bootstrap' [backendopt:malloc] 2 simple mallocs removed in 'RPyThreadStart__bootstrapConst_star_1' [backendopt:malloc] 1 simple mallocs removed in 'wrapper' [backendopt:malloc] 2 simple mallocs removed in 'runme' [backendopt:malloc] 3 simple mallocs removed in 'write' [backendopt:malloc] 2 simple mallocs removed in 'scoped_nonmovingbuffer.__init__' [backendopt:malloc] 7 simple mallocs removed in 'write__Signed_arrayPtr_Signed_star_3' [backendopt:malloc] 1 simple mallocs removed in 'sleep' [backendopt:malloc] 1 simple mallocs removed in 'rpython_print_item' [backendopt:malloc] 3 simple mallocs removed in 'select__Signed_arrayPtr_arrayPtr_arrayPtr_timevalPtr_star_5' [backendopt:malloc] 1 simple mallocs removed in 'rpython_print_end' [backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v7___simple_call__function_con_star_3' [backendopt:malloc] 5 simple mallocs removed in 'll_math_fmod__Float_Float' [backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v25___simple_call__function_co_star_3' [backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_le__listPtr_Signed' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v47___simple_call__function_co_star_3' [backendopt:malloc] 13 simple mallocs removed in '_PyPy_dg_dtoa__Float_Signed_Signed_arrayPtr_arrayPtr_arrayPtr_star_6' [backendopt:malloc] 3 simple mallocs removed in '_PyPy_dg_freedtoa__arrayPtr_star_1' [backendopt:malloc] 7 simple mallocs removed in 'format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool' [backendopt:malloc] 4 simple mallocs removed in '_ll_append_multiple_char__stringbuilderPtr_Char_Signed' [backendopt:malloc] 1 simple mallocs removed in 'll_append_char__stringbuilderPtr_Char' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v55___simple_call__function_co_star_2' [backendopt:malloc] 5 simple mallocs removed in 'fmod__Float_Float_star_2' [backendopt:malloc] 3 simple mallocs removed in '_likely_raise' [backendopt:malloc] 3 simple mallocs removed in 'fabs__Float_star_1' [backendopt:malloc] removed 78 simple mallocs in total [backendopt:mergeifblocks] starting to merge if blocks [backendopt] merging blocks in dtoa_formatd__Float_Char_Signed_Signed [backendopt] merging blocks in format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool [c58163ae4be7480] translation-task} [translation:info] usession directory: /build_dir/tmp/pytest/usession-main-501 [translation:info] already done: Annotating&simplifying [translation:info] already done: RTyping [translation:info] already done: lltype back-end optimisations [translation:info] inserting stack checks... [c58163ae4c8e800] {translation-task starting stackcheckinsertion_lltype [flowgraph] (rpython.rlib.rstack:42)stack_check [flowgraph] (rpython.rlib.rstack:67)stack_check_slowpath [rtyper] -=- specialized 8 more blocks -=- [translation:info] inserted 0 stack checks. [c58163ae65aaf00] translation-task} [translation:info] Creating database for generating c source... [c58163ae65c9d80] {translation-task starting database_c [flowgraph] (rpython.translator.exceptiontransform:100)rpyexc_occurred [flowgraph] (rpython.translator.exceptiontransform:104)rpyexc_fetch_type [flowgraph] (rpython.translator.exceptiontransform:107)rpyexc_fetch_value [flowgraph] (rpython.translator.exceptiontransform:110)rpyexc_clear [flowgraph] (rpython.translator.exceptiontransform:114)rpyexc_raise [flowgraph] (rpython.translator.exceptiontransform:128)rpyexc_reraise [flowgraph] (rpython.translator.exceptiontransform:133)rpyexc_fetch_exception [flowgraph] (rpython.translator.exceptiontransform:138)rpyexc_restore_exception [flowgraph] (rpython.translator.exceptiontransform:539)rpyexc_get_exception_addr [flowgraph] (rpython.translator.exceptiontransform:543)rpyexc_get_exc_value_addr [flowgraph] (rpython.rtyper.rclass:1173)ll_inst_type [rtyper] specializing: 1100 / 1117 blocks (98%) [rtyper] -=- specialized 25 more blocks -=- [flowgraph] (rpython.memory.gctransform.transform:447)_ll_malloc_fixedsize [flowgraph] (rpython.memory.gctransform.transform:454)_ll_malloc_fixedsize_zero [flowgraph] (rpython.memory.gctransform.transform:470)_ll_malloc_varsize_no_length [flowgraph] (rpython.memory.gctransform.transform:487)ll_malloc_varsize [flowgraph] (rpython.memory.gctransform.transform:493)_ll_malloc_varsize_no_length_zero [c58163aeb550800] translation-task} ____________________ TestUsingFramework.test_one_thread_rev ____________________ self = <pypy.module.thread.test.test_gil.TestUsingFramework object at 0xf31928ac> def test_one_thread_rev(self): > self.test_one_thread(skew=-1) module/thread/test/test_gil.py:112: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ module/thread/test/test_gil.py:107: in test_one_thread fn = self.getcompiled(f, []) ../rpython/translator/c/test/test_boehm.py:40: in getcompiled thread=self.use_threads, **extra_options) ../rpython/translator/c/test/test_genc.py:124: in compile t.compile_c() ../rpython/translator/interactive.py:123: in compile_c self.driver.compile_c() ../rpython/translator/driver.py:108: in proc return self.proceed(backend_goal) ../rpython/translator/driver.py:568: in proceed result = self._execute(goals, task_skip = self._maybe_skip()) ../rpython/translator/tool/taskengine.py:114: in _execute res = self._do(goal, taskcallable, *args, **kwds) ../rpython/translator/driver.py:278: in _do res = func() ../rpython/translator/driver.py:435: in task_database_c database = cbuilder.build_database() ../rpython/translator/c/genc.py:102: in build_database self.config.translation.reverse_debugger) ../rpython/translator/c/database.py:64: in __init__ self.gctransformer = self.gcpolicy.gettransformer(translator, gchooks) ../rpython/translator/c/gc.py:452: in gettransformer return shadowstack.ShadowStackFrameworkGCTransformer(translator, gchooks) ../rpython/memory/gctransform/framework.py:132: in __init__ GCClass, GC_PARAMS = choose_gc_from_config(translator.config) ../rpython/memory/gc/base.py:593: in choose_gc_from_config globals(), locals(), [classname]) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import sys from rpython.memory.gc.semispace import SemiSpaceGC from rpython.memory.gc.semispace import GCFLAG_EXTERNAL, GCFLAG_FORWARDED from rpython.memory.gc.semispace import GC_HASH_TAKEN_ADDR > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/generation.py:5: SyntaxError ----------------------------- Captured stderr call ----------------------------- [flowgraph] (rpython.translator.c.test.test_genc:66)entry_point [translation:info] Annotating&simplifying... [c58163b01476e00] {translation-task starting annotate [translation:info] with policy: rpython.annotator.policy.AnnotatorPolicy [flowgraph] (pypy.module.thread.test.test_gil:71)f [flowgraph] (pypy.module.thread.gil:25)GILThreadLocals.setup_threads [flowgraph] (rpython.rlib.rgil:153)allocate [flowgraph] (rpython.rlib.rthread:130)start_new_thread [flowgraph] (rpython.rlib.rthread:99)ll_start_new_thread [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)RPyThreadStart [flowgraph] (?:6)wrapper [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_RPyThreadStart [flowgraph] (rpython.rlib.rgil:160)release [flowgraph] (rpython.rlib.rgil:183)acquire_maybe_in_new_thread [flowgraph] (rpython.rlib.rthread:124)get_or_make_ident [flowgraph] (rpython.rlib.rthread:356)get_or_make_raw [flowgraph] (rpython.rlib.rgil:171)acquire [flowgraph] (rpython.rlib.rthread:282)gc_thread_run [flowgraph] (pypy.module.thread.test.test_gil:64)bootstrap [flowgraph] (rpython.rlib.rposix:500)write [flowgraph] (pypy.module.thread.test.test_gil:48)runme [flowgraph] (rpython.rtyper.lltypesystem.rffi:1427)scoped_nonmovingbuffer.__init__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:1431)scoped_nonmovingbuffer.__enter__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:873)get_nonmovingbuffer_ll [flowgraph] (rpython.rlib.rthread:114)get_ident [flowgraph] (rpython.rlib.objectmodel:315)we_are_translated_to_c [flowgraph] (rpython.rlib.rthread:349)getraw [flowgraph] (rpython.rlib.rthread:297)gc_thread_die [flowgraph] (rpython.rtyper.lltypesystem.rstr:116)copy_string_to_raw [flowgraph] (rpython.rtyper.lltypesystem.rstr:63)_get_raw_buf [flowgraph] (rpython.rlib.rgil:201)yield_thread [flowgraph] (rpython.rtyper.lltypesystem.rstr:57)_str_ofs [flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)write [flowgraph] (rpython.rtyper.lltypesystem.rffi:1433)scoped_nonmovingbuffer.__exit__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:937)free_nonmovingbuffer_ll [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_write [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rthread:349)getraw [flowgraph] (rpython.rlib.rthread:349)getraw [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rthread:364)setraw [flowgraph] (rpython.rlib.rthread:364)setraw [flowgraph] (rpython.rlib.rtime:282)sleep [flowgraph] (rpython.rtyper.lltypesystem.lltype:2296)scoped_alloc [flowgraph] (rpython.rtyper.lltypesystem.lltype:2280)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__init__ [flowgraph] (rpython.rtyper.lltypesystem.lltype:2286)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__enter__ [flowgraph] (rpython.flowspace.specialcase:76)rpython_print_item [flowgraph] (rpython.translator.c.test.test_genc:39)llrepr_out [flowgraph] (rpython.rtyper.lltypesystem.lltype:2289)ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__exit__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:1362)setintfield [flowgraph] (rpython.rtyper.lltypesystem.rffi:1362)setintfield [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)select [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_select [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rposix:113)get_saved_errno [flowgraph] (rpython.flowspace.specialcase:95)rpython_print_newline [flowgraph] (rpython.rlib.rposix:430)handle_posix_error [flowgraph] (rpython.rlib.rarithmetic:139)widen [flowgraph] (rpython.flowspace.specialcase:85)rpython_print_end [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__make_wrapper_for_0 [flowgraph] (?:1)memo_offsetof_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (?:1)memo__sizeof_none_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (?:1)memo__make_scoped_allocator_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__should_widen_type_0 [c58163b25261a00] translation-task} [translation:info] usession directory: /build_dir/tmp/pytest/usession-main-501 [translation:info] already done: Annotating&simplifying [translation:info] RTyping... [c58163b252bcf00] {translation-task starting rtype_lltype [flowgraph] (rpython.rtyper.rclass:1170)ll_runtime_type_info [flowgraph] (rpython.rtyper.lltypesystem.rstr:1306)ll_strnext [flowgraph] (rpython.rtyper.lltypesystem.rlist:470)ll_listiter [flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:218)ll_math_fmod [flowgraph] (rpython.rtyper.lltypesystem.rstr:350)ll_strlen [flowgraph] (rpython.rtyper.lltypesystem.rlist:384)ll_fixed_newlist [flowgraph] (rpython.rtyper.rlist:726)ll_setitem_nonneg [flowgraph] (rpython.rtyper.lltypesystem.rlist:407)ll_fixed_setitem_fast [flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg [flowgraph] (rpython.rtyper.rlist:721)ll_getitem_foldable_nonneg [flowgraph] (rpython.rtyper.lltypesystem.rlist:402)ll_fixed_getitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rrange:70)ll_newrange [flowgraph] (rpython.rtyper.lltypesystem.rrange:91)ll_rangeiter [rtyper] specializing: 100 / 329 blocks (30%) [flowgraph] (rpython.rtyper.rlist:572)ll_len [flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length [flowgraph] (rpython.rtyper.lltypesystem.ll_str:13)ll_int2dec [flowgraph] (rpython.rtyper.lltypesystem.ll_str:7)ll_unsigned [flowgraph] (?:2)mallocstr [flowgraph] (rpython.rtyper.lltypesystem.rstr:36)mallocstr [flowgraph] (rpython.rtyper.rfloat:60)ll_str [flowgraph] (?:2)formatd [flowgraph] (rpython.rlib.rfloat:105)formatd [flowgraph] (rpython.rlib.rdtoa:290)dtoa_formatd [flowgraph] (rpython.rlib.rdtoa:248)dtoa [flowgraph] (rpython.rlib.objectmodel:397)revdb_flag_io_disabled [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)_PyPy_dg_dtoa [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)_PyPy_dg_freedtoa [flowgraph] (rpython.rlib.rdtoa:97)format_number [flowgraph] (rpython.rlib.rdtoa:82)format_nonfinite [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:11)ll_join_strs_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rstr:785)<lambda> [flowgraph] (rpython.rlib.jit:294)loop_unrolling_heuristic [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs [flowgraph] (rpython.rtyper.lltypesystem.llmemory:1037)cast_any_ptr [flowgraph] (rpython.rtyper.lltypesystem.rstr:78)copy_string_contents [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (?:2)ll_join_strs_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs [flowgraph] (rpython.rtyper.lltypesystem.rstr:1293)ll_striter [flowgraph] (rpython.rtyper.rlist:588)ll_append [flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length [flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda> [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array [flowgraph] (?:2)ll_arraycopy [flowgraph] (rpython.rlib.rgc:362)ll_arraycopy [flowgraph] (rpython.rlib.rgc:342)copy_item [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:2)_ll_list_resize_hint_really_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items [flowgraph] (?:1)memo__ll_prebuilt_empty_array_0 [flowgraph] (?:1)memo__contains_gcptr_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (?:11)ll_join_chars_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rstr:821)<lambda> [flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (?:2)ll_join_chars_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars [flowgraph] (?:11)ll_listdelslice_startonly_look_inside_iff [flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly [flowgraph] (rpython.rtyper.rlist:539)ll_null_item [flowgraph] (rpython.rtyper.rlist:912)<lambda> [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (rpython.rtyper.lltypesystem.rlist:295)_ll_list_resize_le [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:2)ll_listdelslice_startonly_trampoline [flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (rpython.rtyper.lltypesystem.rlist:357)ll_newemptylist [flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array [flowgraph] (?:1)memo__ll_prebuilt_empty_array_0 [flowgraph] (rpython.rtyper.rstr:425)ll_str [flowgraph] (?:1)memo_ll_constant_0 [flowgraph] (rpython.rtyper.rint:149)ll_str [flowgraph] (rpython.rtyper.rrange:172)ll_rangenext_up [flowgraph] (rpython.rtyper.rlist:588)ll_append [flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda> [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (?:2)ll_arraycopy [flowgraph] (rpython.rlib.rgc:362)ll_arraycopy [flowgraph] (rpython.rlib.rgc:342)copy_item [flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast [flowgraph] (?:2)_ll_list_resize_hint_really_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (?:1)memo__contains_gcptr_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (?:1)memo__sizeof_none_0 [flowgraph] (rpython.rtyper.rclass:870)ll_str [flowgraph] (rpython.rtyper.lltypesystem.rstr:425)ll_strconcat [flowgraph] (rpython.rtyper.lltypesystem.rstr:416)ll_length [flowgraph] (rpython.rtyper.lltypesystem.ll_str:47)ll_int2hex [flowgraph] (rpython.rtyper.lltypesystem.ll_str:7)ll_unsigned [flowgraph] (?:1)memo_conststr_0 [flowgraph] (?:1)memo_conststr_0 [flowgraph] (?:1)memo_conststr_0 [flowgraph] (?:1)memo_conststr_0 [flowgraph] (rpython.rtyper.lltypesystem.rlist:476)ll_listnext [flowgraph] (rpython.rtyper.lltypesystem.rlist:372)ll_getitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rstr:856)ll_stringslice_startonly [flowgraph] (rpython.rtyper.lltypesystem.rstr:840)_ll_stringslice [flowgraph] (?:1)memo_emptystrfun_0 [flowgraph] (rpython.rtyper.lltypesystem.rstr:860)ll_stringslice_startstop [rtyper] specializing: 400 / 892 blocks (44%) [flowgraph] (rpython.rtyper.rstr:890)ll_char_isdigit [flowgraph] (rpython.rtyper.lltypesystem.rstr:354)ll_stritem_nonneg [rtyper] specializing: 500 / 897 blocks (55%) [flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg [flowgraph] (rpython.rtyper.rlist:721)ll_getitem_foldable_nonneg [flowgraph] (rpython.rtyper.lltypesystem.rlist:402)ll_fixed_getitem_fast [flowgraph] (rpython.rtyper.rint:434)ll_uint_py_div [flowgraph] (rpython.rtyper.lltypesystem.rstr:1046)ll_contains [rtyper] specializing: 600 / 911 blocks (65%) [flowgraph] (rpython.rtyper.lltypesystem.rstr:362)ll_chr2str [flowgraph] (rpython.rtyper.rstr:930)ll_lower_char [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:328)ll_append_charpsize [flowgraph] (rpython.rtyper.lltypesystem.rstr:145)copy_raw_to_string [flowgraph] (?:2)ll_grow_by [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:94)ll_grow_by [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:178)ll_append_char [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:275)ll_append_multiple_char [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:282)_ll_append_multiple_char [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:299)ll_jit_try_append_multiple_char [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:11)ll_build_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)ll_build [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)<lambda> [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:374)ll_fold_pieces [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:365)ll_shrink_final [flowgraph] (?:2)ll_shrink_array [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:346)ll_getlength [flowgraph] (rpython.rlib.rgc:468)ll_shrink_array [flowgraph] (?:2)ll_build_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:355)ll_build [flowgraph] (rpython.rtyper.lltypesystem.rbuilder:445)ll_new [rtyper] specializing: 800 / 1021 blocks (78%) [flowgraph] (rpython.rtyper.rint:525)ll_uint_py_mod [rtyper] specializing: 900 / 1023 blocks (87%) [flowgraph] (rpython.rtyper.rbuiltin:240)ll_min [rtyper] specializing: 1000 / 1025 blocks (97%) [rtyper] -=- specialized 1025 blocks -=- [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)fmod [flowgraph] (rpython.rtyper.lltypesystem.rffi:2)ccall_fmod [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rfloat:567)_likely_raise [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)fabs [flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:106)ll_math_isfinite [flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:91)ll_math_isnan [flowgraph] (rpython.rtyper.lltypesystem.module.ll_math:98)ll_math_isinf [rtyper] -=- specialized 46 more blocks -=- [rtyper] -=- specialized 9 more blocks -=- [flowgraph] (rpython.rtyper.rclass:1133)ll_issubclass [flowgraph] (rpython.rtyper.rclass:1130)ll_type [rtyper] -=- specialized 4 more blocks -=- [c58163b8bdd0980] translation-task} [translation:info] usession directory: /build_dir/tmp/pytest/usession-main-501 [translation:info] already done: Annotating&simplifying [translation:info] already done: RTyping [translation:info] lltype back-end optimisations... [c58163b8be28a80] {translation-task starting backendopt_lltype [backendopt:removecasts] removed 6 cast_pointers in f [backendopt:removecasts] removed 1 cast_pointers in ll_start_new_thread__bootstrap [backendopt:removecasts] removed 1 cast_pointers in bootstrap [backendopt:removecasts] removed 5 cast_pointers in runme [backendopt:removecasts] removed 1 cast_pointers in _get_raw_buf__rpy_string [backendopt:removecasts] removed 3 cast_pointers in sleep [backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__write [backendopt:removecasts] removed 1 cast_pointers in ll_strnext__stringiterPtr [backendopt:removecasts] removed 2 cast_pointers in dtoa_formatd__Float_Char_Signed_Signed [backendopt:removecasts] removed 3 cast_pointers in dtoa__Float_Char_Signed_Signed_Signed_SomeList_Bool [backendopt:removecasts] removed 4 cast_pointers in format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool [backendopt:removecasts] removed 1 cast_pointers in format_nonfinite__arrayPtr_Signed_Signed_SomeList [backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v70___simple_call__function_ll [backendopt:removecasts] removed 1 cast_pointers in copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed [backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v73___simple_call__function_ll [backendopt:removecasts] removed 1 cast_pointers in ll_rangenext_up__rangePtr_Signed [backendopt:removecasts] removed 1 cast_pointers in ll_listnext__listiterPtr [backendopt:removecasts] removed 1 cast_pointers in _ll_stringslice__rpy_stringPtr_Signed_Signed [backendopt:removecasts] removed 1 cast_pointers in copy_raw_to_string__arrayPtr_rpy_stringPtr_Signed_Signed [backendopt:removecasts] removed 1 cast_pointers in ll_grow_by__stringbuilderPtr_Signed [backendopt:removecasts] removed 3 cast_pointers in _likely_raise [backendopt:inlining] phase with threshold factor: 32.4 [backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic [backendopt:inlining] 0.00 copy_raw_to_string__arrayPtr_rpy_stringPtr_Signed_Signed [backendopt:inlining] 0.00 isconstant__v118___simple_call__function_i [backendopt:inlining] 0.00 isconstant__v81___simple_call__function_is [backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0 [backendopt:inlining] 0.00 ll_append_multiple_char__stringbuilderPtr_Char_Signed [backendopt:inlining] 0.00 _PyPy_dg_dtoa__Float_Signed_Signed_arrayPtr_arrayPtr_arrayPtr_star_6 [backendopt:inlining] 0.00 isconstant__v116___simple_call__function_i [backendopt:inlining] 0.00 isconstant__v114___simple_call__function_i [backendopt:inlining] 0.00 cast_any_ptr__Ptr_GcStruct_rpy_stringLlT_rpy_stringPtr [backendopt:inlining] 0.00 isconstant__v82___simple_call__function_is [backendopt:inlining] 0.00 memo_ll_constant_0 [backendopt:inlining] 0.00 isconstant__v103___simple_call__function_i [backendopt:inlining] 0.00 isconstant__v109___simple_call__function_i [backendopt:inlining] 0.00 isconstant__v69___simple_call__function_is [backendopt:inlining] 0.00 conditional_call__v113___simple_call__function_c_star_2 [backendopt:inlining] 0.00 isvirtual__v71___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v77___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v93___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v97___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v107___simple_call__function_i [backendopt:inlining] 0.00 fabs__Float_star_1 [backendopt:inlining] 0.00 ll_append_char__stringbuilderPtr_Char [backendopt:inlining] 0.00 isvirtual__v121___simple_call__function_i [backendopt:inlining] 0.00 isconstant__v87___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v102___simple_call__function_i [backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0 [backendopt:inlining] 0.00 memo_emptystrfun_0 [backendopt:inlining] 0.00 ll_setitem_nonneg__dum_nocheckConst_arrayPtr_Signed_Signed [backendopt:inlining] 0.00 gc_thread_run [backendopt:inlining] 0.00 ll_getlength__stringbuilderPtr [backendopt:inlining] 0.00 RPyThreadStart__bootstrapConst_star_1 [backendopt:inlining] 0.00 memo_conststr_0 [backendopt:inlining] 0.00 ll_unsigned__Unsigned [backendopt:inlining] 0.00 conditional_call__v100___simple_call__function_c_star_3 [backendopt:inlining] 0.00 isvirtual__v94___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v96___simple_call__function_is [backendopt:inlining] 0.00 isvirtual__v88___simple_call__function_is [backendopt:inlining] 0.00 memo__sizeof_none_0 [backendopt:inlining] 0.00 fmod__Float_Float_star_2 [backendopt:inlining] 0.00 _get_raw_buf__rpy_string [backendopt:inlining] 0.00 ll_getitem_nonneg__dum_nocheckConst_ll_getitem_foldable_nonnegCons_arrayPtr_Signed [backendopt:inlining] 0.00 conditional_call__v104___simple_call__function_c_star_3 [backendopt:inlining] 0.00 get_nonmovingbuffer_ll [backendopt:inlining] 0.00 copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed [backendopt:inlining] 0.00 memo__sizeof_none_0 [backendopt:inlining] 0.00 _PyPy_dg_freedtoa__arrayPtr_star_1 [backendopt:inlining] 0.00 conditional_call__v76___simple_call__function_co_star_3 [backendopt:inlining] 0.00 widen__int [backendopt:inlining] 0.00 scoped_nonmovingbuffer.__init__ [backendopt:inlining] 0.00 isconstant__v75___simple_call__function_is [backendopt:inlining] 0.00 scoped_nonmovingbuffer.__enter__ [backendopt:inlining] 0.00 ll_getitem_nonneg__dum_nocheckConst_ll_getitem_foldable_nonnegCons_arrayPtr_Signed [backendopt:inlining] 0.00 copy_string_to_raw [backendopt:inlining] 0.00 gc_thread_die [backendopt:inlining] 0.00 write__Signed_arrayPtr_Signed_star_3 [backendopt:inlining] 0.00 __exit____star_3 [backendopt:inlining] 0.00 select__Signed_arrayPtr_arrayPtr_arrayPtr_timevalPtr_star_5 [backendopt:inlining] 2.00 ll_length__listPtr [backendopt:inlining] 2.00 getraw [backendopt:inlining] 2.00 ll_strlen__rpy_stringPtr [backendopt:inlining] 2.00 ll_length__listPtr [backendopt:inlining] 2.00 getraw [backendopt:inlining] 2.00 setraw [backendopt:inlining] 2.00 setraw [backendopt:inlining] 2.00 ll_items__listPtr [backendopt:inlining] 2.00 ll_items__listPtr [backendopt:inlining] 2.00 ll_uint_py_div__Unsigned_Unsigned [backendopt:inlining] 2.00 ll_unsigned__Signed [backendopt:inlining] 2.00 ll_uint_py_mod__Unsigned_Unsigned [backendopt:inlining] 2.00 ll_length__rpy_stringPtr [backendopt:inlining] 2.00 ll_math_isnan__Float [backendopt:inlining] 2.00 ll_fixed_newlist__GcArray_SignedLlT_Signed [backendopt:inlining] 2.00 get_or_make_raw [backendopt:inlining] 2.00 ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__enter__ [backendopt:inlining] 2.00 getraw [backendopt:inlining] 4.00 ll_str__StringR_Ptr_GcStruct_rpy_strin_rpy_stringPtr [backendopt:inlining] 4.00 ll_stritem_nonneg__rpy_stringPtr_Signed [backendopt:inlining] 4.00 ll_fixed_getitem_fast__arrayPtr_Signed [backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed [backendopt:inlining] 4.00 ll_fixed_getitem_fast__arrayPtr_Signed [backendopt:inlining] 4.00 ll_min__Unsigned_Unsigned [backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed [backendopt:inlining] 4.00 loop_unrolling_heuristic__v68___simple_call__function_lo [backendopt:inlining] 4.00 ll_math_isfinite__Float [backendopt:inlining] 4.00 ll_fixed_setitem_fast__arrayPtr_Signed_Signed [backendopt:inlining] 4.00 __exit____star_3 [backendopt:inlining] 4.00 setintfield__timevalPtr_c_tv_sec_Signed [backendopt:inlining] 4.00 setintfield__timevalPtr_c_tv_usec_Signed [backendopt:inlining] 5.00 release [backendopt:inlining] 2.00 get_saved_errno [backendopt:inlining] 5.00 allocate [backendopt:inlining] 2.00 get_ident [backendopt:inlining] 2.00 get_or_make_ident [backendopt:inlining] 5.50 ll_math_isinf__Float [backendopt:inlining] 6.00 ScopedAlloc_Struct timeval { c_tv_sec, c_tv_usec }.__init__ [backendopt:inlining] 6.00 _str_ofs__rpy_string [backendopt:inlining] 7.00 mallocstr__Signed [backendopt:inlining] 7.00 ll_str__IntegerR_SignedConst_Signed [backendopt:inlining] 2.00 ll_len__listPtr [backendopt:inlining] 4.00 ll_getitem_foldable_nonneg__arrayPtr_Signed [backendopt:inlining] 4.00 ll_getitem_foldable_nonneg__arrayPtr_Signed [backendopt:inlining] 7.00 ll_build_look_inside_iff__stringbuilderPtr [backendopt:inlining] 7.00 ll_shrink_array__rpy_stringPtr_Signed [backendopt:inlining] 7.00 ll_listdelslice_startonly_look_inside_iff__listPtr_Signed [backendopt:inlining] 7.00 rpython_print_newline [backendopt:inlining] 7.00 start_new_thread__bootstrap [backendopt:inlining] 7.00 llrepr_out__int [backendopt:inlining] 7.50 ll_char_isdigit__Char [backendopt:inlining] 7.50 mallocstr__Signed [backendopt:inlining] 8.00 ll_newrange__Ptr_GcStruct_rangeLlT_Signed_Signed [backendopt:inlining] 8.00 ll_newemptylist__GcStruct_listLlT [backendopt:inlining] 8.00 ll_listiter__Ptr_GcStruct_listiterLlT_listPtr [backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool [backendopt:inlining] 9.00 ll_join_strs_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT [backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool [backendopt:inlining] 9.00 formatd__Float_Char_Signed_Signed [backendopt:inlining] 9.00 formatd__Float_Char_Signed_Signed [backendopt:inlining] 9.00 ll_str__FloatR_FloatConst_Float [backendopt:inlining] 9.00 ll_join_chars_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT [backendopt:inlining] 9.50 ll_chr2str__Char [backendopt:inlining] 7.00 acquire [backendopt:inlining] 10.75 GILThreadLocals.setup_threads [backendopt:inlining] 10.75 ll_lower_char__Char [backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed [backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed [backendopt:inlining] 11.00 ll_stringslice_startonly__rpy_stringPtr_Signed [backendopt:inlining] 6.00 ll_getitem_fast__listPtr_Signed [backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_GCREFPtr [backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_Char [backendopt:inlining] 12.00 ll_rangeiter__Ptr_GcStruct_rangeLlT_rangePtr [backendopt:inlining] 12.00 ll_striter__rpy_stringPtr [backendopt:inlining] 9.00 acquire_maybe_in_new_thread [backendopt:inlining] 12.50 ll_rangenext_up__rangePtr_Signed [backendopt:inlining] 12.00 scoped_alloc__timeval_False [backendopt:inlining] 13.00 free_nonmovingbuffer_ll [backendopt:inlining] 9.00 ll_listdelslice_startonly__v91___simple_call__function_ll [backendopt:inlining] 9.00 ll_listdelslice_startonly__v99___simple_call__function_ll [backendopt:inlining] 12.00 bootstrap [backendopt:inlining] 15.50 ll_strnext__stringiterPtr [backendopt:inlining] 17.00 ll_contains__rpy_stringPtr_Char [backendopt:inlining] 18.12 ll_stringslice_startstop__rpy_stringPtr_Signed_Signed [backendopt:inlining] 19.00 ll_shrink_final__stringbuilderPtr [backendopt:inlining] 21.00 ccall_fmod [backendopt:inlining] 22.00 ll_shrink_array__rpy_stringPtr_Signed [backendopt:inlining] 19.00 ll_listnext__listiterPtr [backendopt:inlining] 17.00 ll_append__listPtr_Char [backendopt:inlining] 17.00 ll_append__listPtr_GCREFPtr [backendopt:inlining] 19.25 _errno_after__v125___simple_call__function__ [backendopt:inlining] 19.25 _errno_after__v66___simple_call__function__e [backendopt:inlining] 19.25 _errno_after__v64___simple_call__function__e [backendopt:inlining] 26.16 ll_join_chars__v86___simple_call__function_ll [backendopt:inlining] 26.16 ll_join_chars__v90___simple_call__function_ll [backendopt:inlining] 27.50 ll_new__Signed [backendopt:inlining] 27.50 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed [backendopt:inlining] 30.25 handle_posix_error__write [backendopt:inlining] 31.87 _errno_before__v124___simple_call__function__ [backendopt:inlining] 31.87 _errno_before__v65___simple_call__function__e [backendopt:inlining] 31.87 _errno_before__v63___simple_call__function__e [backendopt:inlining] inlined 330 callsites. [backendopt:malloc] starting malloc removal [backendopt:malloc] 2 simple mallocs removed in 'f' [backendopt:malloc] 2 simple mallocs removed in 'll_start_new_thread__bootstrap' [backendopt:malloc] 2 simple mallocs removed in 'RPyThreadStart__bootstrapConst_star_1' [backendopt:malloc] 1 simple mallocs removed in 'wrapper' [backendopt:malloc] 3 simple mallocs removed in 'write' [backendopt:malloc] 2 simple mallocs removed in 'runme' [backendopt:malloc] 2 simple mallocs removed in 'scoped_nonmovingbuffer.__init__' [backendopt:malloc] 7 simple mallocs removed in 'write__Signed_arrayPtr_Signed_star_3' [backendopt:malloc] 1 simple mallocs removed in 'sleep' [backendopt:malloc] 1 simple mallocs removed in 'rpython_print_item' [backendopt:malloc] 3 simple mallocs removed in 'select__Signed_arrayPtr_arrayPtr_arrayPtr_timevalPtr_star_5' [backendopt:malloc] 1 simple mallocs removed in 'rpython_print_end' [backendopt:malloc] 5 simple mallocs removed in 'll_math_fmod__Float_Float' [backendopt:malloc] 13 simple mallocs removed in '_PyPy_dg_dtoa__Float_Signed_Signed_arrayPtr_arrayPtr_arrayPtr_star_6' [backendopt:malloc] 3 simple mallocs removed in '_PyPy_dg_freedtoa__arrayPtr_star_1' [backendopt:malloc] 7 simple mallocs removed in 'format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool' [backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v76___simple_call__function_co_star_3' [backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_le__listPtr_Signed' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v100___simple_call__function_c_star_3' [backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v104___simple_call__function_c_star_3' [backendopt:malloc] 1 simple mallocs removed in 'll_append_char__stringbuilderPtr_Char' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v113___simple_call__function_c_star_2' [backendopt:malloc] 4 simple mallocs removed in '_ll_append_multiple_char__stringbuilderPtr_Char_Signed' [backendopt:malloc] 5 simple mallocs removed in 'fmod__Float_Float_star_2' [backendopt:malloc] 3 simple mallocs removed in '_likely_raise' [backendopt:malloc] 3 simple mallocs removed in 'fabs__Float_star_1' [backendopt:malloc] removed 78 simple mallocs in total [backendopt:mergeifblocks] starting to merge if blocks [backendopt] merging blocks in dtoa_formatd__Float_Char_Signed_Signed [backendopt] merging blocks in format_number__arrayPtr_Signed_Signed_Signed_Char_Signed_Signed_Bool [c58163bbf3bf500] translation-task} [translation:info] usession directory: /build_dir/tmp/pytest/usession-main-501 [translation:info] already done: Annotating&simplifying [translation:info] already done: RTyping [translation:info] already done: lltype back-end optimisations [translation:info] inserting stack checks... [c58163bbf45d400] {translation-task starting stackcheckinsertion_lltype [flowgraph] (rpython.rlib.rstack:42)stack_check [flowgraph] (rpython.rlib.rstack:67)stack_check_slowpath [rtyper] -=- specialized 8 more blocks -=- [translation:info] inserted 0 stack checks. [c58163bc0a03980] translation-task} [translation:info] Creating database for generating c source... [c58163bc0a1a300] {translation-task starting database_c [flowgraph] (rpython.translator.exceptiontransform:100)rpyexc_occurred [flowgraph] (rpython.translator.exceptiontransform:104)rpyexc_fetch_type [flowgraph] (rpython.translator.exceptiontransform:107)rpyexc_fetch_value [flowgraph] (rpython.translator.exceptiontransform:110)rpyexc_clear [flowgraph] (rpython.translator.exceptiontransform:114)rpyexc_raise [flowgraph] (rpython.translator.exceptiontransform:128)rpyexc_reraise [flowgraph] (rpython.translator.exceptiontransform:133)rpyexc_fetch_exception [flowgraph] (rpython.translator.exceptiontransform:138)rpyexc_restore_exception [flowgraph] (rpython.translator.exceptiontransform:539)rpyexc_get_exception_addr [flowgraph] (rpython.translator.exceptiontransform:543)rpyexc_get_exc_value_addr [flowgraph] (rpython.rtyper.rclass:1173)ll_inst_type [rtyper] specializing: 1100 / 1117 blocks (98%) [rtyper] -=- specialized 25 more blocks -=- [flowgraph] (rpython.memory.gctransform.transform:447)_ll_malloc_fixedsize [flowgraph] (rpython.memory.gctransform.transform:454)_ll_malloc_fixedsize_zero [flowgraph] (rpython.memory.gctransform.transform:470)_ll_malloc_varsize_no_length [flowgraph] (rpython.memory.gctransform.transform:487)ll_malloc_varsize [flowgraph] (rpython.memory.gctransform.transform:493)_ll_malloc_varsize_no_length_zero [c58163bc3892480] translation-task} __________________________ AppTestLocal.test_local_1 ___________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf300caac>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_1'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a3c32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d94cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_1'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d94cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_1'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3652dc4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf33ba56c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf33ba56c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3652cd4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf33ecbac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf33ecbac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...st_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_1'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_local_1'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_local_1'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_local_1'>, space = StdObjSpace target = <function test_local_1 at 0xf300848c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>,) w_func = <Function test_local_1> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_local_1> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_local_1> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_local_1, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] return new_frame.run() elif nargs >= 1 and fast_natural_arity == Code.PASSTHROUGHARGS1: assert isinstance(code, gateway.BuiltinCodePassThroughArguments1) return code.funcrun_obj(self, args_w[0], Arguments(self.space, list(args_w[1:]))) > return self.call_args(Arguments(self.space, list(args_w))) interpreter/function.py:124: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_local_1> args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>]) def call_args(self, args): # delegate activation to code > w_res = self.getcode().funcrun(self, args) interpreter/function.py:68: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <code object test_local_1, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> func = <Function test_local_1> args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>]) def funcrun(self, func, args): frame = self.space.createframe(self, func.w_func_globals, func) sig = self._signature # speed hack fresh_frame = jit.hint(frame, access_directly=True, fresh_virtualizable=True) args.parse_into_scope(None, fresh_frame.locals_cells_stack_w, func.name, sig, func.defs_w) fresh_frame.init_cells() > return frame.run() interpreter/pycode.py:223: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33 pycode = <code object test_local_1, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> next_instr = 144 ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf509430c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x02\x00l\x00\x00m\x02\x00}\x03\x00...x00s:\x01t\x08\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x03\x00d\x05\x00k\x02\x00sR\x01t\x08\x00\x82\x01\x00d\x00\x00S' next_instr = 144 ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf509430c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x02\x00l\x00\x00m\x02\x00}\x03\x00...x00s:\x01t\x08\x00\x82\x01\x00\xcc\x15\x00\x88\x00\x00j\x03\x00d\x05\x00k\x02\x00sR\x01t\x08\x00\x82\x01\x00d\x00\x00S' next_instr = 235L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf509430c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_1,...inux-x86-32/build/pypy/module/thread/test/test_local.py:6]', line 1> at line 33 nameindex = 9, ignored = (235L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf51e4d2c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf51e4d2c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf51e4d2c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ___________________ AppTestLocal.test_local_is_not_immortal ____________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf471adbc>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_is_not_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_is_not_immortal'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a3c32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d94cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_is_not_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_is_not_immortal'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d94cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_is_not_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_local_is_not_immortal'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_is_not_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf4c2cc34> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf334980c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf334980c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_is_not_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3619144> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf334978c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf334978c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...t_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_local_is_not_immortal'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_local_is_not_immortal'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_local_is_not_immortal'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_local_is_not_immortal'>, space = StdObjSpace target = <function test_local_is_not_immortal at 0xf4981304> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>,) w_func = <Function test_local_is_not_immortal> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_local_is_not_immortal> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_local_is_not_immortal> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_local_is_not_immortal, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] return new_frame.run() elif nargs >= 1 and fast_natural_arity == Code.PASSTHROUGHARGS1: assert isinstance(code, gateway.BuiltinCodePassThroughArguments1) return code.funcrun_obj(self, args_w[0], Arguments(self.space, list(args_w[1:]))) > return self.call_args(Arguments(self.space, list(args_w))) interpreter/function.py:124: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_local_is_not_immortal> args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>]) def call_args(self, args): # delegate activation to code > w_res = self.getcode().funcrun(self, args) interpreter/function.py:68: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <code object test_local_is_not_immortal, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> func = <Function test_local_is_not_immortal> args = Arguments([<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf4d00d8c>]) def funcrun(self, func, args): frame = self.space.createframe(self, func.w_func_globals, func) sig = self._signature # speed hack fresh_frame = jit.hint(frame, access_directly=True, fresh_virtualizable=True) args.parse_into_scope(None, fresh_frame.locals_cells_stack_w, func.name, sig, func.defs_w) fresh_frame.init_cells() > return frame.run() interpreter/pycode.py:223: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17 pycode = <code object test_local_is_not_immortal, file '[/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf509430c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00d\x02\x00...\x00d\x0b\x00g\x02\x00k\x02\x00s\xc7\x00t\x08\x00\x82\x01\x00\x88\x00\x00\xc9\t\x00d\x0c\x00\xca\x01\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf509430c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x01\x00d\x00\x00l\x02\x00}\x03\x00d\x02\x00...\x00d\x0b\x00g\x02\x00k\x02\x00s\xc7\x00t\x08\x00\x82\x01\x00\x88\x00\x00\xc9\t\x00d\x0c\x00\xca\x01\x00\x01d\x00\x00S' next_instr = 168L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf509430c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_local_is...ux-x86-32/build/pypy/module/thread/test/test_local.py:111]', line 1> at line 17 nameindex = 7, ignored = (168L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf51e4d2c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf51e4d2c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf51e4d2c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _______________________ AppTestThread.test_thread_count ________________________ self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf351394c> def test_thread_count(self): import thread, time feedback = [] please_start = [] def f(): feedback.append(42) self.waitfor(lambda: please_start) > assert thread._count() == 0 E (application-level) AssertionError: assert 1 == 0 E + where 1 = <built-in function _count>() E + where <built-in function _count> = <built-in function _count> E + where <built-in function _count> = <module 'thread' (built-in)>._count [/build_dir/own-linux-x86-32/build/pypy/module/thread/test/test_thread.py:21]:8: AssertionError =========================== short test summary info ============================ FAIL module/thread/test/test_gil.py::TestUsingFramework::()::test_one_thread FAIL module/thread/test/test_gil.py::TestUsingFramework::()::test_one_thread_rev FAIL module/thread/test/test_local.py::AppTestLocal::()::test_local_1 FAIL module/thread/test/test_local.py::AppTestLocal::()::test_local_is_not_immortal FAIL module/thread/test/test_thread.py::AppTestThread::()::test_thread_count =============== 5 failed, 42 passed, 1 skipped in 150.12 seconds =============== ++ 22:34:15 starting module/zipimport/test [123 started in total] __ module/test_lib_pypy [120 done in total, somefailed=False] _________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 200 items / 7 skipped module/test_lib_pypy/test_collections.py ..................... module/test_lib_pypy/test_marshal_extra.py ....................................................................................................................................................... module/test_lib_pypy/test_md5_extra.py ...... module/test_lib_pypy/test_msvcrt.py s module/test_lib_pypy/test_pickle_extra.py s module/test_lib_pypy/test_sha_extra.py ... module/test_lib_pypy/test_site_extra.py . module/test_lib_pypy/test_structseq.py ......... module/test_lib_pypy/test_tputil.py ..s.... =================== 197 passed, 10 skipped in 248.78 seconds =================== ++ 22:35:48 starting module/zlib/test [124 started in total] __ module/micronumpy/test [121 done in total, somefailed=True] ________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 705 items / 1 skipped module/micronumpy/test/test_appbridge.py .. module/micronumpy/test/test_arrayops.py .................... module/micronumpy/test/test_broadcast.py ....... module/micronumpy/test/test_casting.py ........ module/micronumpy/test/test_compile.py .............................s........ module/micronumpy/test/test_complex.py ......................... module/micronumpy/test/test_deprecations.py . module/micronumpy/test/test_dtypes.py .............................................................................s...... module/micronumpy/test/test_flagsobj.py ....... module/micronumpy/test/test_iterators.py ... module/micronumpy/test/test_ndarray.py ...................................................................................................................................................................................................................................................................................................... module/micronumpy/test/test_nditer.py .......s......ss..s module/micronumpy/test/test_object_arrays.py ......sF.s..s module/micronumpy/test/test_outarg.py ..... module/micronumpy/test/test_scalar.py ................................... module/micronumpy/test/test_selection.py ........s.sss..... module/micronumpy/test/test_subtype.py ......................... module/micronumpy/test/test_support.py . module/micronumpy/test/test_support_app.py .... module/micronumpy/test/test_ufuncs.py ................................................................................................ =================================== FAILURES =================================== __________________ AppTestObjectDtypes.test_keep_object_alive __________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xed224224>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keep_object_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keep_object_alive'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a7f32c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a1b76c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keep_object_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keep_object_alive'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf6a1b76c>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keep_object_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_keep_object_alive'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keep_object_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xed1c4cd4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ject_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xed227bec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xed227bec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ject_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keep_object_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xed1c4c34> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ject_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xed227fac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xed227fac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...ject_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_keep_object_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_keep_object_alive'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_keep_object_alive'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_keep_object_alive'>, space = StdObjSpace target = <function test_keep_object_alive at 0xed1cab54> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xed250bac>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xed250bac>,) w_func = <Function test_keep_object_alive> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xed250bac> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_keep_object_alive> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xed250bac>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_keep_object_alive> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xed250bac>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_keep_object_alive, file '[/build_dir/own-linux-x86-32/build/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11 pycode = <code object test_keep_object_alive, file '[/build_dir/own-linux-x86-32/build/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xee9b1d4c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...01\xcc\x1c\x00|\x05\x00d\x06\x00\x19\xc9\x05\x00\xca\x00\x00d\x07\x00k\x02\x00s\x7f\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xee9b1d4c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x01\x00d\x01\x00d\x00\x00l\x01\x00}\x02\x00d\x02\x00t\x02\x00f\x01\x00d\x03\x00\x84\x00\...01\xcc\x1c\x00|\x05\x00d\x06\x00\x19\xc9\x05\x00\xca\x00\x00d\x07\x00k\x02\x00s\x7f\x00t\x06\x00\x82\x01\x00d\x00\x00S' next_instr = 92L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xee9b1d4c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_keep_obj...ild/pypy/module/micronumpy/test/test_object_arrays.py:102]', line 1> at line 11 nameindex = 4, ignored = (92L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xee94e5ac> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xee94e5ac> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xee94e5ac> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError =========================== short test summary info ============================ FAIL module/micronumpy/test/test_object_arrays.py::AppTestObjectDtypes::()::test_keep_object_alive ============== 1 failed, 691 passed, 14 skipped in 606.67 seconds ============== ++ 22:36:03 starting objspace/fake/test [125 started in total] __ objspace/fake/test [122 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 21 items objspace/fake/test/test_checkmodule.py ........ objspace/fake/test/test_objspace.py ............. ========================== 21 passed in 17.67 seconds ========================== ++ 22:36:24 starting objspace/std/test [126 started in total] __ module/zlib/test [123 done in total, somefailed=False] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 31 items module/zlib/test/test_zlib.py ............................s.. ==================== 30 passed, 1 skipped in 45.61 seconds ===================== ++ 22:36:39 starting objspace/test [127 started in total] __ objspace/test [124 done in total, somefailed=False] ________________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 59 items objspace/test/apptest_binop_overriding.py . objspace/test/apptest_descriptor.py ........ objspace/test/apptest_descroperation.py ............s.......................... objspace/test/test_descroperation.py ........... ==================== 58 passed, 1 skipped in 18.74 seconds ===================== ++ 22:36:59 starting sandbox/test [128 started in total] __ sandbox/test [125 done in total, somefailed=True] __________________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 1 items sandbox/test/test_pypy_interact.py E ==================================== ERRORS ==================================== __________________________ ERROR at setup of test_run __________________________ mod = <module 'test_pypy_interact' from '/build_dir/own-linux-x86-32/build/pypy/sandbox/test/test_pypy_interact.py'> def setup_module(mod): t = Translation(mini_pypy_like_entry_point, backend='c', sandbox=True, lldebug=True) > mod.executable = str(t.compile()) sandbox/test/test_pypy_interact.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ../rpython/translator/interactive.py:117: in compile getattr(self.driver, 'compile_' + backend)() ../rpython/translator/driver.py:108: in proc return self.proceed(backend_goal) ../rpython/translator/driver.py:568: in proceed result = self._execute(goals, task_skip = self._maybe_skip()) ../rpython/translator/tool/taskengine.py:114: in _execute res = self._do(goal, taskcallable, *args, **kwds) ../rpython/translator/driver.py:278: in _do res = func() ../rpython/translator/driver.py:435: in task_database_c database = cbuilder.build_database() ../rpython/translator/c/genc.py:102: in build_database self.config.translation.reverse_debugger) ../rpython/translator/c/database.py:64: in __init__ self.gctransformer = self.gcpolicy.gettransformer(translator, gchooks) ../rpython/translator/c/gc.py:452: in gettransformer return shadowstack.ShadowStackFrameworkGCTransformer(translator, gchooks) ../rpython/memory/gctransform/framework.py:132: in __init__ GCClass, GC_PARAMS = choose_gc_from_config(translator.config) ../rpython/memory/gc/base.py:593: in choose_gc_from_config globals(), locals(), [classname]) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ import sys from rpython.memory.gc.semispace import SemiSpaceGC from rpython.memory.gc.semispace import GCFLAG_EXTERNAL, GCFLAG_FORWARDED from rpython.memory.gc.semispace import GC_HASH_TAKEN_ADDR > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/generation.py:5: SyntaxError ---------------------------- Captured stderr setup ----------------------------- [flowgraph] (test_pypy_interact:20)mini_pypy_like_entry_point [translation:info] Annotating&simplifying... [c58165c46c8c100] {translation-task starting annotate [translation:info] with policy: rpython.annotator.policy.AnnotatorPolicy [flowgraph] (test_pypy_interact:15)assert_ [flowgraph] (rpython.flowspace.specialcase:76)rpython_print_item [flowgraph] (rpython.rtyper.controllerentry:80)getattr [flowgraph] (rpython.flowspace.specialcase:95)rpython_print_newline [flowgraph] (rpython.flowspace.specialcase:85)rpython_print_end [flowgraph] (rpython.rlib.rposix_environ:61)get_items [flowgraph] (rpython.rlib.rposix:500)write [flowgraph] (rpython.rtyper.lltypesystem.rffi:1427)scoped_nonmovingbuffer.__init__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:1431)scoped_nonmovingbuffer.__enter__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:873)get_nonmovingbuffer_ll [flowgraph] (rpython.rlib.objectmodel:315)we_are_translated_to_c [flowgraph] (rpython.rtyper.lltypesystem.rstr:116)copy_string_to_raw [flowgraph] (rpython.rtyper.lltypesystem.rstr:63)_get_raw_buf [flowgraph] (rpython.rtyper.lltypesystem.rstr:57)_str_ofs [flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof [flowgraph] (rpython.rlib.rposix_stat:637)lstat [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)write [flowgraph] (rpython.rtyper.lltypesystem.rffi:1433)scoped_nonmovingbuffer.__exit__ [flowgraph] (rpython.rtyper.lltypesystem.lltype:2296)scoped_alloc [flowgraph] (rpython.rtyper.lltypesystem.lltype:2280)ScopedAlloc_Struct stat { c_st_dev, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c__pad8, c__pad9, c__pad10, c__pad11, c_st_size, c_st_blksize, c_st_blocks, c_st_atim, c_st_mtim, c_st_ctim, c_st_ino }.__init__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:937)free_nonmovingbuffer_ll [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_write [flowgraph] (rpython.rlib.rgil:160)release [flowgraph] (rpython.rtyper.lltypesystem.lltype:2286)ScopedAlloc_Struct stat { c_st_dev, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c__pad8, c__pad9, c__pad10, c__pad11, c_st_size, c_st_blksize, c_st_blocks, c_st_atim, c_st_mtim, c_st_ctim, c_st_ino }.__enter__ [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rthread:349)getraw [flowgraph] (rpython.rlib.rthread:349)getraw [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rposix:385)_as_bytes0 [flowgraph] (rpython.rtyper.lltypesystem.lltype:2289)ScopedAlloc_Struct stat { c_st_dev, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c__pad8, c__pad9, c__pad10, c__pad11, c_st_size, c_st_blksize, c_st_blocks, c_st_atim, c_st_mtim, c_st_ctim, c_st_ino }.__exit__ [flowgraph] (rpython.rlib.rthread:364)setraw [flowgraph] (rpython.rlib.rposix:371)_as_bytes [flowgraph] (rpython.rlib.rthread:364)setraw [flowgraph] (rpython.rlib.rgil:171)acquire [flowgraph] (rpython.rlib.rthread:282)gc_thread_run [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)lstat [flowgraph] (rpython.rtyper.lltypesystem.rffi:926)get_nonmovingbuffer_ll_final_null [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_lstat [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rposix:430)handle_posix_error [flowgraph] (rpython.rlib.rarithmetic:139)widen [flowgraph] (rpython.rlib.rposix:113)get_saved_errno [flowgraph] (rpython.rlib.rposix_stat:501)build_stat_result [flowgraph] (stat:49)S_ISREG [flowgraph] (stat:24)S_IFMT [flowgraph] (rpython.rtyper.controllerentry:80)getattr [flowgraph] (rpython.rlib.rposix_stat:624)stat [flowgraph] (rpython.rlib.rposix_environ:66)get_get [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)stat [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_stat [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rposix:461)open [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)open [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_open [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rposix:430)handle_posix_error [flowgraph] (rpython.rlib.rposix:430)handle_posix_error [flowgraph] (stat:40)S_ISDIR [flowgraph] (rpython.rlib.rposix:490)read [flowgraph] (rpython.rtyper.lltypesystem.rffi:1469)scoped_alloc_buffer.__init__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:1471)scoped_alloc_buffer.__enter__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:953)alloc_buffer [flowgraph] (?:2)mallocstr [flowgraph] (rpython.rtyper.lltypesystem.rstr:36)mallocstr [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)read [flowgraph] (rpython.rtyper.lltypesystem.rffi:1474)scoped_alloc_buffer.__exit__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:1008)keep_buffer_alive_until_here [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_read [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rposix:430)handle_posix_error [flowgraph] (rpython.rtyper.lltypesystem.rffi:1476)scoped_alloc_buffer.str [flowgraph] (?:2)str_from_buffer [flowgraph] (rpython.rtyper.lltypesystem.rffi:988)str_from_buffer [flowgraph] (rpython.rtyper.lltypesystem.rstr:145)copy_raw_to_string [flowgraph] (rpython.rlib.rposix:508)close [flowgraph] (rpython.rlib.rposix:268)SuppressIPH.__init__ [flowgraph] (rpython.rlib.rposix:271)SuppressIPH.__enter__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)close [flowgraph] (rpython.rlib.rposix:274)SuppressIPH.__exit__ [flowgraph] (rpython.rtyper.lltypesystem.rffi:2)ccall_close [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rlib.rposix:430)handle_posix_error [flowgraph] (rpython.rlib.rposix:730)getcwd [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)getcwd [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_getcwd [flowgraph] (rpython.rlib.rposix:151)_errno_before [flowgraph] (rpython.rlib.rposix:170)_errno_after [flowgraph] (rpython.rtyper.lltypesystem.rffi:854)charp2str [flowgraph] (rpython.rtyper.lltypesystem.rffi:1030)charpsize2str [flowgraph] (rpython.rlib.rposix:1182)strerror [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)strerror [flowgraph] (rpython.rlib.rposix:430)handle_posix_error [flowgraph] (rpython.rlib.rposix:1162)isatty [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)isatty [flowgraph] (rpython.rtyper.lltypesystem.rffi:3)ccall_isatty [flowgraph] (?:1)memo_offsetof_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (?:1)memo__sizeof_none_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (?:1)memo__make_scoped_allocator_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__should_widen_type_0 [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_envitems [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_getenv [flowgraph] (rpython.rlib.rmarshal:223)dump_string_or_none [flowgraph] (rpython.rlib.rmarshal:119)w_long [flowgraph] (rpython.rlib.rmarshal:129)dump_none [flowgraph] (rpython.rlib.rmarshal:473)dump_tuple [flowgraph] (rpython.rlib.rmarshal:473)dump_tuple [flowgraph] (rpython.translator.sandbox.rsandbox:72)sandboxed_io [flowgraph] (rpython.rtyper.lltypesystem.lltype:2296)scoped_alloc [flowgraph] (rpython.rtyper.lltypesystem.lltype:2280)ScopedAlloc_Array of Char {'nolength': True} .__init__ [flowgraph] (rpython.rtyper.lltypesystem.lltype:2286)ScopedAlloc_Array of Char {'nolength': True} .__enter__ [flowgraph] (rpython.translator.sandbox.rsandbox:40)writeall_not_sandboxed [flowgraph] (rpython.rtyper.lltypesystem.lltype:2289)ScopedAlloc_Array of Char {'nolength': True} .__exit__ [flowgraph] (rpython.translator.sandbox.rsandbox:55)FdLoader.__init__ [flowgraph] (rpython.rlib.rmarshal:173)load_int [flowgraph] (rpython.rlib.rmarshal:284)Loader.__init__ [flowgraph] (rpython.rlib.rmarshal:312)readchr [flowgraph] (rpython.translator.sandbox.rsandbox:60)FdLoader.need_more_data [flowgraph] (rpython.rlib.rmarshal:325)readlong [flowgraph] (rpython.translator.sandbox.rsandbox:90)reraise_error [flowgraph] (rpython.rlib.rmarshal:266)load_string_or_none [flowgraph] (rpython.rlib.rmarshal:408)load_list_or_none [flowgraph] (rpython.rlib.rmarshal:298)readstr [flowgraph] (rpython.rlib.rmarshal:487)load_tuple [flowgraph] (rpython.rlib.rmarshal:246)load_string [flowgraph] (rpython.rlib.rmarshal:288)Loader.check_finished [flowgraph] (?:1)memo__make_scoped_allocator_0 [c58165c779a1380] translation-task} [translation:info] RTyping... [c58165c779b3100] {translation-task starting rtype_lltype [flowgraph] (rpython.rtyper.rclass:1170)ll_runtime_type_info [flowgraph] (rpython.rtyper.rlist:572)ll_len [flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length [flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg [flowgraph] (rpython.rtyper.rlist:717)ll_getitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rlist:372)ll_getitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items [flowgraph] (rpython.rtyper.rstr:425)ll_str [flowgraph] (?:1)memo_ll_constant_0 [flowgraph] (?:11)ll_join_strs_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs [flowgraph] (rpython.rtyper.lltypesystem.llmemory:1037)cast_any_ptr [flowgraph] (rpython.rtyper.lltypesystem.rstr:785)<lambda> [flowgraph] (rpython.rlib.jit:294)loop_unrolling_heuristic [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.rstr:78)copy_string_contents [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (?:2)ll_join_strs_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rstr:783)ll_join_strs [flowgraph] (rpython.rtyper.rlist:588)ll_append [flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda> [flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:2)ll_arraycopy [flowgraph] (rpython.rlib.rgc:362)ll_arraycopy [flowgraph] (rpython.rlib.rgc:342)copy_item [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast [flowgraph] (?:2)_ll_list_resize_hint_really_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (?:1)memo__ll_prebuilt_empty_array_0 [flowgraph] (?:1)memo__contains_gcptr_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (rpython.rtyper.lltypesystem.rstr:1293)ll_striter [flowgraph] (rpython.rtyper.lltypesystem.rstr:1306)ll_strnext [rtyper] specializing: 100 / 803 blocks (12%) [flowgraph] (?:11)ll_join_chars_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars [flowgraph] (rpython.rtyper.lltypesystem.rstr:821)<lambda> [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (?:2)ll_join_chars_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rstr:820)ll_join_chars [flowgraph] (rpython.rtyper.lltypesystem.rstr:425)ll_strconcat [flowgraph] (rpython.rtyper.lltypesystem.rstr:416)ll_length [rtyper] specializing: 200 / 834 blocks (23%) [flowgraph] (rpython.rtyper.lltypesystem.rstr:350)ll_strlen [flowgraph] (rpython.rtyper.rlist:572)ll_len [flowgraph] (rpython.rtyper.lltypesystem.rlist:365)ll_length [flowgraph] (rpython.rtyper.rlist:688)ll_getitem_nonneg [flowgraph] (rpython.rtyper.rlist:717)ll_getitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rlist:372)ll_getitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rlist:369)ll_items [flowgraph] (rpython.rtyper.lltypesystem.rstr:601)ll_streq [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_lstat [flowgraph] (rpython.rtyper.lltypesystem.rlist:384)ll_fixed_newlist [flowgraph] (rpython.rtyper.rlist:726)ll_setitem_nonneg [flowgraph] (rpython.rtyper.lltypesystem.rlist:407)ll_fixed_setitem_fast [flowgraph] (rpython.rtyper.lltypesystem.rlist:470)ll_listiter [flowgraph] (rpython.rtyper.lltypesystem.rlist:484)ll_listnext_foldable [flowgraph] (rpython.rtyper.lltypesystem.rlist:395)ll_fixed_length [flowgraph] (rpython.rtyper.rlist:721)ll_getitem_foldable_nonneg [flowgraph] (rpython.rtyper.lltypesystem.rlist:402)ll_fixed_getitem_fast [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_stat [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_stat [flowgraph] (rpython.rtyper.lltypesystem.rlist:357)ll_newemptylist [flowgraph] (rpython.rtyper.lltypesystem.rlist:351)_ll_new_empty_item_array [flowgraph] (?:1)memo__ll_prebuilt_empty_array_0 [flowgraph] (rpython.rtyper.lltypesystem.rrange:70)ll_newrange [flowgraph] (rpython.rtyper.lltypesystem.rrange:91)ll_rangeiter [flowgraph] (rpython.rtyper.rrange:172)ll_rangenext_up [flowgraph] (rpython.rtyper.rlist:588)ll_append [flowgraph] (rpython.rtyper.lltypesystem.rlist:280)_ll_list_resize_ge [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:11)_ll_list_resize_hint_really_look_inside_iff [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)<lambda> [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (?:2)ll_arraycopy [flowgraph] (rpython.rlib.rgc:362)ll_arraycopy [flowgraph] (rpython.rlib.rgc:342)copy_item [flowgraph] (rpython.rtyper.lltypesystem.llmemory:411)sizeof [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rtyper.lltypesystem.rlist:377)ll_setitem_fast [flowgraph] (?:2)_ll_list_resize_hint_really_trampoline [flowgraph] (rpython.rtyper.lltypesystem.rlist:198)_ll_list_resize_hint_really [flowgraph] (?:1)memo__contains_gcptr_0 [flowgraph] (?:1)memo_itemoffsetof_0 [flowgraph] (?:1)memo__sizeof_none_0 [rtyper] specializing: 300 / 973 blocks (30%) [flowgraph] (rpython.rtyper.lltypesystem.rstr:860)ll_stringslice_startstop [flowgraph] (rpython.rtyper.lltypesystem.rstr:840)_ll_stringslice [flowgraph] (?:1)memo_emptystrfun_0 [flowgraph] (rpython.rtyper.rlist:792)ll_extend_with_str [flowgraph] (rpython.rtyper.rlist:795)ll_extend_with_str_slice_startonly [flowgraph] (rpython.rtyper.lltypesystem.rstr:354)ll_stritem_nonneg [flowgraph] (rpython.rtyper.rlist:547)listItemType [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_stat [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_open [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_read [flowgraph] (rpython.rtyper.rstr:944)ll_str_is_true [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_close [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_getcwd [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_strerror [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_isatty [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_open [rtyper] specializing: 400 / 1010 blocks (39%) [flowgraph] (?:11)ll_listdelslice_startonly_look_inside_iff [flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly [flowgraph] (rpython.rtyper.rlist:539)ll_null_item [flowgraph] (rpython.rtyper.rlist:912)<lambda> [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:281)isvirtual [flowgraph] (rpython.rtyper.lltypesystem.rlist:295)_ll_list_resize_le [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (rpython.rlib.jit:269)isconstant [flowgraph] (?:2)ll_listdelslice_startonly_trampoline [flowgraph] (rpython.rlib.jit:1300)conditional_call [flowgraph] (rpython.rtyper.rlist:912)ll_listdelslice_startonly [flowgraph] (rpython.translator.sandbox.rsandbox:157)sandboxed_ll_os.ll_os_write [rtyper] specializing: 500 / 1050 blocks (47%) [flowgraph] (rpython.rtyper.lltypesystem.rlist:357)ll_newemptylist [rtyper] specializing: 600 / 1052 blocks (57%) [rtyper] specializing: 700 / 1052 blocks (66%) [rtyper] specializing: 800 / 1052 blocks (76%) [rtyper] specializing: 900 / 1052 blocks (85%) [rtyper] specializing: 1000 / 1052 blocks (95%) [rtyper] -=- specialized 1052 blocks -=- [flowgraph] (rpython.rlib.rmarshal:473)dump_tuple [flowgraph] (rpython.rlib.rmarshal:473)dump_tuple [flowgraph] (rpython.rlib.rmarshal:157)dump_int [flowgraph] (rpython.rlib.rmarshal:379)load_with_custom_recreate [flowgraph] (rpython.rlib.rmarshal:487)load_tuple [flowgraph] (rpython.rlib.rmarshal:473)dump_tuple [flowgraph] (rpython.rlib.rmarshal:473)dump_tuple [flowgraph] (rpython.rlib.rmarshal:133)load_none [flowgraph] (rpython.rlib.rmarshal:200)load_longlong [flowgraph] (rpython.rlib.rmarshal:147)load_bool [flowgraph] (rpython.rlib.rmarshal:166)load_int_nonneg [flowgraph] (rpython.rlib.rmarshal:215)load_float [flowgraph] (rpython.rlib.rfloat:87)rstring_to_float [flowgraph] (rpython.rlib.rdtoa:54)strtod [flowgraph] (rpython.rlib.objectmodel:397)revdb_flag_io_disabled [flowgraph] (rpython.rtyper.lltypesystem.rffi:278)_PyPy_dg_strtod [flowgraph] (rpython.rlib.rposix_stat:187)stat_result_recreate [flowgraph] (?:1)memo__isfunctype_0 [flowgraph] (?:1)memo__isfunctype_0 [rtyper] specializing: 1100 / 1179 blocks (93%) [flowgraph] (rpython.rtyper.lltypesystem.ll_str:13)ll_int2dec [flowgraph] (rpython.rtyper.lltypesystem.ll_str:7)ll_unsigned [flowgraph] (rpython.rtyper.rint:525)ll_uint_py_mod [flowgraph] (rpython.rtyper.rint:434)ll_uint_py_div [rtyper] -=- specialized 147 more blocks -=- [flowgraph] (rpython.rtyper.rclass:1133)ll_issubclass [flowgraph] (rpython.rtyper.rclass:1130)ll_type [rtyper] specializing: 1200 / 1203 blocks (99%) [rtyper] -=- specialized 4 more blocks -=- [c58165cef00db00] translation-task} [translation:info] lltype back-end optimisations... [c58165cef01c780] {translation-task starting backendopt_lltype [backendopt:removecasts] removed 1 cast_pointers in assert_ [backendopt:removecasts] removed 1 cast_pointers in _get_raw_buf__rpy_string [backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__lstat [backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__open [backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__stat [backendopt:removecasts] removed 3 cast_pointers in read [backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__read [backendopt:removecasts] removed 1 cast_pointers in str_from_buffer [backendopt:removecasts] removed 1 cast_pointers in copy_raw_to_string [backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__close [backendopt:removecasts] removed 6 cast_pointers in getcwd [backendopt:removecasts] removed 1 cast_pointers in charpsize2str [backendopt:removecasts] removed 1 cast_pointers in strerror [backendopt:removecasts] removed 3 cast_pointers in handle_posix_error__write [backendopt:removecasts] removed 2 cast_pointers in isatty [backendopt:removecasts] removed 2 cast_pointers in writeall_not_sandboxed [backendopt:removecasts] removed 1 cast_pointers in load_int [backendopt:removecasts] removed 4 cast_pointers in FdLoader.need_more_data [backendopt:removecasts] removed 12 cast_pointers in reraise_error [backendopt:removecasts] removed 1 cast_pointers in load_string_or_none [backendopt:removecasts] removed 1 cast_pointers in load_list_or_none [backendopt:removecasts] removed 2 cast_pointers in readstr [backendopt:removecasts] removed 2 cast_pointers in load_tuple [backendopt:removecasts] removed 1 cast_pointers in load_string [backendopt:removecasts] removed 1 cast_pointers in Loader.check_finished [backendopt:removecasts] removed 1 cast_pointers in ll_getitem_nonneg__dum_checkidxConst_ll_getitem_fastConst_listPtr_Signed [backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v14___simple_call__function_ll [backendopt:removecasts] removed 1 cast_pointers in copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed [backendopt:removecasts] removed 1 cast_pointers in ll_join_strs__v20___simple_call__function_ll [backendopt:removecasts] removed 1 cast_pointers in ll_strnext__stringiterPtr [backendopt:removecasts] removed 1 cast_pointers in ll_listnext_foldable__listiterPtr [backendopt:removecasts] removed 1 cast_pointers in ll_rangenext_up__rangePtr_Signed [backendopt:removecasts] removed 1 cast_pointers in _ll_stringslice__rpy_stringPtr_Signed_Signed [backendopt:removecasts] removed 2 cast_pointers in ll_extend_with_str_slice_startonly__listPtr_rpy_stringPtr_ll_strlenConst_ll_stritem_nonnegConst_Signed [backendopt:removecasts] removed 2 cast_pointers in load_tuple [backendopt:removecasts] removed 1 cast_pointers in load_none [backendopt:removecasts] removed 1 cast_pointers in load_longlong [backendopt:removecasts] removed 1 cast_pointers in load_bool [backendopt:removecasts] removed 1 cast_pointers in load_int_nonneg [backendopt:removecasts] removed 1 cast_pointers in load_float [backendopt:removecasts] removed 2 cast_pointers in strtod [backendopt:inlining] phase with threshold factor: 32.4 [backendopt:inlining] heuristic: rpython.translator.backendopt.inline.inlining_heuristic [backendopt:inlining] 0.00 cast_any_ptr__Ptr_GcStruct_rpy_stringLlT_rpy_stringPtr [backendopt:inlining] 0.00 widen__int [backendopt:inlining] 0.00 memo_emptystrfun_0 [backendopt:inlining] 0.00 isconstant__v44___simple_call__function_is [backendopt:inlining] 0.00 ll_getitem_fast__listPtr_Signed [backendopt:inlining] 0.00 ll_getitem_nonneg__dum_checkidxConst_ll_getitem_fastConst_listPtr_Signed [backendopt:inlining] 0.00 copy_string_contents__rpy_stringPtr_rpy_stringPtr_Signed_Signed_Signed [backendopt:inlining] 0.00 conditional_call__v40___simple_call__function_co_star_3 [backendopt:inlining] 0.00 isconstant__v39___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v28___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v24___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v46___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v41___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v54___simple_call__function_is [backendopt:inlining] 0.00 get_nonmovingbuffer_ll_final_null [backendopt:inlining] 0.00 ll_setitem_nonneg__dum_nocheckConst_arrayPtr_Signed_GCREFPtr [backendopt:inlining] 0.00 memo_ll_constant_0 [backendopt:inlining] 0.00 isvirtual__v35___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v51___simple_call__function_is [backendopt:inlining] 0.00 read__Signed_arrayPtr_Signed_star_3 [backendopt:inlining] 0.00 isconstant__v55___simple_call__function_is [backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0 [backendopt:inlining] 0.00 getcwd__arrayPtr_Signed_star_2 [backendopt:inlining] 0.00 isconstant__v22___simple_call__function_is [backendopt:inlining] 0.00 copy_raw_to_string [backendopt:inlining] 0.00 isconstant__v29___simple_call__function_is [backendopt:inlining] 0.00 isconstant__v34___simple_call__function_is [backendopt:inlining] 0.00 close__Signed_star_1 [backendopt:inlining] 0.00 _get_raw_buf__rpy_string [backendopt:inlining] 0.00 isconstant__v17___simple_call__function_is [backendopt:inlining] 0.00 isatty__Signed_star_1 [backendopt:inlining] 0.00 isvirtual__v52___simple_call__function_is [backendopt:inlining] 0.00 get_get [backendopt:inlining] 0.00 open__SomeString_Signed_Signed_star_3 [backendopt:inlining] 0.00 _as_bytes__str [backendopt:inlining] 0.00 conditional_call__v23___simple_call__function_co_star_3 [backendopt:inlining] 0.00 strerror__Signed_star_1 [backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2 [backendopt:inlining] 0.00 get_nonmovingbuffer_ll [backendopt:inlining] 0.00 get_nonmovingbuffer_ll_final_null [backendopt:inlining] 0.00 memo__ll_prebuilt_empty_array_0 [backendopt:inlining] 0.00 memo__sizeof_none_0 [backendopt:inlining] 0.00 ll_getitem_fast__listPtr_Signed [backendopt:inlining] 0.00 memo__sizeof_none_0 [backendopt:inlining] 0.00 stat__SomeString_statPtr_star_2 [backendopt:inlining] 0.00 alloc_buffer [backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2 [backendopt:inlining] 0.00 get_items [backendopt:inlining] 0.00 scoped_nonmovingbuffer.__enter__ [backendopt:inlining] 0.00 _PyPy_dg_strtod__arrayPtr_arrayPtr_star_2 [backendopt:inlining] 0.00 ll_getitem_nonneg__dum_nocheckConst_ll_getitem_fastConst_listPtr_Signed [backendopt:inlining] 0.00 gc_thread_run [backendopt:inlining] 0.00 scoped_nonmovingbuffer.__init__ [backendopt:inlining] 0.00 copy_string_to_raw [backendopt:inlining] 0.00 get_nonmovingbuffer_ll_final_null [backendopt:inlining] 0.00 stat__SomeString_statPtr_star_2 [backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2 [backendopt:inlining] 0.00 __exit____star_3 [backendopt:inlining] 0.00 isvirtual__v18___simple_call__function_is [backendopt:inlining] 0.00 conditional_call__v57___simple_call__function_co_star_3 [backendopt:inlining] 0.00 write__Signed_arrayPtr_Signed_star_3 [backendopt:inlining] 2.00 ll_strlen__rpy_stringPtr [backendopt:inlining] 0.00 get_nonmovingbuffer_ll_final_null [backendopt:inlining] 0.00 stat__SomeString_statPtr_star_2 [backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2 [backendopt:inlining] 2.00 ll_length__listPtr [backendopt:inlining] 2.00 getraw [backendopt:inlining] 2.00 getraw [backendopt:inlining] 2.00 setraw [backendopt:inlining] 2.00 setraw [backendopt:inlining] 2.00 ll_items__listPtr [backendopt:inlining] 2.00 ll_items__listPtr [backendopt:inlining] 2.00 ll_length__listPtr [backendopt:inlining] 2.00 ScopedAlloc_Array of Char {'nolength': True} .__enter__ [backendopt:inlining] 2.00 ScopedAlloc_Struct stat { c_st_dev, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c__pad8, c__pad9, c__pad10, c__pad11, c_st_size, c_st_blksize, c_st_blocks, c_st_atim, c_st_mtim, c_st_ctim, c_st_ino }.__enter__ [backendopt:inlining] 2.00 S_IFMT [backendopt:inlining] 2.00 ll_unsigned__Signed [backendopt:inlining] 2.00 ll_uint_py_div__Unsigned_Unsigned [backendopt:inlining] 2.00 ll_uint_py_mod__Unsigned_Unsigned [backendopt:inlining] 2.00 ll_fixed_newlist__GcArray_Ptr_GCREF__gcopaque_Ll_Signed [backendopt:inlining] 2.00 ll_fixed_length__arrayPtr [backendopt:inlining] 2.00 ll_length__rpy_stringPtr [backendopt:inlining] 2.00 scoped_alloc_buffer.__init__ [backendopt:inlining] 4.00 ll_stritem_nonneg__rpy_stringPtr_Signed [backendopt:inlining] 4.00 ll_fixed_setitem_fast__arrayPtr_Signed_GCREFPtr [backendopt:inlining] 4.00 __exit____star_3 [backendopt:inlining] 4.00 __exit____star_3 [backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed [backendopt:inlining] 4.00 ll_fixed_getitem_fast__arrayPtr_Signed [backendopt:inlining] 4.00 copy_item__arrayPtr_arrayPtr_Signed_Signed [backendopt:inlining] 4.00 Loader.__init__ [backendopt:inlining] 4.00 ScopedAlloc_Array of Char {'nolength': True} .__init__ [backendopt:inlining] 2.00 get_saved_errno [backendopt:inlining] 5.00 release [backendopt:inlining] 6.00 _str_ofs__rpy_string [backendopt:inlining] 0.00 get_nonmovingbuffer_ll_final_null [backendopt:inlining] 0.00 stat__SomeString_statPtr_star_2 [backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2 [backendopt:inlining] 6.00 ScopedAlloc_Struct stat { c_st_dev, c__pad0, c__pad1, c__pad2, c__pad3, c__pad4, c__pad5, c__pad6, c__pad7, c_st_mode, c_st_nlink, c_st_uid, c_st_gid, c_st_rdev, c__pad8, c__pad9, c__pad10, c__pad11, c_st_size, c_st_blksize, c_st_blocks, c_st_atim, c_st_mtim, c_st_ctim, c_st_ino }.__init__ [backendopt:inlining] 7.00 mallocstr [backendopt:inlining] 0.00 _as_bytes0__str [backendopt:inlining] 7.00 rstring_to_float [backendopt:inlining] 4.00 ll_getitem_foldable_nonneg__arrayPtr_Signed [backendopt:inlining] 2.00 ll_len__listPtr [backendopt:inlining] 2.00 ll_len__listPtr [backendopt:inlining] 7.00 ll_listdelslice_startonly_look_inside_iff__listPtr_Signed [backendopt:inlining] 7.00 dump_none [backendopt:inlining] 7.00 rpython_print_newline [backendopt:inlining] 7.50 mallocstr [backendopt:inlining] 8.00 ll_newemptylist__GcStruct_listLlT [backendopt:inlining] 8.00 ll_newrange__Ptr_GcStruct_rangeLlT_Signed_Signed [backendopt:inlining] 8.00 ll_listiter__Ptr_GcStruct_listiterLlT_arrayPtr [backendopt:inlining] 8.00 ll_newemptylist__GcStruct_listLlT [backendopt:inlining] 9.00 ll_join_strs_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT [backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool [backendopt:inlining] 9.00 _ll_list_resize_hint_really_look_inside_iff__listPtr_Signed_Bool [backendopt:inlining] 9.00 ll_join_chars_look_inside_iff__Signed_arrayPtr_Ptr_GcStruct_rpy_stringLlT [backendopt:inlining] 4.00 S_ISDIR [backendopt:inlining] 4.00 S_ISREG [backendopt:inlining] 4.00 ll_str__StringR_Ptr_GcStruct_rpy_strin_rpy_stringPtr [backendopt:inlining] 7.00 acquire [backendopt:inlining] 7.00 ll_str_is_true__LLHelpersConst_rpy_stringPtr [backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed [backendopt:inlining] 11.00 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed [backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_Char [backendopt:inlining] 6.00 ll_setitem_fast__listPtr_Signed_GCREFPtr [backendopt:inlining] 11.00 ll_extend_with_str__listPtr_rpy_stringPtr_ll_strlenConst_ll_stritem_nonnegConst [backendopt:inlining] 6.00 ll_getitem_fast__listPtr_Signed [backendopt:inlining] 6.00 ll_getitem_fast__listPtr_Signed [backendopt:inlining] 8.00 FdLoader.__init__ [backendopt:inlining] 11.00 str_from_buffer [backendopt:inlining] 12.00 ll_rangeiter__Ptr_GcStruct_rangeLlT_rangePtr [backendopt:inlining] 12.00 ll_striter__rpy_stringPtr [backendopt:inlining] 12.25 loop_unrolling_heuristic__v16___simple_call__function_lo [backendopt:inlining] 12.50 ll_rangenext_up__rangePtr_Signed [backendopt:inlining] 10.00 scoped_alloc__array_False [backendopt:inlining] 12.00 scoped_alloc__stat_False [backendopt:inlining] 13.00 free_nonmovingbuffer_ll [backendopt:inlining] 0.00 stat__SomeString_statPtr_star_2 [backendopt:inlining] 0.00 lstat__SomeString_statPtr_star_2 [backendopt:inlining] 13.00 keep_buffer_alive_until_here [backendopt:inlining] 14.00 dump_int [backendopt:inlining] 14.00 load_with_custom_recreate [backendopt:inlining] 14.00 dump_tuple [backendopt:inlining] 9.00 ll_listdelslice_startonly__v58___simple_call__function_ll [backendopt:inlining] 9.00 ll_listdelslice_startonly__v49___simple_call__function_ll [backendopt:inlining] 14.00 load_int_nonneg [backendopt:inlining] 14.00 load_none [backendopt:inlining] 15.50 ll_strnext__stringiterPtr [backendopt:inlining] 16.50 load_bool [backendopt:inlining] 13.00 Loader.check_finished [backendopt:inlining] 18.12 ll_stringslice_startstop__rpy_stringPtr_Signed_Signed [backendopt:inlining] 19.00 scoped_alloc_buffer.str [backendopt:inlining] 19.00 __exit____star_3 [backendopt:inlining] 19.25 load_int [backendopt:inlining] 21.00 ccall_close [backendopt:inlining] 0.00 close__Signed_star_1 [backendopt:inlining] 21.65 ll_streq__rpy_stringPtr_rpy_stringPtr [backendopt:inlining] 23.00 dump_tuple [backendopt:inlining] 22.25 assert_ [backendopt:inlining] 23.33 charp2str [backendopt:inlining] 24.50 load_string [backendopt:inlining] 17.50 ll_listnext_foldable__listiterPtr [backendopt:inlining] 17.00 ll_append__listPtr_Char [backendopt:inlining] 17.00 ll_append__listPtr_GCREFPtr [backendopt:inlining] 19.25 _errno_after__v13___simple_call__function__e [backendopt:inlining] 19.25 _errno_after__v9___simple_call__function__er [backendopt:inlining] 19.25 _errno_after__v11___simple_call__function__e [backendopt:inlining] 0.00 close__Signed_star_1 [backendopt:inlining] 19.25 _errno_after__v7___simple_call__function__er [backendopt:inlining] 19.25 _errno_after__v5___simple_call__function__er [backendopt:inlining] 19.25 _errno_after__v1___simple_call__function__er [backendopt:inlining] 19.25 _errno_after__v3___simple_call__function__er [backendopt:inlining] 26.16 ll_join_chars__v32___simple_call__function_ll [backendopt:inlining] 26.16 ll_join_chars__v37___simple_call__function_ll [backendopt:inlining] 27.00 load_string_or_none [backendopt:inlining] 27.50 ll_arraycopy__arrayPtr_arrayPtr_Signed_Signed_Signed [backendopt:inlining] 31.25 load_float [backendopt:inlining] 32.00 load_longlong [backendopt:inlining] 30.25 handle_posix_error__write [backendopt:inlining] 30.25 handle_posix_error__read [backendopt:inlining] 30.25 handle_posix_error__close [backendopt:inlining] 30.25 handle_posix_error__stat [backendopt:inlining] 30.25 handle_posix_error__open [backendopt:inlining] 30.25 handle_posix_error__lstat [backendopt:inlining] 31.87 _errno_before__v10___simple_call__function__e [backendopt:inlining] 0.00 close__Signed_star_1 [backendopt:inlining] 31.87 _errno_before__v8___simple_call__function__er [backendopt:inlining] 31.87 _errno_before__v12___simple_call__function__e [backendopt:inlining] 31.87 _errno_before__v6___simple_call__function__er [backendopt:inlining] 31.87 _errno_before__v0___simple_call__function__er [backendopt:inlining] 31.87 _errno_before__v2___simple_call__function__er [backendopt:inlining] 31.87 _errno_before__v4___simple_call__function__er [backendopt:inlining] inlined 515 callsites. [backendopt:removecasts] removed 2 cast_pointers in strtod [backendopt:malloc] starting malloc removal [backendopt:malloc] 1 simple mallocs removed in 'mini_pypy_like_entry_point' [backendopt:malloc] 1 simple mallocs removed in 'rpython_print_item' [backendopt:malloc] 1 simple mallocs removed in 'rpython_print_end' [backendopt:malloc] 3 simple mallocs removed in 'write' [backendopt:malloc] 2 simple mallocs removed in 'scoped_nonmovingbuffer.__init__' [backendopt:malloc] 1 simple mallocs removed in 'lstat__str' [backendopt:malloc] 7 simple mallocs removed in 'write__Signed_arrayPtr_Signed_star_3' [backendopt:malloc] 8 simple mallocs removed in 'lstat__SomeString_statPtr_star_2' [backendopt:malloc] 9 simple mallocs removed in 'build_stat_result' [backendopt:malloc] 1 simple mallocs removed in 'stat__str' [backendopt:malloc] 8 simple mallocs removed in 'stat__SomeString_statPtr_star_2' [backendopt:malloc] 10 simple mallocs removed in 'open__str' [backendopt:malloc] 10 simple mallocs removed in 'open__SomeString_Signed_Signed_star_3' [backendopt:malloc] 2 simple mallocs removed in 'scoped_alloc_buffer.__enter__' [backendopt:malloc] 7 simple mallocs removed in 'read__Signed_arrayPtr_Signed_star_3' [backendopt:malloc] 1 simple mallocs removed in 'close' [backendopt:malloc] 3 simple mallocs removed in 'close__Signed_star_1' [backendopt:malloc] 5 simple mallocs removed in 'getcwd' [backendopt:malloc] 5 simple mallocs removed in 'getcwd__arrayPtr_Signed_star_2' [backendopt:malloc] 1 simple mallocs removed in 'isatty' [backendopt:malloc] 1 simple mallocs removed in 'sandboxed_ll_os.ll_os_getenv__star_1' [backendopt:malloc] 3 simple mallocs removed in 'sandboxed_io' [backendopt:malloc] 3 simple mallocs removed in 'FdLoader.need_more_data' [backendopt:malloc] 2 simple mallocs removed in 'load_list_or_none' [backendopt:malloc] 3 simple mallocs removed in 'load_tuple' [backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v23___simple_call__function_co_star_3' [backendopt:malloc] 1 simple mallocs removed in 'sandboxed_ll_os.ll_os_stat__star_1' [backendopt:malloc] 1 simple mallocs removed in 'sandboxed_ll_os.ll_os_stat__star_1' [backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_ge__listPtr_Signed' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v40___simple_call__function_co_star_3' [backendopt:malloc] 1 simple mallocs removed in 'sandboxed_ll_os.ll_os_stat__star_1' [backendopt:malloc] 1 simple mallocs removed in '_ll_list_resize_le__listPtr_Signed' [backendopt:malloc] 1 simple mallocs removed in 'conditional_call__v57___simple_call__function_co_star_3' [backendopt:malloc] 19 simple mallocs removed in 'load_tuple' [backendopt:malloc] 1 simple mallocs removed in 'strtod' [backendopt:malloc] 5 simple mallocs removed in '_PyPy_dg_strtod__arrayPtr_arrayPtr_star_2' [backendopt:malloc] 7 simple mallocs removed in 'stat_result_recreate' [backendopt:malloc] removed 139 simple mallocs in total [backendopt:mergeifblocks] starting to merge if blocks [backendopt] merging blocks in sandboxed_ll_os.ll_os_getenv__star_1 [backendopt] merging blocks in reraise_error [backendopt] merging blocks in load_string_or_none [backendopt] merging blocks in load_list_or_none [backendopt] merging blocks in sandboxed_ll_os.ll_os_read__star_2 [backendopt] merging blocks in sandboxed_ll_os.ll_os_isatty__star_1 [backendopt] merging blocks in load_bool [c58165d205e7f80] translation-task} [translation:info] inserting stack checks... [c58165d205f9e80] {translation-task starting stackcheckinsertion_lltype [flowgraph] (rpython.rlib.rstack:42)stack_check [flowgraph] (rpython.rlib.rstack:67)stack_check_slowpath [rtyper] -=- specialized 8 more blocks -=- [translation:info] inserted 0 stack checks. [c58165d2172d780] translation-task} [translation:info] Creating database for generating c source... [c58165d2173cc00] {translation-task starting database_c [flowgraph] (rpython.translator.exceptiontransform:100)rpyexc_occurred [flowgraph] (rpython.translator.exceptiontransform:104)rpyexc_fetch_type [flowgraph] (rpython.translator.exceptiontransform:107)rpyexc_fetch_value [flowgraph] (rpython.translator.exceptiontransform:110)rpyexc_clear [flowgraph] (rpython.translator.exceptiontransform:114)rpyexc_raise [flowgraph] (rpython.translator.exceptiontransform:128)rpyexc_reraise [flowgraph] (rpython.translator.exceptiontransform:133)rpyexc_fetch_exception [flowgraph] (rpython.translator.exceptiontransform:138)rpyexc_restore_exception [flowgraph] (rpython.translator.exceptiontransform:539)rpyexc_get_exception_addr [flowgraph] (rpython.translator.exceptiontransform:543)rpyexc_get_exc_value_addr [flowgraph] (rpython.rtyper.rclass:1173)ll_inst_type [rtyper] -=- specialized 25 more blocks -=- [flowgraph] (rpython.memory.gctransform.transform:447)_ll_malloc_fixedsize [flowgraph] (rpython.memory.gctransform.transform:454)_ll_malloc_fixedsize_zero [flowgraph] (rpython.memory.gctransform.transform:470)_ll_malloc_varsize_no_length [flowgraph] (rpython.memory.gctransform.transform:487)ll_malloc_varsize [flowgraph] (rpython.memory.gctransform.transform:493)_ll_malloc_varsize_no_length_zero [c58165d2388b980] translation-task} =========================== 1 error in 11.15 seconds =========================== ++ 22:37:12 starting tool/bench/test [129 started in total] __ module/unicodedata/test [126 done in total, somefailed=False] ______________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 26 items module/unicodedata/test/test_hyp.py ................ module/unicodedata/test/test_unicodedata.py .......... ========================= 26 passed in 218.72 seconds ========================== ++ 22:37:15 starting tool/memusage/test [130 started in total] __ tool/bench/test [127 done in total, somefailed=False] ______________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 3 items / 1 skipped tool/bench/test/test_pypyresult.py ... ===================== 3 passed, 1 skipped in 2.48 seconds ====================== ++ 22:37:15 starting tool/pytest/test [131 started in total] __ tool/memusage/test [128 done in total, somefailed=False] ___________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 5 items tool/memusage/test/test_log2gnumeric.py ..... =========================== 5 passed in 3.06 seconds =========================== ++ 22:37:19 starting tool/release/test [132 started in total] __ tool/release/test [129 done in total, somefailed=False] ____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 8 items tool/release/test/test_package.py ....s tool/release/test/test_smartstrip.py ... ===================== 7 passed, 1 skipped in 22.73 seconds ===================== ++ 22:37:43 starting tool/test [133 started in total] __ tool/test [130 done in total, somefailed=False] ____________________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 29 items tool/test/test_gdb_pypy.py ........... tool/test/test_getdocstrings.py ... tool/test/test_isolate.py ....... tool/test/test_lib_pypy.py ... tool/test/test_license.py . tool/test/test_package.py . tool/test/test_tab.py .. tool/test/test_template.py . ========================== 29 passed in 14.92 seconds ========================== __ tool/pytest/test [131 done in total, somefailed=False] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 24 items tool/pytest/test/test_appsupport.py ......... tool/pytest/test/test_astrewrite.py ..... tool/pytest/test/test_conftest1.py .. tool/pytest/test/test_pytestsupport.py ........ ========================== 24 passed in 84.60 seconds ========================== __ module/zipimport/test [132 done in total, somefailed=False] ________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 47 items module/zipimport/test/test_undocumented.py ...... module/zipimport/test/test_zipimport.py .................... module/zipimport/test/test_zipimport_deflated.py ..................... ========================= 47 passed in 460.68 seconds ========================== __ objspace/std/test [133 done in total, somefailed=True] _____________________ ============================= test session starts ============================== platform linux2 -- Python 2.7.18, pytest-2.9.2, py-1.4.29, pluggy-0.3.1 hypothesis profile 'default' -> deadline=None, database=DirectoryBasedExampleDatabase('/build_dir/own-linux-x86-32/build/pypy/.hypothesis/examples') pytest-2.9.2 from /build_dir/own-linux-x86-32/build/pytest.pyc rootdir: /build_dir/own-linux-x86-32/build, inifile: pytest.ini plugins: hypothesis-4.39.3 collected 2130 items objspace/std/test/apptest_boolobject.py ........ objspace/std/test/apptest_bufferobject.py ............... objspace/std/test/apptest_callmethod.py ........ objspace/std/test/apptest_complexobject.py ............................... objspace/std/test/apptest_instmethobject.py ..... objspace/std/test/apptest_iterobject.py ......F....... objspace/std/test/apptest_operation.py ... objspace/std/test/apptest_stringformat.py ...............s...........................s........ objspace/std/test/apptest_userobject.py ...............FF..... objspace/std/test/test_boolobject.py ....... objspace/std/test/test_bytearrayobject.py ....................................................... objspace/std/test/test_bytesobject.py .............................................................................. objspace/std/test/test_callmethod.py ... objspace/std/test/test_celldict.py ....................................... objspace/std/test/test_complexobject.py .... objspace/std/test/test_dictmultiobject.py ...........s................................................................................................................................................................... objspace/std/test/test_dictproxy.py .......... objspace/std/test/test_floatobject.py ...................................... objspace/std/test/test_identitydict.py ...... objspace/std/test/test_identityset.py ....... objspace/std/test/test_index.py .............................................. objspace/std/test/test_intobject.py .........................F..................................s........................................s............... objspace/std/test/test_iterobject.py .... objspace/std/test/test_jsondict.py ........... objspace/std/test/test_kwargsdict.py .................................... objspace/std/test/test_lengthhint.py .................... objspace/std/test/test_listobject.py ....................................................................................................................... objspace/std/test/test_liststrategies.py ...................................................................s.......................................s..s..s.......s.......s.... objspace/std/test/test_longobject.py ......................................... objspace/std/test/test_mapdict.py ........................s.ss.................................................................FF................................................ objspace/std/test/test_memoryobject.py ....... objspace/std/test/test_methodcache.py ....................................................................... objspace/std/test/test_newformat.py ......................................................................................ss........ objspace/std/test/test_noneobject.py ... objspace/std/test/test_obj.py ....................... objspace/std/test/test_prebuiltint.py ...........................s............... objspace/std/test/test_proxy.py ssssssssssss objspace/std/test/test_proxy_function.py ........ objspace/std/test/test_proxy_internals.py ........ objspace/std/test/test_proxy_iter.py . objspace/std/test/test_proxy_object.py .......... objspace/std/test/test_proxy_usercreated.py . objspace/std/test/test_random_attr.py ..... objspace/std/test/test_setobject.py .................................................................................... objspace/std/test/test_setstrategies.py ....s...ss.. objspace/std/test/test_sliceobject.py ............ objspace/std/test/test_smalllongobject.py .........................F..................................s........................................................................................................................s.............. objspace/std/test/test_specialisedtupleobject.py ..................ss....................... objspace/std/test/test_stdobjspace.py s...... objspace/std/test/test_tupleobject.py ................................... objspace/std/test/test_typeobject.py .............................................................................. objspace/std/test/test_unicodeobject.py ..........................................................................................s................. objspace/std/test/test_userobject.py . objspace/std/test/test_versionedtype.py ............... =================================== FAILURES =================================== __________________________ test_reversed_frees_empty ___________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf4272dbc>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_reversed_frees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_reversed_frees_empty'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a3332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d14cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_reversed_frees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_reversed_frees_empty'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d14cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_reversed_frees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_reversed_frees_empty'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_reversed_frees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3e2f34c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3bb028c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3bb028c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_reversed_frees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3f0316c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3bb0a0c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf3bb0a0c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...rees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_reversed_frees_empty'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestFunction 'test_reversed_frees_empty'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_reversed_frees_empty'> def runtest(self): target = self.w_obj space = target.space self.check_run(space, target) > self.execute_appex(space, target) tool/pytest/apptest2.py:85: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_reversed_frees_empty'>, space = StdObjSpace w_func = <Function test_reversed_frees_empty> def execute_appex(self, space, w_func): space.getexecutioncontext().set_sys_exc_info(None) sig = w_func.code._signature if sig.varargname or sig.kwargname: raise ValueError( 'Test functions may not use *args or **kwargs') args_w = self.get_fixtures(space, sig.argnames) try: > space.call_function(w_func, *args_w) tool/pytest/apptest2.py:114: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_reversed_frees_empty>, args_w = () nargs = 0, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_reversed_frees_empty>, args_w = () gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_reversed_frees_empty, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42 pycode = <code object test_reversed_frees_empty, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b942c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42 co_code = 'x\xbb\x00t\x00\x00t\x01\x00f\x02\x00D]\xad\x00}\x00\x00t\x02\x00g\x01\x00\x89\x00\x00d\x01\x00|\x00\x00f\x01\x00\x87\...}\x04\x00t\x0b\x00t\t\x00\xc9\x0c\x00|\x04\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00}\x03\x00q\r\x00Wd\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b942c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42 co_code = 'x\xbb\x00t\x00\x00t\x01\x00f\x02\x00D]\xad\x00}\x00\x00t\x02\x00g\x01\x00\x89\x00\x00d\x01\x00|\x00\x00f\x01\x00\x87\...}\x04\x00t\x0b\x00t\t\x00\xc9\x0c\x00|\x04\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00}\x03\x00q\r\x00Wd\x00\x00S' next_instr = 93L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b942c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_reversed...x86-32/build/pypy/objspace/std/test/apptest_iterobject.py', line 34> at line 42 nameindex = 8, ignored = (93L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf52d114c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf52d114c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf52d114c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ___________________________________ test_del ___________________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf38cc17c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a3332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d14cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d14cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3abebe4> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf363f28c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf363f28c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf3abeb94> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf363f2ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf363f2ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i... 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestFunction 'test_del'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_del'> def runtest(self): target = self.w_obj space = target.space self.check_run(space, target) > self.execute_appex(space, target) tool/pytest/apptest2.py:85: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_del'>, space = StdObjSpace w_func = <Function test_del> def execute_appex(self, space, w_func): space.getexecutioncontext().set_sys_exc_info(None) sig = w_func.code._signature if sig.varargname or sig.kwargname: raise ValueError( 'Test functions may not use *args or **kwargs') args_w = self.get_fixtures(space, sig.argnames) try: > space.call_function(w_func, *args_w) tool/pytest/apptest2.py:114: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_del>, args_w = (), nargs = 0 Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_del>, args_w = () gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_del, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142 pycode = <code object test_del, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b942c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00g\x00\x00\x89\x00\x00d\x02\x00t\x01\x00f\x01\x00\x87\x00\x00f\x01\x00d\x03\x00\x8...05\x00t\t\x00t\x03\x00\xc9\n\x00|\x05\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x03\x00}\x02\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b942c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00g\x00\x00\x89\x00\x00d\x02\x00t\x01\x00f\x01\x00\x87\x00\x00f\x01\x00d\x03\x00\x8...05\x00t\t\x00t\x03\x00\xc9\n\x00|\x05\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x03\x00}\x02\x00d\x00\x00S' next_instr = 59L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b942c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del, fil...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 135> at line 142 nameindex = 2, ignored = (59L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf52d114c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf52d114c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf52d114c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ______________________________ test_del_exception ______________________________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf3f758b4>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del_exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del_exception'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a3332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d14cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del_exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del_exception'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d14cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del_exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestFunction 'test_del_exception'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del_exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf365d34c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf37fd2ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf37fd2ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del_exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf365d2fc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf37fd3cc> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf37fd3cc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i..._exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestFunction 'test_del_exception'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestFunction 'test_del_exception'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_del_exception'> def runtest(self): target = self.w_obj space = target.space self.check_run(space, target) > self.execute_appex(space, target) tool/pytest/apptest2.py:85: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestFunction 'test_del_exception'>, space = StdObjSpace w_func = <Function test_del_exception> def execute_appex(self, space, w_func): space.getexecutioncontext().set_sys_exc_info(None) sig = w_func.code._signature if sig.varargname or sig.kwargname: raise ValueError( 'Test functions may not use *args or **kwargs') args_w = self.get_fixtures(space, sig.argnames) try: > space.call_function(w_func, *args_w) tool/pytest/apptest2.py:114: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_del_exception>, args_w = () nargs = 0, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_del_exception>, args_w = () gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_del_exception, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154 pycode = <code object test_del_exception, file '/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b942c> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00d\x01\x00d\x00\x00l\x01\x00}\x01\x00d\x01\x00d\x00\x00l\x02\x00}\x02\x00d\x02\x00...0e\x00t\r\x00t\n\x00\xc9\x0e\x00|\x0e\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x0b\x00}\x0c\x00d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b942c> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154 co_code = 'd\x01\x00d\x00\x00l\x00\x00}\x00\x00d\x01\x00d\x00\x00l\x01\x00}\x01\x00d\x01\x00d\x00\x00l\x02\x00}\x02\x00d\x02\x00...0e\x00t\r\x00t\n\x00\xc9\x0e\x00|\x0e\x00\xca\x01\x00\x83\x01\x00\x82\x01\x00d\x00\x00\x04}\x0b\x00}\x0c\x00d\x00\x00S' next_instr = 98L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf51b942c> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_del_exce...6-32/build/pypy/objspace/std/test/apptest_userobject.py', line 145> at line 154 nameindex = 5, ignored = (98L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf52d114c> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf52d114c> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf52d114c> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _________________ TestW_IntObject.test_lshift_without_fromint __________________ self = <pypy.objspace.std.test.test_intobject.TestW_IntObject instance at 0xf2e4014c> monkeypatch = <_pytest.monkeypatch.monkeypatch instance at 0xf2e40f4c> def test_lshift_without_fromint(self, monkeypatch): space = self.space monkeypatch.setattr(rbigint, 'fromint', None) x = sys.maxint // 4 y = 16 f1 = iobj.W_IntObject(x) f2 = iobj.W_IntObject(y) > v = f1.descr_lshift(space, f2) objspace/std/test/test_intobject.py:361: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ objspace/std/intobject.py:620: in descr_binop return ovf2long(space, x, self, y, w_other) objspace/std/intobject.py:645: in _ovf2long_lshift return space.newlong_from_rbigint(rbigint.lshift_int_int_bigint_result(x, y)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ iself = 536870911, int_other = 16 @staticmethod @jit.elidable def lshift_int_int_bigint_result(iself, int_other): if not SUPPORT_INT128 or SHIFT != 63 or not int_in_valid_range(iself): > return rbigint.fromint(iself).lshift(int_other) E TypeError: 'NoneType' object is not callable ../rpython/rlib/rbigint.py:1383: TypeError ___________ AppTestWithMapDictAndCounters.test_dont_keep_class_alive ___________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf28dae9c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_keep_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_keep_class_alive'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a3332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d14cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_keep_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_keep_class_alive'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d14cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_keep_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_dont_keep_class_alive'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_keep_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf2871e3c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf28191ac> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf28191ac> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_keep_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf287161c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf28191ec> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf28191ec> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_dont_keep_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_dont_keep_class_alive'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_dont_keep_class_alive'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_dont_keep_class_alive'>, space = StdObjSpace target = <function test_dont_keep_class_alive at 0xf28b2f0c> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28bea6c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28bea6c>,) w_func = <Function test_dont_keep_class_alive> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28bea6c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_dont_keep_class_alive> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28bea6c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_dont_keep_class_alive> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28bea6c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_dont_keep_class_alive, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 pycode = <code object test_dont_keep_class_alive, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 co_code = 'd\x01\x00d\x00\x00l\x00\x00\x89\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00\x87\x00\x00\x87\x01\x00f\x02\x00d\x02\x00\x86\x00\x00}\x01\x00|\x01\x00\x83\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 co_code = 'd\x01\x00d\x00\x00l\x00\x00\x89\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00\x87\x00\x00\x87\x01\x00f\x02\x00d\x02\x00\x86\x00\x00}\x01\x00|\x01\x00\x83\x00\x00\x01d\x00\x00S' next_instr = 48L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: > self.CALL_FUNCTION(oparg, next_instr) interpreter/pyopcode.py:268: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 oparg = 0, next_instr = 48L def CALL_FUNCTION(self, oparg, next_instr): # XXX start of hack for performance if (oparg >> 8) & 0xff == 0: # Only positional arguments nargs = oparg & 0xff w_function = self.peekvalue(nargs) > w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1) interpreter/pyopcode.py:1233: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function f>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 dropvalues = 1, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function f>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 dropvalues = 1, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) > return self._flat_pycall(code, nargs, frame, dropvalues) interpreter/function.py:174: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function f> code = <code object f, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_dont_kee...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 1> at line 15 dropvalues = 1 @jit.unroll_safe def _flat_pycall(self, code, nargs, frame, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:201: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12 pycode = <code object f, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12 co_code = 'd\x01\x00t\x00\x00f\x01\x00d\x02\x00\x84\x00\x00\x83\x00\x00Y}\x00\x00\x88\x01\x00\xc9\x01\x00|\x00\x00\xca\x01\x00}\...\x01\xcc\x15\x00|\x01\x00\x83\x00\x00d\x00\x00k\x08\x00sk\x00t\x04\x00\x82\x01\x00d\x03\x00S\x00\x82\x01\x00d\x03\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12 co_code = 'd\x01\x00t\x00\x00f\x01\x00d\x02\x00\x84\x00\x00\x83\x00\x00Y}\x00\x00\x88\x01\x00\xc9\x01\x00|\x00\x00\xca\x01\x00}\...\x01\xcc\x15\x00|\x01\x00\x83\x00\x00d\x00\x00k\x08\x00sk\x00t\x04\x00\x82\x01\x00d\x03\x00S\x00\x82\x01\x00d\x03\x00S' next_instr = 59L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1646]', line 4> at line 12 nameindex = 3, ignored = (59L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf37f44cc> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf37f44cc> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf37f44cc> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError ________ AppTestWithMapDictAndCounters.test_instance_keeps_class_alive _________ self = <CallInfo when='call' exception: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details (env.py, line 423)> func = <function <lambda> at 0xf292f17c>, when = 'call' def __init__(self, func, when): #: context of invocation: one of "setup", "call", #: "teardown", "memocollect" self.when = when self.start = time() try: > self.result = func() ../_pytest/runner.py:150: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > return CallInfo(lambda: ihook(item=item, **kwds), when=when) ../_pytest/runner.py:138: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_HookCaller 'pytest_runtest_call'> kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_instance_keeps_class_alive'>, '...lticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_instance_keeps_class_alive'>} def __call__(self, **kwargs): assert not self.is_historic() > return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs) ../_pytest/vendored_packages/pluggy.py:724: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.config.PytestPluginManager object at 0xf7a3332c> hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d14cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_instance_keeps_class_alive'>, '...lticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_instance_keeps_class_alive'>} def _hookexec(self, hook, methods, kwargs): # called from all hookcaller instances. # enable_tracing will set its own wrapping function at self._inner_hookexec > return self._inner_hookexec(hook, methods, kwargs) ../_pytest/vendored_packages/pluggy.py:338: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ hook = <_HookCaller 'pytest_runtest_call'> methods = [<_pytest.vendored_packages.pluggy.HookImpl instance at 0xf69d14cc>] kwargs = {'__multicall__': <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_instance_keeps_class_alive'>, '...lticall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>, 'item': <AppTestMethod 'test_instance_keeps_class_alive'>} self._inner_hookexec = lambda hook, methods, kwargs: \ > _MultiCall(methods, kwargs, hook.spec_opts).execute() ../_pytest/vendored_packages/pluggy.py:333: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_instance_keeps_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf2c71c34> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf293956c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf293956c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_instance_keeps_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: > return _wrapped_call(hook_impl.function(*args), self.execute) ../_pytest/vendored_packages/pluggy.py:595: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ wrap_controller = <generator object pytest_runtest_call at 0xf2c3ebbc> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def _wrapped_call(wrap_controller, func): """ Wrap calling to a function with a generator which needs to yield exactly once. The yield point will trigger calling the wrapped function and return its _CallOutcome to the yield point. The generator then needs to finish (raise StopIteration) in order for the wrapped call to complete. """ try: next(wrap_controller) # first yield except StopIteration: _raise_wrapfail(wrap_controller, "did not yield") call_outcome = _CallOutcome(func) try: wrap_controller.send(call_outcome) _raise_wrapfail(wrap_controller, "has second yield") except StopIteration: pass > return call_outcome.get_result() ../_pytest/vendored_packages/pluggy.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf293996c> def get_result(self): if self.excinfo is None: return self.result else: ex = self.excinfo if _py3: raise ex[1].with_traceback(ex[2]) > _reraise(*ex) # noqa ../_pytest/vendored_packages/pluggy.py:279: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_pytest.vendored_packages.pluggy._CallOutcome instance at 0xf293996c> func = <bound method _MultiCall.execute of <_MultiCall 0 results, 1 meths, kwargs={'i...lass_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}>> def __init__(self, func): try: > self.result = func() ../_pytest/vendored_packages/pluggy.py:264: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <_MultiCall 0 results, 1 meths, kwargs={'item': <AppTestMethod 'test_instance_keeps_class_alive'>, '__multicall__': <_MultiCall 0 results, 1 meths, kwargs={...}>}> def execute(self): all_kwargs = self.kwargs self.results = results = [] firstresult = self.specopts.get("firstresult") while self.hook_impls: hook_impl = self.hook_impls.pop() args = [all_kwargs[argname] for argname in hook_impl.argnames] if hook_impl.hookwrapper: return _wrapped_call(hook_impl.function(*args), self.execute) > res = hook_impl.function(*args) ../_pytest/vendored_packages/pluggy.py:596: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ item = <AppTestMethod 'test_instance_keeps_class_alive'> def pytest_runtest_call(item): try: > item.runtest() ../_pytest/runner.py:91: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_instance_keeps_class_alive'> def runtest(self): target = self.obj if self.config.option.runappdirect: return target() space = target.im_self.space filename = self._getdynfilename(target) func = app2interp_temp(target.im_func, filename=filename) w_instance = self.parent.w_instance > self.execute_appex(space, func, space, w_instance) tool/pytest/apptest.py:89: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <AppTestMethod 'test_instance_keeps_class_alive'>, space = StdObjSpace target = <function test_instance_keeps_class_alive at 0xf275e9cc> args = (StdObjSpace, <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28bea6c>) def execute_appex(self, space, target, *args): self.space = space try: > target(*args) tool/pytest/apptest.py:30: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28bea6c>,) w_func = <Function test_instance_keeps_class_alive> args = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28bea6c> def appcaller(space, *args_w): if not isinstance(space, ObjSpace): raise TypeError("first argument must be a space instance.") # the last argument can be an Arguments w_func = self.wget(space, name) if not args_w: return space.call_function(w_func) else: args = args_w[-1] assert args is not None if not isinstance(args, Arguments): > return space.call_function(w_func, *args_w) interpreter/gateway.py:1227: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function test_instance_keeps_class_alive> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28bea6c>,) nargs = 1, Function = <class 'pypy.interpreter.function.Function'> Method = <class 'pypy.interpreter.function.Method'> def call_function(self, w_func, *args_w): nargs = len(args_w) # used for pruning funccall versions if not self.config.objspace.disable_call_speedhacks and nargs < 5: # start of hack for performance from pypy.interpreter.function import Function, Method if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: if nargs < 4: func = w_func.w_function if isinstance(func, Function): return func.funccall(w_inst, *args_w) elif args_w and ( self.abstract_isinstance_w(args_w[0], w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): > return w_func.funccall(*args_w) interpreter/baseobjspace.py:1210: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function test_instance_keeps_class_alive> args_w = (<pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0xf28bea6c>,) gateway = <module 'pypy.interpreter.gateway' from '/build_dir/own-linux-x86-32/build/pypy/interpreter/gateway.pyc'> PyCode = <class 'pypy.interpreter.pycode.PyCode'> code = <code object test_instance_keeps_class_alive, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> def funccall(self, *args_w): # speed hack from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit nargs = len(args_w) fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, args_w[0]) elif nargs == 2: assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, args_w[0], args_w[1]) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) return code.fastcall_3(self.space, self, args_w[0], args_w[1], args_w[2]) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) return code.fastcall_4(self.space, self, args_w[0], args_w[1], args_w[2], args_w[3]) elif (nargs | PyCode.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) if nargs < 5: new_frame = self.space.createframe(code, self.w_func_globals, self) for i in funccallunrolling: if i < nargs: new_frame.locals_cells_stack_w[i] = args_w[i] > return new_frame.run() interpreter/function.py:118: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 pycode = <code object test_instance_keeps_class_alive, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 co_code = 'd\x01\x00d\x00\x00l\x00\x00\x89\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00\x87\x00\x00\x87\x01\x00f\x02\x00d\x02\...x00S\x00}\x02\x00\xcc\x12\x00|\x02\x00d\x03\x00k\x02\x00sH\x00t\x02\x00\x82\x01\x00|\x01\x00\x83\x00\x00\x01d\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 co_code = 'd\x01\x00d\x00\x00l\x00\x00\x89\x01\x00d\x01\x00d\x00\x00l\x01\x00\x89\x00\x00\x87\x00\x00\x87\x01\x00f\x02\x00d\x02\...x00S\x00}\x02\x00\xcc\x12\x00|\x02\x00d\x03\x00k\x02\x00sH\x00t\x02\x00\x82\x01\x00|\x01\x00\x83\x00\x00\x01d\x00\x00S' next_instr = 48L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: > self.CALL_FUNCTION(oparg, next_instr) interpreter/pyopcode.py:268: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 oparg = 0, next_instr = 48L def CALL_FUNCTION(self, oparg, next_instr): # XXX start of hack for performance if (oparg >> 8) & 0xff == 0: # Only positional arguments nargs = oparg & 0xff w_function = self.peekvalue(nargs) > w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1) interpreter/pyopcode.py:1233: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = StdObjSpace, w_func = <Function f>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 dropvalues = 1, methodcall = False def call_valuestack(self, w_func, nargs, frame, dropvalues, methodcall=False): # methodcall is only used for better error messages in argument.py from pypy.interpreter.function import Function, Method, is_builtin_code if frame.get_is_being_profiled() and is_builtin_code(w_func): # XXX: this code is copied&pasted :-( from the slow path below # call_valuestack(). args = frame.make_arguments(nargs) frame.dropvalues(dropvalues) return self.call_args_and_c_profile(frame, w_func, args) if not self.config.objspace.disable_call_speedhacks: # start of hack for performance if isinstance(w_func, Method): w_inst = w_func.w_instance if w_inst is not None: w_func = w_func.w_function # reuse callable stack place for w_inst frame.settopvalue(w_inst, nargs) nargs += 1 methodcall = True elif nargs > 0 and ( self.abstract_isinstance_w(frame.peekvalue(nargs-1), # :-( w_func.w_class)): w_func = w_func.w_function if isinstance(w_func, Function): return w_func.funccall_valuestack( > nargs, frame, methodcall=methodcall, dropvalues=dropvalues) interpreter/baseobjspace.py:1243: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function f>, nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 dropvalues = 1, methodcall = False def funccall_valuestack(self, nargs, frame, dropvalues, methodcall=False): # speed hack # methodcall is only for better error messages from pypy.interpreter import gateway from pypy.interpreter.pycode import PyCode code = self.getcode() # hook for the jit # if (jit.we_are_jitted() and code is self.space._code_of_sys_exc_info and nargs == 0): frame.dropvalues(dropvalues) from pypy.module.sys.vm import exc_info_direct return exc_info_direct(self.space, frame) # fast_natural_arity = code.fast_natural_arity if nargs == fast_natural_arity: if nargs == 0: frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode0) return code.fastcall_0(self.space, self) elif nargs == 1: f_0 = frame.peekvalue(0) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode1) return code.fastcall_1(self.space, self, f_0) elif nargs == 2: f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) frame.dropvalues(dropvalues) assert isinstance(code, gateway.BuiltinCode2) return code.fastcall_2(self.space, self, f_1, f_0) elif nargs == 3: assert isinstance(code, gateway.BuiltinCode3) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) frame.dropvalues(dropvalues) return code.fastcall_3(self.space, self, f_2, f_1, f_0) elif nargs == 4: assert isinstance(code, gateway.BuiltinCode4) f_0 = frame.peekvalue(0) f_1 = frame.peekvalue(1) f_2 = frame.peekvalue(2) f_3 = frame.peekvalue(3) frame.dropvalues(dropvalues) return code.fastcall_4(self.space, self, f_3, f_2, f_1, f_0) elif (nargs | Code.FLATPYCALL) == fast_natural_arity: assert isinstance(code, PyCode) > return self._flat_pycall(code, nargs, frame, dropvalues) interpreter/function.py:174: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <Function f> code = <code object f, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> nargs = 0 frame = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object test_instance...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 1> at line 13 dropvalues = 1 @jit.unroll_safe def _flat_pycall(self, code, nargs, frame, dropvalues): # code is a PyCode new_frame = self.space.createframe(code, self.w_func_globals, self) for i in xrange(nargs): new_frame.locals_cells_stack_w[i] = frame.peekvalue(nargs-1-i) frame.dropvalues(dropvalues) > return new_frame.run() interpreter/function.py:201: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11 def run(self): """Start this frame's execution.""" if self.getcode().co_flags & pycode.CO_GENERATOR: from pypy.interpreter.generator import GeneratorIterator return GeneratorIterator(self) else: > return self.execute_frame() interpreter/pyframe.py:253: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, executioncontext) except OperationError: raise except Exception as e: # general fall-back > raise self._convert_unexpected_exception(e) interpreter/pyframe.py:290: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11 e = SyntaxError("Non-ASCII character '\\xe2' in file /build_dir/own-linux-x86-32/b..., ('/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py', 423, 0, None)) def _convert_unexpected_exception(self, e): from pypy.interpreter import error > operr = error.get_converted_unexpected_exception(self.space, e) interpreter/pyframe.py:943: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11 w_inputvalue = None, operr = None def execute_frame(self, w_inputvalue=None, operr=None): """Execute this frame. Main entry point to the interpreter. The optional arguments are there to handle a generator's frame: w_inputvalue is for generator.send() and operr is for generator.throw(). """ # the following 'assert' is an annotation hint: it hides from # the annotator all methods that are defined in PyFrame but # overridden in the {,Host}FrameClass subclasses of PyFrame. assert (isinstance(self, self.space.FrameClass) or not self.space.config.translating) executioncontext = self.space.getexecutioncontext() executioncontext.enter(self) got_exception = True w_exitvalue = self.space.w_None try: executioncontext.call_trace(self) # try: if operr is not None: next_instr = self.handle_operation_error( executioncontext, operr) self.last_instr = intmask(next_instr - 1) else: # Execution starts just after the last_instr. Initially, # last_instr is -1. After a generator suspends it points to # the YIELD_VALUE instruction. next_instr = r_uint(self.last_instr + 1) if next_instr != 0: self.pushvalue(w_inputvalue) w_exitvalue = self.dispatch(self.pycode, next_instr, > executioncontext) interpreter/pyframe.py:286: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11 pycode = <code object f, file '[/build_dir/own-linux-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> def dispatch(self, pycode, next_instr, ec): # For the sequel, force 'next_instr' to be unsigned for performance next_instr = r_uint(next_instr) co_code = pycode.co_code try: while True: > next_instr = self.handle_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11 co_code = 'd\x01\x00t\x00\x00f\x01\x00d\x02\x00\x84\x00\x00\x83\x00\x00Y}\x00\x00\x88\x01\x00\xc9\x01\x00|\x00\x00\xca\x01\x00}\...x00S\x88\x00\x00\xc9\x02\x00\xca\x00\x00\x01\x88\x00\x00\xc9\x02\x00\xca\x00\x00\x01|\x02\x00\xc9\x03\x00\xca\x00\x00S' next_instr = 0L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> def handle_bytecode(self, co_code, next_instr, ec): try: > next_instr = self.dispatch_bytecode(co_code, next_instr, ec) interpreter/pyopcode.py:70: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11 co_code = 'd\x01\x00t\x00\x00f\x01\x00d\x02\x00\x84\x00\x00\x83\x00\x00Y}\x00\x00\x88\x01\x00\xc9\x01\x00|\x00\x00\xca\x01\x00}\...x00S\x88\x00\x00\xc9\x02\x00\xca\x00\x00\x01\x88\x00\x00\xc9\x02\x00\xca\x00\x00\x01|\x02\x00\xc9\x03\x00\xca\x00\x00S' next_instr = 55L ec = <pypy.interpreter.executioncontext.ExecutionContext object at 0xf37d70cc> @jit.unroll_safe def dispatch_bytecode(self, co_code, next_instr, ec): while True: self.last_instr = intmask(next_instr) if jit.we_are_jitted(): if self.debugdata: ec.bytecode_only_trace(self) next_instr = r_uint(self.last_instr) else: ec.bytecode_trace(self) next_instr = r_uint(self.last_instr) opcode = ord(co_code[next_instr]) next_instr += 1 if opcode >= HAVE_ARGUMENT: lo = ord(co_code[next_instr]) hi = ord(co_code[next_instr+1]) next_instr += 2 oparg = (hi * 256) | lo else: oparg = 0 # note: the structure of the code here is such that it makes # (after translation) a big "if/elif" chain, which is then # turned into a switch(). while opcode == opcodedesc.EXTENDED_ARG.index: opcode = ord(co_code[next_instr]) if opcode < HAVE_ARGUMENT: raise BytecodeCorruption lo = ord(co_code[next_instr+1]) hi = ord(co_code[next_instr+2]) next_instr += 3 oparg = (oparg * 65536) | (hi * 256) | lo if opcode == opcodedesc.RETURN_VALUE.index: if not self.blockstack_non_empty(): self.frame_finished_execution = True # for generators raise Return w_returnvalue = self.popvalue() block = self.unrollstack(SReturnValue.kind) if block is None: self.pushvalue(w_returnvalue) raise Return else: unroller = SReturnValue(w_returnvalue) next_instr = block.handle(self, unroller) return next_instr # now inside a 'finally' block elif opcode == opcodedesc.END_FINALLY.index: unroller = self.end_finally() if isinstance(unroller, SuspendedUnroller): # go on unrolling the stack block = self.unrollstack(unroller.kind) if block is None: w_result = unroller.nomoreblocks() self.pushvalue(w_result) raise Return else: next_instr = block.handle(self, unroller) return next_instr elif opcode == opcodedesc.JUMP_ABSOLUTE.index: return self.jump_absolute(oparg, ec) elif opcode == opcodedesc.BREAK_LOOP.index: next_instr = self.BREAK_LOOP(oparg, next_instr) elif opcode == opcodedesc.CONTINUE_LOOP.index: return self.CONTINUE_LOOP(oparg, next_instr) elif opcode == opcodedesc.FOR_ITER.index: next_instr = self.FOR_ITER(oparg, next_instr) elif opcode == opcodedesc.JUMP_FORWARD.index: next_instr = self.JUMP_FORWARD(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_FALSE_OR_POP.index: next_instr = self.JUMP_IF_FALSE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_NOT_DEBUG.index: next_instr = self.JUMP_IF_NOT_DEBUG(oparg, next_instr) elif opcode == opcodedesc.JUMP_IF_TRUE_OR_POP.index: next_instr = self.JUMP_IF_TRUE_OR_POP(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_FALSE.index: next_instr = self.POP_JUMP_IF_FALSE(oparg, next_instr) elif opcode == opcodedesc.POP_JUMP_IF_TRUE.index: next_instr = self.POP_JUMP_IF_TRUE(oparg, next_instr) elif opcode == opcodedesc.BINARY_ADD.index: self.BINARY_ADD(oparg, next_instr) elif opcode == opcodedesc.BINARY_AND.index: self.BINARY_AND(oparg, next_instr) elif opcode == opcodedesc.BINARY_DIVIDE.index: self.BINARY_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_FLOOR_DIVIDE.index: self.BINARY_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_LSHIFT.index: self.BINARY_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_MODULO.index: self.BINARY_MODULO(oparg, next_instr) elif opcode == opcodedesc.BINARY_MULTIPLY.index: self.BINARY_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.BINARY_OR.index: self.BINARY_OR(oparg, next_instr) elif opcode == opcodedesc.BINARY_POWER.index: self.BINARY_POWER(oparg, next_instr) elif opcode == opcodedesc.BINARY_RSHIFT.index: self.BINARY_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBSCR.index: self.BINARY_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.BINARY_SUBTRACT.index: self.BINARY_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.BINARY_TRUE_DIVIDE.index: self.BINARY_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.BINARY_XOR.index: self.BINARY_XOR(oparg, next_instr) elif opcode == opcodedesc.BUILD_CLASS.index: self.BUILD_CLASS(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST.index: self.BUILD_LIST(oparg, next_instr) elif opcode == opcodedesc.BUILD_LIST_FROM_ARG.index: self.BUILD_LIST_FROM_ARG(oparg, next_instr) elif opcode == opcodedesc.BUILD_MAP.index: self.BUILD_MAP(oparg, next_instr) elif opcode == opcodedesc.BUILD_SET.index: self.BUILD_SET(oparg, next_instr) elif opcode == opcodedesc.BUILD_SLICE.index: self.BUILD_SLICE(oparg, next_instr) elif opcode == opcodedesc.BUILD_TUPLE.index: self.BUILD_TUPLE(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION.index: self.CALL_FUNCTION(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_KW.index: self.CALL_FUNCTION_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR.index: self.CALL_FUNCTION_VAR(oparg, next_instr) elif opcode == opcodedesc.CALL_FUNCTION_VAR_KW.index: self.CALL_FUNCTION_VAR_KW(oparg, next_instr) elif opcode == opcodedesc.CALL_METHOD.index: self.CALL_METHOD(oparg, next_instr) elif opcode == opcodedesc.COMPARE_OP.index: self.COMPARE_OP(oparg, next_instr) elif opcode == opcodedesc.DELETE_ATTR.index: self.DELETE_ATTR(oparg, next_instr) elif opcode == opcodedesc.DELETE_FAST.index: self.DELETE_FAST(oparg, next_instr) elif opcode == opcodedesc.DELETE_GLOBAL.index: self.DELETE_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.DELETE_NAME.index: self.DELETE_NAME(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_0.index: self.DELETE_SLICE_0(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_1.index: self.DELETE_SLICE_1(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_2.index: self.DELETE_SLICE_2(oparg, next_instr) elif opcode == opcodedesc.DELETE_SLICE_3.index: self.DELETE_SLICE_3(oparg, next_instr) elif opcode == opcodedesc.DELETE_SUBSCR.index: self.DELETE_SUBSCR(oparg, next_instr) elif opcode == opcodedesc.DUP_TOP.index: self.DUP_TOP(oparg, next_instr) elif opcode == opcodedesc.DUP_TOPX.index: self.DUP_TOPX(oparg, next_instr) elif opcode == opcodedesc.EXEC_STMT.index: self.EXEC_STMT(oparg, next_instr) elif opcode == opcodedesc.GET_ITER.index: self.GET_ITER(oparg, next_instr) elif opcode == opcodedesc.IMPORT_FROM.index: self.IMPORT_FROM(oparg, next_instr) elif opcode == opcodedesc.IMPORT_NAME.index: self.IMPORT_NAME(oparg, next_instr) elif opcode == opcodedesc.IMPORT_STAR.index: self.IMPORT_STAR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_ADD.index: self.INPLACE_ADD(oparg, next_instr) elif opcode == opcodedesc.INPLACE_AND.index: self.INPLACE_AND(oparg, next_instr) elif opcode == opcodedesc.INPLACE_DIVIDE.index: self.INPLACE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_FLOOR_DIVIDE.index: self.INPLACE_FLOOR_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_LSHIFT.index: self.INPLACE_LSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MODULO.index: self.INPLACE_MODULO(oparg, next_instr) elif opcode == opcodedesc.INPLACE_MULTIPLY.index: self.INPLACE_MULTIPLY(oparg, next_instr) elif opcode == opcodedesc.INPLACE_OR.index: self.INPLACE_OR(oparg, next_instr) elif opcode == opcodedesc.INPLACE_POWER.index: self.INPLACE_POWER(oparg, next_instr) elif opcode == opcodedesc.INPLACE_RSHIFT.index: self.INPLACE_RSHIFT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_SUBTRACT.index: self.INPLACE_SUBTRACT(oparg, next_instr) elif opcode == opcodedesc.INPLACE_TRUE_DIVIDE.index: self.INPLACE_TRUE_DIVIDE(oparg, next_instr) elif opcode == opcodedesc.INPLACE_XOR.index: self.INPLACE_XOR(oparg, next_instr) elif opcode == opcodedesc.LIST_APPEND.index: self.LIST_APPEND(oparg, next_instr) elif opcode == opcodedesc.LOAD_ATTR.index: self.LOAD_ATTR(oparg, next_instr) elif opcode == opcodedesc.LOAD_CLOSURE.index: self.LOAD_CLOSURE(oparg, next_instr) elif opcode == opcodedesc.LOAD_CONST.index: self.LOAD_CONST(oparg, next_instr) elif opcode == opcodedesc.LOAD_DEREF.index: self.LOAD_DEREF(oparg, next_instr) elif opcode == opcodedesc.LOAD_FAST.index: self.LOAD_FAST(oparg, next_instr) elif opcode == opcodedesc.LOAD_GLOBAL.index: self.LOAD_GLOBAL(oparg, next_instr) elif opcode == opcodedesc.LOAD_LOCALS.index: self.LOAD_LOCALS(oparg, next_instr) elif opcode == opcodedesc.LOAD_NAME.index: self.LOAD_NAME(oparg, next_instr) elif opcode == opcodedesc.LOOKUP_METHOD.index: > self.LOOKUP_METHOD(oparg, next_instr) interpreter/pyopcode.py:356: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ f = <pypy.objspace.std.frame.StdObjSpaceFrame executing <code object f, file '[/bu...-x86-32/build/pypy/objspace/std/test/test_mapdict.py:1662]', line 4> at line 11 nameindex = 2, ignored = (55L,) MutableCell = <class 'pypy.objspace.std.typeobject.MutableCell'> space = StdObjSpace w_obj = <pypy.module.gc.moduledef.Module object at 0xf37f44cc> def LOOKUP_METHOD(f, nameindex, *ignored): from pypy.objspace.std.typeobject import MutableCell # stack before after # -------------- --fast-method----fallback-case------------ # # w_object None # w_object => w_function w_boundmethod_or_whatever # (more stuff) (more stuff) (more stuff) # space = f.space w_obj = f.popvalue() if not jit.we_are_jitted(): # mapdict has an extra-fast version of this function if LOOKUP_METHOD_mapdict(f, nameindex, w_obj): return w_name = f.getname_w(nameindex) w_value = None w_type = space.type(w_obj) if w_type.has_object_getattribute(): name = space.text_w(w_name) # bit of a mess to use these internal functions, but it allows the # mapdict caching below to work without an additional lookup version_tag = w_type.version_tag() if version_tag is None: _, w_descr = w_type._lookup_where(name) w_descr_cell = None else: _, w_descr_cell = w_type._pure_lookup_where_with_method_cache( name, version_tag) w_descr = w_descr_cell if isinstance(w_descr, MutableCell): w_descr = w_descr.unwrap_cell(space) if w_descr is None: # this handles directly the common case # module.function(args..) > w_value = w_obj.getdictvalue(space, name) objspace/std/callmethod.py:63: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf37f44cc> space = StdObjSpace, name = 'collect' def getdictvalue(self, space, name): w_value = space.finditem_str(self.w_dict, name) if self.lazy and w_value is None: > return self._load_lazily(space, name) interpreter/mixedmodule.py:93: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <pypy.module.gc.moduledef.Module object at 0xf37f44cc> space = StdObjSpace, name = 'collect' def _load_lazily(self, space, name): w_name = space.new_interned_str(name) try: loader = self.loaders[name] except KeyError: return None else: > w_value = loader(space) interpreter/mixedmodule.py:103: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ space = StdObjSpace def ifileloader(space): d = {'space':space} # EVIL HACK (but it works, and this is not RPython :-) while 1: try: value = eval(spec, d) except NameError as ex: name = ex.args[0].split("'")[1] # super-Evil if name in d: raise # propagate the NameError try: > d[name] = __import__(pkgroot+'.'+name, None, None, [name]) interpreter/mixedmodule.py:182: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from pypy.interpreter.gateway import unwrap_spec from pypy.interpreter.error import oefmt from rpython.rlib import rgc > from pypy.module.gc.hook import W_GcCollectStepStats module/gc/interp_gc.py:4: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ from rpython.memory.gc.hook import GcHooks > from rpython.memory.gc import incminimark module/gc/hook.py:2: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ """ # XXX Should find a way to bound the major collection threshold by the # XXX total addressable size. Maybe by keeping some minimarkpage arenas # XXX pre-reserved, enough for a few nursery collections? What about # XXX raw-malloced memory? # XXX try merging old_objects_pointing_to_pinned into # XXX old_objects_pointing_to_young (IRC 2014-10-22, fijal and gregor_w) import sys import os import time from rpython.rtyper.lltypesystem import lltype, llmemory, llarena, llgroup from rpython.rtyper.lltypesystem.lloperation import llop from rpython.rtyper.lltypesystem.llmemory import raw_malloc_usage from rpython.memory.gc.base import GCBase, MovingGCBase > from rpython.memory.gc import env E File "/build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py", line 423 E SyntaxError: Non-ASCII character '\xe2' in file /build_dir/own-linux-x86-32/build/rpython/memory/gc/env.py on line 423, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details ../rpython/memory/gc/incminimark.py:70: SyntaxError _________________ TestW_IntObject.test_lshift_without_fromint __________________ self = <pypy.objspace.std.test.test_intobject.TestW_IntObject instance at 0xf1ab6b0c> monkeypatch = <_pytest.monkeypatch.monkeypatch instance at 0xf1ab6a0c> def test_lshift_without_fromint(self, monkeypatch): space = self.space monkeypatch.setattr(rbigint, 'fromint', None) x = sys.maxint // 4 y = 16 f1 = iobj.W_IntObject(x) f2 = iobj.W_IntObject(y) > v = f1.descr_lshift(space, f2) objspace/std/test/test_intobject.py:361: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ objspace/std/intobject.py:620: in descr_binop return ovf2long(space, x, self, y, w_other) objspace/std/intobject.py:645: in _ovf2long_lshift return space.newlong_from_rbigint(rbigint.lshift_int_int_bigint_result(x, y)) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ iself = 536870911, int_other = 16 @staticmethod @jit.elidable def lshift_int_int_bigint_result(iself, int_other): if not SUPPORT_INT128 or SHIFT != 63 or not int_in_valid_range(iself): > return rbigint.fromint(iself).lshift(int_other) E TypeError: 'NoneType' object is not callable ../rpython/rlib/rbigint.py:1383: TypeError =========================== short test summary info ============================ FAIL objspace/std/test/apptest_iterobject.py::test_reversed_frees_empty FAIL objspace/std/test/apptest_userobject.py::test_del FAIL objspace/std/test/apptest_userobject.py::test_del_exception FAIL objspace/std/test/test_intobject.py::TestW_IntObject::()::test_lshift_without_fromint FAIL objspace/std/test/test_mapdict.py::AppTestWithMapDictAndCounters::()::test_dont_keep_class_alive FAIL objspace/std/test/test_mapdict.py::AppTestWithMapDictAndCounters::()::test_instance_keeps_class_alive FAIL objspace/std/test/test_smalllongobject.py::TestW_IntObject::()::test_lshift_without_fromint ============= 7 failed, 2085 passed, 38 skipped in 409.08 seconds ============== program finished with exit code 1 elapsedTime=2568.899104