[Git][NTPsec/ntpsec][master] mrulist: Fix "sort=addr"/"sort=-addr" in Python 3

Eric S. Raymond gitlab at mg.gitlab.com
Wed May 3 02:20:51 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
c624cd3c by Matt Nordhoff at 2017-05-02T22:20:40-04:00
mrulist: Fix "sort=addr"/"sort=-addr" in Python 3

Fixes #283.

- - - - -


1 changed file:

- pylib/packet.py


Changes:

=====================================
pylib/packet.py
=====================================
--- a/pylib/packet.py
+++ b/pylib/packet.py
@@ -741,7 +741,7 @@ class MRUEntry:
             addr = addr[:addr.find(':')]
             # prefix with 0s so IPv6 sorts after IPv4
             # Need 16 rather than 12 to catch ::1
-            return '\0'*16 + socket.inet_pton(socket.AF_INET, addr)
+            return b'\0'*16 + socket.inet_pton(socket.AF_INET, addr)
 
     def __repr__(self):
         return "<MRUentry: " + repr(self.__dict__)[1:-1] + ">"



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/c624cd3c93491bdde7698b5fe753affc26cc9d9f

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/c624cd3c93491bdde7698b5fe753affc26cc9d9f
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170503/e12193fa/attachment.html>


More information about the vc mailing list