You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Remove stack trace for socket errors with mkdocs serve #596
I often forget I already have a server running on localhost:8080, and whenever I run mkdocs serve I get a huge stack trace with a '[Errno 98] Address already in use' at the end. I think we should just catch socket errors and spit out the error message, like for ConfigurationError. Here's what you could do. Should we catch all socket errors though? Or just keep 98 and re-throw the rest?
I think @samhatfield is learning GitHub, but yeah, go ahead and open a pull request :) It is best to propose changes with pull requests so we can easily review/merge.
Another addition to the release notes would be great too!
Sorry if my tone was off. I noticed that @samhatfield had asked for feedback on his proposed change. However he hadn't received any feedback specifically about that (at least by my reading) -- only that the general request was reasonable. I was trying to tell him that I thought his proposed change looked good and he should submit a PR. Of course, final approval comes from @d0ugal so I did not give any definitive statements regarding whether such a PR would be accepted.
Not at all :) it was useful, I actually missed the link to the commit when I read it too quickly. So glad you mentioned it, I thought it was just a very reasonable suggestion.
I was just about to submit a PR earlier, but then I saw that socket.error is a deprecated alias of OSError as of Python 3.3. OSError seems too broad to catch, and I couldn't find any appropriate subclasses. If you guys think it's fine as it is though, I'll submit a PR.
Well, for Python < 3.3 we would still need to catch the socket.error so it doesn't cause any harm to leave it in. It appears that up through 3.6socket.error will still be in the code base--it just inherits from a different parent class. So I would say leave it as-is.
Although, an argument could be made to catch all errors on the command line (except when in debug mode) and only output the message. However, I expect that would be a more complex issue that should be implemented across the entire CLI.
Activity
samhatfield commentedon Jun 5, 2015
I meant port 8000, not 8080.
d0ugal commentedon Jun 5, 2015
Ha, I often do this too. Or i have another tool running on 8000 and forget.
I think we should catch it and just output an error message.
waylan commentedon Jun 5, 2015
@samhatfield why not create a pull request with your proposed change? That seems like the most sensible fix to me.
d0ugal commentedon Jun 5, 2015
I think @samhatfield is learning GitHub, but yeah, go ahead and open a pull request :) It is best to propose changes with pull requests so we can easily review/merge.
Another addition to the release notes would be great too!
waylan commentedon Jun 5, 2015
Sorry if my tone was off. I noticed that @samhatfield had asked for feedback on his proposed change. However he hadn't received any feedback specifically about that (at least by my reading) -- only that the general request was reasonable. I was trying to tell him that I thought his proposed change looked good and he should submit a PR. Of course, final approval comes from @d0ugal so I did not give any definitive statements regarding whether such a PR would be accepted.
d0ugal commentedon Jun 5, 2015
Not at all :) it was useful, I actually missed the link to the commit when I read it too quickly. So glad you mentioned it, I thought it was just a very reasonable suggestion.
samhatfield commentedon Jun 5, 2015
I was just about to submit a PR earlier, but then I saw that
socket.erroris a deprecated alias ofOSErroras of Python 3.3. OSError seems too broad to catch, and I couldn't find any appropriate subclasses. If you guys think it's fine as it is though, I'll submit a PR.waylan commentedon Jun 5, 2015
Well, for Python < 3.3 we would still need to catch the
socket.errorso it doesn't cause any harm to leave it in. It appears that up through 3.6socket.errorwill still be in the code base--it just inherits from a different parent class. So I would say leave it as-is.Although, an argument could be made to catch all errors on the command line (except when in debug mode) and only output the message. However, I expect that would be a more complex issue that should be implemented across the entire CLI.
samhatfield commentedon Jun 5, 2015
Sure thing, #600 submitted.
d0ugal commentedon Jun 6, 2015
Merged. Thanks!