Home - Summaries: (main) : (py3.11) : (py3.12) : Everything - Nightly builds - Benchmarks - RPython - Builders - About

pypy/module/cpyext/test/test_buffer.py::AppTestBuffer::()::test_argparse

self = <pypy.interpreter.typedef.W_ObjectObjectUserDictWeakrefable object at 0x00000001622680c8>

    def test_argparse(self):
            # issue 5136
            module = self.import_extension("foo", [
            ("getbuffer", "METH_VARARGS", """
                Py_buffer buf;
                if (!PyArg_ParseTuple(args, "y*", &buf))
                    return NULL;
                int ro = buf.readonly;
                PyBuffer_Release(&buf);
                return PyLong_FromLong(ro);
            """),
            ])
            # buf = array.array("B", [0] * 1024)
            buf = bytearray(1024)
            # buf = (ctypes.c_uint8 * 1024)()
>           ret = module.getbuffer(buf)
E           (application-level) ValueError: __release_buffer__ called with a buffer not obtained from this object

[/Users/matti/build-worker-arm64/own-macos-arm64/build/pypy/module/cpyext/test/test_buffer.py:89]:16: ValueError
---------- Captured stdout call ----------
Error in cpyext, CPython compatibility layer:
The function cpyext_bf_releasebuffer_bytearray was not supposed to fail
Fatal error in cpyext, CPython compatibility layer, calling cpyext_bf_releasebuffer_bytearray
Either report a bug or consider not using this particular extension
---------- Captured stderr call ----------
<function PyModule_Create2 at 0x0000000131ed6908>  DONE
<function PySequence_Fast_ITEMS at 0x0000000162718d40>  DONE
<function cpyext_bf_getbuffer_bytearray at 0x000000014190cb60>  DONE
<function PyBuffer_IsContiguous at 0x0000000131fe7790>  DONE
<function cpyext_bf_releasebuffer_bytearray at 0x000000014190cc50>Traceback (most recent call last):
  File "/Users/matti/build-worker-arm64/own-macos-arm64/build/pypy/module/cpyext/api.py", line 1164, in wrapper_second_level
    raise not_supposed_to_fail(pname)
  File "/Users/matti/build-worker-arm64/own-macos-arm64/build/pypy/module/cpyext/api.py", line 1018, in not_supposed_to_fail
    raise SystemError
SystemError
  File "/Users/matti/oss/pypy-arm64-buildbot/lib_pypy/_ctypes/function.py", line 283, in f
    return to_call(*args)
  File "/Users/matti/build-worker-arm64/own-macos-arm64/build/rpython/rtyper/lltypesystem/ll2ctypes.py", line 895, in callback
    return callback_internal(*cargs)
  File "/Users/matti/build-worker-arm64/own-macos-arm64/build/rpython/rtyper/lltypesystem/ll2ctypes.py", line 872, in callback_internal
    llres = container._callable(*llargs)
  File "/Users/matti/build-worker-arm64/own-macos-arm64/build/pypy/module/cpyext/api.py", line 990, in wrapper
    return wrapper_second_level(callable, pname, *args)
  File "/Users/matti/build-worker-arm64/own-macos-arm64/build/pypy/module/cpyext/api.py", line 1186, in wrapper_second_level
    state.check_and_raise_exception(always=True)
  File "/Users/matti/build-worker-arm64/own-macos-arm64/build/pypy/module/cpyext/state.py", line 79, in check_and_raise_exception
    raise operror
 OpErrFmtNoArgs: [<W_TypeObject 'ValueError' at 0x132a3f5c8>: W_BaseExceptionUserWeakrefable([W_UnicodeObject('__release_buffer__ called with a buffer not obtained from this object')])]
<function PyLong_FromLong at 0x00000001325adbc8>  DONE
builder: own-macos-arm64 build #1337+
test: pypy/module/cpyext/test/test_buffer.py::AppTestBuffer::()::test_argparse