[PATCH STABLE] python-zstandard: apply big-endian fix (issue6188)

Gregory Szorc gregory.szorc at gmail.com
Sun Aug 25 12:01:58 EDT 2019


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1566748826 25200
#      Sun Aug 25 09:00:26 2019 -0700
# Branch stable
# Node ID 0da517c3ff6ce9e0ea014a85fb7344eca61b97b2
# Parent  7521e6d18057bfc41614d63c85424c50ee114cdf
python-zstandard: apply big-endian fix (issue6188)

This is a port of commit d4baf1f95b811f40773f5df0d8780fb2111ba6f5
from the upstream project to fix python-zstandard on 64-bit big-endian.

diff --git a/contrib/python-zstandard/c-ext/decompressor.c b/contrib/python-zstandard/c-ext/decompressor.c
--- a/contrib/python-zstandard/c-ext/decompressor.c
+++ b/contrib/python-zstandard/c-ext/decompressor.c
@@ -68,13 +68,13 @@ static int Decompressor_init(ZstdDecompr
 	};
 
 	ZstdCompressionDict* dict = NULL;
-	size_t maxWindowSize = 0;
+	Py_ssize_t maxWindowSize = 0;
 	ZSTD_format_e format = ZSTD_f_zstd1;
 
 	self->dctx = NULL;
 	self->dict = NULL;
 
-	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O!II:ZstdDecompressor", kwlist,
+	if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|O!nI:ZstdDecompressor", kwlist,
 		&ZstdCompressionDictType, &dict, &maxWindowSize, &format)) {
 		return -1;
 	}


More information about the Mercurial-devel mailing list