Author Ma Lin
Recipients Dima.Tisnek, Ma Lin, Mariatta, ned.deily, njs, ronaldoussoren
Date 2020-04-07.06:54:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Windows build encountered a similar problem, see issue32394.
The solution is to check the runtime system version when importing socket module, if it is an older system, delete the constants. [1]

issue32394 has a small script ( to help find such constants, usage:
1, build a CPython build with old SDK.
2, use, dump possible affected constants to a file `winsdk_dump.json`.
3, build a CPython build with new SDK.
4, use, compare constants between two builds .

If a new constant is introduced by new SDK/API, we remove it on older system during runtime.
Otherwise we can ignore this new constant, this means it has nothing to do with the new SDK.
(msg311858 is a demo.)

We don't need to use routinely, just use it when updating the building SDK, this process only takes about 10~20 minutes.

I think macOS build can also uses this process.

The commit:

Note that there was a minor fix later:
Date User Action Args
2020-04-07 06:54:11Ma Linsetrecipients: + Ma Lin, ronaldoussoren, ned.deily, njs, Dima.Tisnek, Mariatta
2020-04-07 06:54:10Ma Linsetmessageid: <>
2020-04-07 06:54:10Ma Linlinkissue40060 messages
2020-04-07 06:54:10Ma Lincreate