I raised this issue with the https://www.home-assistant.io/ guys.
There seems to be a bug in Python 3.7 that could cause this error. Python 3.6 seems ok.
See: https://github.com/home-assistant/home-assistant/issues/21367#issuecomment-467397812
How can this be brought to the attention of the TTN developers?