setting icon using py2exe?

Thomas Heller theller at
Wed Jun 30 13:16:46 CEST 2004

Grant Edwards <grante at> writes:

>>  2) According to
>>     you can set the icon_resources in the like this:
>>       #
>>       from distutils.core import setup
>>       import py2exe
>>       setup(windows=[{"script":"","icon_resources":[(1,"rivatek.ico")]}])
>>     That doesn't work either:
>>         File "C:\Python23\Lib\site-packages\py2exe\", line 577, in build_executable
>>           add_icon(unicode(exe_path), unicode(ico_filename), ico_id)
>>       RuntimeError: MapExistingFile: The handle is invalid.
> Never mind....
> Further googling reveals this is a known bug when running under
> Win98/Me:

The bug should be fixed in CVS.  Since py2exe now can also be built with
MingW32, you could try that, even if you don't have MSVC.  Or you have
to wait for the release.


More information about the Python-list mailing list