Features and Improvements
- Metadata reads (
ArchiveSession.get_metadata, and soget_item,
Item.refreshandia metadata) now sendextended_err=1, merged
with any caller-suppliedparams. An identifier that exists or existed
but cannot be served now returns{"error": ..., "errcode": ...}instead
of{};ia metadata <identifier>prints that body. Item.errcode(int orNone) andItem.error(str orNone)
expose the extended error, so callers can tell a deleted item from one that
is temporarily unreadable.Item.__repr__shows them when set.ia metadata --existsprints the error to stderr when the response
carried one. Exit codes are unchanged.
Bugfixes
Item.existsis nowFalseforerrcode103 (unbacked user item,
never created) and 104 (deleted), andTruefor every other non-empty
response, including 101 (creation pending) and 102 (data nodes offline).
Previously the API returned{}for all of these, so a pending or
temporarily unreadable item read as not existing.
Compatibility:existsno longer implies the metadata is loaded. For
101, 102 and the other non-deleted error codes,existsisTrue
whileitem.metadatais{}anditem.filesis[]; check
item.errorbefore reading them. As a resultia deleteon such an
item prints "no files found, nothing deleted." and exits 1 instead of
"item doesn't exist" with exit 0 (no delete requests are sent), and
ia downloadstill reports it as "item does not exist".- Reloading an item (
Item.refresh,Item.load) now resets the
attributes set from the previous response, so an item that was deleted
or became unreadable no longer keeps its oldfilesandmetadata.
load({})now replaces the previous response instead of being ignored. ia search --ftsandsearch_items(..., full_text_search=True)returned
no results after the full-text search API began validating parameter types:
the request sentscrollas the string"true", which the API now
rejects with a 400. It is now sent as a JSON boolean. Errors from the
full-text search API (a 4xx or 5xx status, or auser_messagein the
response body) now raiseValueErrorwith the server's message, so
ia search --ftsprints it and exits 1 instead of printing nothing and
exiting 0 (#842). This includes an expired scroll id partway through
iteration, which previously ended the results early without warning, and a
failednum_foundrequest, which previously returnedNone.ia search --fts --itemlistcrashed withTypeErroron the second and
later scroll pages: the API returns the identifier in_sourcethere
rather than infields. The identifier is now taken from
fields.identifier, else_source.identifier, else the part of the hit's
_idbefore the|.search_items(..., full_text_search=True)still
yields the hits exactly as the API returns them.
Security
- Development and CI dependencies updated past their open advisories:
virtualenv 21.15.6 (was 21.14.12) and filelock 4.2.10 (was 3.32.3). On
Python 3.10 filelock stays at 4.1.0, the last release that supports it, which
still has open advisories. The security notice in the README now names the
correct fixed version, v5.5.1 (it said v5.4.2, which was never released).
What's Changed
Other Changes
- Send FTS scroll as a JSON boolean and raise on FTS API errors by @jjjake in #843
- Tighten agent rules in AGENTS.md by @jjjake in #845
- Handle _source hits in ia search --fts --itemlist by @jjjake in #846
- Send extended_err=1 on metadata reads and tighten Item.exists by @jjjake in #841
- Upgrade virtualenv and filelock in uv.lock; correct README security notice by @jjjake in #844
- Date the 5.13.0 changelog section by @jjjake in #848
Full Changelog: v5.12.1...v5.13.0