Patchwork D6511: py3: hack around inconsistency of type of name passed to DNSQuestion

login
register
mail settings
Submitter phabricator
Date June 30, 2019, 10:57 a.m.
Message ID <0fb0046a06e56d4bc231528a60ee4779@localhost.localdomain>
Download mbox | patch
Permalink /patch/40736/
State Not Applicable
Headers show

Comments

phabricator - June 30, 2019, 10:57 a.m.
Closed by commit rHG8306b6c29add: py3: hack around inconsistency of type of name passed to DNSQuestion (authored by pulkit).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6511?vs=15711&id=15725

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6511/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6511

AFFECTED FILES
  contrib/python3-whitelist
  hgext/zeroconf/Zeroconf.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mjpieters, mercurial-devel

Patch

diff --git a/hgext/zeroconf/Zeroconf.py b/hgext/zeroconf/Zeroconf.py
--- a/hgext/zeroconf/Zeroconf.py
+++ b/hgext/zeroconf/Zeroconf.py
@@ -89,6 +89,8 @@ 
 import time
 import traceback
 
+from mercurial import pycompat
+
 __all__ = ["Zeroconf", "ServiceInfo", "ServiceBrowser"]
 
 # hook for threads
@@ -270,6 +272,8 @@ 
     """A DNS question entry"""
 
     def __init__(self, name, type, clazz):
+        if pycompat.ispy3 and isinstance(name, str):
+            name = name.encode('ascii')
         if not name.endswith(".local."):
             raise NonLocalNameException(name)
         DNSEntry.__init__(self, name, type, clazz)
diff --git a/contrib/python3-whitelist b/contrib/python3-whitelist
--- a/contrib/python3-whitelist
+++ b/contrib/python3-whitelist
@@ -518,6 +518,7 @@ 
 test-pathconflicts-merge.t
 test-pathconflicts-update.t
 test-pathencode.py
+test-paths.t
 test-pending.t
 test-permissions.t
 test-phabricator.t