From c2f05f10b23e369bd4f574d013ec32f432aa4853 Mon Sep 17 00:00:00 2001 From: "Dr. Seuss" Date: Mon, 1 Dec 2014 11:41:53 -0500 Subject: [PATCH] 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 --- zeroconf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zeroconf.py b/zeroconf.py index 779aef75..671762b5 100644 --- a/zeroconf.py +++ b/zeroconf.py @@ -1069,7 +1069,7 @@ def _set_properties(self, properties): if value is None: suffix = b'' - elif isinstance(value, unicode): + elif isinstance(value, unicode) or isinstance(value, str): suffix = value.encode('utf-8') elif isinstance(value, int): if value: