diff options
author | Joe Guo <joeg@catalyst.net.nz> | 2018-04-05 12:49:09 +1200 |
---|---|---|
committer | Douglas Bagnall <dbagnall@samba.org> | 2018-04-13 07:27:13 +0200 |
commit | c07068038857bb93e3cf7f9f058054a3c9bda253 (patch) | |
tree | 502671f0d24814aaba4d59103838202b47de766b /selftest/tests.py | |
parent | eec07f2fe5eab8046eed78c7c4439732f9f2118b (diff) | |
download | samba-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.py | 2 |
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") |