summaryrefslogtreecommitdiff
path: root/selftest/tests.py
diff options
context:
space:
mode:
authorJoe Guo <joeg@catalyst.net.nz>2018-04-05 12:49:09 +1200
committerDouglas Bagnall <dbagnall@samba.org>2018-04-13 07:27:13 +0200
commitc07068038857bb93e3cf7f9f058054a3c9bda253 (patch)
tree502671f0d24814aaba4d59103838202b47de766b /selftest/tests.py
parenteec07f2fe5eab8046eed78c7c4439732f9f2118b (diff)
downloadsamba-c07068038857bb93e3cf7f9f058054a3c9bda253.tar.gz
selftest: enable py3 for samba.tests.source
In py2, `open` has no `encoding` arg, python guesses file encoding from locale. This could be wrong. Use `io.open` to open a file, so we can specify encoding in both py2 and py3. Also, open file with `r` instead of `rb` for py3. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Diffstat (limited to 'selftest/tests.py')
-rw-r--r--selftest/tests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/selftest/tests.py b/selftest/tests.py
index d866ca9f970..548e68b5c1b 100644
--- a/selftest/tests.py
+++ b/selftest/tests.py
@@ -41,7 +41,7 @@ have_man_pages_support = ("XSLTPROC_MANPAGES" in config_hash)
with_pam = ("WITH_PAM" in config_hash)
pam_wrapper_so_path=config_hash["LIBPAM_WRAPPER_SO_PATH"]
-planpythontestsuite("none", "samba.tests.source")
+planpythontestsuite("none", "samba.tests.source", py3_compatible=True)
if have_man_pages_support:
planpythontestsuite("none", "samba.tests.docs")