Skip to content

Commit

Permalink
decode bytes in dict_to_text()
Browse files Browse the repository at this point in the history
  • Loading branch information
svinota committed Jun 15, 2014
1 parent 67be631 commit f658137
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mdns/zeroconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ def dict_to_text(d):
suffix = 'false'
else:
suffix = ''.encode('utf-8')
if isinstance(key, bytes):
key = key.decode('utf-8')
list.append('='.join((key, suffix)))
for item in list:
result = ''.join((result, struct.pack('!c', chr(len(item))), item))
Expand Down

0 comments on commit f658137

Please sign in to comment.