29 ms·
Given how much confusion the current behavior seems to have caused, the best course of action seems to have been a simple: "Listening on port $PORT. Warning:
by tsimionescu 5y ago
Given how much confusion the current behavior seems to have caused, the best course of action seems to have been a simple:
"Listening on port $PORT.
Warning: failed to bind localhost:5000. Start process with --port=$X to specify a different port"
That would be much more helpful behavior and messaging than simply failing, especially since it seems people don't know that they can control the port, and start looking to disabling OS services rather than changing a port...
- the_mitsuhiko 5y agoIt might be something to consider, but there are definitely some negative consequences to silently starting on another port, particularly when using automation and tests. It's not fun to have flask silently start on another port and then an integration test hits a completely unrelated service that happens to occupy that port.
- checkyoursudo 5y agoTotally agree, but if you're running tests, presumably you are looking for errors in the first place, right? So it doesn't have to fail silently, does it? The testing tools failing for whatever reason seems important to know as well.