Problem with McMillans Installer

  • Thread starter =?ISO-8859-1?Q?Mikael_Lex=E9n?=
  • Start date
?

=?ISO-8859-1?Q?Mikael_Lex=E9n?=

Hi

I have the following code

fileName="test.txt"
inputFile=file(fileName,'r')
b = unicode(inputFile.read(), 'utf-8')
inputFile.close()

outputFile=file(fileName,'w')

print >> outputFile, b.encode('iso-8859-1')

outputFile.close()

This code works ok. Then I use the Installer and made a --onefile
"binary". The building process is also ok but when I try to execute the
program I get the following error

c:\python\siebel>convert "copy of test.txt"
Traceback (most recent call last):
File "<string>", line 18, in ?
LookupError: no codec search functions registered: can't find encoding

I change to --onedir build and get the same result. I did some tests
and found that if I put the "encodings" directory (from
".../python22/lib" directory) in the "--onedir" directory everything
works ok . So my question is how can I tell the Installer to get the
"encodings" directory in the build process?

/Mikael
 
E

Eric Brunel

Mikael said:
Hi

I have the following code

fileName="test.txt"
inputFile=file(fileName,'r')
b = unicode(inputFile.read(), 'utf-8')
inputFile.close()

outputFile=file(fileName,'w')

print >> outputFile, b.encode('iso-8859-1')

outputFile.close()

This code works ok. Then I use the Installer and made a --onefile
"binary". The building process is also ok but when I try to execute the
program I get the following error

c:\python\siebel>convert "copy of test.txt"
Traceback (most recent call last):
File "<string>", line 18, in ?
LookupError: no codec search functions registered: can't find encoding

I change to --onedir build and get the same result. I did some tests
and found that if I put the "encodings" directory (from
".../python22/lib" directory) in the "--onedir" directory everything
works ok . So my question is how can I tell the Installer to get the
"encodings" directory in the build process?

Expicitely importing the codecs module in the Python program should solve the
problem.

BTW, McMillan Installer has its own mailing list (see
http://trixie.triqs.com/mailman/listinfo/installer). You'll usually get quicker
and/or better answers if you post your questions there rather than on c.l.py.

HTH
 
?

=?ISO-8859-1?Q?Mikael_Lex=E9n?=

Nop I have

import unicodedata,codecs

but it doesn't help. I will try the mailing list. Thanks

/Mikael
 
?

=?ISO-8859-1?Q?Mikael_Lex=E9n?=

As always google is your friend. The answer to the problem is and I quote

"""
Chad, Just change support/useUnicode.py to say:
"import encodings"

(codecs and encodings used to import each other, but not any longer).

-- Gordon
"""

/Mikael
 

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

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top