Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failures with Python 3.12.0b3 #99

Open
swt2c opened this issue Jul 7, 2023 · 3 comments
Open

Test failures with Python 3.12.0b3 #99

swt2c opened this issue Jul 7, 2023 · 3 comments

Comments

@swt2c
Copy link
Contributor

swt2c commented Jul 7, 2023

I'm seeing a few test failures when building pyopengl for Python 3.12.0b3 on Fedora. (Note: numpy doesn't have wheels for Python 3.12 yet - but you can use the nightly wheels from here: https://anaconda.org/scientific-python-nightly-wheels/numpy/). pyopengl builds successfully, but some tests fail. The failures are all similar, due to exceptions like this:

ctypes.ArgumentError: ("argument 2: TypeError: No array-type handler for type <class '_ctypes.CArgObject'> (value: <cparam 'P' (0x7fc0e72f7ca0)>) registered",

Here's one failure:

________________________ TestCore.test_orinput_handling ________________________
self = <test_core.TestCore testMethod=test_orinput_handling>
    def test_orinput_handling( self ):
        if not glGenVertexArrays:
            return None
        x = glGenVertexArrays(1)
        x = int(x) # check that we got x as an integer-compatible value
        x2 = GLuint()
>       r_value = glGenVertexArrays( 1, x2 )
PyOpenGL-3.1.6/tests/test_core.py:534: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/latebind.pyx:39: in OpenGL_accelerate.latebind.LateBind.__call__
    ???
src/wrapper.pyx:314: in OpenGL_accelerate.wrapper.Wrapper.__call__
    ???
src/wrapper.pyx:311: in OpenGL_accelerate.wrapper.Wrapper.__call__
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
self = <CFunctionType object at 0x7fc0e72cb1d0>
args = (1, <cparam 'P' (0x7fc0e72f7f20)>), named = {}
    def __call__( self, *args, **named ):
        if not self.ccisvalid():
            from OpenGL import error
            raise error.NoContext( self.func.__name__, args, named )
>       return self.func( *args, **named )
E       ctypes.ArgumentError: ("argument 2: TypeError: No array-type handler for type <class '_ctypes.CArgObject'> (value: <cparam 'P' (0x7fc0e72f7f20)>) registered", (1, <cparam 'P' (0x7fc0e72f7f20)>))
../../BUILDROOT/python-pyopengl-3.1.6-2.fc39.x86_64/usr/lib/python3.12/site-packages/OpenGL/platform/baseplatform.py:41: ArgumentError
swt2c added a commit to swt2c/pyopengl that referenced this issue Jul 18, 2023
In Python 3.12, CArgObject moved from builtins to _ctypes it seems.

Fixes mcfletch#99.
@JPLeBreton
Copy link

My distro just upgraded to Python 3.12, and I'm seeing this error on some of my software. But it looks like my distro upgraded the package recently? So I'm not sure why I'm seeing the error.

@JPLeBreton
Copy link

Oh, I see. That package only tracks the official releases, and a new release of PyOpenGL hasn't been tagged since those fixes went in.

@AElimrani
Copy link

Yes, the package requires manual compiling for version 3.12. I think the fixes are already merged but require a new release. I managed to monkey patch it (like in the expyriment issue), but I wonder if there aren't other issues that are blocking a release that I just haven't stumbled upon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants