Python and freeze (something odd)

Aki Niimura akineko at pacbell.net
Wed Jul 9 21:46:45 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 "websc.py", line 284, in ?
  File "websc.py", line 276, in main
  File "websc.py", line 125, in upload_files
  File "websc_upload.py", line 173, in httprequest
  File "/usr/local/lib/python2.2/email/Message.py", line 113, in as_string
    g.flatten(self, unixfrom=unixfrom)
  File "/usr/local/lib/python2.2/email/Generator.py", line 103, in flatten
    self._write(msg)
  File "/usr/local/lib/python2.2/email/Generator.py", line 131, in _write
    self._dispatch(msg)
  File "/usr/local/lib/python2.2/email/Generator.py", line 157, in _dispatch
    meth(msg)
  File "/usr/local/lib/python2.2/email/Generator.py", line 231, in _handle_multipart
    g.flatten(part, unixfrom=False)
  File "/usr/local/lib/python2.2/email/Generator.py", line 103, in flatten
    self._write(msg)
  File "/usr/local/lib/python2.2/email/Generator.py", line 138, in _write
    self._write_headers(msg)
  File "/usr/local/lib/python2.2/email/Generator.py", line 172, in _write_headers
    elif _is8bitstring(v):
  File "/usr/local/lib/python2.2/email/Generator.py", 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

(This is a repost as my previous posting seemed ignored)




More information about the Python-list mailing list