diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-11-16 07:29:48 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-11-16 07:55:02 +0300 |
commit | f949be383b813c65da08576594b35e69727ecaf8 (patch) | |
tree | 011141bcdf0c956e349d11b0a1d3f2f61be57fec | |
parent | 27c76c0c99226ac94a4ad256ecc30460cfbd5356 (diff) | |
download | ydb-f949be383b813c65da08576594b35e69727ecaf8.tar.gz |
Update contrib/python/zstandard/py3 to 0.22.0
-rw-r--r-- | contrib/python/zstandard/py3/.dist-info/METADATA | 10 | ||||
-rw-r--r-- | contrib/python/zstandard/py3/c-ext/decompressobj.c | 9 | ||||
-rw-r--r-- | contrib/python/zstandard/py3/c-ext/decompressor.c | 9 | ||||
-rw-r--r-- | contrib/python/zstandard/py3/c-ext/python-zstandard.h | 3 | ||||
-rw-r--r-- | contrib/python/zstandard/py3/ya.make | 2 | ||||
-rw-r--r-- | contrib/python/zstandard/py3/zstandard/__init__.py | 2 |
6 files changed, 23 insertions, 12 deletions
diff --git a/contrib/python/zstandard/py3/.dist-info/METADATA b/contrib/python/zstandard/py3/.dist-info/METADATA index 6eaf253026..d7be705bd9 100644 --- a/contrib/python/zstandard/py3/.dist-info/METADATA +++ b/contrib/python/zstandard/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: zstandard -Version: 0.21.0 +Version: 0.22.0 Summary: Zstandard bindings for Python Home-page: https://github.com/indygreg/python-zstandard Author: Gregory Szorc @@ -11,16 +11,16 @@ Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: BSD License Classifier: Programming Language :: C -Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 -Requires-Python: >=3.7 +Classifier: Programming Language :: Python :: 3.12 +Requires-Python: >=3.8 License-File: LICENSE -Requires-Dist: cffi (>=1.11) ; platform_python_implementation == "PyPy" +Requires-Dist: cffi >=1.11 ; platform_python_implementation == "PyPy" Provides-Extra: cffi -Requires-Dist: cffi (>=1.11) ; extra == 'cffi' +Requires-Dist: cffi >=1.11 ; extra == 'cffi' ================ python-zstandard diff --git a/contrib/python/zstandard/py3/c-ext/decompressobj.c b/contrib/python/zstandard/py3/c-ext/decompressobj.c index 5c3a124fc9..a22257bbb9 100644 --- a/contrib/python/zstandard/py3/c-ext/decompressobj.c +++ b/contrib/python/zstandard/py3/c-ext/decompressobj.c @@ -89,7 +89,7 @@ static PyObject *DecompressionObj_decompress(ZstdDecompressionObj *self, } } - if (0 == zresult) { + if (0 == zresult && !self->readAcrossFrames) { self->finished = 1; /* We should only get here at most once. */ @@ -98,6 +98,13 @@ static PyObject *DecompressionObj_decompress(ZstdDecompressionObj *self, break; } + else if (0 == zresult && self->readAcrossFrames) { + if (input.pos == input.size) { + break; + } else { + output.pos = 0; + } + } else if (input.pos == input.size && output.pos == 0) { break; } diff --git a/contrib/python/zstandard/py3/c-ext/decompressor.c b/contrib/python/zstandard/py3/c-ext/decompressor.c index 3e61fe9ee6..b8e7f82cf1 100644 --- a/contrib/python/zstandard/py3/c-ext/decompressor.c +++ b/contrib/python/zstandard/py3/c-ext/decompressor.c @@ -397,13 +397,14 @@ finally: static ZstdDecompressionObj *Decompressor_decompressobj(ZstdDecompressor *self, PyObject *args, PyObject *kwargs) { - static char *kwlist[] = {"write_size", NULL}; + static char *kwlist[] = {"write_size", "read_across_frames", NULL}; ZstdDecompressionObj *result = NULL; size_t outSize = ZSTD_DStreamOutSize(); + PyObject *readAcrossFrames = NULL; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|k:decompressobj", kwlist, - &outSize)) { + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|kO:decompressobj", kwlist, + &outSize, &readAcrossFrames)) { return NULL; } @@ -426,6 +427,8 @@ static ZstdDecompressionObj *Decompressor_decompressobj(ZstdDecompressor *self, result->decompressor = self; Py_INCREF(result->decompressor); result->outSize = outSize; + result->readAcrossFrames = + readAcrossFrames ? PyObject_IsTrue(readAcrossFrames) : 0; return result; } diff --git a/contrib/python/zstandard/py3/c-ext/python-zstandard.h b/contrib/python/zstandard/py3/c-ext/python-zstandard.h index a58261d0e4..ffcbdfd101 100644 --- a/contrib/python/zstandard/py3/c-ext/python-zstandard.h +++ b/contrib/python/zstandard/py3/c-ext/python-zstandard.h @@ -31,7 +31,7 @@ /* Remember to change the string in zstandard/__init__.py, rust-ext/src/lib.rs, and debian/changelog as well */ -#define PYTHON_ZSTANDARD_VERSION "0.21.0" +#define PYTHON_ZSTANDARD_VERSION "0.22.0" typedef enum { compressorobj_flush_finish, @@ -220,6 +220,7 @@ typedef struct { ZstdDecompressor *decompressor; size_t outSize; + int readAcrossFrames; int finished; PyObject *unused_data; } ZstdDecompressionObj; diff --git a/contrib/python/zstandard/py3/ya.make b/contrib/python/zstandard/py3/ya.make index 27e56f1470..d817d61ac9 100644 --- a/contrib/python/zstandard/py3/ya.make +++ b/contrib/python/zstandard/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(0.21.0) +VERSION(0.22.0) LICENSE(BSD-3-Clause) diff --git a/contrib/python/zstandard/py3/zstandard/__init__.py b/contrib/python/zstandard/py3/zstandard/__init__.py index 7840473e1c..8588729004 100644 --- a/contrib/python/zstandard/py3/zstandard/__init__.py +++ b/contrib/python/zstandard/py3/zstandard/__init__.py @@ -80,7 +80,7 @@ else: ) # Keep this in sync with python-zstandard.h, rust-ext/src/lib.rs, and debian/changelog. -__version__ = "0.21.0" +__version__ = "0.22.0" _MODE_CLOSED = 0 _MODE_READ = 1 |