Upgrade to release 10.13.0.post1:
- Behavior change: pikepdf.DataDecodingError now derives from
pikepdf.PdfError. A stream that will not decode is a defect in
the document, and the same call that raises it -
Object.read_bytes() - already raised PdfError for other kinds of
damage, so except PdfError was a handler that looked correct,
passed on healthy files, and let a traceback escape on damaged
ones. Code catching DataDecodingError by name is unaffected. Code
that orders except PdfError before except DataDecodingError will
now take the first branch; if the distinction matters, reverse
the order.
- Behavior change: pikepdf.PdfParsingError now derives from
pikepdf.PdfError, for the same reason.
- pikepdf.PasswordError remains a sibling of PdfError, not a
subclass. A wrong password does not mean the document is
defective, and handlers that report the two separately depend on
except PdfError not catching it.
- pikepdf.NotExtractableError is now exported. It was already the
base class of the exported HifiPrintImageNotTranscodableError but
could not be caught by name.
- Fixed the exceptions documentation, which referenced a nonexistent
FormCopyWarning (the class is PageCopyWarning) and omitted
ReferenceCycleError, PageCopyWarning and NotExtractableError.
- XMP assigns a type to every standard property, and software that
reads XMP discards a property whose type is wrong - Ghostscript
strips these silently, and PDF/A validators reject them. pikepdf
used to choose the RDF container from the Python type of the
value it was handed, so meta['dc:subject'] = ['a', 'b'] wrote an
rdf:Seq where the specification requires an rdf:Bag, and
meta['dc:creator'] = 'Author' wrote a bare string where an
rdf:Seq belongs. pikepdf now knows the type of the properties in
the standard schemas and converts values to it.
This work was sponsored by GOVCERT.LU.
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Upgrade to release 10.9.1:
- Fixed a crash (SIGABRT via std::terminate) that could occur when
a file-backed {class}pikepdf.Pdf was deallocated while a Python
exception was already propagating -- for example when
pikepdf.open(filename) appears as a transient element of a
list/tuple literal whose later element raises. Opening from a
filename closes the file in the input source destructor, which
calls back into Python; with an exception already in flight that
call raised an error that escaped the destructor. The in-flight
exception is now preserved and propagates normally. Added a guard
for a likely non-reproducible related case with DecimalPrecision.
This work was sponsored by GOVCERT.LU.
Signed-off-by: Leon Anavi <leon.anavi@konsulko.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>