
This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.
Created on2015-08-20 12:43 byfxkr, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| http_server__on_startup_show_host_and_port_as_url.patch | fxkr,2015-08-20 12:43 | review | ||
| http_server__on_startup_show_host_and_port_as_url.patch | fxkr,2015-08-20 15:10 | review | ||
| Messages (8) | |||
|---|---|---|---|
| msg248882 -(view) | Author: Felix Kaiser (fxkr)* | Date: 2015-08-20 12:43 | |
http.server: on startup, show host/port as URLOld:% python3 -m http.serverServing HTTP on 0.0.0.0 port 8000 ...New:% ./python -m http.server Servinghttp://0.0.0.0:8000/ ...This is useful because (modern) terminals will auto-detect URLs and make them clickable, so printing an URL makes it easier to navigate the browser there. | |||
| msg248886 -(view) | Author: R. David Murray (r.david.murray)*![]() | Date: 2015-08-20 14:38 | |
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) ... | |||
| msg248888 -(view) | Author: Felix Kaiser (fxkr)* | Date: 2015-08-20 15:10 | |
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 broken links). Here's a new patch though. Your choice :-)As for breaking programs: that message is clearly intended for human consumption. My opinion is that if someone parses that, they deserve the opportunity to fix their code. However, out of curiosity, I did search for code containing "Serving HTTP on" before opening the issue and couldn't find anything that's parsing that message. | |||
| msg248889 -(view) | Author: R. David Murray (r.david.murray)*![]() | Date: 2015-08-20 15:24 | |
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 presenting the info hit different parts of my brain: one is the part that looks at things from a networking perspective (ports and IPs) and the other that looks at it from a web perspective (urls). | |||
| msg248944 -(view) | Author: Raymond Hettinger (rhettinger)*![]() | Date: 2015-08-21 05:47 | |
FWIW, I like Felix's original suggestion. | |||
| msg249990 -(view) | Author: Felix Kaiser (fxkr)* | Date: 2015-09-06 11:41 | |
So do I, but I can live with either way.Can one of you merge one of these patches? | |||
| msg264497 -(view) | Author: Roundup Robot (python-dev)![]() | Date: 2016-04-29 13:48 | |
New changeset3be61137280a by Berker Peksag in branch 'default':Issue#24902: Print server URL on http.server startuphttps://hg.python.org/cpython/rev/3be61137280a | |||
| msg264498 -(view) | Author: Berker Peksag (berker.peksag)*![]() | Date: 2016-04-29 13:51 | |
I replaced %-string with str.format(). Thanks!Note: Please sign the PSF contributor agreement athttps://www.python.org/psf/contrib/contrib-form/ | |||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:19 | admin | set | github: 69090 |
| 2016-04-29 13:51:04 | berker.peksag | set | status: open -> closed versions: + Python 3.6 nosy: +berker.peksag messages: +msg264498 resolution: fixed stage: resolved |
| 2016-04-29 13:48:23 | python-dev | set | nosy: +python-dev messages: +msg264497 |
| 2015-09-06 11:41:44 | fxkr | set | messages: +msg249990 |
| 2015-08-25 07:09:11 | martin.panter | set | nosy: +martin.panter |
| 2015-08-21 05:47:18 | rhettinger | set | nosy: +rhettinger messages: +msg248944 |
| 2015-08-20 15:24:13 | r.david.murray | set | messages: +msg248889 |
| 2015-08-20 15:10:03 | fxkr | set | files: +http_server__on_startup_show_host_and_port_as_url.patch messages: +msg248888 |
| 2015-08-20 14:38:09 | r.david.murray | set | nosy: +r.david.murray messages: +msg248886 |
| 2015-08-20 12:43:34 | fxkr | create | |