zeroconf: port to Python 3
Needs ReviewPublic

Authored by indygreg on Feb 2 2019, 3:08 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

Since we're using the source transformer on Python 3, calls into
Zeroconf and return values from it are generally bytes.

But various socket functions require str on Python 3.

This commit contains enough changes to coerce test-paths.t into
passing on Python 3. I suspect there are still a handful of bugs
on Python 3. But the tests do pass.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped
indygreg created this revision.Feb 2 2019, 3:08 PM
yuja added a subscriber: yuja.Feb 2 2019, 9:36 PM
    1. advertise to browsers svc = Zeroconf.ServiceInfo('_http._tcp.local.',
  • name + '._http._tcp.local.', + pycompat.bytestr(name + r'._http._tcp.local.'), server = host, port = port,
  • properties = {'description': desc,
  • 'path': "/" + path}, + properties = { + 'description': pycompat.bytestr(desc), + 'path': pycompat.bytestr(r"/" + path)}, address = localip, weight = 0, priority = 0) server.registerService(svc)
    1. advertise to Mercurial clients svc = Zeroconf.ServiceInfo('_hg._tcp.local.',
  • name + '._hg._tcp.local.', + pycompat.bytestr(name + r'._hg._tcp.local.'), server = host, port = port,
  • properties = {'description': desc,
  • 'path': "/" + path}, + properties = { + 'description': pycompat.bytestr(desc), + 'path': pycompat.bytestr(r"/" + path)}, address = localip, weight = 0, priority = 0)

I think path and desc are bytes since they come from ui.config().