Python and freeze (something odd)

Discussion in 'Python' started by Aki Niimura, Jul 9, 2003.

  1. Aki Niimura

    Aki Niimura Guest

    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
     
    Aki Niimura, Jul 9, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Aki Niimura

    Python and freeze (something odd)

    Aki Niimura, Jul 9, 2003, in forum: Python
    Replies:
    2
    Views:
    384
    Aki Niimura
    Jul 10, 2003
  2. Frederik
    Replies:
    2
    Views:
    355
    Kevin Cazabon
    Jul 28, 2003
  3. Andrew Robert
    Replies:
    3
    Views:
    813
    Andrew Robert
    May 18, 2006
  4. Michael Speer

    Odd behavior with odd code

    Michael Speer, Feb 16, 2007, in forum: C Programming
    Replies:
    33
    Views:
    1,109
    Richard Heathfield
    Feb 18, 2007
  5. Replies:
    5
    Views:
    256
    Olivier Renaud
    Mar 15, 2007
Loading...

Share This Page