Python and freeze (something odd)

Aki Niimura akineko at
Wed Jul 9 04:24:49 CEST 2003

Hello Everyone,

I feel sorry to bother you guys as I posted another yesterday, too.

Finally my script which accesses a web site from a Python script is functioning
fully. It works very nicely (upload / download / does operations).

Now I'm trying to "freeze" my script to a single executable file under Solaris
using freeze. I have done such many times and it worked magically (until now).

However, maybe I'm out of luck.

When I started the generated executable, I got the following:
 Traceback (most recent call last):
  File "", line 284, in ?
  File "", line 276, in main
  File "", line 125, in upload_files
  File "", line 173, in httprequest
  File "/usr/local/lib/python2.2/email/", line 113, in as_string
    g.flatten(self, unixfrom=unixfrom)
  File "/usr/local/lib/python2.2/email/", line 103, in flatten
  File "/usr/local/lib/python2.2/email/", line 131, in _write
  File "/usr/local/lib/python2.2/email/", line 157, in _dispatch
  File "/usr/local/lib/python2.2/email/", line 231, in _handle_multipart
    g.flatten(part, unixfrom=False)
  File "/usr/local/lib/python2.2/email/", line 103, in flatten
  File "/usr/local/lib/python2.2/email/", line 138, in _write
  File "/usr/local/lib/python2.2/email/", line 172, in _write_headers
    elif _is8bitstring(v):
  File "/usr/local/lib/python2.2/email/", line 44, in _is8bitstring
    unicode(s, 'us-ascii')
LookupError: unknown encoding: us-ascii


As I mentioned earlier, it works fine if it is invoked from .py files.
Also, I created a simple test program which just does unicode(s, 'us-ascii').
The frozen version of such test program works without a hitch.

Guido mentioned in a document for 'freeze' saying:
"... It may still be confused -- it will not
know about calls to the __import__ built-in function, ..."

I guess my program confused 'freeze' as unicode is a built-in function.
However, he didn't offer any further information.

Any thoughts, any suggestions?

Thanks in advance.

Best regards,
Aki Niimura

More information about the Python-list mailing list