mirror of
https://github.com/python/cpython.git
synced 2025-11-08 13:42:22 +00:00
Patch #640236: Better eplain unused data.
This commit is contained in:
parent
5b8bfdf67c
commit
9e9a7c3dd7
1 changed files with 12 additions and 7 deletions
|
|
@ -123,24 +123,29 @@ action is to delete the object.
|
||||||
Decompression objects support the following methods, and two attributes:
|
Decompression objects support the following methods, and two attributes:
|
||||||
|
|
||||||
\begin{memberdesc}{unused_data}
|
\begin{memberdesc}{unused_data}
|
||||||
A string which contains any unused data from the last string fed to
|
A string which contains any bytes past the end of the compressed data.
|
||||||
this decompression object. If the whole string turned out to contain
|
That is, this remains \code{""} until the last byte that contains
|
||||||
compressed data, this is \code{""}, the empty string.
|
compression data is available. If the whole string turned out to
|
||||||
|
contain compressed data, this is \code{""}, the empty string.
|
||||||
|
|
||||||
The only way to determine where a string of compressed data ends is by
|
The only way to determine where a string of compressed data ends is by
|
||||||
actually decompressing it. This means that when compressed data is
|
actually decompressing it. This means that when compressed data is
|
||||||
contained part of a larger file, you can only find the end of it by
|
contained part of a larger file, you can only find the end of it by
|
||||||
reading data and feeding it into a decompression object's
|
reading data and feeding it followed by some non-empty string into a
|
||||||
\method{decompress} method until the \member{unused_data} attribute is
|
decompression object's \method{decompress} method until the
|
||||||
no longer the empty string.
|
\member{unused_data} attribute is no longer the empty string.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
\begin{memberdesc}{unconsumed_tail}
|
\begin{memberdesc}{unconsumed_tail}
|
||||||
A string that contains any data that was not consumed by the last
|
A string that contains any data that was not consumed by the last
|
||||||
\method{decompress} call because it exceeded the limit for the
|
\method{decompress} call because it exceeded the limit for the
|
||||||
uncompressed data buffer.
|
uncompressed data buffer. This data has not yet been seen by the zlib
|
||||||
|
machinery, so you must feed it (possibly with further data
|
||||||
|
concatenated to it) back to a subsequent \method{decompress} method
|
||||||
|
call in order to get correct output.
|
||||||
\end{memberdesc}
|
\end{memberdesc}
|
||||||
|
|
||||||
|
|
||||||
\begin{methoddesc}[Decompress]{decompress}{string}{\optional{max_length}}
|
\begin{methoddesc}[Decompress]{decompress}{string}{\optional{max_length}}
|
||||||
Decompress \var{string}, returning a string containing the
|
Decompress \var{string}, returning a string containing the
|
||||||
uncompressed data corresponding to at least part of the data in
|
uncompressed data corresponding to at least part of the data in
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue