[New-bugs-announce] [issue41839] Fix error checking in sched_get_priority_ functions

Jakub Kulik report at bugs.python.org
Wed Sep 23 05:44:51 EDT 2020


New submission from Jakub Kulik <kulikjak at gmail.com>:

Python presumes that any negative number returned from sched_get_priority_min or sched_get_priority_max indicates that error has occurred. However, neither Linux manual pages nor POSIX.1-2001 specification forbids negative values to be returned; only -1 has a special meaning for error.

On Solaris, sched_get_priority_min can, in some instances, return -60, and while this is a legitimate scheduling priority value, Python throws an OSError. Checking for -1 rather than all negative values fixes this issue.

----------
components: Library (Lib)
messages: 377363
nosy: kulikjak
priority: normal
severity: normal
status: open
title: Fix error checking in sched_get_priority_ functions
type: behavior
versions: Python 3.10, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41839>
_______________________________________


More information about the New-bugs-announce mailing list