Eryk Sun added the comment:

If the examples continue to use printf, then msvcrt.dll is the best option. The 
universal CRT exports a single Swiss-Army-knife function, 
__stdio_common_vfprintf, which requires 5 parameters, including a va_list for 
the variadic argument list. That's not appropriate for a tutorial. We just need 
a docs update to warn that msvcrt.dll has its own set of file descriptors, 
heap, and thread-locale state.

> Does it mean `cdll.msvcrt` is not the standard way to access 
> the C symbols anymore?

On a tangent, cdll.msvcrt shouldn't be recommended anywhere in the ctypes docs. 
All code that uses cdll.msvcrt shares the same restype, argtypes, and errcheck 
prototypes for each function pointer, which is an unholy mess. The docs should 
recommend CDLL('mscvrt') or CDLL('msvcrt', use_errno=True). Every module or 
package should use its own private instance of CDLL.

----------

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

Reply via email to