The branch, master has been updated via edfb6cb8223 PY3: change shebang to python3 in misc dirs via a07279b78a8 PY3: change shebang to python3 in lib dir via c65a70781da PY3: change shebang to python3 in wintest dir via 9d8e35ab97c PY3: change shebang to python3 in script dir via 8e3c194453f PY3: change shebang to python3 in source4/dsdb dir via 338413ad5ab PY3: change shebang to python3 in source4/scripting dir via 359d832e898 PY3: change shebang to python3 in source4/torture dir via a19d5bd771c PY3: change shebang to python3 in source4/scripting/bin dir via 934e336a951 s3:test: make sids2xids test compatible with py2 and py3 via 5ddff307b4a build: Move python detection back into waf (instead of in configure and Makefile) from 31957c7fe9d audit_logging: auth_json_audit required auth_json
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit edfb6cb8223be430360c8372457880471a198630 Author: Joe Guo <j...@catalyst.net.nz> Date: Wed Dec 12 13:43:21 2018 +1300 PY3: change shebang to python3 in misc dirs Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Noel Power <npo...@samba.org> Autobuild-User(master): Noel Power <npo...@samba.org> Autobuild-Date(master): Fri Dec 14 18:00:40 CET 2018 on sn-devel-144 commit a07279b78a83d7e62eb0c58a2ac989407a40fb6b Author: Joe Guo <j...@catalyst.net.nz> Date: Wed Dec 12 13:41:58 2018 +1300 PY3: change shebang to python3 in lib dir Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Noel Power <npo...@samba.org> commit c65a70781da987b4ea445b3ad79784b508170bf5 Author: Joe Guo <j...@catalyst.net.nz> Date: Wed Dec 12 13:37:10 2018 +1300 PY3: change shebang to python3 in wintest dir Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Noel Power <npo...@samba.org> commit 9d8e35ab97c0e613761136a3495515b18c85a157 Author: Joe Guo <j...@catalyst.net.nz> Date: Wed Dec 12 13:18:40 2018 +1300 PY3: change shebang to python3 in script dir Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Noel Power <npo...@samba.org> commit 8e3c194453f206152b40fa7a5efb1436b13424e9 Author: Joe Guo <j...@catalyst.net.nz> Date: Wed Dec 12 13:40:43 2018 +1300 PY3: change shebang to python3 in source4/dsdb dir Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Noel Power <npo...@samba.org> commit 338413ad5aba0b6fa2f0419eb99b4d00ebf6ebc7 Author: Joe Guo <j...@catalyst.net.nz> Date: Wed Dec 12 13:39:24 2018 +1300 PY3: change shebang to python3 in source4/scripting dir Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Noel Power <npo...@samba.org> commit 359d832e8981bce350cd7f1d9b087baa57e47cd7 Author: Joe Guo <j...@catalyst.net.nz> Date: Wed Dec 12 13:38:33 2018 +1300 PY3: change shebang to python3 in source4/torture dir Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Noel Power <npo...@samba.org> commit a19d5bd771c1727b037d28d24af0b85e49bdafb2 Author: Joe Guo <j...@catalyst.net.nz> Date: Tue Dec 11 12:23:17 2018 +1300 PY3: change shebang to python3 in source4/scripting/bin dir Samba default python is 3 now. Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Noel Power <npo...@samba.org> commit 934e336a951a9e6eea00dee9a74059f6a9a37224 Author: Joe Guo <j...@catalyst.net.nz> Date: Thu Dec 13 16:33:40 2018 +1300 s3:test: make sids2xids test compatible with py2 and py3 define a wrapper function for subprocess.check_output, to return bytes for py2 and unicode for py3, and replace Popen with it. Signed-off-by: Joe Guo <j...@catalyst.net.nz> Reviewed-by: Noel Power <npo...@samba.org> commit 5ddff307b4af5c82d5064745f5bd2c33bd340ced Author: Andrew Bartlett <abart...@samba.org> Date: Wed Dec 12 07:10:30 2018 +1300 build: Move python detection back into waf (instead of in configure and Makefile) This avoids creating a mini-configure in the configure script. Users wishing to use python2 to build need to specify PYTHON= to both ./configure and make After we merged the python3 change, it became clear that relying on systems prefixing the correct python just causes trouble and make debugging harder, so only use $PYTHON for the override, not the default case This essentially reverts a660b7fb8e519bd3be558fd0425bff8f287fca1f but leaves the files more consistent. Signed-off-by: Andrew Bartlett <abart...@samba.org> Reviewed-by: Noel Power <npo...@samba.org> ----------------------------------------------------------------------- Summary of changes: Makefile | 1 - auth/credentials/tests/bind.py | 2 +- buildtools/bin/waf | 2 +- buildtools/examples/run_on_target.py | 2 +- configure | 2 +- ctdb/Makefile | 1 - ctdb/configure | 2 +- examples/logon/ntlogon/ntlogon.py | 2 +- lib/ldb-samba/tests/match_rules.py | 2 +- lib/ldb/Makefile | 1 - lib/ldb/configure | 2 +- lib/ldb/tests/python/api.py | 2 +- lib/ldb/tests/python/index.py | 2 +- lib/replace/Makefile | 1 - lib/replace/configure | 2 +- lib/talloc/Makefile | 1 - lib/talloc/configure | 2 +- lib/talloc/test_pytalloc.py | 2 +- lib/tdb/Makefile | 1 - lib/tdb/configure | 2 +- lib/tdb/python/tdbdump.py | 2 +- lib/tdb/python/tests/simple.py | 2 +- lib/tevent/Makefile | 1 - lib/tevent/configure | 2 +- python/examples/dnsserver.py | 2 +- python/examples/netbios.py | 2 +- python/examples/samr.py | 2 +- python/examples/winreg.py | 2 +- python/samba/tests/dcerpc/raw_protocol.py | 2 +- python/samba/tests/subunitrun.py | 2 +- script/bisect-test.py | 2 +- script/compare_cc_results.py | 2 +- script/traffic_learner | 2 +- script/traffic_replay | 2 +- selftest/filter-subunit | 2 +- selftest/format-subunit | 2 +- selftest/format-subunit-json | 2 +- source3/script/tests/test_wbinfo_sids2xids_int.py | 31 +++++++++++++--------- source3/torture/test_ntlm_auth.py | 2 +- .../samdb/ldb_modules/tests/possibleinferiors.py | 2 +- source4/dsdb/tests/python/acl.py | 2 +- .../dsdb/tests/python/ad_dc_medley_performance.py | 2 +- source4/dsdb/tests/python/ad_dc_multi_bind.py | 2 +- source4/dsdb/tests/python/ad_dc_performance.py | 2 +- .../tests/python/ad_dc_provision_performance.py | 2 +- .../dsdb/tests/python/ad_dc_search_performance.py | 2 +- source4/dsdb/tests/python/confidential_attr.py | 2 +- source4/dsdb/tests/python/deletetest.py | 2 +- source4/dsdb/tests/python/dirsync.py | 2 +- source4/dsdb/tests/python/dsdb_schema_info.py | 2 +- source4/dsdb/tests/python/ldap.py | 2 +- source4/dsdb/tests/python/ldap_schema.py | 2 +- source4/dsdb/tests/python/ldap_syntaxes.py | 2 +- source4/dsdb/tests/python/linked_attributes.py | 2 +- source4/dsdb/tests/python/login_basics.py | 2 +- source4/dsdb/tests/python/ndr_pack_performance.py | 2 +- source4/dsdb/tests/python/notification.py | 2 +- source4/dsdb/tests/python/password_lockout.py | 2 +- source4/dsdb/tests/python/password_settings.py | 2 +- source4/dsdb/tests/python/passwords.py | 2 +- source4/dsdb/tests/python/sam.py | 2 +- source4/dsdb/tests/python/sec_descriptor.py | 2 +- source4/dsdb/tests/python/sites.py | 2 +- source4/dsdb/tests/python/sort.py | 2 +- source4/dsdb/tests/python/token_group.py | 2 +- source4/dsdb/tests/python/tombstone_reanimation.py | 2 +- source4/dsdb/tests/python/urgent_replication.py | 2 +- source4/dsdb/tests/python/user_account_control.py | 2 +- source4/dsdb/tests/python/vlv.py | 2 +- source4/script/depfilter.py | 2 +- source4/scripting/bin/autoidl | 2 +- source4/scripting/bin/enablerecyclebin | 2 +- source4/scripting/bin/findprovisionusnranges | 2 +- source4/scripting/bin/fullschema | 2 +- source4/scripting/bin/gen_error_common.py | 2 +- source4/scripting/bin/gen_hresult.py | 2 +- source4/scripting/bin/gen_ntstatus.py | 2 +- source4/scripting/bin/gen_output.py | 2 +- source4/scripting/bin/gen_werror.py | 2 +- source4/scripting/bin/get-descriptors | 2 +- source4/scripting/bin/machineaccountccache | 2 +- source4/scripting/bin/minschema | 2 +- source4/scripting/bin/mymachinepw | 2 +- source4/scripting/bin/rebuildextendeddn | 2 +- source4/scripting/bin/renamedc | 2 +- source4/scripting/bin/rpcclient | 2 +- source4/scripting/bin/samba-gpupdate | 2 +- source4/scripting/bin/samba-tool | 2 +- source4/scripting/bin/samba3dump | 2 +- source4/scripting/bin/samba_dnsupdate | 2 +- source4/scripting/bin/samba_kcc | 2 +- source4/scripting/bin/samba_spnupdate | 2 +- source4/scripting/bin/samba_upgradedns | 2 +- source4/scripting/bin/samba_upgradeprovision | 2 +- source4/scripting/bin/sambaundoguididx | 2 +- source4/scripting/bin/smbstatus | 2 +- source4/scripting/bin/subunitrun | 2 +- source4/scripting/bin/w32err_code.py | 2 +- source4/scripting/bin/wscript_build | 2 +- source4/scripting/devel/addlotscontacts | 2 +- source4/scripting/devel/chgkrbtgtpass | 2 +- source4/scripting/devel/chgtdcpass | 2 +- source4/scripting/devel/config_base | 2 +- source4/scripting/devel/crackname | 2 +- source4/scripting/devel/createtrust | 2 +- source4/scripting/devel/enumprivs | 2 +- source4/scripting/devel/getncchanges | 2 +- source4/scripting/devel/pfm_verify.py | 2 +- source4/scripting/devel/repl_cleartext_pwd.py | 2 +- source4/scripting/devel/rodcdns | 2 +- source4/scripting/devel/speedtest.py | 2 +- source4/torture/drs/python/cracknames.py | 2 +- source4/torture/drs/python/delete_object.py | 2 +- source4/torture/drs/python/drs_base.py | 2 +- source4/torture/drs/python/fsmo.py | 2 +- source4/torture/drs/python/getnc_exop.py | 2 +- source4/torture/drs/python/getnc_unpriv.py | 2 +- source4/torture/drs/python/getncchanges.py | 2 +- source4/torture/drs/python/link_conflicts.py | 2 +- .../torture/drs/python/linked_attributes_drs.py | 2 +- source4/torture/drs/python/repl_move.py | 2 +- source4/torture/drs/python/repl_rodc.py | 2 +- source4/torture/drs/python/repl_schema.py | 2 +- source4/torture/drs/python/replica_sync.py | 2 +- source4/torture/drs/python/replica_sync_rodc.py | 2 +- source4/torture/drs/python/ridalloc_exop.py | 2 +- source4/torture/libnet/python/samr-test.py | 2 +- wintest/test-s3.py | 2 +- wintest/test-s4-howto.py | 2 +- wintest/wintest.py | 2 +- 130 files changed, 140 insertions(+), 142 deletions(-) Changeset truncated at 500 lines: diff --git a/Makefile b/Makefile index c13843d3a4b..c2de1df7b60 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ # simple makefile wrapper to run waf -PYTHON?=python3 WAF_BINARY=$(PYTHON) ./buildtools/bin/waf WAF=PYTHONHASHSEED=1 WAF_MAKE=1 $(WAF_BINARY) diff --git a/auth/credentials/tests/bind.py b/auth/credentials/tests/bind.py index 31627af5769..2eaf0c0fd08 100755 --- a/auth/credentials/tests/bind.py +++ b/auth/credentials/tests/bind.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This is unit with tests for LDAP access checks diff --git a/buildtools/bin/waf b/buildtools/bin/waf index e3c0cb5563d..3ee4d5bc4df 100755 --- a/buildtools/bin/waf +++ b/buildtools/bin/waf @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # encoding: latin-1 # Thomas Nagy, 2005-2018 # diff --git a/buildtools/examples/run_on_target.py b/buildtools/examples/run_on_target.py index 83227594512..79c57308ad0 100755 --- a/buildtools/examples/run_on_target.py +++ b/buildtools/examples/run_on_target.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Sample run-on-target script diff --git a/configure b/configure index 6a89b17e733..a6ca50feb47 100755 --- a/configure +++ b/configure @@ -13,5 +13,5 @@ export JOBS unset LD_PRELOAD cd . || exit 1 -${PYTHON:=python3} $WAF configure "$@" || exit 1 +$PYTHON $WAF configure "$@" || exit 1 cd $PREVPATH diff --git a/ctdb/Makefile b/ctdb/Makefile index 142998a9652..ec362e29408 100644 --- a/ctdb/Makefile +++ b/ctdb/Makefile @@ -1,6 +1,5 @@ # simple makefile wrapper to run waf -PYTHON?=python3 WAF_BINARY=$(PYTHON) ../buildtools/bin/waf WAF=WAF_MAKE=1 $(WAF_BINARY) diff --git a/ctdb/configure b/ctdb/configure index 370ddccb6a5..dbb0c1446b5 100755 --- a/ctdb/configure +++ b/ctdb/configure @@ -11,5 +11,5 @@ JOBS=1 export JOBS cd . || exit 1 -${PYTHON:=python3} $WAF configure "$@" || exit 1 +$PYTHON $WAF configure "$@" || exit 1 cd $PREVPATH diff --git a/examples/logon/ntlogon/ntlogon.py b/examples/logon/ntlogon/ntlogon.py index ff25c42ec0b..4e278f8d861 100755 --- a/examples/logon/ntlogon/ntlogon.py +++ b/examples/logon/ntlogon/ntlogon.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 """ ntlogon.py written by Timothy (rhacer) Grant diff --git a/lib/ldb-samba/tests/match_rules.py b/lib/ldb-samba/tests/match_rules.py index 13561b174e9..0ad375653f6 100755 --- a/lib/ldb-samba/tests/match_rules.py +++ b/lib/ldb-samba/tests/match_rules.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 import optparse import sys diff --git a/lib/ldb/Makefile b/lib/ldb/Makefile index 0ac14aae74e..18ef459eb16 100644 --- a/lib/ldb/Makefile +++ b/lib/ldb/Makefile @@ -1,6 +1,5 @@ # simple makefile wrapper to run waf -PYTHON?=python3 WAF_BINARY=$(PYTHON) ../../buildtools/bin/waf WAF=PYTHONHASHSEED=1 WAF_MAKE=1 $(WAF_BINARY) diff --git a/lib/ldb/configure b/lib/ldb/configure index 8625206d611..6c931bfbf5e 100755 --- a/lib/ldb/configure +++ b/lib/ldb/configure @@ -17,5 +17,5 @@ JOBS=1 export JOBS cd . || exit 1 -${PYTHON:=python3} $WAF configure "$@" || exit 1 +$PYTHON $WAF configure "$@" || exit 1 cd $PREVPATH diff --git a/lib/ldb/tests/python/api.py b/lib/ldb/tests/python/api.py index 6be410b22f3..7b6418154e6 100755 --- a/lib/ldb/tests/python/api.py +++ b/lib/ldb/tests/python/api.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Simple tests for the ldb python bindings. # Copyright (C) 2007 Jelmer Vernooij <jel...@samba.org> diff --git a/lib/ldb/tests/python/index.py b/lib/ldb/tests/python/index.py index 63486eb9b2d..3652901888e 100755 --- a/lib/ldb/tests/python/index.py +++ b/lib/ldb/tests/python/index.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Tests for truncated index keys # diff --git a/lib/replace/Makefile b/lib/replace/Makefile index 3e54a16927c..a123a37b937 100644 --- a/lib/replace/Makefile +++ b/lib/replace/Makefile @@ -1,6 +1,5 @@ # simple makefile wrapper to run waf -PYTHON?=python3 WAF_BINARY=$(PYTHON) ../../buildtools/bin/waf WAF=PYTHONHASHSEED=1 WAF_MAKE=1 $(WAF_BINARY) diff --git a/lib/replace/configure b/lib/replace/configure index 69bbc4a1bae..d8a8d2ac2f3 100755 --- a/lib/replace/configure +++ b/lib/replace/configure @@ -17,5 +17,5 @@ JOBS=1 export JOBS cd . || exit 1 -${PYTHON:=python3} $WAF configure "$@" || exit 1 +$PYTHON $WAF configure "$@" || exit 1 cd $PREVPATH diff --git a/lib/talloc/Makefile b/lib/talloc/Makefile index 7cfac0cafc9..36048e56e2d 100644 --- a/lib/talloc/Makefile +++ b/lib/talloc/Makefile @@ -1,6 +1,5 @@ # simple makefile wrapper to run waf -PYTHON?=python3 WAF_BINARY=$(PYTHON) ../../buildtools/bin/waf WAF=PYTHONHASHSEED=1 WAF_MAKE=1 $(WAF_BINARY) diff --git a/lib/talloc/configure b/lib/talloc/configure index 69bbc4a1bae..d8a8d2ac2f3 100755 --- a/lib/talloc/configure +++ b/lib/talloc/configure @@ -17,5 +17,5 @@ JOBS=1 export JOBS cd . || exit 1 -${PYTHON:=python3} $WAF configure "$@" || exit 1 +$PYTHON $WAF configure "$@" || exit 1 cd $PREVPATH diff --git a/lib/talloc/test_pytalloc.py b/lib/talloc/test_pytalloc.py index 43b09df8ecc..809510fea8d 100644 --- a/lib/talloc/test_pytalloc.py +++ b/lib/talloc/test_pytalloc.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Simple tests for the talloc python bindings. # Copyright (C) 2015 Petr Viktorin <pvikt...@redhat.com> diff --git a/lib/tdb/Makefile b/lib/tdb/Makefile index 0f088ea2231..3e70146c248 100644 --- a/lib/tdb/Makefile +++ b/lib/tdb/Makefile @@ -1,6 +1,5 @@ # simple makefile wrapper to run waf -PYTHON?=python3 WAF_BINARY=$(PYTHON) ../../buildtools/bin/waf WAF=PYTHONHASHSEED=1 WAF_MAKE=1 $(WAF_BINARY) diff --git a/lib/tdb/configure b/lib/tdb/configure index 69bbc4a1bae..d8a8d2ac2f3 100755 --- a/lib/tdb/configure +++ b/lib/tdb/configure @@ -17,5 +17,5 @@ JOBS=1 export JOBS cd . || exit 1 -${PYTHON:=python3} $WAF configure "$@" || exit 1 +$PYTHON $WAF configure "$@" || exit 1 cd $PREVPATH diff --git a/lib/tdb/python/tdbdump.py b/lib/tdb/python/tdbdump.py index 08769eaa3e5..306a950d28c 100644 --- a/lib/tdb/python/tdbdump.py +++ b/lib/tdb/python/tdbdump.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Trivial reimplementation of tdbdump in Python from __future__ import print_function diff --git a/lib/tdb/python/tests/simple.py b/lib/tdb/python/tests/simple.py index 151807874ed..312d587fcde 100644 --- a/lib/tdb/python/tests/simple.py +++ b/lib/tdb/python/tests/simple.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Some simple tests for the Python bindings for TDB # Note that this tests the interface of the Python bindings # It does not test tdb itself. diff --git a/lib/tevent/Makefile b/lib/tevent/Makefile index 989f4b9845c..c3676a4f425 100644 --- a/lib/tevent/Makefile +++ b/lib/tevent/Makefile @@ -1,5 +1,4 @@ # simple makefile wrapper to run waf -PYTHON?=python3 WAF_BINARY=$(PYTHON) ../../buildtools/bin/waf WAF=PYTHONHASHSEED=1 WAF_MAKE=1 $(WAF_BINARY) diff --git a/lib/tevent/configure b/lib/tevent/configure index df0bdac0ed0..c3c444754e3 100755 --- a/lib/tevent/configure +++ b/lib/tevent/configure @@ -17,5 +17,5 @@ JOBS=1 export JOBS cd . || exit 1 -${PYTHON:=python3} $WAF configure "$@" || exit 1 +$PYTHON $WAF configure "$@" || exit 1 cd $PREVPATH diff --git a/python/examples/dnsserver.py b/python/examples/dnsserver.py index 2f04e064746..ccb003f9212 100755 --- a/python/examples/dnsserver.py +++ b/python/examples/dnsserver.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # script to test the dnsserver RPC protocol diff --git a/python/examples/netbios.py b/python/examples/netbios.py index 5f71f27b1f4..7a3a9da828f 100644 --- a/python/examples/netbios.py +++ b/python/examples/netbios.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jel...@samba.org> 2008 diff --git a/python/examples/samr.py b/python/examples/samr.py index 494d0862592..7cd70f5a110 100755 --- a/python/examples/samr.py +++ b/python/examples/samr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Unix SMB/CIFS implementation. diff --git a/python/examples/winreg.py b/python/examples/winreg.py index 604fe1db41a..8a7940b5a50 100755 --- a/python/examples/winreg.py +++ b/python/examples/winreg.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # tool to manipulate a remote registry # Copyright Andrew Tridgell 2005 diff --git a/python/samba/tests/dcerpc/raw_protocol.py b/python/samba/tests/dcerpc/raw_protocol.py index dd1fe99fa18..d752481f6f5 100755 --- a/python/samba/tests/dcerpc/raw_protocol.py +++ b/python/samba/tests/dcerpc/raw_protocol.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Unix SMB/CIFS implementation. # Copyright (C) Stefan Metzmacher 2014,2015 # diff --git a/python/samba/tests/subunitrun.py b/python/samba/tests/subunitrun.py index 92f36edaa17..d3956620259 100755 --- a/python/samba/tests/subunitrun.py +++ b/python/samba/tests/subunitrun.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Simple subunit testrunner for python diff --git a/script/bisect-test.py b/script/bisect-test.py index 7896742747c..313c4e3c6ce 100755 --- a/script/bisect-test.py +++ b/script/bisect-test.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # use git bisect to work out what commit caused a test failure # Copyright Andrew Tridgell 2010 # released under GNU GPL v3 or later diff --git a/script/compare_cc_results.py b/script/compare_cc_results.py index 8ff7bde6564..4b8abf601f4 100755 --- a/script/compare_cc_results.py +++ b/script/compare_cc_results.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Compare the results of native and cross-compiled configure tests diff --git a/script/traffic_learner b/script/traffic_learner index 1abfdf7b37b..22341ef231c 100755 --- a/script/traffic_learner +++ b/script/traffic_learner @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Generate a traffic model from a traffic summary file # # Copyright (C) Catalyst IT Ltd. 2017 diff --git a/script/traffic_replay b/script/traffic_replay index 0ee0f9b6575..124136e9495 100755 --- a/script/traffic_replay +++ b/script/traffic_replay @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Generates samba network traffic # # Copyright (C) Catalyst IT Ltd. 2017 diff --git a/selftest/filter-subunit b/selftest/filter-subunit index a37b2a5fbdd..4340439dd3b 100755 --- a/selftest/filter-subunit +++ b/selftest/filter-subunit @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Filter a subunit stream # Copyright (C) 2009-2011 Jelmer Vernooij <jel...@samba.org> diff --git a/selftest/format-subunit b/selftest/format-subunit index 9538ce19e9a..b27513a502a 100755 --- a/selftest/format-subunit +++ b/selftest/format-subunit @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # vim: expandtab # Pretty-format subunit output # Copyright (C) 2008-2010 Jelmer Vernooij <jel...@samba.org> diff --git a/selftest/format-subunit-json b/selftest/format-subunit-json index e612962e322..6f100e78445 100644 --- a/selftest/format-subunit-json +++ b/selftest/format-subunit-json @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright (C) 2008-2010 Jelmer Vernooij <jel...@samba.org> # Copyright (C) 2016 Douglas Bagnall <douglas.bagn...@catalyst.net.nz> # Published under the GNU GPL, v3 or later diff --git a/source3/script/tests/test_wbinfo_sids2xids_int.py b/source3/script/tests/test_wbinfo_sids2xids_int.py index a3cc3901d74..cb8d8fe2af3 100755 --- a/source3/script/tests/test_wbinfo_sids2xids_int.py +++ b/source3/script/tests/test_wbinfo_sids2xids_int.py @@ -1,9 +1,10 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 from __future__ import print_function import sys import os import subprocess +from samba.compat import get_string if len(sys.argv) != 3: @@ -14,6 +15,16 @@ wbinfo = sys.argv[1] netcmd = sys.argv[2] +def run(cmd): + """ + Run a cmd, return bytes str for py2 and unicode str for py3. + + NOTE: subprocess api always return bytes, in both py2 and py3. + """ + output = subprocess.check_output(cmd).strip() + return get_string(output) + + def flush_cache(sids=[], uids=[], gids=[]): for sid in sids: os.system(netcmd + (" cache del IDMAP/SID2XID/%s" % (sid))) @@ -27,14 +38,11 @@ def fill_cache(inids, idtype='gid'): for inid in inids: if inid is None: continue - subprocess.Popen([wbinfo, '--%s-to-sid=%s' % (idtype, inid)], - stdout=subprocess.PIPE).communicate() + run([wbinfo, '--%s-to-sid=%s' % (idtype, inid)]) -domain = subprocess.Popen([wbinfo, "--own-domain"], - stdout=subprocess.PIPE).communicate()[0].strip() -domsid = subprocess.Popen([wbinfo, "-n", domain + "/"], - stdout=subprocess.PIPE).communicate()[0] +domain = run([wbinfo, "--own-domain"]) +domsid = run([wbinfo, "-n", domain + "/"]) domsid = domsid.split(' ')[0] # print domain @@ -44,8 +52,7 @@ sids = [domsid + '-512', 'S-1-5-32-545', domsid + '-513', 'S-1-1-0', 'S-1-3-1', flush_cache(sids=sids) -sids2xids = subprocess.Popen([wbinfo, '--sids-to-unix-ids=' + ','.join(sids)], - stdout=subprocess.PIPE).communicate()[0].strip() +sids2xids = run([wbinfo, '--sids-to-unix-ids=' + ','.join(sids)]) gids = [] uids = [] @@ -83,8 +90,7 @@ def check_singular(sids, ids, idtype='gid'): if ids[i] is None: continue - outid = subprocess.Popen([wbinfo, '--sid-to-%s' % idtype, sid], - stdout=subprocess.PIPE).communicate()[0].strip() + outid = run([wbinfo, '--sid-to-%s' % idtype, sid]) if outid != ids[i]: print("Expected %s, got %s\n" % (outid, ids[i])) flush_cache(sids=sids, uids=uids, gids=gids) @@ -96,8 +102,7 @@ def check_singular(sids, ids, idtype='gid'): def check_multiple(sids, idtypes): - sids2xids = subprocess.Popen([wbinfo, '--sids-to-unix-ids=' + ','.join(sids)], - stdout=subprocess.PIPE).communicate()[0].strip() + sids2xids = run([wbinfo, '--sids-to-unix-ids=' + ','.join(sids)]) # print sids2xids i = 0 for line in sids2xids.split('\n'): diff --git a/source3/torture/test_ntlm_auth.py b/source3/torture/test_ntlm_auth.py index ac60632347d..2e04dd07565 100755 --- a/source3/torture/test_ntlm_auth.py +++ b/source3/torture/test_ntlm_auth.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Unix SMB/CIFS implementation. # A test for the ntlm_auth tool diff --git a/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py b/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py index 20963c0150d..ab13b14b3a8 100755 --- a/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py +++ b/source4/dsdb/samdb/ldb_modules/tests/possibleinferiors.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Unix SMB/CIFS implementation. # Copyright (C) Andrew Tridgell 2009 diff --git a/source4/dsdb/tests/python/acl.py b/source4/dsdb/tests/python/acl.py index 0f6264f09c9..dbad8a36a8d 100755 --- a/source4/dsdb/tests/python/acl.py +++ b/source4/dsdb/tests/python/acl.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This is unit with tests for LDAP access checks diff --git a/source4/dsdb/tests/python/ad_dc_medley_performance.py b/source4/dsdb/tests/python/ad_dc_medley_performance.py index 0636210d1e3..1be8ef6ce39 100644 --- a/source4/dsdb/tests/python/ad_dc_medley_performance.py +++ b/source4/dsdb/tests/python/ad_dc_medley_performance.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python -- Samba Shared Repository