#260 Python3 - Can't convert 'bytes' object to str implicitly

v3.0.0
closed-fixed
nobody
GL (74)
5
2014-09-06
2013-08-23
Jiri Stransky
No

In Python 3, when i call glGetUniformLocation, i get this error:

  File "/home/jistr/projects/archive/pingine/pingine/rendering.py", line 136, in render
    m_to_s_loc = GL.glGetUniformLocation(self.program, 'modelToSector')
  File "/home/jistr/projects/archive/pingine/.tox/dev/lib/python3.3/site-packages/OpenGL/latebind.py", line 61, in __call__
    return self.wrapperFunction( self.baseFunction, *args, **named )
  File "/home/jistr/projects/archive/pingine/.tox/dev/lib/python3.3/site-packages/OpenGL/GL/VERSION/GL_2_0.py", line 221, in glGetUniformLocation
    name = name + _NULL_8_BYTE
TypeError: Can't convert 'bytes' object to str implicitly

I fixed it temporarily by changing that line to:

name = bytes(name, 'ascii') + _NULL_8_BYTE

...but that might not be backwards compatible.

Discussion

    • status: open --> closed-fixed
     
  • I've added support for Unicode names to bzr head in the VERSION and extension versions of both glGetUniformLocation and glGetAttributeLocation

     
  • Note: workaround with current version is to pass in bytes objects as the names.

     
  • Jiri Stransky
    Jiri Stransky
    2013-09-07

    You rock. Thanks!