On this page
gzip.BadGzipFile
Up: gzip | Next: gzip.compress
Rel: gzip.compress, gzip.decompress, gzip.GzipFile, gzip.open
Ref: docs.python.org โ gzip.BadGzipFile
Tags: #public #python3 #stdlib #gzip
Import
import gzip
from gzip import BadGzipFile
Signature & Overview
gzip.BadGzipFile(...)
Exception raised in some cases for invalid gzip files.
Methods & Attributes
BadGzipFile.add_note(self, note, /)โ Add a note to the exceptionBadGzipFile.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import gzip
try:
gzip.decompress(b"not gzip")
except gzip.BadGzipFile:
assert issubclass(gzip.BadGzipFile, OSError)
Gotchas
- Subclass of
OSError: Raised on corrupt headers or invalid CRC checksums.
REPL Inspect
from gzip import BadGzipFile
help(BadGzipFile)
Linked from
Related notes
- tuts/python3/stdlib_module/gzip/compress Linked here; links to this page; shared tags: #gzip, #stdlib
- tuts/python3/stdlib_module/gzip/decompress Linked here; links to this page; shared tags: #gzip, #stdlib
- tuts/python3/stdlib_module/gzip/GzipFile Linked here; links to this page; shared tags: #gzip, #stdlib
- tuts/python3/stdlib_module/gzip/open Linked here; links to this page; shared tags: #gzip, #stdlib
- tuts/python3/stdlib_module/gzip Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib