py2exe IOErrors on Windows 7 32-bit systems

939 Views Asked by At

I have a script that uses py2exe for Windows 32-bit Python 2.6, using Python 2.6.2. This script has exception handling built in and works correctly on Windows 7 64-bit systems and Windows XP systems in its compiled py2exe executable format with no errors and no issues.

However, when I run the executable on a Windows 7 32-bit system I get a pop up error that reads:

See the logfile at 'C:\path\to\directory\program_name.exe.log' for details.

When I go to that file, it contains the following information:

close failed in file object destructor:
IOError: [Errno 0] Error

The file runs correctly and has no issues at all, with the exception of the error that is logged to the directory listed above.

I have been reading around all morning trying to get a handle on what is going on. I saw a knowledge base article, STDIN/STDOUT Redirection May Not Work If Started from a File Association, from a couple of years ago talking about issues with Windows XP and return codes. This seems like it could be the same type of issue, but the article said that the issue was resolved with a hotfix.

When I run the actual Python script on the system that is giving me this error with the compiled executable, it runs fine with no errors or exceptions at all.

Why is this issue coming up? I think it is an issue with py2exe, or how Windows 7 32-bit handles return codes from the py2exe executable.

0

There are 0 best solutions below