changeset 43677:0f82b29f7494 stable

zeroconf: fix traceback under py3 hg serve under py3 caused struct.error: char format requires a bytes object of length 1 <pulkit25> ah, I think that should be `pycompat.bytechr` instead of chr
author Kim Alvefur <zash@zash.se>
date Wed, 13 Nov 2019 22:40:32 +0100
parents 53607fd3ec6c
children c5bcd946a34b
files hgext/zeroconf/Zeroconf.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/zeroconf/Zeroconf.py	Sun Nov 17 19:55:01 2019 +0100
+++ b/hgext/zeroconf/Zeroconf.py	Wed Nov 13 22:40:32 2019 +0100
@@ -1191,7 +1191,11 @@
                 list.append(b'='.join((key, suffix)))
             for item in list:
                 result = b''.join(
-                    (result, struct.pack(b'!c', chr(len(item))), item)
+                    (
+                        result,
+                        struct.pack(b'!c', pycompat.bytechr(len(item))),
+                        item,
+                    )
                 )
             self.text = result
         else: