The thread handling the web_server was crashing. This in turn ended in
the web_server not being able to start again, thus being impossible to
login again if you logged out.
Surround the serve_forever function of the web server with a try-catch
on Windows, in order to avoid printing the entire (useless) traceback.
Now a warning message is be displayed in the log instead.
The behavior is untouched in other platforms
* Fix PermissionError when importing http.server
Instead of crashing, now it'll just not start the server. This means that you won't be able to receive the response from the log-in so you won't be able to log in. The browser gives an error that it can't find the page on localhost. But at least it doesn't crash.
Fixes crash CURA-3Q.
* Log an error when the HTTP server can't be started
Contributes to crash CURA-3Q.
* Indicate that types are optional
Attempt to fix the typing issue with MyPy. I can't run this locally so the CI server will have to tell me if this fixed it.
Contributes to Sentry issue CURA-3Q.