[New-bugs-announce] [issue3213] "pydoc -p" should listen to [::] if IPv6 is supported

Hans Ulrich Niedermann report at bugs.python.org
Fri Jun 27 02:11:29 CEST 2008


New submission from Hans Ulrich Niedermann <hun at n-dimensional.de>:

According to "pydoc --help",

pydoc -p <port>
    Start an HTTP server on the given port on the local machine.

The IP address pydoc binds to is not specified, thus I would expect it
to either bind to the local address or to the wildcard address.

Current behaviour of "pydoc -p 1234" is to bind to the IPv4-only 
address 0.0.0.0:1234.

On a IPv4/IPv6 dual-stack machine, I would expect pydoc to listen to
either both 127.0.0.1:1234 and [::1]:<port>, or just [::]:<port> ([::]
also catches accesses to IPv4 addresses such as 127.0.0.1).

Then access to the pydoc webserver is
available both via IPv4 (e.g. http://127.0.0.1:1234/) and IPv6 (e.g.
http://[::1]:1234/), and in both cases via http://localhost:1234/
regardless whether localhost is resolved via IPv6 or IPv4.

Trivial patch attached (tested on Linux x86 machine with local IPv6
networking).

----------
components: Library (Lib)
files: python-pydoc-p-ipv6.patch
keywords: patch
messages: 68811
nosy: ndim
severity: normal
status: open
title: "pydoc -p" should listen to [::] if IPv6 is supported
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file10748/python-pydoc-p-ipv6.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3213>
_______________________________________


More information about the New-bugs-announce mailing list