Title: os.sched_getaffinity() is missing - module 'os' has no attribute 'sched_getaffinity'
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: josh.r, wesinator
Priority: normal Keywords:

Created on 2019-07-15 21:08 by wesinator, last changed 2019-07-15 23:14 by josh.r. This issue is now closed.

Messages (2)
msg347991 - (view) Author: wesinator (wesinator) * Date: 2019-07-15 21:08
Python 3.7.4 macOS 10.14.5 (homebrew) 

According to , there is a method `os.sched_getaffinity()` (

Code to reproduce :
import os

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'os' has no attribute 'sched_getaffinity'
msg347995 - (view) Author: Josh Rosenberg (josh.r) * (Python triager) Date: 2019-07-15 23:14
Per the docs on the function group that includes os.sched_getaffinity ( ):

> These functions control how a process is allocated CPU time by the operating system. They are only available on some Unix platforms. For more detailed information, consult your Unix manpages.

> New in version 3.3.

> The following scheduling policies are exposed if they are supported by the operating system.

OSX doesn't support these APIs, so Python on OSX won't have them.
Date User Action Args
2019-07-15 23:14:32josh.rsetstatus: open -> closed

nosy: + josh.r
messages: + msg347995

resolution: not a bug
stage: resolved
2019-07-15 21:09:07wesinatorsettitle: sched_getaffinity() is missing - module 'os' has no attribute 'sched_getaffinity' -> os.sched_getaffinity() is missing - module 'os' has no attribute 'sched_getaffinity'
2019-07-15 21:08:09wesinatorcreate