[Python-Dev] [isssue 2001] Pydoc enhancement patch questions

Nick Coghlan ncoghlan at gmail.com
Sun Jul 25 05:44:15 CEST 2010


On Sun, Jul 25, 2010 at 1:16 AM, Alexander Belopolsky
<alexander.belopolsky at gmail.com> wrote:
> On Sat, Jul 24, 2010 at 6:37 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> ..
>> For the "-b" option, if the server is already running (and hence the
>> port is in use), catch the exception, print a message and start the
>> webbrowser anyway.
>
> I was going to make a similar suggestion, but then realized that there
> it may not be easy or desirable for pydoc to figure out whether the
> service running on the used port is in fact pydoc.  Any query that
> pydoc would send may be disruptive depending on what program is
> listening on the port.  It may also get easily confused by a pydoc
> service from a different version of python.   It may be better to
> search for an unused port in the error case and pass it to the
> browser.

I don't think there's any need to check if it is an actual pydoc
server running on the port - if it isn't pydoc, the user will be able
to tell that by what shows up in the webbrowser window.

To request automatic assignment of a local port number, "-p 0" could
be made to work correctly (i.e. print out the actual port the OS
assigned rather than the 0 that was passed in on the command line as
it does currently).

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Dev mailing list