New submission from Jakub Kulik <kulik...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue41839>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to