Conversation
|
HA can start up in Windows Python 3.6.3 now. However press Ctrl+C cannot stop process, have to kill it through task manager. The following Ctrl+C didn't got any response After kill through task manager, get another stack trace output |
| except ImportError: | ||
| pass | ||
| else: | ||
| asyncio.set_event_loop_policy(uvloop.EventLoopPolicy()) |
There was a problem hiding this comment.
Could be simple:
try:
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
except ..:
pass
There was a problem hiding this comment.
Yes it's simpler, but the part that's supposed to raise an ImportError is the actual import. I don't want to guard the policy call because if uvloop has an internal problem which happens to raise an ImportError the system may be left in an inconsistent state and the error won't be reported.
All of this is probably not relevant in this particular case, but I got into the habit of following this pattern as a matter of principle because it's good coding practice and I did hit that set of circumstances often enough to be wary of it.
|
CC @smurfix |
|
See Apparently this runner does no longer get a Could you check whether the latest change in https://github.com/M-o-a-T/home-assistant/tree/aio_run ( |
|
No change, same error. Even I comment out the whole |
|
Hmm, the other problem seems to be that the signal handler isn't even registered, sorry that I missed that. See homeassistant/helpers/signal.py -- please change that so that it reads i.e. the SIGINT and SIGTERM parts are no longer guarded by the |
|
|
|
OK. Use |
|
Looks good this time. I can clean up the change and make a push later |
|
Phew. ;-) Thanks. |
|
hass can start and stop on Windows now. EDIT: false alarm, I forget I had forward my localhost 8123 port to my dev VM. LOL |
|
Could you please pull from https://github.com/M-o-a-T/home-assistant/tree/winfix (and push that onto this pull request)? This change adds the change from comment #16737 to this pull request. Having that code in the async part blocks one of the original goals of moving towards |
|
Restart tested on Windows |
|
Great work everyone |
Description:
Fix the event loop under Windows after #16617.