Issue 19802: socket.SO_PRIORITY is missing (original) (raw)

Created on 2013-11-26 17:06 by deleted250130, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
socket.patch Claudiu.Popa,2013-11-26 17:59 review
Messages (9)
msg204506 - (view) Author: (deleted250130) Date: 2013-11-26 17:06
socket(7) does contain SO_PRIORITY but trying to use this value will result in this error: AttributeError: 'module' object has no attribute 'SO_PRIORITY'
msg204509 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-11-26 17:35
For the record, a little googling indicates this may be a linux-only option (FreeBSD 6.4, for example, does not support it, nor does OS X 10.8, which are two systems to which I currently have access). That doesn't mean it shouldn't be added.
msg204511 - (view) Author: PCManticore (Claudiu.Popa) * (Python triager) Date: 2013-11-26 17:59
Here's a simple patch which adds this flag. It has no tests, because I noticed that there are no tests for per-platform flags in test_socket.py (only for CAN, RDS and general flags).
msg204512 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-11-26 18:08
Yeah, I'm not sure how you'd write a test in such a way that it would test anything meaningful. Parse the .h file in the test? Seems like overkill.
msg204547 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2013-11-27 02:13
I agree. The test is not that meaningful. But hey, we have the test that tests this kind of constant. http://hg.python.org/cpython/rev/513da56d28de
msg204586 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2013-11-27 14:20
You should also modify Doc/library/socket.rst to mention the new constant in the documentation (don't forget the ".. versionadded::" flag). Adding a new constant cannot break anything in Python, so I propose to it in Python 3.4. @Larry (our release manager): Do you agree?
msg204593 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2013-11-27 14:58
It's *possible* but I'm willing to risk it. You have my permission to apply that patch.
msg204598 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-11-27 15:19
New changeset 9bbada125b3f by Benjamin Peterson in branch 'default': add SO_PRIORITY (closes #19802) http://hg.python.org/cpython/rev/9bbada125b3f
msg269457 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2016-06-29 01:30
Sorry, this is now too late for 3.4. 3.4 is now in "security fixes only" mode. This is not a security fix, therefore 3.4 is now ineligible. Since this change was committed to 3.5, it's better to let the historical record reflect that. So I'm changing the version back to 3.5 (and not 3.4).
History
Date User Action Args
2022-04-11 14:57:54 admin set github: 64001
2016-06-29 01:30:53 larry set messages: + versions: + Python 3.5, - Python 3.4
2016-06-29 01:28:12 martin.panter set versions: + Python 3.4, - Python 3.5
2013-11-27 15:19:44 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: resolved
2013-11-27 14:58:38 larry set messages: +
2013-11-27 14:20:44 vstinner set nosy: + larrymessages: +
2013-11-27 13:46:19 pitrou set nosy: + vstinner
2013-11-27 02:13:47 vajrasky set nosy: + vajraskymessages: +
2013-11-26 18:08:45 r.david.murray set messages: +
2013-11-26 17:59:43 Claudiu.Popa set files: + socket.patchnosy: + Claudiu.Popamessages: + keywords: + patch
2013-11-26 17:35:14 r.david.murray set nosy: + r.david.murraymessages: + components: + Tests, - Library (Lib)type: behavior -> enhancement
2013-11-26 17:21:01 benjamin.peterson set keywords: + easyversions: + Python 3.5, - Python 2.7, Python 3.3
2013-11-26 17:06:19 deleted250130 create