You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
os.sched_setaffinity does not handle errors during iteration. #81601
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2019-06-27.16:11:13.968>created_at=<Date2019-06-26.22:22:26.691>labels= ['type-bug', 'library', '3.9']
title='os.sched_setaffinity does not handle errors during iteration.'updated_at=<Date2019-06-27.16:45:35.150>user='https://github.com/brandtbucher'
This is related to bpo-37417: os.sched_setaffinity doesn't properly handle errors that arise during iteration of the mask argument:
Python 3.9.0a0 (heads/master:d52a83a, Jun 26 2019, 15:13:41)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> bad_iter =map(int, "0X")
>>> os.sched_setaffinity(0, bad_iter)
ValueError: invalid literal for int() with base 10: 'X'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
SystemError: <built-in function sched_setaffinity> returned a result with an error set
It looks like this bug is also present on all versions of Python 3. I've attached a patch with a fix and a regression test.
New changeset 45a30af by Benjamin Peterson (Brandt Bucher) in branch 'master':
closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. (GH-14414) 45a30af
New changeset 65e1872 by Miss Islington (bot) in branch '3.7':
closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. (GH-14414) 65e1872
New changeset 6fbed53 by Miss Islington (bot) in branch '3.8':
closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. (GH-14414) 6fbed53
Activity
brandtbucher commentedon Jun 26, 2019
This is related to bpo-37417: os.sched_setaffinity doesn't properly handle errors that arise during iteration of the mask argument:
It looks like this bug is also present on all versions of Python 3. I've attached a patch with a fix and a regression test.
benjaminp commentedon Jun 27, 2019
New changeset 45a30af by Benjamin Peterson (Brandt Bucher) in branch 'master':
closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. (GH-14414)
45a30af
miss-islington commentedon Jun 27, 2019
New changeset 65e1872 by Miss Islington (bot) in branch '3.7':
closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. (GH-14414)
65e1872
miss-islington commentedon Jun 27, 2019
New changeset 6fbed53 by Miss Islington (bot) in branch '3.8':
closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. (GH-14414)
6fbed53