This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author malin
Recipients asvetlov, malin, methane, ned.deily, njs, paul.moore, skn78, steve.dower, thatiparthy, tim.golden, tjguk, zach.ware
Date 2018-02-09.00:57:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> What's about other OS/flags?
> Should we commit that every exposed socket flag is supported in runtime?
> It looks like very heavy burden.

Let alone run-time check. Flags only depend on .C code and the building SDK, therefore, for a certain official release (e.g. CPython 3.6.5), the flags are fixed.
Then it is possible to get a flag-snapshot of a certain official release.

I wrote a script to dump/compare these flags in some Windows related modules (written in C language), see attached file

Let me demonstrate how to use it:

> Comparing from A to B:
> A: 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]
> B: 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)]
> socket added 2 constants: {'TCP_KEEPCNT', 'TCP_FASTOPEN'}
> Finished, 1 modules changed constants.

Comparing official 3.6.3 (1607 SDK) with official 3.6.4 (1703 SDK).
It caught the 2 flags lead to this issue.

> Comparing from A to B:
> A: 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:54:40) [MSC v.1900 64 bit (AMD64)]
> B: 3.7.0b1 (v3.7.0b1:9561d7f, Jan 31 2018, 07:26:34) [MSC v.1900 64 bit (AMD64)]
> _winapi added 15 constants: {'NORMAL_PRIORITY_CLASS', 'FILE_TYPE_DISK', 'IDLE_PRIORITY_C
> socket added 3 constants: {'TCP_KEEPIDLE', 'TCP_KEEPINTVL', 'MSG_ERRQUEUE'}
> mmap added 1 constants: {'ACCESS_DEFAULT'}
> Finished, 3 modules changed constants.

Comparing official 3.6.4 (1703 SDK) with official 3.7.0b1 (1709 SDK).

_winapi added 15 constants, after searching on GitHub repository, we know they were added in 2 commits:
So they can be ignored.

socket added 3 constants.
After exploring, we know the 2 flags (TCP_KEEPIDLE, TCP_KEEPINTVL) were added by 1709 SDK, so we need to handle them during run-time as well.
Another new flag MSG_ERRQUEUE was also added by 1709 SDK, we need a socket expert decide what to do.

mmap added 1 constants.
It was added in:
Also ignore it.

This check is only needed after switching to a newer Windows SDK. As the file name, it's a watchdog of Windows SDK.

Some people build third-party-build by themselves, it's also possible to create a unittest, and teach it how to recognize flexible-flags (may be removed during run-time).

For example, a man builds CPython 3.7.0b1 with 1607 SDK (official 3.7.0b1 build with 1709 SDK), then he got a prompt like this:

> These flags are missing in socket module:
> Maybe you are using a older SDK than official release's, or these flags are removed in this machine during run-time.

If he build CPython 3.7.0b1 with 1903 SDK in two years later, he may got prompt like this:

> Unknown flags appear in socket module:
> They were added by newer Windows SDK, please make sure....
Date User Action Args
2018-02-09 00:57:54malinsetrecipients: + malin, paul.moore, tim.golden, ned.deily, njs, asvetlov, methane, zach.ware, steve.dower, thatiparthy, tjguk, skn78
2018-02-09 00:57:53malinsetmessageid: <>
2018-02-09 00:57:53malinlinkissue32394 messages
2018-02-09 00:57:53malincreate