weird error with py2exe

Hi there,

I experienced some strange errors when I distributed our application to
some colleagues in Denmark.

The application uses:

Python 2.4
wxPython 2.5.5.1
numeric 23.7
matplotlib 0.83.1

The GUI was designed with Boa Constructor 0.4.4. The exe-file was compiled
with py2exe 0.6.3

A student who works for me has made an .exe-file of the application that
worked fine on our PC's in Norway (I tested it on around 10 PC's, both
Windows XP and 2000). Last week we had a meeting with some colleagues from
Denmark who brought their laptops and installed the application.
Installation went fine for all of them, but the application would not run
on 3 out of 9 laptops (both Windows XP and 2000).

I understand that the error has something to do with matplotlib and with
Unicode displaying the letter 'æ', but I can't find out what the reason is
for this. Strange thing is, we use the same letter here in Norway. My guess
i that it has someting to do with language settings on these 3 PC's, but I
am not sure about this.

Anyone an idea what went wrong here? Thanks a lot in advance!

Oliver

Here is the error report and the setup.py for py2exe

Error report:
Traceback (most recent call last):
  File "PanelCheck.py", line 4, in ?
  File "PanelCheck_GUI.pyc", line 9, in ?
  File "Line_Plot.pyc", line 3, in ?
  File "Plot_Setup.pyc", line 9, in ?
  File "matplotlib\backends\backend_wxagg.pyc", line 18, in ?
  File "matplotlib\backends\backend_agg.pyc", line 82, in ?
  File "matplotlib\figure.pyc", line 3, in ?
  File "matplotlib\axes.pyc", line 14, in ?
  File "matplotlib\axis.pyc", line 25, in ?
  File "matplotlib\font_manager.pyc", line 993, in ?
  File "matplotlib\font_manager.pyc", line 837, in __init__
  File "matplotlib\font_manager.pyc", line 830, in rebuild
  File "matplotlib\font_manager.pyc", line 456, in createFontDict
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in
position 15: ordinal not in range(128)
Traceback (most recent call last):
  File "PanelCheck.py", line 4, in ?
  File "PanelCheck_GUI.pyc", line 9, in ?
  File "Line_Plot.pyc", line 3, in ?
  File "Plot_Setup.pyc", line 9, in ?
  File "matplotlib\backends\backend_wxagg.pyc", line 18, in ?
  File "matplotlib\backends\backend_agg.pyc", line 82, in ?
  File "matplotlib\figure.pyc", line 3, in ?
  File "matplotlib\axes.pyc", line 14, in ?
  File "matplotlib\axis.pyc", line 25, in ?
  File "matplotlib\font_manager.pyc", line 993, in ?
  File "matplotlib\font_manager.pyc", line 837, in __init__
  File "matplotlib\font_manager.pyc", line 830, in rebuild
  File "matplotlib\font_manager.pyc", line 456, in createFontDict
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe6' in
position 15: ordinal not in range(128)

setup.py for py2exe:
# setup.py
from distutils.core import setup
import py2exe
import glob
import sys

class Target:
    def __init__(self, **kw):
        self.__dict__.update(kw)
        # for the versioninfo resources
        self.version = "1.22"
        self.company_name = "Matforsk "
        self.copyright = "no copyright"
        self.name = "PanelCheck"

manifest_template = '''
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
    version="5.0.0.0"
    processorArchitecture="x86"
    name="%(prog)s"
    type="win32"
/>
<description>%(prog)s Program</description>
<dependency>
    <dependentAssembly>
        <assemblyIdentity
            type="win32"
            name="Microsoft.Windows.Common-Controls"
            version="6.0.0.0"
            processorArchitecture="X86"
            publicKeyToken="6595b64144ccf1df"
            language="*"
        />
    </dependentAssembly>
</dependency>
</assembly>
'''

RT_MANIFEST = 24

PanelCheck_files = [
"About.py",
"Correlation_Plot.py",
"FileOpen_Summary.py",
"Line_Plot.py",
"LoadData.py",
"PanelCheck.py",
"PanelCheck_GUI.py",
"pca.py",
"Plot_Setup.py",
"fig.ico",
"about.png",
"logo.png",
"help.chm",
"Tucker1_Plot.py",
"Eggshell_Plot.py",
"pmse_Plot.py",
"SplashScreen.py",
"pstat.py",
"stats.py"
]

data = glob.glob(r'C:\Program Files\Python24\share\matplotlib\*')
data.append(r'C:\Program Files\Python24\share\matplotlib\matplotlibrc')

PanelCheck = Target(
    script = "PanelCheck.py",
    other_resources = [(RT_MANIFEST, 1, manifest_template %
dict(prog="PanelCheck"))],
    icon_resources = [(1, "fig.ico")],
    #data_files = [("matplotlibdata", data)],
    dest_base = "PanelCheck")

setup( data_files = [("matplotlibdata", data), ("",["fig.ico", "help.chm",
"about.png", "logo.png"]),
                      ("code", PanelCheck_files)],

      options = {“py2exe”: { “packages”: [“encodings”, “pytz”, “numarray”,
“matplotlib.numerix.random_array”],
                              “bundle_files”: 3,
                              “ascii”: 1}
                     },
       zipfile = None,
       name=‘PanelCheck’,
       version=‘1.22’,
       description=‘Data Analysis Tool’,
       author=‘Henning Risvik and Oliver Tomic’,
       url=‘http://www.matforsk.no/PanelCheck’,
       windows = [PanelCheck],
      )

···

=================
Oliver Tomic,
Dr. Scient, Research Scientist
MATFORSK - Norwegian Food Research Institute
Osloveien 1
1430 Ås
Norway

Tel.: 0047 6497 0252
Fax: 0047 6497 0333
Mob.: 0047 9574 6167

http://www.matforsk.no
http://www.matforsk.no/panelcheck