Ma Lin <> added the comment:

> We don't remove unsupported socket flags on Unix, why should we do it for 
> Windows?

We have this problem because: compile with new Windows SDK, but run on old 
version Windows.
On Linux/Unix, the compile-time headers always consist with the system, so 
there should not has this problem.
Correct me if I'm wrong.

> The other option would be to always hide the new constant on Windows in 3.6, 
> and make it unconditionally available on 3.7.

Search on GitHub [1], most people only check whether `socket` has such flags, 
like this:
if hasattr(socket, "TCP_KEEPCNT"):
Most of they don't check platform or Python version, so I'm -1 on this option.

TCP_KEEPIDLE and TCP_KEEPINTVL were added in Windows 10 1709. [2]
The master branch on AppVeyor is using 10.0.16229 (1709) SDK. [3]
While 3.6 branch is using 10.0.15062 (1703) SDK. [4]
If you agree the way of PR 5523, maybe we should remove these two flags as well.



Python tracker <>
Python-bugs-list mailing list

Reply via email to