1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/python
Petr Viktorin 40e409bf9e python3: Use "y#" instead of "s#" for binary data in PyArg_ParseTuple
The "s#" format code for PyArg_ParseTupleAndKeywords and Py_BuildValue
converts a char* and size to/from Python str (with utf-8 encoding under
Python 3).
In some cases, we want bytes (str on Python 2, bytes on 3) instead. The
code for this is "y#" in Python 3, but that is not available in 2.

Introduce a PYARG_BYTES_LEN macro that expands to "s#" or "y#", and use
that in:
- credentials.get_ntlm_response (for input and output)
- ndr_unpack argument in PIDL generated code

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-05-19 22:20:15 +02:00
..
examples python/examples/winreg: two variable name typos on a single line 2017-03-10 07:31:10 +01:00
samba samba-tool: Rename Samba4 to Samba AD 2017-05-05 15:51:54 +02:00
samba_external Move python modules from source4/scripting/python/ to python/. 2013-03-02 03:57:34 +01:00
modules.c Move python modules from source4/scripting/python/ to python/. 2013-03-02 03:57:34 +01:00
modules.h Move python modules from source4/scripting/python/ to python/. 2013-03-02 03:57:34 +01:00
py3compat.h python3: Use "y#" instead of "s#" for binary data in PyArg_ParseTuple 2017-05-19 22:20:15 +02:00
pyglue.c python: Add py_is_heimdal_built() to pyglue 2017-04-29 23:31:11 +02:00
wscript waf: Move python build instructions to wscript 2017-04-29 23:31:11 +02:00