In case it helps, here's the patch ready to be copied to
debian/patches/ (I tested it locally and it works).


        Frederic
Description: fix Python deprecation warnings about PY_SSIZE_T_CLEAN
Origin: upstream, https://github.com/facebook/watchman/commit/6813a948fee72a15acf4120262d37c9c8dc3f16b

--- a/python/pywatchman/bser.c
+++ b/python/pywatchman/bser.c
@@ -28,6 +28,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#define PY_SSIZE_T_CLEAN
 #include <Python.h>
 #include <bytesobject.h>
 #ifdef _MSC_VER
@@ -1026,7 +1027,7 @@ static int pdu_info_helper(
     int64_t* total_len_out) {
   const char* start = NULL;
   const char* data = NULL;
-  int datalen = 0;
+  Py_ssize_t datalen = 0;
   const char* end;
   int64_t expected_len;
   off_t position;
@@ -1075,7 +1076,7 @@ static PyObject* bser_pdu_len(PyObject* self, PyObject* args) {
 
 static PyObject* bser_loads(PyObject* self, PyObject* args, PyObject* kw) {
   const char* data = NULL;
-  int datalen = 0;
+  Py_ssize_t datalen = 0;
   const char* start;
   const char* end;
   int64_t expected_len;

Reply via email to