Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > encoding error

Reply
Thread Tools

encoding error

 
 
ryan
Guest
Posts: n/a
 
      07-21-2003
1) i have a function that i made in one of my program's modules named
"input_box.py" 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
else:
ev_unicode = ord(ev_unicode)
value = unichr(ev_unicode).encode('latin1')
return (event.key, value)
else:
pass
------------------
2) i use py2exe to compile it with the option for encodings, like the docs
say:

python setup.py 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading Text File Encoding and converting to Perls internal UTF-8 encoding sln@netherlands.com Perl Misc 2 04-17-2009 11:22 PM
Character conversion error: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (line number may be too low). alcor@fibertel.com.ar Java 0 04-03-2006 01:19 PM
Error with.. "Transfer-encoding:..." Lars Netzel ASP .Net 1 12-05-2004 01:24 PM
changing JVM encoding; setting -Dfile.encoding doesn't work pasmol@plusnet.pl Java 1 10-08-2004 09:50 PM
Encoding.Default and Encoding.UTF8 Hardy Wang ASP .Net 5 06-09-2004 04:04 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57