This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xdegaye
Recipients giampaolo.rodola, gvanrossum, pitrou, vstinner, xdegaye, yselivanov
Date 2016-02-25.13:51:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1456408319.2.0.804697554696.issue26437@psf.upfronthosting.co.za>
In-reply-to
Content
create_server() used to accept the 'port' parameter as a string before in all cases (until last december at least).
The following session shows the difference in behavior when the listening address is INADDR_ANY and '127.0.0.1':

============================
$ python
Python 3.6.0a0 (default:47fa003aa9f1, Feb 24 2016, 13:09:02) 
[GCC 5.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from asyncio import *
>>> loop = get_event_loop()
>>> coro = loop.create_server(Protocol(), '', '12345')
>>> loop.run_until_complete(coro)
<Server sockets=[<socket.socket fd=7, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('0.0.0.0', 12345)>, <socket.socket fd=9, family=AddressFamily.AF_INET6, type=2049, proto=6, laddr=('::', 12345, 0, 0)>]>
>>> coro = loop.create_server(Protocol(), '127.0.0.1', '12345')
>>> loop.run_until_complete(coro)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 373, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.6/asyncio/futures.py", line 274, in result
    raise self._exception
  File "/usr/local/lib/python3.6/asyncio/tasks.py", line 240, in _step
    result = coro.send(None)
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 946, in create_server
    sock.bind(sa)
TypeError: an integer is required (got type str)
============================

IMPHO python should consistently either accept 'port' as str or require 'port' as int.
History
Date User Action Args
2016-02-25 13:51:59xdegayesetrecipients: + xdegaye, gvanrossum, pitrou, vstinner, giampaolo.rodola, yselivanov
2016-02-25 13:51:59xdegayesetmessageid: <1456408319.2.0.804697554696.issue26437@psf.upfronthosting.co.za>
2016-02-25 13:51:59xdegayelinkissue26437 messages
2016-02-25 13:51:58xdegayecreate