From e9f70cb20c3fcbd6c96cb0fe1fbd9d89652aadca Mon Sep 17 00:00:00 2001 From: Jacob Feder Date: Wed, 28 Jul 2021 10:58:19 -0500 Subject: [PATCH 1/2] change byte lengths to use Py_ssize_t --- xdelta3/_xdelta3.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xdelta3/_xdelta3.c b/xdelta3/_xdelta3.c index 4c032ef..62b0bd2 100644 --- a/xdelta3/_xdelta3.c +++ b/xdelta3/_xdelta3.c @@ -2,6 +2,7 @@ #include "xdelta3.h" #include "xdelta3.c" +#define PY_SSIZE_T_CLEAN #include static PyObject *NoDeltaFound; @@ -10,8 +11,9 @@ static PyObject *XDeltaError; static PyObject * xdelta3_execute(PyObject *self, PyObject *args) { uint8_t *input_bytes = NULL, *source_bytes = NULL, *output_buf = NULL; - int input_len, source_len, flags, action, result; - size_t input_size, source_size, output_alloc, output_size; + Py_ssize_t input_len, source_len, output_size; + int flags, action, result; + size_t input_size, source_size, output_alloc; if (!PyArg_ParseTuple(args, "y#y#ii", &input_bytes, &input_len, &source_bytes, &source_len, &flags, &action)) return NULL; From afb9bd405dff7c050773b4ae3f77c09097d900a5 Mon Sep 17 00:00:00 2001 From: Jacob Feder Date: Wed, 28 Jul 2021 11:21:33 -0500 Subject: [PATCH 2/2] update python version compatibility --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index bb100db..17d5417 100644 --- a/README.rst +++ b/README.rst @@ -8,7 +8,7 @@ Fast delta encoding in python using xdelta3. Requirements ------------ -* **Python 3.5 or 3.6** - it's 2017, you should be using python 3.6 by now anyway. +* **Python 3.5 - 3.9** - it's 2021, you should be using python 3.6+ by now anyway. * **linux** - compilation only tested on ubuntu, might work on other platform. Installation