From: Rick K. <ric...@co...> - 2010-01-19 11:51:26
|
My program is unicode-aware and I'm opening files with codecs.open( self.file_name,'w','utf-8' ), for example. This doesn't work with the .exe created by py2exe because of a lookup error for the "unknown encoding: utf-8". How can I get this to work? I'm using python 2.6.4. Thanks! Rick King Southfield MI |
From: Werner F. B. <wer...@fr...> - 2010-01-19 13:24:06
|
On 19/01/2010 12:51, Rick King wrote: > My program is unicode-aware and I'm opening files with codecs.open( > self.file_name,'w','utf-8' ), for example. > > This doesn't work with the .exe created by py2exe because of a lookup > error for the "unknown encoding: utf-8". > > How can I get this to work? > > I'm using python 2.6.4. In the past encodings had to be included manually (with the package option), but IIRC this has been fixed a long long time ago. What version of py2exe are you using, how does your setup.py look? Maybe you want to put a small script together which shows this problem with the corresponding setup.py. Werner |
From: Rick K. <ric...@co...> - 2010-01-19 17:35:24
Attachments:
unicodepy2exetest-setup.py
|
import codecs do_file = codecs.open( "unicodepy2exetest.txt",'w','utf-8' ) print do_file |
From: Alexander B. <bi...@uk...> - 2010-01-20 05:39:53
|
setup( options = {"py2exe": {"compressed": 1, "optimize": 2, "ascii": 1, "includes":["dbhash"], "bundle_files": 1}}, zipfile = None, windows = [unicodepy2exetest], ## data_files=[(".",["filetoolgui_notes.txt", ## ]) ## ] ) You have to remove `"ascii": 1` line, because it exclude all codecs from exe. What you'd expect with it? |
From: Werner F. B. <wer...@fr...> - 2010-01-20 08:50:47
Attachments:
setup.py
|
Rick, On 19/01/2010 18:35, Rick King wrote: > I have py2exe 0.6.9. > > I attached a simple script and a setup.py that shows the problem. As Alexander pointed out you need to remove or change to "ascii": False Attached the changed setup.py, I also added a console target as otherwise you can't see the print output. Werner |
From: Rick K. <ric...@co...> - 2010-01-20 14:34:06
|
Thanks, Werner. py2exe seems to be SUCH A GOOD PROGRAM that I don't want to bother to use anything other than the samples to create setup scripts. I don't want to take the time to learn distutils, which, to me, is rather intimidating since altogether it accounts for a significant fraction of the *entire* global module list for python, but as a result I don't fully understand all the samples. Up until now I've had no problems (well, except for the problem with the manifest and recent versions of python). Rick Werner F. Bruhin wrote: > Rick, > > On 19/01/2010 18:35, Rick King wrote: >> I have py2exe 0.6.9. >> >> I attached a simple script and a setup.py that shows the problem. > As Alexander pointed out you need to remove or change to "ascii": False > > Attached the changed setup.py, I also added a console target as > otherwise you can't see the print output. > > Werner > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > ------------------------------------------------------------------------ > > _______________________________________________ > Py2exe-users mailing list > Py2...@li... > https://lists.sourceforge.net/lists/listinfo/py2exe-users |
From: Werner F. B. <wer...@fr...> - 2010-01-20 15:04:24
|
Rick, On 20/01/2010 15:34, Rick King wrote: > Thanks, Werner. You are welcome. > > py2exe seems to be SUCH A GOOD PROGRAM that I don't want to bother to > use anything other than the samples to create setup scripts. I don't > want to take the time to learn distutils, which, to me, is rather > intimidating since altogether it accounts for a significant fraction of > the *entire* global module list for python, but as a result I don't > fully understand all the samples. Up until now I've had no problems > (well, except for the problem with the manifest and recent versions of > python). You might want to look at Gui2Exe (http://code.google.com/p/gui2exe/) a GUI to generate e.g. py2exe setup.py's. Werner |