<div dir="ltr"><div><div>Hi Reuben,<br><br></div>Thanks for reporting this. I've had a similar report recently in the Tulip tracker (<a href="http://code.google.com/p/tulip/issues/detail?id=89" target="_blank">http://code.google.com/p/tulip/issues/detail?id=89</a>). But the problem seems with the use of SO_REUSEPORT in the test.support package's bind_port() helper.<br>

<br>This really belongs in the Python issue tracker (<a href="http://bugs.python.org">bugs.python.org</a>) -- can you submit a bug there? My hunch is that, because this seems to be a relatively new feature, we should just catch and ignore the exception from that specific call.<br>

<br></div>--Guido<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 3, 2013 at 7:24 AM, Reuben Garrett <span dir="ltr"><<a href="mailto:reubengarrett@gmail.com" target="_blank">reubengarrett@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Greetings, learned Python devs! <br><br></div>Apologies in advance if my message is misdirected. I'm building Python 3.3.2-r2 from Gentoo's Portage tree [1] and 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 # 16594 [3] may be related (not sure). <br>


<br></div>Is it possible to detect the kernel version and skip (or modify) these tests if SO_REUSEPORT is not available? If I'm missing something obvious (or should be reporting this elsewhere), please educate me so I can better respect your attention next time around :] <br>


<div><div><div><div><br></div><div><br></div><div>+=== excerpt of portage build log: <br></div><div>======================================================================<br>ERROR: test_bind_port (test.test_support.TestSupport)<br>


----------------------------------------------------------------------<br>Traceback (most recent call last):<br>  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<br>


    support.bind_port(s)<br>  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<br>    if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:<br>


OSError: [Errno 92] Protocol not available<br><br>======================================================================<br>ERROR: test_find_unused_port (test.test_support.TestSupport)<br>----------------------------------------------------------------------<br>


Traceback (most recent call last):<br>  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<br>    port = support.find_unused_port()<br>


  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<br>    port = bind_port(tempsock)<br>  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<br>


    if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1:<br>OSError: [Errno 92] Protocol not available<br>===+ <br><br>[1]: <a href="https://packages.gentoo.org/package/dev-lang/python" target="_blank">https://packages.gentoo.org/package/dev-lang/python</a><br>


[2]: <a href="https://lwn.net/Articles/542629/" target="_blank">https://lwn.net/Articles/542629/</a><br>[3]: <a href="http://bugs.python.org/issue16594" target="_blank">http://bugs.python.org/issue16594</a><span class="HOEnZb"><font color="#888888"><br>

<br>-- <br></font></span></div><span class="HOEnZb"><font color="#888888"><div>Best regards, <br></div>
<div>Reuben Garrett <br><br></div></font></span></div></div></div></div>
<br>_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/guido%40python.org" target="_blank">https://mail.python.org/mailman/options/python-dev/guido%40python.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)
</div>