Message11189

Author mg
Recipients danchr, piranha, tonfa, wbruna
Date 2009-12-09.18:56:48
Content
Yeah, that's bound to go wrong -- the code in question does:

  elif isinstance(value, str):
      suffix = value.encode('utf-8')

So value is a (byte) string and the code tries to *encode* it. That's
effectively the same as doing

   unicode(value).encode('utf-8')

which in turn is the same as

   value.decode('ASCII').encode('utf-8')

since the default codec is still ASCII. I think this looks like a
mistake in Zeroconf -- it could have made sense if it tried to *decode*
the string from a UTF-8 byte string to a Unicode object.

I don't really know anything about zeroconf, though. If it does not
support non-ASCII characters at all, then we can solve the problem on
our end by stripping them. If it does support, say, UTF-8 encoded
strings, then this looks like a bug in Zeroconf.
History
Date User Action Args
2009-12-09 18:56:48mgsetmessageid: <1260385008.15.0.0369068344274.issue1942@mercurial.selenic.com>
2009-12-09 18:56:48mgsetrecipients: + tonfa, wbruna, piranha, danchr
2009-12-09 18:56:48mglinkissue1942 messages
2009-12-09 18:56:48mgcreate