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 giampaolo.rodola
Recipients giampaolo.rodola, paul.moore, pitrou, steve.dower, tim.golden, yanirh, zach.ware
Date 2018-03-28.14:53:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
By re-reading and I now remember why I haven't fixed this issue in psutil yet: because the whole thing (MS APIs and doc basically) is confusing.

GetMaximumProcessorCount (now used by os.cpu_count()) returns "the maximum number of logical processors that a processor group or the system CAN have", not the actual number. That would explain why in OP's case os.cpu_count() returns 128 instead of 40.

As per dwNumberOfProcessors wasn't good because it doesn't take multiple processor groups into account (hence the number may be too small) and GetLogicalProcessorInformationEx may be the way to go. This is based on the assumption that os.cpu_count() should report the number of CPUs in the system (including the non-usable ones, like in case of process groups).
Date User Action Args
2018-03-28 14:53:13giampaolo.rodolasetrecipients: + giampaolo.rodola, paul.moore, pitrou, tim.golden, zach.ware, steve.dower, yanirh
2018-03-28 14:53:12giampaolo.rodolasetmessageid: <>
2018-03-28 14:53:12giampaolo.rodolalinkissue33166 messages
2018-03-28 14:53:12giampaolo.rodolacreate