Stepping through inside, it seems that the buffer has the right size, and the data is the right length at the point the buffer write occurs. But the buffer write fails (and I can't step that)
I'm 99% certain that this worked before I upgraded from Kubuntu 13.10 to 14.04
### transcript
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
>>> import numpy
>>> import pygame
>>> a = numpy.zeros((10,20,3), numpy.uint8)
>>> pygame.SurfaceArray.make_surface(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'SurfaceArray'
>>> pygame.surfarray.make_surface(a)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/pygame/surfarray.py", line 243, in make_surface
return numpysf.make_surface (array)
File "/usr/lib/python2.7/dist-packages/pygame/_numpysurfarray.py", line 368, in make_surface
blit_array (surface, array)
File "/usr/lib/python2.7/dist-packages/pygame/_numpysurfarray.py", line 437, in blit_array
surface.get_buffer ().write (data, 0)
IndexError: bytes to write exceed buffer size
Feeding a numpy array to make_surface gives an error:
to reproduce: (10,20, 3), numpy.uint8) SurfaceArray. make_surface( a)
$ python
>>> import numpy
>>> import pygame
>>> a = numpy.zeros(
>>> pygame.
output: 10x20x32) SW)>
IndexError: bytes to write exceed buffer size
expected:
<Surface(
Stepping through inside, it seems that the buffer has the right size, and the data is the right length at the point the buffer write occurs. But the buffer write fails (and I can't step that)
I'm 99% certain that this worked before I upgraded from Kubuntu 13.10 to 14.04
### transcript (10,20, 3), numpy.uint8) SurfaceArray. make_surface( a) surfarray. make_surface( a) python2. 7/dist- packages/ pygame/ surfarray. py", line 243, in make_surface make_surface (array) python2. 7/dist- packages/ pygame/ _numpysurfarray .py", line 368, in make_surface python2. 7/dist- packages/ pygame/ _numpysurfarray .py", line 437, in blit_array get_buffer ().write (data, 0)
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
>>> import numpy
>>> import pygame
>>> a = numpy.zeros(
>>> pygame.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'SurfaceArray'
>>> pygame.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
return numpysf.
File "/usr/lib/
blit_array (surface, array)
File "/usr/lib/
surface.
IndexError: bytes to write exceed buffer size
$ lsb_release -rd
Description: Ubuntu 14.04 LTS
Release: 14.04
$ apt-cache policy python-pygame dfsg-9ubuntu1 dfsg-9ubuntu1 dfsg-9ubuntu1 0 gb.archive. ubuntu. com/ubuntu/ trusty/universe amd64 Packages dpkg/status
python-pygame:
Installed: 1.9.1release+
Candidate: 1.9.1release+
Version table:
*** 1.9.1release+
500 http://
100 /var/lib/