summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libgzip.tex
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>1999-04-05 19:00:54 (GMT)
committerFred Drake <fdrake@acm.org>1999-04-05 19:00:54 (GMT)
commit1dc3a501a67e369139002991e13465ac914eb28b (patch)
tree1a93a6b3ae891a63c0dc03f2508b68c37a8a00c6 /Doc/lib/libgzip.tex
parentfa1591c1299dcae295e1b11301e81e8b45c79dd3 (diff)
downloadcpython-1dc3a501a67e369139002991e13465ac914eb28b.zip
cpython-1dc3a501a67e369139002991e13465ac914eb28b.tar.gz
cpython-1dc3a501a67e369139002991e13465ac914eb28b.tar.bz2
Made improvements based on changes just made and comments from
Bernhard Reiter <bernhard@csd.uwm.edu>.
Diffstat (limited to 'Doc/lib/libgzip.tex')
-rw-r--r--Doc/lib/libgzip.tex17
1 files changed, 11 insertions, 6 deletions
diff --git a/Doc/lib/libgzip.tex b/Doc/lib/libgzip.tex
index ba3267c..3df75ce 100644
--- a/Doc/lib/libgzip.tex
+++ b/Doc/lib/libgzip.tex
@@ -11,7 +11,10 @@ with that used by the GNU compression program \program{gzip}.
Accordingly, the \module{gzip} module provides the \class{GzipFile}
class to read and write \program{gzip}-format files, automatically
compressing or decompressing the data so it looks like an ordinary
-file object.
+file object. Note that additional file formats which can be
+decompressed by the \program{gzip} and \program{gunzip} programs, such
+as those produced by \program{compress} and \program{pack}, are not
+supported by this module.
The module defines the following items:
@@ -34,10 +37,12 @@ to the filename of \var{fileobj}, if discernible; otherwise, it
defaults to the empty string, and in this case the original filename
is not included in the header.
-The \var{mode} argument can be either \code{'r'} or \code{'w'},
-depending on whether the file will be read or written. The default is
-the mode of \var{fileobj} if discernible; otherwise, the default is
-\code{'r'}.
+The \var{mode} argument can be any of \code{'r'}, \code{'rb'},
+\code{'a'}, \code{'ab'}, \code{'w'}, or \code{'wb'}, depending on
+whether the file will be read or written. The default is the mode of
+\var{fileobj} if discernible; otherwise, the default is \code{'rb'}.
+Be aware that only the \code{'rb'}, \code{'ab'}, and \code{'wb'}
+values should be used for cross-platform portability.
The \var{compresslevel} argument is an integer from \code{1} to
\code{9} controlling the level of compression; \code{1} is fastest and
@@ -55,7 +60,7 @@ object's \method{getvalue()} method.
\begin{funcdesc}{open}{filename\optional{, mode\optional{, compresslevel}}}
This is a shorthand for \code{GzipFile(\var{filename},}
\code{\var{mode},} \code{\var{compresslevel})}. The \var{filename}
-argument is required; \var{mode} defaults to \code{'r'} and
+argument is required; \var{mode} defaults to \code{'rb'} and
\var{compresslevel} defaults to \code{9}.
\end{funcdesc}