Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pydoc -p" should listen to [::] if IPv6 is supported #47463

Closed
ndim mannequin opened this issue Jun 27, 2008 · 5 comments
Closed

"pydoc -p" should listen to [::] if IPv6 is supported #47463

ndim mannequin opened this issue Jun 27, 2008 · 5 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@ndim
Copy link
Mannequin

ndim mannequin commented Jun 27, 2008

BPO 3213
Nosy @loewis, @berkerpeksag, @vadmium, @jleedev
Files
  • python-pydoc-p-ipv6.patch: IPv6 support for 'pydoc -p '
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2016-05-16.07:27:47.442>
    created_at = <Date 2008-06-27.00:11:28.448>
    labels = ['type-feature', 'library']
    title = '"pydoc -p" should listen to [::] if IPv6 is supported'
    updated_at = <Date 2016-05-16.07:27:47.439>
    user = 'https://bugs.python.org/ndim'

    bugs.python.org fields:

    activity = <Date 2016-05-16.07:27:47.439>
    actor = 'berker.peksag'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-05-16.07:27:47.442>
    closer = 'berker.peksag'
    components = ['Library (Lib)']
    creation = <Date 2008-06-27.00:11:28.448>
    creator = 'ndim'
    dependencies = []
    files = ['10748']
    hgrepos = []
    issue_num = 3213
    keywords = ['patch']
    message_count = 5.0
    messages = ['68811', '68814', '262883', '265517', '265676']
    nosy_count = 5.0
    nosy_names = ['loewis', 'ndim', 'berker.peksag', 'martin.panter', 'jleedev']
    pr_nums = []
    priority = 'low'
    resolution = 'rejected'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue3213'
    versions = ['Python 3.6']

    @ndim
    Copy link
    Mannequin Author

    ndim mannequin commented Jun 27, 2008

    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).

    @ndim ndim mannequin added type-bug An unexpected behavior, bug, or error stdlib Python modules in the Lib dir labels Jun 27, 2008
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jun 27, 2008

    That will break on systems where AF_INET6 doesn't default to
    dual-stacked sockets and mapped v4 addresses (e.g. Windows); to make it
    work correctly, you'll also have to disable the IPV6_V6ONLY option,
    which then breaks on systems which don't implement that option (e.g.
    Windows XP).

    @merwok merwok added type-feature A feature request or enhancement and removed type-bug An unexpected behavior, bug, or error labels Feb 21, 2012
    @vadmium
    Copy link
    Member

    vadmium commented Apr 5, 2016

    I understand Windows XP isn’t so important these days. So maybe we just need to disable IPV6_V6ONLY. (Unless we want this for 2.7 maybe?)

    @vadmium
    Copy link
    Member

    vadmium commented May 14, 2016

    Currently pydoc only binds to IPv4 localhost, not the “any-address” 0.0.0.0. See bpo-22421 and bpo-672656.

    Apart from satisfying Hans’s expectation, what is the benefit of running pydoc on IPv6? I guess it would be possible to bind two sockets, one to IPv4 localhost (127.1 or ::ffff:127.0.0.1), and the other IPv6 localhost (::1). But why bother?

    @HubleGiter HubleGiter mannequin added type-crash A hard crash of the interpreter, possibly with a core dump and removed type-feature A feature request or enhancement labels May 14, 2016
    @vadmium vadmium added type-feature A feature request or enhancement and removed type-crash A hard crash of the interpreter, possibly with a core dump labels May 14, 2016
    @berkerpeksag
    Copy link
    Member

    Agreed with Martin.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants