We are going to want to switch to ipaddress from ipaddr, since
ipaddress is available in python3. But ipaddress insists on unicode
strings, even in python2. ipaddr doesn't mind them.
So make everything be unicode. In particular: all of our literals and
all of our io streams. We wrap up io.open(), which is a compatibility
thing from python-future.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
# don't believe it is a creative work that attracts copyright. -iwj.
from __future__ import print_function
+from __future__ import unicode_literals
import ipaddr
from ipaddr import IPNetwork, IPAddress
"""
from __future__ import print_function
+from __future__ import unicode_literals
from builtins import int
import string
VERSION="0.1.18"
+from sys import version_info
+if version_info.major == 2: # for python2
+ import codecs
+ sys.stdin = codecs.getreader('utf-8')(sys.stdin)
+ sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
+ import io
+ open=lambda f,m='r': io.open(f,m,encoding='utf-8')
+
# Are we being invoked from userv?
service=0
# If we are, which group does the caller want to modify?