# Unable to open anki app on Win10 "UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)"

**URL:** <https://forums.ankiweb.net/t/unable-to-open-anki-app-on-win10-unicodeerror-encoding-with-idna-codec-failed-unicodeerror-label-empty-or-too-long/5938>\
**Category:** Help\
**Created:** [December 20, 2020, 10:57pm UTC](https://forums.ankiweb.net/t/unable-to-open-anki-app-on-win10-unicodeerror-encoding-with-idna-codec-failed-unicodeerror-label-empty-or-too-long/5938 "2020-12-20T22:57:32Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kelciour](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/kelciour/32/14770_2.png) [@kelciour](https://forums.ankiweb.net/u/kelciour)\
**Post date:** [December 21, 2020, 12:06am UTC](https://forums.ankiweb.net/t/unable-to-open-anki-app-on-win10-unicodeerror-encoding-with-idna-codec-failed-unicodeerror-label-empty-or-too-long/5938/2 "2020-12-21T00:06:46Z")

</div>

It’s likely related to your `hosts` file.

> [@Anki 2.33 Will Not Start](https://forums.ankiweb.net/t/anki-2-33-will-not-start/2882/6):
>
> You’ll need to “pip install flask” first What’s the contents of your hosts file?

[https://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/](https://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/)

* * *

```auto
C:\Users\stevewinter>hostname
WINDOWS10

```

> I’ve added 0.0.0.0 Windows10 to the top of the list and now everything functions as expected.

> <https://github.com/Pylons/waitress/issues/268>
>
> Attempting to initiate \`serve\` with a Flask app using
> \`\`\`serve(app, host='0.0.0….0', port=8080)\`\`\`
> results in 
> \`\`\`UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)\`\`\`
> 
> If I modify line 260 of \`server.py\` to also catch error \`UnicodeError\` i.e.
> \`\`\`except (socket.error, UnicodeDecodeError, UnicodeError):\`\`\`
> then the server will start and run as expected, though it reports
> \`\`\`Serving on http://.psf:8080\`\`\`
> 
> If I omit the host and port config, the same error occurs. I've tried this on three different Windows 10 machines with identical results. On Windows 7 this issue doesn't appear to exist.
> - Python version: 3.7.5
> - Waitress version: 1.3.1
> - Windows version: 10 (Version 1809, Build 17763.864)
> 
> I wonder if this is somehow related to the configuration of the computer itself (hence my trying several different ones) in terms of them being able to report their hostname since the issue seems to stem from \`gethostbyaddr\` but I'm not familiar enough with Windows to know how I would set a hostname?
> 
> Even if this can be solved by local configuration I think the change I'm making on line 260 should probably be made to prevent a complete failure in this scenario. Thoughts?

---

_[View the full topic](https://forums.ankiweb.net/t/unable-to-open-anki-app-on-win10-unicodeerror-encoding-with-idna-codec-failed-unicodeerror-label-empty-or-too-long/5938)._
