Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#21 py2exe should set __file__ on the main module

open
nobody
None
5
2008-09-04
2008-09-04
Alexey Borzenkov
No

py2exe currently does not set __file__ attribute on its main module, which can break scripts that rely on __file__ in the main module pointing to the 'program name', i.e. to open files in the same directory, etc.

This patch add support for __file__ by setting it to the module name.

Additionally it has a patch for not redefining Py_ssize_t when it is already defined, otherwise it breaks compilation under mingw.

Discussion