lib/ldb: Use new PYARG_ES format for parseTuple
authorNoel Power <noel.power@suse.com>
Mon, 12 Nov 2018 16:06:10 +0000 (16:06 +0000)
committerKarolin Seeger <kseeger@samba.org>
Mon, 21 Jan 2019 08:48:15 +0000 (09:48 +0100)
commit8738db2afadc449db26a79ccb6a6112fdbcac005
treef76c4a0bcc214ce785d411f01af41a0bf2ca7dde
parent869ae9a17b2fb502714d68c73e95bd066d290a3d
lib/ldb: Use new PYARG_ES format for parseTuple

While 'es' format works great for unicode (in python2) and
str (in python3) The behaviour with str (in python2) is unexpected.
In python2 the str type is (re-encoded) with the specified encoding.
In python2 the 'et' type would be a better match, that ensures 'str'
type is treated like it was with 's' (no reencoding) and unicode is
encoded with the specified encoding. However in python3 'et' allows
byte (or bytearray) params to be accepted (with no reencoding), we
don't want this. This patch adds a new PYARG_STR_UNI format code which
is a hybrid, in python2 it evaluates to 'et' and in python3 'es' and
so gives the desired behaviour for each python version.

Additionally remove the associated known fail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13616
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Sun Jan 13 03:53:00 CET 2019 on sn-devel-144

(cherry picked from commit 8900e0b4cb05613df9cbeeb8b8253273b06b3c17)
lib/ldb/pyldb.c
selftest/knownfail