Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

GDM discovery assumes ASCII #32

Closed
JshWright opened this issue May 13, 2016 · 0 comments
Closed

GDM discovery assumes ASCII #32

JshWright opened this issue May 13, 2016 · 0 comments

Comments

@JshWright
Copy link

The GDM discovery component assumes it will be receiving ASCII. This is likely to cause an issue if someone has non-ASCII characters in their Plex server name. @nauticus25 reported the following crash in the Home Assistant gitter channel:

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/home/pi/.homeassistant/deps/netdisco/service.py", line 60, in run
    self._scan()
  File "/home/pi/.homeassistant/deps/netdisco/service.py", line 74, in _scan
    self.discovery.scan()
  File "/home/pi/.homeassistant/deps/netdisco/discovery.py", line 57, in scan
    self.gdm.scan()
  File "/home/pi/.homeassistant/deps/netdisco/gdm.py", line 23, in scan
    self.update()
  File "/home/pi/.homeassistant/deps/netdisco/gdm.py", line 89, in update
    data = data.decode('ascii')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 124: ordinal not in range(128)

My guess is it would be safer to assume utf-8 when decoding, but I don't have any Plex stuff, so I'm not able to test that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant