[issue7346] Redirected stdout fires [Errno 9]

Amaury Forgeot d'Arc report at bugs.python.org
Wed Sep 29 01:21:01 CEST 2010


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

Yes, mingw uses a different C runtime (msvcrt.dll) than Python (msvcr90.dll), so file descriptors are completely different and this causes the error.

I can see two solutions:

- Use the same compiler as python26; I've also heard about a way to force mingw to use msvcr90.dll.

- Avoid to pass mingw file descriptors to the python interpreter.  This requires more work: create a PyTypeObject that mimics a file object, and set this as sys.stdout. It should be enough to implement .write() and .flush(); you can use the C system calls (fwrite, fflush or whatever) there, and the file descriptors are used in a consistent way.

----------
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue7346>
_______________________________________


More information about the Python-bugs-list mailing list