pypy/interpreter/test/test_main.py::TestMain::()::test_run_module
self = <pypy.interpreter.test.test_main.TestMain instance at 0x0000000014101260>
def test_run_module(self):
checkoutput(self.space, testresultoutput, main.run_module,
> testmodule, ['hello world'])
interpreter/test/test_main.py:79:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
interpreter/test/test_main.py:36: in checkoutput
f(*(args + (space,)))
interpreter/main.py:93: in run_module
runpy = space.call_function(w_import, space.newtext('runpy'))
interpreter/baseobjspace.py:1248: in call_function
return w_func.funccall(*args_w)
interpreter/function.py:138: in funccall
return self.call_args(Arguments(self.space, list(args_w)))
interpreter/function.py:82: in call_args
w_res = self.getcode().funcrun(self, args)
interpreter/gateway.py:869: in funcrun
return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter/gateway.py:884: in funcrun_obj
self.handle_exception(space, e)
interpreter/gateway.py:908: in handle_exception
raise error.get_converted_unexpected_exception(space, e)
interpreter/gateway.py:878: in funcrun_obj
w_result = activation._run(space, scope_w)
<2021-codegen /buildbot/slave/own-linux-x86-64/build/rpython/tool/sourcetools.py:200>:3: in _run
return self.behavior(space, scope_w[0], scope_w[1], scope_w[2], scope_w[3], scope_w[4])
module/_frozen_importlib/interp_import.py:96: in interp___import__
w_level)
interpreter/baseobjspace.py:1252: in call_function
return self.call_args(w_func, args)
objspace/descroperation.py:192: in call_args
return w_obj.call_args(args)
interpreter/function.py:82: in call_args
w_res = self.getcode().funcrun(self, args)
interpreter/pycode.py:280: in funcrun
return frame.run(func.name, func.qualname)
interpreter/pyframe.py:257: in run
return self.execute_frame()
interpreter/pyframe.py:354: in execute_frame
raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:845: in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:350: in execute_frame
executioncontext)
interpreter/pyopcode.py:68: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:74: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:311: in dispatch_bytecode
self.CALL_FUNCTION(oparg, next_instr)
interpreter/pyopcode.py:1467: in CALL_FUNCTION
w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1)
interpreter/baseobjspace.py:1275: in call_valuestack
nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/function.py:194: in funccall_valuestack
natural_arity - nargs, dropvalues)
interpreter/function.py:232: in _flat_pycall_defaults
return new_frame.run(self.name, self.qualname)
interpreter/pyframe.py:257: in run
return self.execute_frame()
interpreter/pyframe.py:354: in execute_frame
raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:845: in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:350: in execute_frame
executioncontext)
interpreter/pyopcode.py:68: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:74: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:311: in dispatch_bytecode
self.CALL_FUNCTION(oparg, next_instr)
interpreter/pyopcode.py:1467: in CALL_FUNCTION
w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1)
interpreter/baseobjspace.py:1275: in call_valuestack
nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/function.py:188: in funccall_valuestack
return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:215: in _flat_pycall
return new_frame.run(self.name, self.qualname)
interpreter/pyframe.py:257: in run
return self.execute_frame()
interpreter/pyframe.py:354: in execute_frame
raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:845: in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:350: in execute_frame
executioncontext)
interpreter/pyopcode.py:68: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:74: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:311: in dispatch_bytecode
self.CALL_FUNCTION(oparg, next_instr)
interpreter/pyopcode.py:1467: in CALL_FUNCTION
w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1)
interpreter/baseobjspace.py:1275: in call_valuestack
nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/function.py:188: in funccall_valuestack
return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:215: in _flat_pycall
return new_frame.run(self.name, self.qualname)
interpreter/pyframe.py:257: in run
return self.execute_frame()
interpreter/pyframe.py:354: in execute_frame
raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:845: in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:350: in execute_frame
executioncontext)
interpreter/pyopcode.py:68: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:74: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:311: in dispatch_bytecode
self.CALL_FUNCTION(oparg, next_instr)
interpreter/pyopcode.py:1467: in CALL_FUNCTION
w_result = self.space.call_valuestack(w_function, nargs, self, dropvalues=nargs+1)
interpreter/baseobjspace.py:1275: in call_valuestack
nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/function.py:188: in funccall_valuestack
return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:215: in _flat_pycall
return new_frame.run(self.name, self.qualname)
interpreter/pyframe.py:257: in run
return self.execute_frame()
interpreter/pyframe.py:354: in execute_frame
raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:845: in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:350: in execute_frame
executioncontext)
interpreter/pyopcode.py:68: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:74: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:317: in dispatch_bytecode
self.CALL_METHOD(oparg, next_instr)
objspace/std/callmethod.py:93: in CALL_METHOD
w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args+2)
interpreter/baseobjspace.py:1275: in call_valuestack
nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/function.py:188: in funccall_valuestack
return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:215: in _flat_pycall
return new_frame.run(self.name, self.qualname)
interpreter/pyframe.py:257: in run
return self.execute_frame()
interpreter/pyframe.py:354: in execute_frame
raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:845: in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:350: in execute_frame
executioncontext)
interpreter/pyopcode.py:68: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:74: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:317: in dispatch_bytecode
self.CALL_METHOD(oparg, next_instr)
objspace/std/callmethod.py:93: in CALL_METHOD
w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args+2)
interpreter/baseobjspace.py:1275: in call_valuestack
nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/function.py:188: in funccall_valuestack
return self._flat_pycall(code, nargs, frame, dropvalues)
interpreter/function.py:215: in _flat_pycall
return new_frame.run(self.name, self.qualname)
interpreter/pyframe.py:257: in run
return self.execute_frame()
interpreter/pyframe.py:354: in execute_frame
raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:845: in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:350: in execute_frame
executioncontext)
interpreter/pyopcode.py:68: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:74: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:317: in dispatch_bytecode
self.CALL_METHOD(oparg, next_instr)
objspace/std/callmethod.py:93: in CALL_METHOD
w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args+2)
interpreter/baseobjspace.py:1275: in call_valuestack
nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
interpreter/function.py:204: in funccall_valuestack
return self.call_args(args)
interpreter/function.py:82: in call_args
w_res = self.getcode().funcrun(self, args)
interpreter/pycode.py:280: in funcrun
return frame.run(func.name, func.qualname)
interpreter/pyframe.py:257: in run
return self.execute_frame()
interpreter/pyframe.py:354: in execute_frame
raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:845: in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:350: in execute_frame
executioncontext)
interpreter/pyopcode.py:68: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:74: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:319: in dispatch_bytecode
self.CALL_METHOD_KW(oparg, next_instr)
objspace/std/callmethod.py:126: in CALL_METHOD_KW
w_result = f.space.call_args(w_callable, args)
objspace/descroperation.py:192: in call_args
return w_obj.call_args(args)
interpreter/function.py:82: in call_args
w_res = self.getcode().funcrun(self, args)
interpreter/pycode.py:280: in funcrun
return frame.run(func.name, func.qualname)
interpreter/pyframe.py:257: in run
return self.execute_frame()
interpreter/pyframe.py:354: in execute_frame
raise self._convert_unexpected_exception(e)
interpreter/pyframe.py:845: in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
interpreter/pyframe.py:350: in execute_frame
executioncontext)
interpreter/pyopcode.py:68: in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:74: in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
interpreter/pyopcode.py:315: in dispatch_bytecode
self.CALL_FUNCTION_EX(oparg, next_instr)
interpreter/pyopcode.py:1509: in CALL_FUNCTION_EX
w_result = self.space.call_args(w_function, args)
objspace/descroperation.py:192: in call_args
return w_obj.call_args(args)
interpreter/function.py:82: in call_args
w_res = self.getcode().funcrun(self, args)
interpreter/gateway.py:869: in funcrun
return BuiltinCode.funcrun_obj(self, func, None, args)
interpreter/gateway.py:884: in funcrun_obj
self.handle_exception(space, e)
interpreter/gateway.py:908: in handle_exception
raise error.get_converted_unexpected_exception(space, e)
interpreter/gateway.py:878: in funcrun_obj
w_result = activation._run(space, scope_w)
<2477-codegen /buildbot/slave/own-linux-x86-64/build/rpython/tool/sourcetools.py:200>:3: in _run
return self.behavior(space, scope_w[0], space.fsencode_w(scope_w[1]), space.text_w(scope_w[2]), space.gateway_int_w(scope_w[3]), space.gateway_int_w(scope_w[4]), space.gateway_int_w(scope_w[5]), space.gateway_int_w(scope_w[6]))
module/__builtin__/compiling.py:86: in compile
optimize=optimize)
interpreter/pycompiler.py:182: in compile
mod = self._compile_to_ast(source, info)
interpreter/pycompiler.py:172: in _compile_to_ast
raise OperationError(space.w_SyntaxError, e.find_sourceline_and_wrap_info(space, source, info.filename))
interpreter/pyparser/error.py:97: in find_sourceline_and_wrap_info
text, space.newbytes(text), 'replace', False, make_replace_error_handler(space), True)
interpreter/unicodehelper.py:537: in _str_decode_utf8_slowpath
return r, rutf8.check_utf8(r, True), pos
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
s = ' init_globals -- dictionary used to pre-populate the module\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbds\n'
allow_surrogates = True, start = 0, stop = -1
def check_utf8(s, allow_surrogates, start=0, stop=-1):
"""Check that 's' is a utf-8-encoded byte string.
Returns the length (number of chars) or raise CheckError.
If allow_surrogates is False, then also raise if we see any.
Note also codepoints_in_utf8(), which also computes the length
faster by assuming that 's' is valid utf-8.
"""
res = _check_utf8(s, allow_surrogates, start, stop)
if res >= 0:
return res
> raise CheckError(~res)
E CheckError
../rpython/rlib/rutf8.py:362: CheckError
builder: own-linux-x86-64 build #10967+
test: pypy/interpreter/test/test_main.py::TestMain::()::test_run_module