Skip to content

Commit c2f05f1

Browse files
committed
encode strings to utf-8 in ServiceInfo
I found that properties dict values registered as "False" rather than the intended string value, such as "path" in the provided examples. eg. Service Paul's Test Web Site._http._tcp.local. added Type is _http._tcp.local. Address is 10.0.1.2:80 Weight is 0, Priority is 0 Server is ash-2.local. Properties are path: False
1 parent 05c3c02 commit c2f05f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

zeroconf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ def _set_properties(self, properties):
10691069

10701070
if value is None:
10711071
suffix = b''
1072-
elif isinstance(value, unicode):
1072+
elif isinstance(value, unicode) or isinstance(value, str):
10731073
suffix = value.encode('utf-8')
10741074
elif isinstance(value, int):
10751075
if value:

0 commit comments

Comments
 (0)