Velocity Reviews

Velocity Reviews (
-   Python (
-   -   encoding error (

ryan 07-21-2003 08:15 PM

encoding error
1) i have a function that i made in one of my program's modules named
"" that uses unicode:

def get_key():
while 1:
event = pygame.event.poll()
if event.type == KEYDOWN:
ev_unicode = event.unicode
if type(ev_unicode) == types.UnicodeType:
if ev_unicode == '':
ev_unicode = 0
ev_unicode = ord(ev_unicode)
value = unichr(ev_unicode).encode('latin1')
return (event.key, value)
2) i use py2exe to compile it with the option for encodings, like the docs

python py2exe --packages encodings
3) I still get the error:
Traceback (most recent call last):
File "<string>", line 110, in ?
File "<string>", line 82, in main
File "handle_keyboard.pyc", line 113, in handle_keyboard
File "open_url.pyc", line 126, in open_url
File "input_box.pyc", line 53, in ask
File "input_box.pyc", line 21, in get_key
LookupError: no codec search functions registered: can't find encoding
4) Aren't I only supposed to get the above error "LookupError: no codec
search functions registered: can't find encoding" if i did NOT compile with
"--packages encodings"?
5) Why am i still getting this error when i run the exe? I do not get it
when i just run the source

All times are GMT. The time now is 08:11 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.