Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > utf encoding error

Reply
Thread Tools

utf encoding error

 
 
Timothy Smith
Guest
Posts: n/a
 
      05-04-2005
hi there, this one is in relation to my py2exe saga.

when i compile a package using py2exe i get the error msg below, if i
just run the py files it doesn't error, so i assume pysvn is trying to
use something thats not being included in the build. only i have no idea
where to start looking.

Traceback (most recent call last):
File "Main.pyc", line 819, in ValidateLogin
File "Main.pyc", line 861, in ShowMainFrameItems
LookupError: unknown encoding: utf-8


and here is my setup.py for py2exe for good measure

from distutils.core import setup
import py2exe

package_dir = ['c:\python23\reportlab', 'c:\python23\lib',
'Z:\Projects\PubWare\trunk\python']

setup(windows=[ "Z:\\Projects\\PubWare\\trunk\\python\\PubWare .py"])
 
Reply With Quote
 
 
 
 
Mike Thompson
Guest
Posts: n/a
 
      05-04-2005
Timothy Smith wrote:
> hi there, this one is in relation to my py2exe saga.
>
> when i compile a package using py2exe i get the error msg below, if i
> just run the py files it doesn't error, so i assume pysvn is trying to
> use something thats not being included in the build. only i have no idea
> where to start looking.
>
> Traceback (most recent call last):
> File "Main.pyc", line 819, in ValidateLogin
> File "Main.pyc", line 861, in ShowMainFrameItems
> LookupError: unknown encoding: utf-8
>
>
> and here is my setup.py for py2exe for good measure
>
> from distutils.core import setup
> import py2exe
> package_dir = ['c:\python23\reportlab', 'c:\python23\lib',
> 'Z:\Projects\PubWare\trunk\python']
> setup(windows=[
> "Z:\\Projects\\PubWare\\trunk\\python\\PubWare .py"])



Py2exe has a Wiki which answers a lot of these questions. In general,
you might find it useful to look there.

For your problem: you need to explicitly include the encodings module
for utf8. Using static analysis Py2exe can't known to include it in the
built exe. Something like this should work for you ...

# setup.py

from distutils.core import setup
import py2exe

explicitIncludes = [
"encodings.utf_8",

]

opts = {
"py2exe": {
"includes": explicitIncludes,
# "optimize" : 2
}
}

setup(
windows = ["XXXXXX.py"],
options=opts,
)
 
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
UTF - SEEK_SET workaround for BOM encoding(utf-16/32) layer Bug sln@netherlands.com Perl Misc 2 08-13-2009 11:35 PM
Reading Text File Encoding and converting to Perls internal UTF-8 encoding sln@netherlands.com Perl Misc 2 04-17-2009 11:22 PM
error: conflicts with new declaration with =?UTF-8?B?4oCYQ+KAmSBs?==?UTF-8?B?aW5rYWdl?= H.S. C++ 12 08-10-2007 03:43 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



Advertisments