1. pygame
  2. pygame
  3. pygame
  4. Issues


Issue #135 resolved

Python 3.x build fails to import due to unicode strings in colordict.py

created an issue

I was attempting to compile pygame for python3 today, using these instructions: http://www.pygame.org/wiki/CompileUbuntu?parent=Compilation, i.e. cloning the repository and running "python3 setup.py install".

While the compilation appeared to work fine, the module failed to import, giving this error message:



Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.2/dist-packages/pygame/init.py", line 106, in <module> import pygame.color File "/usr/local/lib/python3.2/dist-packages/pygame/colordict.py", line 679 u'gray17' : (43, 43, 43, 255) , ^ SyntaxError: invalid syntax }}}

Inspecting colordict.py revealed that from line 679 onwards, all the keys were in the form u'colour' :. I've fixed this on my local machine with a quick regex to remove the leading u, and the module now imports fine, but I'm not familiar enough with mercurial to upload a fix myself.

Comments (5)

  1. Log in to comment