New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests fail due to unsupported SO_REUSEPORT when building Python 3.3.2-r2 #64100
Comments
When building Python 3.3.2-r2 from Gentoo's Portage tree 1, I encountered two failed tests which probably should not have been attempted on my OS (Gentoo 3.7.10): test_bind_port and test_find_unused_port both use the SO_REUSEPORT socket option which, to the best of my knowledge is only available since kernel version 3.9. I was able to build by skipping the tests — but I believe the tests are there for a reason, and it would be best if a test that is known to fail should be skipped (or replaced with a fallback that is likely to succeed). Issue bpo-16594 3 may be related (not sure). Is it possible to detect the kernel version and skip (or modify) these tests if SO_REUSEPORT is not available? Better yet (since even a 3.9 kernel could have it disabled) — try the test with SO_REUSEPORT, but trap the exception for lack of OS support, print a warning, and try again without SO_REUSEPORT. +=== excerpt of portage build log: Traceback (most recent call last):
File "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/test_support.py", line 87, in test_bind_port
support.bind_port(s)
File "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/support.py", line 548, in bind_port
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
OSError: [Errno 92] Protocol not available ====================================================================== Traceback (most recent call last):
File "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/test_support.py", line 80, in test_find_unused_port
port = support.find_unused_port()
File "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/support.py", line 522, in find_unused_port
port = bind_port(tempsock)
File "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/support.py", line 548, in bind_port
if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:
OSError: [Errno 92] Protocol not available
===+ |
[FWIW, this looks similar to an issue I ran into on Fedora: |
I fixed this in 3.3 and 3.4 several weeks ago. http://hg.python.org/cpython/rev/9791c5d55f52 |
On Sat, Dec 7, 2013 at 1:35 PM, Gregory P. Smith <report@bugs.python.org>wrote:
|
On Sat, Dec 7, 2013 at 1:35 PM, Gregory P. Smith <report@bugs.python.org>
Sorry for the duplicate message a few moments ago … "fat-fingered" my send So, has the fix just not reached the Portage tree yet? I don't fully |
You didn't do anything wrong. You were running 3.3.3 which is the latest release of 3.3. Portage is Gentoo's thing, you'd have to ask the gentoo python portage ebuild maintainer and point them at the commit with the additional patch to apply if you want it fixed there. (or file a bug on gentoo's bug tracking system and point it at this one) In general gentoo is one of the more up to date distros (compared to everything else) but it is always helpful to try checking out and compiling the latest source tree from hg.python.org as described in http://docs.python.org/devguide/ (on the 3.3 branch in your case) when reporting an issue. I just happened to have noticed this problem myself and fixed it without bothering to file an issue about it a few weeks before you ran into it. :) |
On Sat, Dec 14, 2013 at 2:38 PM, Gregory P. Smith <report@bugs.python.org>
That's actually really good advice (applicable to other projects beyond |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: