py2exe crashes on simple program

Steven D'Aprano steve+comp.lang.python at pearwood.info
Tue Jul 5 02:13:51 EDT 2016


On Tuesday 05 July 2016 14:06, John Nagle wrote:

>   I'm trying to create an executable with py2exe.
> The program runs fine in interpretive mode.  But
> when I try to build an executable, py2exe crashes with
> an assertion error. See below.
[...]
> Building shared code archive 'dist\library.zip'.
[...]
>     assert mod.__file__.endswith(EXTENSION_SUFFIXES[0])
> AssertionError

To me, that looks like you're trying to build something called "library.zip" 
and .zip isn't an allowed file type extension.

If you change it to "library.exe" does it work?

Also, I consider this a bug in py2exe:

- it's an abuse of assert, using it to check user-supplied input;

- it's a failing assertion, which by definition is a bug.



-- 
Steve




More information about the Python-list mailing list