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)
committerDouglas Bagnall <dbagnall@samba.org>
Sun, 13 Jan 2019 02:53:00 +0000 (03:53 +0100)
commit8900e0b4cb05613df9cbeeb8b8253273b06b3c17
tree3e823760f5e0dc88672997bf3c9ce52da1c7e49d
parent45f5337f9f02faa9bc8f5501601df399c229732e
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
lib/ldb/pyldb.c
selftest/knownfail