utf encoding error

T

Timothy Smith

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"])
 
M

Mike Thompson

Timothy said:
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,
)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top