pypy/module/termios/test/test_termios.py::TestTermios::()::test_ioctl_termios
self = <test_termios.TestTermios object at 0x00007f7d4a6aec60>
def test_ioctl_termios(self):
source = py.code.Source(r"""
import termios
import fcntl
lgt = len(fcntl.ioctl(2, termios.TIOCGWINSZ, b'\000'*8))
assert lgt == 8
print('ok!')
""")
f = udir.join("test_ioctl_termios.py")
f.write(source)
child = self.spawn(['--withmod-termios', '--withmod-fcntl', str(f)])
> child.expect('ok!')
module/termios/test/test_termios.py:99:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../virt_test/site-packages/pexpect/spawnbase.py:355: in expect
timeout, searchwindowsize, async_)
../virt_test/site-packages/pexpect/spawnbase.py:383: in expect_list
return exp.expect_loop(timeout)
../virt_test/site-packages/pexpect/expect.py:179: in expect_loop
return self.eof(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pexpect.expect.Expecter object at 0x00007f7d4a6b49c0>
err = EOF('End Of File (EOF). Empty string style platform.',)
def eof(self, err=None):
spawn = self.spawn
spawn.before = spawn._before.getvalue()
spawn._buffer = spawn.buffer_type()
spawn._before = spawn.buffer_type()
spawn.after = EOF
index = self.searcher.eof_index
if index >= 0:
spawn.match = EOF
spawn.match_index = index
return index
else:
spawn.match = None
spawn.match_index = None
msg = str(spawn)
msg += '\nsearcher: %s' % self.searcher
if err is not None:
msg = str(err) + '\n' + msg
exc = EOF(msg)
exc.__cause__ = None # in Python 3.x we can use "raise exc from None"
> raise exc
E EOF: End Of File (EOF). Empty string style platform.
E <pexpect.pty_spawn.spawn object at 0x00007f7d4a6af8d8>
E command: /Users/matti/build-worker-x86_64/own-macos-x86-64/build/virt_test/bin/python
E args: ['/Users/matti/build-worker-x86_64/own-macos-x86-64/build/virt_test/bin/python', '/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/bin/pyinteractive.py', '-S', '--withmod-termios', '--withmod-fcntl', '/tmp/buildbot-x86_64/usession-py3.11-3434/test_ioctl_termios.py']
E buffer (last 100 chars): ''
E before (last 100 chars): "types_Array of Char {'nolength': True} *0 instead of LP_ctypes_Array of Char {'nolength': True} *0\r\n"
E after: <class 'pexpect.exceptions.EOF'>
E match: None
E match_index: None
E exitstatus: None
E flag_eof: True
E pid: 81822
E child_fd: 18
E closed: False
E timeout: 600
E delimiter: <class 'pexpect.exceptions.EOF'>
E logfile: <_pytest.capture.EncodedFile object at 0x00007f7d496bdcc8>
E logfile_read: None
E logfile_send: None
E maxread: 5000
E ignorecase: False
E searchwindowsize: None
E delaybeforesend: 0.05
E delayafterclose: 0.1
E delayafterterminate: 0.1
E searcher: searcher_re:
E 0: re.compile('ok!')
../virt_test/site-packages/pexpect/expect.py:122: EOF
---------- Captured stdout call ----------
SPAWN: ('/Users/matti/build-worker-x86_64/own-macos-x86-64/build/virt_test/bin/python', ['/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/bin/pyinteractive.py', '-S', '--withmod-termios', '--withmod-fcntl', '/tmp/buildbot-x86_64/usession-py3.11-3434/test_ioctl_termios.py']) {}
Traceback (most recent call last):
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/bin/pyinteractive.py", line 218, in <module>
sys.exit(main_(sys.argv))
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/bin/pyinteractive.py", line 189, in main_
verbose=interactiveconfig.verbose):
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/main.py", line 108, in run_toplevel
f()
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/bin/pyinteractive.py", line 173, in doit
main.run_file(filename, space=space)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/main.py", line 74, in run_file
run_string(istring, filename, space)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/main.py", line 62, in run_string
_run_eval_string(source, filename, space, False)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/main.py", line 50, in _run_eval_string
retval = pycode.exec_code(space, w_globals, w_globals)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/eval.py", line 33, in exec_code
return frame.run()
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/pyframe.py", line 256, in run
return self.execute_frame()
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/pyframe.py", line 353, in execute_frame
raise self._convert_unexpected_exception(e)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/pyframe.py", line 844, in _convert_unexpected_exception
operr = error.get_converted_unexpected_exception(self.space, e)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/pyframe.py", line 349, in execute_frame
executioncontext)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/pyopcode.py", line 67, in dispatch
next_instr = self.handle_bytecode(co_code, next_instr, ec)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/pyopcode.py", line 73, in handle_bytecode
next_instr = self.dispatch_bytecode(co_code, next_instr, ec)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/pyopcode.py", line 296, in dispatch_bytecode
self.CALL_METHOD(oparg, next_instr)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/objspace/std/callmethod.py", line 93, in CALL_METHOD
w_callable, n, f, methodcall=w_self is not None, dropvalues=n_args+2)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/baseobjspace.py", line 1261, in call_valuestack
nargs, frame, methodcall=methodcall, dropvalues=dropvalues)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/function.py", line 203, in funccall_valuestack
return self.call_args(args)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/function.py", line 81, in call_args
w_res = self.getcode().funcrun(self, args)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/gateway.py", line 869, in funcrun
return BuiltinCode.funcrun_obj(self, func, None, args)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/gateway.py", line 884, in funcrun_obj
self.handle_exception(space, e)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/gateway.py", line 908, in handle_exception
raise error.get_converted_unexpected_exception(space, e)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/interpreter/gateway.py", line 878, in funcrun_obj
w_result = activation._run(space, scope_w)
File "<2349-codegen /Users/matti/build-worker-x86_64/own-macos-x86-64/build/rpython/tool/sourcetools.py:174>", line 3, in _run
return self.behavior(space, scope_w[0], scope_w[1], scope_w[2], space.gateway_int_w(scope_w[3]))
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/pypy/module/fcntl/interp_fcntl.py", line 298, in ioctl
rv = ioctl_str(fd, op, buf.raw)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/rpython/rtyper/lltypesystem/rffi.py", line 321, in wrapper
res = call_external_function(*real_args)
File "<2174-codegen /Users/matti/build-worker-x86_64/own-macos-x86-64/build/rpython/rtyper/lltypesystem/rffi.py:217>", line 13, in call_external_function
res = funcptr(a0, a1, a2)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/rpython/rtyper/lltypesystem/lltype.py", line 1384, in __call__
return callb(*args)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/rpython/rtyper/lltypesystem/ll2ctypes.py", line 1342, in __call__
return self.trampoline(*argvalues)
File "/Users/matti/build-worker-x86_64/own-macos-x86-64/build/rpython/rtyper/lltypesystem/ll2ctypes.py", line 1370, in invoke_via_ctypes
cvalue = cfunc.extraargs[i - natural_arity](cvalue)
File "/Users/matti/oss/pypy-x86_64-buildbot/lib_pypy/_ctypes/pointer.py", line 73, in __init__
self.contents = value
File "/Users/matti/oss/pypy-x86_64-buildbot/lib_pypy/_ctypes/pointer.py", line 106, in setcontents
self._type_.__name__, type(value).__name__))
TypeError: expected ctypes_Array of Char {'nolength': True} *0 instead of LP_ctypes_Array of Char {'nolength': True} *0
builder: own-macos-x86-64 build #1205
test: pypy/module/termios/test/test_termios/py/TestTermios/()/test_ioctl_termios