[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Sun Sep 16 07:22:02 UTC 2018


The branch, master has been updated
       via  0cb3413 s4/librpc: Fix py2 dependecies leaking into py3 libraries
       via  a0851c5 PY3: wrap filter calls with list where list is expected
       via  dc9117e PY3: ensure output of subprocess.Popen is decoded
       via  6c62e22 PY3: detect talloc_utils (for version of python running the build)
       via  0df8ef4 PY3: use pyembed_libname for library names (otherwise missing deps)
       via  e2c0af6 PY3: xrange->range
       via  899ef5d PY3: string.upper not in PY3
       via  eceb997 PY3: decode output of cmd_output for easier string manip
       via  a0c8c8c PY3: string.translate string.upper don't exist in PY3
       via  b342e6f PY3: bytes.maketrans, string.maketrans is a PY2 only function
       via  9fc6759 PY3: enclose filter with list as len on result of filter fails
       via  bb9e945 PY3: fix string.rsplit usage (doens't exist in PY3)
       via  59f69a7 py2/py3 enclose map with list
       via  0358d57 PY3: dict_keys doesn't have a sort method
       via  82c8451 PY3: dict doesn't have has_key
       via  b2b0f81 PY3: iterkeys -> keys
       via  d20e85d PY3: iterkeys -> keys
       via  c688413 PY3: dict has no iterkeys method
       via  693834f PY3: fix iteritems usage, not supported in python3
       via  3cc284b PY3: fix some octal literals
      from  4038e7b s4/selftest: enable samba.tests.ntlmdisabled for py3

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 0cb341321fcdd2d6d7281d591ebcaa540da48134
Author: Noel Power <noel.power at suse.com>
Date:   Tue Sep 4 15:30:00 2018 +0100

    s4/librpc: Fix py2 dependecies leaking into py3 libraries
    
    Caused strange crashes when using python3
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Sun Sep 16 09:21:59 CEST 2018 on sn-devel-144

commit a0851c5fdcd8463b571a00929a9bf492f35a92c0
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 18:45:35 2018 +0100

    PY3: wrap filter calls with list where list is expected
    
    filter in PY2 returns list in PY3 it returns an iterator
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit dc9117e41835048c1f445f9fd5b9b8aa6d712016
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 18:32:30 2018 +0100

    PY3: ensure output of subprocess.Popen is decoded
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 6c62e22c1c751a6a2472a996316656ec5d03aa51
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 16:51:59 2018 +0100

    PY3: detect talloc_utils (for version of python running the build)
    
    It seems all combinations have potential to fail here :/ however for
    the moment making the assumption
      *  if python2 driving the build you are building against libpython2 (with the option of having python3 as 'extra-python'
      *  if python3 driving the build you are building against libpython3 (with the option of having python3 as 'extra-python' NOTE: this isn't inforced it probably should be !!!! In a system with python2 and python3 installed it seems waf needs PYTHON env variable to decide which libpython to build against. It's also an option that configure should use that too (to figure out which talloc_util to use or build)
    
    However.... right now I just want the thing to build
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 0df8ef41a336a232d2e348462174434d7d7ec610
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 15:52:12 2018 +0100

    PY3: use pyembed_libname for library names (otherwise missing deps)
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit e2c0af6bcdf271ff75c455695c129bc18322bd5a
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 14:58:26 2018 +0100

    PY3: xrange->range
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 899ef5d186c2c44f63c1cbf415daa33e9f668a5b
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 12:53:08 2018 +0100

    PY3: string.upper not in PY3
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit eceb99708f1f49b54cb2e8a3e829fe5fd8e5c05a
Author: Noel Power <noel.power at suse.com>
Date:   Thu Aug 2 15:10:15 2018 +0100

    PY3: decode output of cmd_output for easier string manip
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit a0c8c8c8331856d9f09d18b389b7dd01c8d33de2
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 12:45:51 2018 +0100

    PY3: string.translate string.upper don't exist in PY3
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit b342e6f038b5277cf30115f11cf0f30d238c12ea
Author: Noel Power <noel.power at suse.com>
Date:   Thu Aug 2 14:51:13 2018 +0100

    PY3: bytes.maketrans, string.maketrans is a PY2 only function
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 9fc6759792e631d73d1ccd7b22de8314bad42624
Author: Noel Power <noel.power at suse.com>
Date:   Thu Aug 2 14:42:55 2018 +0100

    PY3: enclose filter with list as len on result of filter fails
    
    filter returns an iterator in PY3 (and a list in PY2)
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit bb9e945e4a6f69c204ac48621e9b7c5567dd62ec
Author: Noel Power <noel.power at suse.com>
Date:   Wed Aug 1 12:34:08 2018 +0100

    PY3: fix string.rsplit usage (doens't exist in PY3)
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 59f69a7c21fa90354699b8752d1473e8af6bf0d3
Author: Noel Power <noel.power at suse.com>
Date:   Wed Aug 1 12:26:03 2018 +0100

    py2/py3 enclose map with list
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 0358d57db4705b2330e294b5d6318c1a78a8518c
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 14:42:33 2018 +0100

    PY3: dict_keys doesn't have a sort method
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 82c84513331da9d0f42ba73d03e58dce5d0f76d3
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 14:25:34 2018 +0100

    PY3: dict doesn't have has_key
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit b2b0f8191dde58fe234b0147c4a0bd39020aa504
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 12:48:07 2018 +0100

    PY3: iterkeys -> keys
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit d20e85d008e1b7badbea5ada8b22639f7767a097
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 12:43:26 2018 +0100

    PY3: iterkeys -> keys
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit c6884138e4c1aec80e8f99ef0978b43919ae9d3a
Author: Noel Power <noel.power at suse.com>
Date:   Fri Aug 3 14:49:59 2018 +0100

    PY3: dict has no iterkeys method
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 693834f7313471b62371a9517c05438b0c8f3e5c
Author: Noel Power <noel.power at suse.com>
Date:   Tue Jul 31 18:04:30 2018 +0100

    PY3: fix iteritems usage, not supported in python3
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 3cc284b2af15dbf7fee87ce56403ec53ef754b61
Author: Noel Power <noel.power at suse.com>
Date:   Fri Jul 27 14:35:16 2018 +0100

    PY3: fix some octal literals
    
    Signed-off-by: Noel Power <noel.power at suse.com>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_abi.py          |  8 ++++----
 buildtools/wafsamba/samba_patterns.py     |  2 +-
 buildtools/wafsamba/wafsamba.py           |  4 ++--
 ctdb/wscript                              | 22 +++++++++++-----------
 lib/replace/wscript                       |  4 ++--
 lib/talloc/wscript                        |  4 ++--
 pidl/wscript                              |  9 +++++----
 selftest/selftesthelpers.py               |  4 ++--
 source4/heimdal/lib/wind/gen-combining.py |  3 +--
 source4/heimdal/lib/wind/gen-errorlist.py |  4 ++--
 source4/heimdal/lib/wind/gen-map.py       |  6 +++---
 source4/heimdal/lib/wind/gen-normalize.py |  2 +-
 source4/heimdal/lib/wind/generate.py      |  9 +++++++--
 source4/heimdal/lib/wind/stringprep.py    |  2 +-
 source4/librpc/wscript_build              |  2 +-
 source4/selftest/tests.py                 |  2 +-
 source4/torture/local/wscript_build       |  4 +++-
 source4/torture/wscript_build             |  9 +++++----
 source4/web_server/wscript_build          |  3 ++-
 19 files changed, 56 insertions(+), 47 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index 8ddf209..b5c6da4 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -16,7 +16,7 @@ abi_type_maps = {
     'struct __va_list_tag *' : 'va_list'
     }
 
-version_key = lambda x: map(int, x.split("."))
+version_key = lambda x: list(map(int, x.split(".")))
 
 def normalise_signature(sig):
     '''normalise a signature from gdb'''
@@ -85,7 +85,7 @@ def abi_check_task(self):
     libpath = self.inputs[0].abspath(self.env)
     libname = os.path.basename(libpath)
 
-    sigs = Utils.cmd_output([abi_gen, libpath])
+    sigs = Utils.cmd_output([abi_gen, libpath]).decode('utf8')
     parsed_sigs = parse_sigs(sigs, self.ABI_MATCH)
 
     sig_file = self.ABI_FILE
@@ -190,8 +190,8 @@ def abi_write_vscript(f, libname, current_version, versions, symmap, abi_match):
         f.write("}%s;\n\n" % last_key)
         last_key = " %s" % symver
     f.write("%s {\n" % current_version)
-    local_abi = filter(lambda x: x[0] == '!', abi_match)
-    global_abi = filter(lambda x: x[0] != '!', abi_match)
+    local_abi = list(filter(lambda x: x[0] == '!', abi_match))
+    global_abi = list(filter(lambda x: x[0] != '!', abi_match))
     f.write("\tglobal:\n")
     if len(global_abi) > 0:
         for x in global_abi:
diff --git a/buildtools/wafsamba/samba_patterns.py b/buildtools/wafsamba/samba_patterns.py
index dc59c38..d0fe965 100644
--- a/buildtools/wafsamba/samba_patterns.py
+++ b/buildtools/wafsamba/samba_patterns.py
@@ -155,7 +155,7 @@ def write_build_options(task):
     keys_header_other = []
     keys_misc = []
     if sys.hexversion>0x300000f:
-        trans_table = bytes.maketrans('.-()', '____')
+        trans_table = bytes.maketrans(b'.-()', b'____')
     else:
         import string
         trans_table = string.maketrans('.-()', '____')
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index 36bc6c3..59a4eac 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -795,7 +795,7 @@ sys.path.insert(1, "%s")""" % (task.env["PYTHONARCHDIR"], task.env["PYTHONDIR"])
         installed_file.write(newline)
         lineno = lineno + 1
     installed_file.close()
-    os.chmod(installed_location, 0755)
+    os.chmod(installed_location, 0o755)
     return 0
 
 def copy_and_fix_perl_path(task):
@@ -823,7 +823,7 @@ def copy_and_fix_perl_path(task):
         installed_file.write(newline)
         lineno = lineno + 1
     installed_file.close()
-    os.chmod(installed_location, 0755)
+    os.chmod(installed_location, 0o755)
     return 0
 
 
diff --git a/ctdb/wscript b/ctdb/wscript
index 6d4fee5..e2e964a 100644
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -736,14 +736,14 @@ def build(bld):
                         target='onnode',
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES('${BINDIR}', 'onnode',
-                      destname='onnode', chmod=0755)
+                      destname='onnode', chmod=0o755)
 
     bld.SAMBA_GENERATOR('ctdb-diagnostics',
                         source='tools/ctdb_diagnostics',
                         target='ctdb_diagnostics',
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES('${BINDIR}', 'ctdb_diagnostics',
-                      destname='ctdb_diagnostics', chmod=0755)
+                      destname='ctdb_diagnostics', chmod=0o755)
 
     if bld.env.etcd_reclock:
         bld.SAMBA_GENERATOR('ctdb-etcd-lock',
@@ -751,35 +751,35 @@ def build(bld):
                             target='ctdb_etcd_lock',
                             rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
         bld.INSTALL_FILES('${CTDB_HELPER_BINDIR}', 'ctdb_etcd_lock',
-                          destname='ctdb_etcd_lock', chmod=0744)
+                          destname='ctdb_etcd_lock', chmod=0o744)
 
     bld.SAMBA_GENERATOR('ctdb-natgw',
                         source='tools/ctdb_natgw',
                         target='ctdb_natgw',
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES('${CTDB_HELPER_BINDIR}', 'ctdb_natgw',
-                      destname='ctdb_natgw', chmod=0755)
+                      destname='ctdb_natgw', chmod=0o755)
 
     bld.SAMBA_GENERATOR('ctdb-lvs',
                         source='tools/ctdb_lvs',
                         target='ctdb_lvs',
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES('${CTDB_HELPER_BINDIR}', 'ctdb_lvs',
-                      destname='ctdb_lvs', chmod=0755)
+                      destname='ctdb_lvs', chmod=0o755)
 
     bld.SAMBA_GENERATOR('ctdbd-wrapper',
                         source='config/ctdbd_wrapper',
                         target='ctdbd_wrapper',
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES('${SBINDIR}', 'ctdbd_wrapper',
-                      destname='ctdbd_wrapper', chmod=0755)
+                      destname='ctdbd_wrapper', chmod=0o755)
 
     def SUBDIR_MODE_callback(arg, dirname, fnames):
         for f in fnames:
             fl = os.path.join(dirname, f)
             if os.path.isdir(fl) or os.path.islink(fl):
                 continue
-            mode = os.lstat(fl).st_mode & 0777
+            mode = os.lstat(fl).st_mode & 0o777
             if arg['trim_path']:
                 fl = samba_utils.os_path_relpath(fl, arg['trim_path'])
             arg['file_list'].append([fl, mode])
@@ -851,7 +851,7 @@ def build(bld):
 
     for t in etc_scripts:
         bld.INSTALL_FILES(bld.env.CTDB_ETCDIR, 'config/%s' % t,
-                          destname=t, chmod=0755)
+                          destname=t, chmod=0o755)
 
     bld.SAMBA_GENERATOR('ctdb-sudoers',
                         source='config/ctdb.sudoers',
@@ -1091,7 +1091,7 @@ def build(bld):
                         target='test_wrap',
                         rule='sed -e "%s" ${SRC} > ${TGT}' % sed_expr)
     bld.INSTALL_FILES(bld.env.CTDB_TEST_DATADIR+"/scripts", 'test_wrap',
-                      destname='test_wrap', chmod=0755)
+                      destname='test_wrap', chmod=0o755)
 
     bld.SAMBA_GENERATOR('ctdb-test-script-install-paths',
                         source='tests/scripts/script_install_paths.sh',
@@ -1099,7 +1099,7 @@ def build(bld):
                         rule='sed %s ${SRC} > ${TGT}' % (sed_cmdline))
     bld.INSTALL_FILES(bld.env.CTDB_TEST_DATADIR+"/scripts",
                       'script_install_paths.sh',
-                      destname='script_install_paths.sh', chmod=0644)
+                      destname='script_install_paths.sh', chmod=0o644)
 
     sed_expr1 = 's@^\(export %s\)=.*@\\1=%s\\nexport %s=\"%s\"@''' % (
                     'CTDB_TEST_DIR', bld.env.CTDB_TEST_DATADIR,
@@ -1111,7 +1111,7 @@ def build(bld):
                         rule='sed -e "%s" -e "%s" ${SRC} > ${TGT}' % (
                              sed_expr1, sed_expr2))
     bld.INSTALL_FILES('${BINDIR}', 'ctdb_run_tests.sh',
-                      destname='ctdb_run_tests', chmod=0755)
+                      destname='ctdb_run_tests', chmod=0o755)
     bld.symlink_as(os.path.join(bld.env.BINDIR, 'ctdb_run_cluster_tests'),
                    'ctdb_run_tests')
 
diff --git a/lib/replace/wscript b/lib/replace/wscript
index 3d47c37..8e28734 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -787,8 +787,8 @@ def build(bld):
 
     REPLACE_HOSTCC_SOURCE = ''
 
-    for filename, functions in REPLACEMENT_FUNCTIONS.iteritems():
-        for function in functions:
+    for filename in REPLACEMENT_FUNCTIONS.keys():
+        for function in REPLACEMENT_FUNCTIONS[filename]:
             if not bld.CONFIG_SET('HAVE_%s' % function.upper()):
                 REPLACE_HOSTCC_SOURCE += ' %s' % filename
                 break
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index 4a17650..a5841b4 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -77,10 +77,10 @@ def configure(conf):
             using_system_pytalloc_util = False
         else:
             using_system_pytalloc_util = True
-            if not conf.CHECK_BUNDLED_SYSTEM_PKG('pytalloc-util', minversion=VERSION,
+            name = 'pytalloc-util' + conf.all_envs['default']['PYTHON_SO_ABI_FLAG']
+            if not conf.CHECK_BUNDLED_SYSTEM_PKG(name, minversion=VERSION,
                                                  implied_deps='talloc replace'):
                 using_system_pytalloc_util = False
-
             # We need to get a pytalloc-util for all the python versions
             # we are building for
             if conf.env['EXTRA_PYTHON']:
diff --git a/pidl/wscript b/pidl/wscript
index 3981611..a2a15d3 100644
--- a/pidl/wscript
+++ b/pidl/wscript
@@ -59,16 +59,17 @@ def build(bld):
         'lib/Parse/Pidl/Wireshark/NDR.pm': 'man3/Parse::Pidl::Wireshark::NDR.${PERLMAN3EXT}'
     }
 
-    for k, v in pidl_manpages.iteritems():
-        pidl_manpages[k] = bld.EXPAND_VARIABLES(v)
+    for k in pidl_manpages.keys():
+        pidl_manpages[k] = bld.EXPAND_VARIABLES(pidl_manpages[k])
 
     # use perl to build the manpages
     bld.env.pidl_srcdir = os.path.join(bld.srcnode.abspath(), 'pidl')
 
     bld.SET_BUILD_GROUP('final')
     if 'POD2MAN' in bld.env and bld.env['POD2MAN'] != '':
-        for src, manpage in pidl_manpages.iteritems():
-            section = string.rsplit(manpage, ".", 1)[1]
+        for src in pidl_manpages.keys():
+            manpage = pidl_manpages[src]
+            section = manpage.rsplit( ".", 1)[1]
             bld(rule='${POD2MAN} -c "Samba Documentation" -s %s ${SRC} ${TGT}' % section,
                 shell=True,
                 source=src,
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index f7ab805..7d469e3 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -165,7 +165,7 @@ bbdir = os.path.join(srcdir(), "testprogs/blackbox")
 configuration = "--configfile=$SMB_CONF_PATH"
 
 smbtorture4 = binpath("smbtorture")
-smbtorture4_testsuite_list = subprocess.Popen([smbtorture4, "--list-suites"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate("")[0].splitlines()
+smbtorture4_testsuite_list = subprocess.Popen([smbtorture4, "--list-suites"], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate("")[0].decode('utf8').splitlines()
 
 smbtorture4_options = [
     configuration,
@@ -187,7 +187,7 @@ def plansmbtorture4testsuite(name, env, options, target, modname=None):
 
 
 def smbtorture4_testsuites(prefix):
-    return filter(lambda x: x.startswith(prefix), smbtorture4_testsuite_list)
+    return list(filter(lambda x: x.startswith(prefix), smbtorture4_testsuite_list))
 
 
 smbclient3 = binpath('smbclient')
diff --git a/source4/heimdal/lib/wind/gen-combining.py b/source4/heimdal/lib/wind/gen-combining.py
index 86cbc6d..6f23af8 100644
--- a/source4/heimdal/lib/wind/gen-combining.py
+++ b/source4/heimdal/lib/wind/gen-combining.py
@@ -79,8 +79,7 @@ combining_c.file.write(
 const struct translation _wind_combining_table[] = {
 ''')
 
-s = trans.keys()
-s.sort()
+s = sorted(trans)
 for k in s:
     v = trans[k]
     combining_c.file.write("{0x%x, %u}, /* %s */\n"
diff --git a/source4/heimdal/lib/wind/gen-errorlist.py b/source4/heimdal/lib/wind/gen-errorlist.py
index f0b9524..29ab9a4 100644
--- a/source4/heimdal/lib/wind/gen-errorlist.py
+++ b/source4/heimdal/lib/wind/gen-errorlist.py
@@ -50,7 +50,7 @@ if len(sys.argv) != 3:
 tables = rfc3454.read(sys.argv[1])
 t2 = rfc4518.read()
 
-for x in t2.iterkeys():
+for x in t2.keys():
     tables[x] = t2[x]
 
 error_list = stringprep.get_errorlist()
@@ -85,7 +85,7 @@ const struct error_entry _wind_errorlist_table[] = {
 
 trans=[]
 
-for t in error_list.iterkeys():
+for t in error_list.keys():
     for l in tables[t]:
         m = re.search('^ *([0-9A-F]+)-([0-9A-F]+); *(.*) *$', l)
         if m:
diff --git a/source4/heimdal/lib/wind/gen-map.py b/source4/heimdal/lib/wind/gen-map.py
index d4f02af..f109735 100644
--- a/source4/heimdal/lib/wind/gen-map.py
+++ b/source4/heimdal/lib/wind/gen-map.py
@@ -51,7 +51,7 @@ if len(sys.argv) != 3:
 tables = rfc3454.read(sys.argv[1])
 t2 = rfc4518.read()
 
-for x in t2.iterkeys():
+for x in t2:
     tables[x] = t2[x]
 
 map_list = stringprep.get_maplist()
@@ -88,7 +88,7 @@ const struct translation _wind_map_table[] = {
 
 trans=[]
 
-for t in map_list.iterkeys():
+for t in map_list:
     for l in tables[t]:
         m = re.search('^ *([0-9A-F]+)-([0-9A-F]+); *([^;]+); *(.*) *$', l)
         if m:
@@ -96,7 +96,7 @@ for t in map_list.iterkeys():
             end   = int(m.group(2), 0x10)
             value = m.group(3)
             desc  = m.group(4)
-            for key in xrange(start,end,1):
+            for key in range(start,end,1):
                 trans.append((key, value, desc, [t]))
             continue
         m = re.search('^ *([^;]+); *([^;]+); *(.*) *$', l)
diff --git a/source4/heimdal/lib/wind/gen-normalize.py b/source4/heimdal/lib/wind/gen-normalize.py
index e51893d..0955a54 100644
--- a/source4/heimdal/lib/wind/gen-normalize.py
+++ b/source4/heimdal/lib/wind/gen-normalize.py
@@ -136,7 +136,7 @@ exclusions = UnicodeData.read(sys.argv[2])
 inv = dict([(''.join(["%05x" % int(x, 0x10) for x in v[4].split(' ')]),
              [k, v[0]])
             for k,v in ud.items()
-            if v[4] and not re.search('<[a-zA-Z]+> *', v[4]) and not exclusions.has_key(k)])
+            if v[4] and not re.search('<[a-zA-Z]+> *', v[4]) and not k in exclusions])
 
 table = 0
 
diff --git a/source4/heimdal/lib/wind/generate.py b/source4/heimdal/lib/wind/generate.py
index 1d708c6..0a32fcd 100644
--- a/source4/heimdal/lib/wind/generate.py
+++ b/source4/heimdal/lib/wind/generate.py
@@ -37,6 +37,7 @@
 import datetime
 import string
 import os
+import sys
 
 class GeneratedFile :
     "Represents a generated file"
@@ -56,10 +57,14 @@ class GeneratedFile :
 
 class Header(GeneratedFile) :
     "Represents a generated header file"
-    guardTrans = string.maketrans('-.', '__')
+    if sys.hexversion>0x300000f:
+        guardTrans = bytes.maketrans(b'-.', b'__')
+    else:
+        import string
+        guardTrans = string.maketrans('-.', '__')
     def makeGuard(self) :
         """Return a name to be used as ifdef guard"""
-        return string.upper(string.translate(self.name, self.guardTrans))
+        return self.name.translate(self.guardTrans).upper()
 
     def __init__(self, name) :
         "Create a new Header with name"
diff --git a/source4/heimdal/lib/wind/stringprep.py b/source4/heimdal/lib/wind/stringprep.py
index 249b1dc..cff4d02 100644
--- a/source4/heimdal/lib/wind/stringprep.py
+++ b/source4/heimdal/lib/wind/stringprep.py
@@ -57,7 +57,7 @@ def symbols(tabledict, tables):
         list = list + tabledict.get(x, [])
     if len(list) == 0:
         return ""
-    return "|".join(map(lambda x: "WIND_PROFILE_%s" % (string.upper(x)), list))
+    return "|".join(map(lambda x: "WIND_PROFILE_%s" % (x.upper()), list))
 
 def get_errorlist():
     d = dict()
diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build
index 054bb6f..7eb8516 100644
--- a/source4/librpc/wscript_build
+++ b/source4/librpc/wscript_build
@@ -295,7 +295,7 @@ for env in bld.gen_python_environments():
 
 	bld.SAMBA_PYTHON('python_preg',
 		source='../../librpc/gen_ndr/py_preg.c',
-		deps='NDR_PREG pytalloc-util pyrpc_util',
+		deps='NDR_PREG %s %s' % (pytalloc_util, pyrpc_util),
 		realname='samba/dcerpc/preg.so',
                 cflags_end=gen_cflags
 		)
diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py
index be3ee68..1803752 100755
--- a/source4/selftest/tests.py
+++ b/source4/selftest/tests.py
@@ -323,7 +323,7 @@ smb2_s3only = [
 smb2 = [x for x in smbtorture4_testsuites("smb2.") if x not in smb2_s3only]
 
 # The QFILEINFO-IPC test needs to be on ipc$
-raw = filter(lambda x: "raw.qfileinfo.ipc" not in x, smbtorture4_testsuites("raw."))
+raw = list(filter(lambda x: "raw.qfileinfo.ipc" not in x, smbtorture4_testsuites("raw.")))
 base = smbtorture4_testsuites("base.")
 
 netapi = smbtorture4_testsuites("netapi.")
diff --git a/source4/torture/local/wscript_build b/source4/torture/local/wscript_build
index 2dd1819..a79b6d9 100644
--- a/source4/torture/local/wscript_build
+++ b/source4/torture/local/wscript_build
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+provision = bld.pyembed_libname('PROVISION')
+
 TORTURE_LOCAL_SOURCE = '''../../../lib/util/charset/tests/iconv.c
 	../../../lib/talloc/testsuite.c ../../lib/messaging/tests/messaging.c
 	../../lib/messaging/tests/irpc.c ../../librpc/tests/binding_string.c
@@ -27,7 +29,7 @@ TORTURE_LOCAL_SOURCE = '''../../../lib/util/charset/tests/iconv.c
 	nss_tests.c
 	fsrvp_state.c'''
 
-TORTURE_LOCAL_DEPS = 'RPC_NDR_ECHO TDR LIBCLI_SMB MESSAGING iconv POPT_CREDENTIALS TORTURE_AUTH TORTURE_UTIL TORTURE_NDR TORTURE_LIBCRYPTO share torture_registry PROVISION ldb samdb replace-test RPC_FSS_STATE util_str_escape'
+TORTURE_LOCAL_DEPS = 'RPC_NDR_ECHO TDR LIBCLI_SMB MESSAGING iconv POPT_CREDENTIALS TORTURE_AUTH TORTURE_UTIL TORTURE_NDR TORTURE_LIBCRYPTO share torture_registry %s ldb samdb replace-test RPC_FSS_STATE util_str_escape' % provision
 
 bld.SAMBA_MODULE('TORTURE_LOCAL',
 	source=TORTURE_LOCAL_SOURCE,
diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build
index aceeded..8d46d73 100644
--- a/source4/torture/wscript_build
+++ b/source4/torture/wscript_build
@@ -1,5 +1,7 @@
 #!/usr/bin/env python
 
+provision = bld.pyembed_libname('PROVISION')
+samba_net = bld.pyembed_libname('samba-net')
 
 bld.SAMBA_SUBSYSTEM('TORTURE_UTIL',
 	source='util_smb.c',
@@ -80,7 +82,6 @@ if bld.AD_DC_BUILD_IS_ENABLED():
         torture_rpc_backupkey = 'rpc/backupkey.c'
     else:
         torture_rpc_backupkey = 'rpc/backupkey_heimdal.c'
-
 bld.SAMBA_MODULE('torture_rpc',
                  source='''
                         rpc/join.c
@@ -167,7 +168,7 @@ bld.SAMBA_MODULE('torture_rpc',
                       RPC_NDR_OXIDRESOLVER
                       RPC_NDR_NTSVCS
                       WB_HELPER
-                      samba-net
+                      %s
                       LIBCLI_AUTH
                       popt
                       POPT_CREDENTIALS
@@ -184,7 +185,7 @@ bld.SAMBA_MODULE('torture_rpc',
                       RPC_NDR_WITNESS
                       RPC_NDR_BACKUPKEY
                       RPC_NDR_WINSPOOL
-                      ''' + ntvfs_specific['deps'],
+                      ''' % samba_net + ntvfs_specific['deps'],
                  internal_module=True,
                  enabled=bld.PYTHON_BUILD_IS_ENABLED())
 
@@ -268,7 +269,7 @@ bld.SAMBA_MODULE('TORTURE_NET',
 	autoproto='libnet/proto.h',
 	subsystem='smbtorture',
 	init_function='torture_net_init',
-	deps='samba-net popt POPT_CREDENTIALS torture_rpc PROVISION',
+	deps='%s popt POPT_CREDENTIALS torture_rpc %s' % (provision, samba_net),
 	internal_module=True,
 	enabled=bld.PYTHON_BUILD_IS_ENABLED()
 	)
diff --git a/source4/web_server/wscript_build b/source4/web_server/wscript_build
index b845067..97c550b 100644
--- a/source4/web_server/wscript_build
+++ b/source4/web_server/wscript_build
@@ -1,5 +1,6 @@
 #!/usr/bin/env python
 
+libpython = bld.pyembed_libname('LIBPYTHON')
 
 bld.SAMBA_SUBSYSTEM('WEB_WSGI',
 		source='wsgi.c',
@@ -13,7 +14,7 @@ bld.SAMBA_MODULE('service_web',
 		source='web_server.c',
 		subsystem='service',
 		init_function='server_service_web_init',
-		deps='LIBTLS process_model LIBPYTHON WEB_WSGI',
+		deps='LIBTLS process_model %s WEB_WSGI' % libpython,
 		pyembed=True,
 		internal_module=False,
 		enabled=bld.AD_DC_BUILD_IS_ENABLED()


-- 
Samba Shared Repository



More information about the samba-cvs mailing list