[issue17561] Add socket.bind_socket() convenience function

2019-04-09 Thread STINNER Victor


STINNER Victor  added the comment:

"""
Fixed. There's a remaining failing BB:
https://buildbot.python.org/all/#/builders/176/builds/185/steps/4/logs/stdio
...but the failure appears unrelated and it has been red for a while.
"""

That's known and unrelated issue: https://bugs.python.org/issue31453

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17561] Add socket.bind_socket() convenience function

2019-04-09 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Fixed. There's a remaining failing BB:
https://buildbot.python.org/all/#/builders/176/builds/185/steps/4/logs/stdio
...but the failure appears unrelated and it has been red for a while.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17561] Add socket.bind_socket() convenience function

2019-04-08 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:


New changeset 8702b67dad62a9084f6c1823dce10653743667c8 by Giampaolo Rodola in 
branch 'master':
BPO-17561: set create_server backlog default to None (GH-12735)
https://github.com/python/cpython/commit/8702b67dad62a9084f6c1823dce10653743667c8


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17561] Add socket.bind_socket() convenience function

2019-04-08 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
pull_requests: +12658
stage: resolved -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17561] Add socket.bind_socket() convenience function

2019-04-08 Thread STINNER Victor


STINNER Victor  added the comment:

The change broke multiple buildbots. Example:

https://buildbot.python.org/all/#builders/16/builds/2625

Traceback (most recent call last):
  File 
"/home/dje/cpython-buildarea/3.x.edelsohn-sles-z/build/Lib/test/_test_multiprocessing.py",
 line 4377, in test_wait_socket
self.assertEqual(b''.join(v), expected)
AssertionError: b'1\n2\n3\n4\n5\n6\n7\n8\n9\n' != 
b'0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n'

More logs:

https://github.com/python/cpython/pull/11784#issuecomment-481036369

--
nosy: +vstinner
resolution: fixed -> 
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17561] Add socket.bind_socket() convenience function

2019-04-08 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

Patch committed as of:
https://github.com/python/cpython/commit/eb7e29f2a9d075accc1ab3faf3612ac44f5e2183
For posterity, since the API evolved since the original proposal (as per PR 
review/suggestions), this is the final incarnation:

# IPv4 only
>>> socket.create_server(addr)  
# IPv6 only
>>> socket.create_server(addr, family=socket.AF_INET6)
# IPv4 + IPv6
>>> socket.create_server(addr, family=socket.AF_INET6, dualstack_ipv6=True)
# IPv4/6 if possible and don't care about IPv4 mapped addresses, else IPv4
>>> if socket.has_dualstack_ipv6():
...s = socket.create_server(addr, family=socket.AF_INET6, 
dualstack_ipv6=True)
... else:
...s = socket.create_server(addr)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17561] Add socket.bind_socket() convenience function

2019-04-08 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17561] Add socket.bind_socket() convenience function

2019-02-17 Thread Giampaolo Rodola'


Change by Giampaolo Rodola' :


--
stage: patch review -> commit review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17561] Add socket.bind_socket() convenience function

2019-02-11 Thread Giampaolo Rodola'


Giampaolo Rodola'  added the comment:

After iterating over this over the last few days I realized it makes more sense 
to implement and discuss the whole thing in here and as a single PR, so sorry 
about previously splitting this in a separate ticket/PR. Relevant PR is now 
this one and is ready for review:
https://github.com/python/cpython/pull/11784
Relevant changes which probably require attention/discussion are: 

1) since it was sort of ambiguous I renamed "has_dual_stack()" to 
"supports_hybrid_ipv46()". There could be space for some bikeshed as we already 
have "socket.has_ipv6" so this may be "has_hybrid_ipv46()" called instead

2) if family is unspecified and determined from *host* (e.g. "localhost" or "") 
the function sorts getaddrinfo() results preferring AF_INET over AF_INET6

3) doc includes link to my http://code.activestate.com/recipes/578504 recipe 
for platforms not supporting hybrid_ipv46 natively

4) it may be worthwhile (or maybe not?) to have another complementary 
bind_sockets() (plural) function returning all items from getaddrinfo(). That 
would be useful for non-blocking apps/frameworks and could be reused by asyncio.

Also, I'm CC-ing people from issue20215 as it contains relevant comments.

--
keywords:  -easy
nosy: +Carlos.Ralli, Paul Marks, andreasr, berker.peksag, dazhaoyu, 
gregory.p.smith, jleedev, jpokorny, martin.panter, nirs, r.david.murray
pull_requests: +11856
title: Add socket.create_server_sock() convenience function -> Add 
socket.bind_socket() convenience function

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com