diff --git a/c-ext/python-zstandard.h b/c-ext/python-zstandard.h index e0335c55..f852a86a 100644 --- a/c-ext/python-zstandard.h +++ b/c-ext/python-zstandard.h @@ -127,7 +127,7 @@ typedef struct { size_t outSize; int entered; int closing; - int closed; + char closed; int writeReturnRead; int closefd; unsigned long long bytesCompressed; @@ -164,7 +164,7 @@ typedef struct { int closefd; int entered; - int closed; + char closed; unsigned long long bytesCompressed; ZSTD_inBuffer input; @@ -244,7 +244,7 @@ typedef struct { /* Whether the context manager is active. */ int entered; /* Whether we've closed the stream. */ - int closed; + char closed; /* Number of bytes decompressed and returned to user. */ unsigned long long bytesDecompressed; @@ -271,7 +271,7 @@ typedef struct { size_t outSize; int entered; int closing; - int closed; + char closed; int writeReturnRead; int closefd; } ZstdDecompressionWriter; diff --git a/docs/news.rst b/docs/news.rst index 4bc3d7d6..8f873653 100644 --- a/docs/news.rst +++ b/docs/news.rst @@ -82,6 +82,16 @@ Other Actions Not Blocking Release 0.17.0 (not yet released) ========================= +Bug Fixes +--------- + +* The `ZstdCompressionReader`, `ZstdCompressionWriter`, + `ZstdDecompressionReader`, and `ZstdDecompressionWriter` types in the C + backend now tracks their `closed` attribute using the proper C type. Before, + due to a mismatch between the C struct type and the type declared to Python, + Python could read the wrong bits on platforms like s390x and incorrectly + report the value of the `closed` attribute to Python. (#105, #164) + Changes -------