From c07068038857bb93e3cf7f9f058054a3c9bda253 Mon Sep 17 00:00:00 2001 From: Joe Guo Date: Thu, 5 Apr 2018 12:49:09 +1200 Subject: 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 Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- selftest/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'selftest/tests.py') 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") -- cgit v1.2.1