pygame.surfarray.make_surface(numpyarray) gives IndexError
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
pygame (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Feeding a numpy array to make_surface gives an error:
to reproduce:
$ python
>>> import numpy
>>> import pygame
>>> a = numpy.zeros(
>>> pygame.
output:
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
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
python-pygame:
Installed: 1.9.1release+
Candidate: 1.9.1release+
Version table:
*** 1.9.1release+
500 http://
100 /var/lib/
sorry. error copying steps to reproduce. Should have been
$ python (10,20, 3), numpy.uint8) surfarray. make_surface( a)
>>> import numpy
>>> import pygame
>>> a = numpy.zeros(
>>> pygame.
output: 10x20x32) SW)>
IndexError: bytes to write exceed buffer size
expected:
<Surface(
Further testing shows it works on a fresh install of Mint.
Failing on Kubuntu 14.04 LTS
Working on Xubuntu 12.04.4 LTS