python/samba: port open to io.open for PY2/PY3 compat
authorNoel Power <noel.power@suse.com>
Wed, 8 Aug 2018 15:52:35 +0000 (16:52 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 3 Sep 2018 01:22:20 +0000 (03:22 +0200)
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/ms_display_specifiers.py
python/samba/ms_schema.py

index 2a81c22..7488b19 100644 (file)
@@ -176,7 +176,8 @@ def read_ms_ldif(filename):
 
     out = []
 
-    f = open(filename, "rU")
+    from io import open
+    f = open(filename, "r", encoding='latin-1')
     for entry in __read_raw_entries(f):
         out.append(__write_ldif_one(__transform_entry(entry)))
 
index 52abe74..4946636 100644 (file)
@@ -295,7 +295,8 @@ def __parse_schema_file(filename, objectClass):
 
     out = []
 
-    f = open(filename, "rU")
+    from io import open
+    f = open(filename, "r", encoding='latin-1')
     for entry in __read_raw_entries(f):
         out.append(__write_ldif_one(__transform_entry(entry, objectClass)))