hgext3rd/__init__.py
author Manuel Jacob <me@manueljacob.de>
Fri, 03 Jul 2020 23:25:19 +0200
branchstable
changeset 45034 b1a1702262c9
parent 43076 2372284d9457
child 48875 6000f5b25c9b
permissions -rw-r--r--
py3: fix crash when server address is 0.0.0.0 (issue6362) `socket.getfqdn()` assumes that the name is passed as `str` on Python 3 and always returns `str` in this case. Mercurial passed `bytes` (but still expected a `str` result), which worked by chance in many cases, except for e.g. b'0.0.0.0', which was returned unchanged, breaking later code. Instead of calling `socket.getfqdn()`, we can also use `self.server_name` from the base `HTTPServer` class, which already stores the FQDN of the locally-bound socket name (see `BaseHTTPServer.py` in the Python 2 stdlib and `http/server.py` in the Python 3 stdlib).

# name space package to host third party extensions
from __future__ import absolute_import
import pkgutil

__path__ = pkgutil.extend_path(__path__, __name__)