Berker Peksag added the comment:
I replaced %-string with str.format(). Thanks!
Note: Please sign the PSF contributor agreement at
https://www.python.org/psf/contrib/contrib-form/
--
nosy: +berker.peksag
resolution: -> fixed
stage: -> resolved
status: open -> closed
versions:
Roundup Robot added the comment:
New changeset 3be61137280a by Berker Peksag in branch 'default':
Issue #24902: Print server URL on http.server startup
https://hg.python.org/cpython/rev/3be61137280a
--
nosy: +python-dev
___
Python tracker
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +martin.panter
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24902
___
___
Raymond Hettinger added the comment:
FWIW, I like Felix's original suggestion.
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24902
___
R. David Murray added the comment:
This is a nice idea, but I think it would be better to add it to the message
rather than change the message (and we'd still break some people's programs,
I'm sure):
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000) ...
--
nosy:
New submission from Felix Kaiser:
http.server: on startup, show host/port as URL
Old:
% python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 ...
New:
% ./python -m http.server
Serving http://0.0.0.0:8000/ ...
This is useful because (modern) terminals will auto-detect URLs and make
Felix Kaiser added the comment:
I'm not sure - that'd be redundant, and I find it harder to read. It also
breaks for badly configured terminals where (/) are part of the
select-by-word character set (but thats a very minor issue -- users with
parentheses in the set will probably be used to
R. David Murray added the comment:
I do it in a number of test suites (you pass in localhost and port 0, then
parse the output to find out what port got used). I'm sure other people do it
as well. The parens could be dropped. I don't think it is really redundant,
as the two ways of