]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4/librpc/ndr: allow GUID to accept unicode also
authorNoel Power <noel.power@suse.com>
Fri, 18 May 2018 16:15:44 +0000 (17:15 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Jul 2018 23:12:24 +0000 (01:12 +0200)
This needed since _GUID_string method change
(in source4/torture/drs/python/drs_base.py) which makes use use
a unicode guid at times now

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/librpc/ndr/py_misc.c

index 849a11460a4054302bbb6612862c171eee193042..6c0b8b2af14a38cec55e727c5554de65a9fc6931 100644 (file)
@@ -97,7 +97,7 @@ static int py_GUID_init(PyObject *self, PyObject *args, PyObject *kwargs)
                DATA_BLOB guid_val;
                Py_ssize_t _size;
 
-               if (!IsPy3BytesOrString(str)) {
+               if (!IsPy3BytesOrString(str) && !PyUnicode_Check(str)) {
                        PyErr_SetString(PyExc_TypeError, "Expected a string or bytes argument to GUID()");
                        return -1;
                }