eryksun added the comment:

> you can't mix CRT methods with OS methods because the CRT does its 
> own buffering

Python 3's io uses the CRT's low I/O (ioinfo struct) in binary mode. It appears 
that the buffers pipech, pipech2, and dbcsbuffer are only used in text mode. So 
it should be generally OK to call get_osfhandle and use Win32 directly, if 
that's ever required. 

Of course, as this patch demonstrates, an io opener (3.3+) can call 
open_osfhandle immediately after CreateFile, and nothing else changes. This 
could be added to io / _pyio in 3.5. Initially it could simply be a pure-Python 
function that uses _winapi and msvcrt. 3.6 could get a C implementation in 
_iomodule.c.

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15244>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to