mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-11-13 03:37:15 +00:00
Upgrade to release 10.18.0:
- pikepdf.Pdf.add_pages_from now carries layers (optional
content) with the pages it copies. The optional content groups
that the copied pages depend on are listed in the destination's
/OCProperties, with the default visibility, place in the layer
list, lock, radio button groups and automatic states that the
source's default configuration gave them. Previously the groups
were copied but not listed, so viewers ignored them: the layer
list was empty and content hidden in the source was shown.
- pikepdf.Pdf.add_pages_from now carries bookmarks. Outline
items of the source that lead to a copied page are appended to
the destination's outline, keeping their hierarchy, titles and
style; items that lead to pages that were not copied are dropped.
- Both are on by default, which changes what existing callers of
add_pages_from get: the destination may gain an /OCProperties and
outline items it did not gain before. Pass layers='ignore' or
outlines='ignore' for the previous behaviour, for example if you
build the merged outline yourself. pikepdf.PageCopyResult
reports layers_added, outline_items_added and
outline_items_dropped.
- pikepdf.Pdf.check_pdf_syntax now performs the same checks
as qpdf --check and reports the same problems. It checks the
linearization data and hint tables of linearized files, which
previously required a separate call to
pikepdf.Pdf.check_linearization, and checks the interactive
form, embedded files, page labels and outlines. A document with
no pages is reported as ERROR: file does not contain any pages,
and a page whose content stream cannot be read is reported as
ERROR: page N: ... along with the other problems found, where it
previously raised pikepdf.PdfError.
- Inserting a pikepdf.Dictionary or pikepdf.Array
that refers to another Pdf into a Pdf now raises
pikepdf.ForeignObjectError, naming the key or index where the
foreign object was found, and leaves the target unchanged.
This covers an indirect object of another Pdf held anywhere in
the value, such as pdf3.Root.X = Dictionary(P=pdf1.Root.Y), and a
direct dictionary or array that another Pdf already contains.
Previously the value was accepted: the first kind made the Pdf
impossible to save, failing part way through writing, and the
second left two documents sharing one object. It applies to every
way of inserting a value, including
pikepdf.Pdf.make_indirect, pikepdf.Page.add_resource,
adding a page built from a dictionary, name and number trees, and
stream dictionaries. Use pikepdf.Pdf.copy_foreign to bring
the foreign object over first.
- A password containing a NUL character now raises {exc}ValueError,
both when opening a PDF and when encrypting one. Previously the
password was silently cut short at the NUL, so a wrong password
could open a file, and an encrypted file could be written with a
shorter password than requested. PDF passwords may not contain
NUL.
- Fixed threads interfering with each other inside one Pdf on
GIL-enabled builds, which could cause an object to be read as
None. The per-Pdf lock is now in force on every build, and
pikepdf.Pdf.lock works on GIL-enabled builds too.
- Methods implemented in Python that change a Pdf in several steps,
such as pikepdf.Page.add_overlay,
pikepdf.Pdf.add_pages_from and the pikepdf.sanitize functions,
now hold its lock until they finish. The thread safety section of
the architecture notes now says which calls are atomic.
- Two threads that each hold the lock of one Pdf and then need the
other's no longer deadlock; one of them gets a RuntimeError
instead. What a callback such as a pikepdf.TokenFilter may
do is now documented: see {ref}callback-restrictions.
- Fixed a crash, a native stack overflow that no Python except can
catch, when reading, saving or checking a PDF in which a JBIG2
image's /JBIG2Globals stream is itself JBIG2-encoded and leads
back to the image, directly or through other streams. Such an
image is now reported as unfilterable, as JBIG2-encoded globals
without a cycle already were: reading it raises
~pikepdf.exceptions.PdfError, extracting it raises
~pikepdf.exceptions.UnsupportedImageTypeError, and saving
writes it unchanged with a warning.
- A JBIG2 image's /JBIG2Globals are now read only when the image is
being JBIG2-decoded, rather than every time qpdf checks whether
the image can be decoded, which included every save.
- Reading the label of a page whose page label style is an unknown
name, such as /S /Z, now warns and keeps the label prefix, as an
invalid non-name style already did. Previously it raised
KeyError.
- Reading the label of a page whose number cannot be written in its
page label style, such as /S /R /St 0 or a Roman numeral above
5000, now warns and writes the number in decimal digits.
Previously it raised ValueError.
- Extracting an image whose /CalGray or /CalRGB colour space array
lacks its parameter dictionary now decodes it as the
corresponding device space, without an ICC profile, as a missing
/WhitePoint already did. Previously it raised IndexError.
- An ICCBased image whose profile stream omits the required /N, or
gives one that is not an integer, now takes its mode and default
/Decode from the profile's colour space. Previously its mode
raised KeyError.
- Fixed pikepdf.form.SignatureField.stamp_overlay stamping
the overlay twice when the signature widget names its page with
/P.
- Fixed a Pdf returned by pikepdf.Job.create_pdf not being
set up like other Pdf objects: setting its conversion_mode raised
pikepdf.PdfError, and on free-threaded Python none of its
methods were protected by a lock.
- Matrix.__array__(copy=False) now raises ValueError, as numpy
expects of an object that cannot share its memory. The check for
this was written in a way that never fired.
- A progress argument to pikepdf.Pdf.save that is not
callable is now rejected with TypeError before anything is
written. Previously the error was raised part of the way through
writing the file.
- Fixed a small memory leak each time
pikepdf.AcroForm.get_fields_with_qualified_name or
pikepdf.AcroForm.fix_copied_annotations returned a field.
- Iterating over a pikepdf.NameTree or
pikepdf.NumberTree now iterates over the keys it had when
the iteration began. Previously the tree was read as the
iteration went on, so changing it meanwhile gave undefined
results.
- Putting an object that belongs to another Pdf in a
pikepdf.NameTree or pikepdf.NumberTree now raises
pikepdf.ForeignObjectError at once, as it does for a
dictionary or an array. Previously the error was not raised until
the Pdf was saved.
- x in tree is now False for an x that cannot be a key of a
pikepdf.NameTree, such as an int, and for None in a
pikepdf.NumberTree. Previously these raised TypeError.
- Corrected the documentation and type hints of
pikepdf.NameTree, which said that names are bytes. Names
are, and have always been, str: qpdf reads each name as a PDF
text string and compares names by that text.
- Fixed building from source on Android (Termux), where importing
pikepdf failed with cannot locate symbol "_Py_TrueStruct" since
v10.6.0. The extension module is now linked against libpython
when the build interpreter is an Android Python, as that platform
requires. Android is not a tested platform.
Free-threaded Python fixes:
Many crashes and data races that occurred when several threads used the
same Pdf at once have been fixed. The test suite now runs under
ThreadSanitizer in continuous integration, which is how most of them
were found ().
- Every binding that reads or changes a Pdf now takes that Pdf's
lock, and the lock of any other Pdf among its arguments, enforced
at compile time. Many bindings previously did not, notably most
methods of pikepdf.NameTree, pikepdf.NumberTree,
attachments, annotations and pikepdf.AcroForm.
- Fixed crashes and data races in pikepdf.Page methods,
content stream parsing, adding pages from one Pdf to another, and
dropping the last reference to a Pdf while another thread used
one of its objects.
- A pikepdf.Dictionary or pikepdf.Array that belongs
to no Pdf is now protected by a lock shared by all such objects.
Threads that each build objects of their own contend for it, so
add a Dictionary or Array to its Pdf as soon as it is created
rather than building large structures before adding them.
- Fixed "dictionary changed size during iteration" when several
threads opened a Pdf's metadata for the first time at once.
- Threads that take turns using the same Pdf are no longer slowed
to a crawl when every CPU is busy.
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>
meta-python
Introduction
This layer is intended to be the home of python modules for OpenEmbedded.
Dependencies
The meta-python layer depends on:
URI: git://git.openembedded.org/openembedded-core
layers: meta
branch: master
URI: git://git.openembedded.org/meta-openembedded
layers: meta-oe
branch: master
Contributing
The meta-openembedded mailinglist (openembedded-devel@lists.openembedded.org) is used for questions, comments and patch review. It is subscriber only, so please register before posting.
Send pull requests to openembedded-devel@lists.openembedded.org with '[meta-python]' in the subject.
When sending single patches, please use something like: git send-email -M30% -C --find-copies-harder -1 --to=openembedded-devel@lists.openembedded.org --subject-prefix='meta-python][PATCH'
Maintenance
Layer maintainers: Tim "moto-timo" Orling TicoTimo@gmail.com Derek Straka derek@asterius.io