report at bugs
Apr 26, 2012, 2:07 PM
Post #19 of 58
Kristján Valur Jónsson <kristjan [at] ccpgames> added the comment:
> I'm not convinced that the errno change is actually correct.
You are right, as SBT pointed out. There are cases where we have had errno.EFOO and errno.WSAEFOO point to different values, because one was used by sockets and other by regular stuff. My patch was too heavy handed and nerfed at least EBADF. Perhaps others. (Getting a concrete example from SBT was helpful, btw)
For socket-specific errors, it is an easy choice, however, but for socket error codes that also have to do with file IO it is less clear and probably full of special cases. This is nothing new, however. For writing portable socket code that needs to deal with the EBADF code, you would have to check for WSAEBADF on windows and EBADF on linux. Probably both to be portable.
Since my patch was aimed at making 3.3. merely compilable for VS2010 I wanted to maintain the same value semantics as were it compiled for 2008. If we are changing the compiler version however, we might just as well take the plunge and translate the windows codes where they have corresponding posix codes. I'm eager to see Brian's patch.
Python tracker <report [at] bugs>
Python-bugs-list mailing list