Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Doc/c-api/unicode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1461,10 +1461,6 @@ the user settings on the machine running the codec.
.. versionadded:: 3.3


Methods & Slots
"""""""""""""""


.. _unicodemethodsandslots:

Methods and Slot Functions
Expand Down
6 changes: 3 additions & 3 deletions Doc/library/ast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,9 @@ Literals
.. class:: Constant(value)

A constant value. The ``value`` attribute of the ``Constant`` literal contains the
Python object it represents. The values represented can be simple types
such as a number, string or ``None``, but also immutable container types
(tuples and frozensets) if all of their elements are constant.
Python object it represents. The values represented can be instances of :class:`str`,
:class:`bytes`, :class:`int`, :class:`float`, :class:`complex`, and :class:`bool`,
and the constants :data:`None` and :data:`Ellipsis`.

.. doctest::

Expand Down
18 changes: 18 additions & 0 deletions Doc/library/compression.zstd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -615,6 +615,24 @@ Advanced parameter control

A value of zero causes the value to be selected automatically.

.. attribute:: content_size_flag

Write the size of the data to be compressed into the Zstandard frame
header when known prior to compressing.

This flag only takes effect under the following two scenarios:

* Calling :func:`compress` for one-shot compression
* Providing all of the data to be compressed in the frame in a single
:meth:`ZstdCompressor.compress` call, with the
:attr:`ZstdCompressor.FLUSH_FRAME` mode.

All other compression calls may not write the size information into the
frame header.

``True`` or ``1`` enable the content size flag while ``False`` or ``0``
disable it.

.. attribute:: checksum_flag

A four-byte checksum using XXHash64 of the uncompressed content is
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix possible crash in the :mod:`compression.zstd` module related to setting
parameter types. Patch by Jelle Zijlstra.
11 changes: 4 additions & 7 deletions Modules/_zstd/_zstdmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,13 +514,10 @@ _zstd_set_parameter_types_impl(PyObject *module, PyObject *c_parameter_type,
return NULL;
}

Py_XDECREF(mod_state->CParameter_type);
Py_INCREF(c_parameter_type);
mod_state->CParameter_type = (PyTypeObject*)c_parameter_type;

Py_XDECREF(mod_state->DParameter_type);
Py_INCREF(d_parameter_type);
mod_state->DParameter_type = (PyTypeObject*)d_parameter_type;
Py_XSETREF(
mod_state->CParameter_type, (PyTypeObject*)Py_NewRef(c_parameter_type));
Py_XSETREF(
mod_state->DParameter_type, (PyTypeObject*)Py_NewRef(d_parameter_type));

Py_RETURN_NONE;
}
Expand Down
2 changes: 1 addition & 1 deletion Modules/_zstd/compressor.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ compress_lock_held(ZstdCompressor *self, Py_buffer *data,
return NULL;
}

#ifdef Py_DEBUG
#ifndef NDEBUG
static inline int
mt_continue_should_break(ZSTD_inBuffer *in, ZSTD_outBuffer *out)
{
Expand Down
Loading