[Python-Dev] Python 2.7: only Visual Studio 2008? (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Sat Aug 25 19:02:15 CEST 2012


Compatibility issues may lead to other strange bugs, too. IIRC each msvcrt has its own thread local storage and therefore its own errno handling. An extension compiled with VS 2010 won't be able to use the PyErrSetFromErrno*() function correctly. That's much harder to debug than a FILE pointer mismatch because it usually doesn't cause a segfault.

Interesting point. This somewhat breaks the stable ABI, which does include three SetFromErrno functions. So I guess we need to warn users of the stable ABI against using these functions.

A solution would then be to add an additional set of functions which expect errno as a parameter, although this is quite some complication. Another solution is to introduce a Py_errno macro (and _Py_errno function) which exposes Python's view of errno, so code that might be confronted with this issue would write

Py_errno = errno;

before calling any of these functions.

Except for the FILE* issue, I never considered any of the other issues really relevant for Python extensions, namely:

Anything else that you are aware of?

Regards, Martin



More information about the Python-Dev mailing list