Ticket #276 (new defect)
ipv6 host support
| Reported by: | ghazel | Owned by: | ianb |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.4.1 |
| Component: | paste | Version: | released-version |
| Severity: | normal | Keywords: | |
| Cc: | felix.schwarz@… |
Description
Currently, if you try to use a server config like:
[server:main] use = egg:Paste#http host = :: port = 80
you get:
Traceback (most recent call last):
File "c:\python25\scripts\paster-script.py", line 8, in <module>
load_entry_point('pastescript==1.3.6', 'console_scripts', 'paster')()
File "c:\python25\lib\site-packages\pastescript-1.3.6-py2.5.egg\paste\script\command.py", line 78, in run
invoke(command, command_name, options, args[1:])
File "c:\python25\lib\site-packages\pastescript-1.3.6-py2.5.egg\paste\script\command.py", line 117, in invoke
exit_code = runner.run(args)
File "c:\python25\lib\site-packages\pastescript-1.3.6-py2.5.egg\paste\script\command.py", line 212, in run
result = self.command()
File "c:\python25\lib\site-packages\pastescript-1.3.6-py2.5.egg\paste\script\serve.py", line 232, in command
server(app)
File "c:\python25\lib\site-packages\pastedeploy-1.3.1-py2.5.egg\paste\deploy\loadwsgi.py", line 140, in server_wrapper
**context.local_conf)
File "c:\python25\lib\site-packages\pastedeploy-1.3.1-py2.5.egg\paste\deploy\util\fixtypeerror.py", line 57, in fix_call
val = callable(*args, **kw)
File "c:\python25\lib\site-packages\paste-1.4.2-py2.5.egg\paste\httpserver.py"
, line 1307, in server_runner
serve(wsgi_app, **kwargs)
File "c:\python25\lib\site-packages\paste-1.4.2-py2.5.egg\paste\httpserver.py"
, line 1257, in serve
threadpool_options=threadpool_options)
File "c:\python25\lib\site-packages\paste-1.4.2-py2.5.egg\paste\httpserver.py"
, line 1107, in __init__
RequestHandlerClass, ssl_context)
File "c:\python25\lib\site-packages\paste-1.4.2-py2.5.egg\paste\httpserver.py"
, line 1087, in __init__
RequestHandlerClass, ssl_context)
File "c:\python25\lib\site-packages\paste-1.4.2-py2.5.egg\paste\httpserver.py"
, line 358, in __init__
HTTPServer.__init__(self, server_address, RequestHandlerClass)
File "c:\python25\lib\SocketServer.py", line 330, in __init__
self.server_bind()
File "c:\python25\lib\BaseHTTPServer.py", line 101, in server_bind
SocketServer.TCPServer.server_bind(self)
File "c:\python25\lib\SocketServer.py", line 341, in server_bind
self.socket.bind(self.server_address)
File "<string>", line 1, in bind
socket.gaierror: (11001, 'getaddrinfo failed')
There are a few ways to add support for this. Here's one example:
in paste.httpserver.SecureHTTPServer.init:
def __init__(self, server_address, RequestHandlerClass,
ssl_context=None):
# This overrides the implementation of __init__ in python's
# SocketServer.TCPServer (which BaseHTTPServer.HTTPServer
# does not override, thankfully).
if ':' in server_address[0]:
self.address_family = socket.AF_INET6
HTTPServer.__init__(self, server_address, RequestHandlerClass)
Once that's fixed you run in to #275, and once that's fixed ipv6 support works!
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

