Michał Górny added the comment:
> An OSError for a file the OS can read seems a bit off. What is the
> accompanying message?
For example:
OSError: Invalid data stream
(I've just put random string into a file, and opened it as bzip2)
> Would something like ValueError("bz2 compressor faile
Terry J. Reedy added the comment:
An OSError for a file the OS can read seems a bit off. What is the
accompanying message? Would something like ValueError("bz2 compressor failed
with BZ_DATA_ERROR") be better?
Michał, are there precedents or models for this in the other file compression
m
New submission from Michał Górny :
Currently, the bz2 extension functions raise a generic OSError() on
BZ_DATA_ERROR and BZ_DATA_ERROR_MAGIC. When working on files, this makes it
unnecessarily hard to catch compressor errors (i.e. invalid bz2 input file)
without catching system I/O errors. C