diff options
author | Lubos Kardos <lkardos@redhat.com> | 2015-09-18 15:29:25 +0200 |
---|---|---|
committer | Lubos Kardos <lkardos@redhat.com> | 2015-09-18 16:03:23 +0200 |
commit | f0a58d1dced6215b7caaa70db17d54834e0cd44e (patch) | |
tree | 8631bd0cda44b1059b9c77f68926a3de28d7bf73 /python/rpmsystem-py.h | |
parent | d20b7d2b00e349610f3cf08d9ff3723cc7c56e32 (diff) | |
download | rpm-f0a58d1dced6215b7caaa70db17d54834e0cd44e.tar.gz |
Define PY_SSIZE_T_CLEAN
When PyArg_ParseTupleAndKeywords() is used with format argument "s#"
that means get a string and his length then the length is returned as
as a Py_ssize_t in python3 but as an int in python2, which casues
a problem because rpmfd_write() that uses PyArg_ParseTupleAndKeywords()
expects the length as a Py_ssize_t always. This problem affects big
endian systems with python2 as default. If PY_SSIZE_T_CLEAN is defined
then PyArg_ParseTupleAndKeywords() returns the length as a Py_ssize_t
in both python2 and python3.
Diffstat (limited to 'python/rpmsystem-py.h')
-rw-r--r-- | python/rpmsystem-py.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/python/rpmsystem-py.h b/python/rpmsystem-py.h index 50e8770e8..c8423e3dc 100644 --- a/python/rpmsystem-py.h +++ b/python/rpmsystem-py.h @@ -5,6 +5,7 @@ #include <sys/types.h> #endif +#define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> |