summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/gzip.rst8
-rw-r--r--Doc/whatsnew/3.8.rst5
2 files changed, 13 insertions, 0 deletions
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
index 8850a33..3349a94 100644
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -59,6 +59,14 @@ The module defines the following items:
.. versionchanged:: 3.6
Accepts a :term:`path-like object`.
+.. exception:: BadGzipFile
+
+ An exception raised for invalid gzip files. It inherits :exc:`OSError`.
+ :exc:`EOFError` and :exc:`zlib.error` can also be raised for invalid gzip
+ files.
+
+ .. versionadded:: 3.8
+
.. class:: GzipFile(filename=None, mode=None, compresslevel=9, fileobj=None, mtime=None)
Constructor for the :class:`GzipFile` class, which simulates most of the
diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst
index 2cfb110..684656f 100644
--- a/Doc/whatsnew/3.8.rst
+++ b/Doc/whatsnew/3.8.rst
@@ -304,6 +304,11 @@ gzip
Added the *mtime* parameter to :func:`gzip.compress` for reproducible output.
(Contributed by Guo Ci Teo in :issue:`34898`.)
+A :exc:`~gzip.BadGzipFile` exception is now raised instead of :exc:`OSError`
+for certain types of invalid or corrupt gzip files.
+(Contributed by Filip Gruszczyński, Michele Orrù, and Zackery Spytz in
+:issue:`6584`.)
+
idlelib and IDLE
----------------