From 7a8d9866180868494a32e12655a8961d5eedfb65 Mon Sep 17 00:00:00 2001 From: Vinit Kumar Date: Wed, 23 Sep 2026 12:24:39 +0530 Subject: [PATCH 1/2] Release 7.1.1 Bump the package version and record the 7.1.1 fixes in HISTORY.rst and RELEASE_NOTES.md: decoder positions in reader errors, UTF-8 BOM acceptance, and the ty 0.0.83 test fixes. --- HISTORY.rst | 7 +++++++ RELEASE_NOTES.md | 27 +++++++++++---------------- json2xml/__init__.py | 2 +- pyproject.toml | 2 +- uv.lock | 2 +- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 861dba4..bb60f7b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,4 +1,11 @@ +7.1.1 / 2026-09-23 +================== + + * fix: include the JSON decoder's line and column in ``JSONReadError``, ``StringReadError``, and ``URLReadError`` messages, so the CLI reports where the input breaks instead of only that it is invalid + * fix: accept a UTF-8 byte order mark in file, URL, string, and stdin JSON input + * chore: fix the diagnostics ty 0.0.83 reports in tests and make the list-omission test compare its result + 7.1.0 / 2026-09-03 ================== diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 99ca620..f8f06ea 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,32 +1,27 @@ -# json2xml 7.1.0 +# json2xml 7.1.1 -Released 2026-09-03. +Released 2026-09-23. ## Highlights -- Enforces conversion depth and item limits inside the native payload walk when `json2xml-rs>=0.6.0` is installed, so the accelerated path no longer pays for a second Python-level traversal. A 2,000-record conversion drops from 7.1 ms to 1.4 ms. -- Keeps tuples on the Python serializer, closing the last known case where the two backends rendered the same payload differently. -- Writes identical CLI output to stdout and `--output` files: UTF-8 bytes ending in exactly one newline. -- Accepts numbers and other scalars in `dicttoxml_fast.escape_xml` and `wrap_cdata` whichever backend is active, and raises `InvalidDataError` from `Json2xml.to_xml` for every value the serializer rejects. -- Loads the optional Rust backend through one tested function that also keeps working with `json2xml-rs` 0.5.0. +- Reader errors now carry the JSON decoder's line and column, so `json2xml-py` says where a document breaks: `Invalid JSON File: Expecting ',' delimiter: line 372 column 3 (char 8920)`. +- A UTF-8 byte order mark, as written by PowerShell and Notepad, no longer makes file, URL, string, or stdin input fail as invalid JSON. +- The test suite type-checks cleanly under ty 0.0.83. ## Behaviour changes and migration guidance -- Files written with `--output` now end with a single newline, matching stdout. Stdout is written as UTF-8 bytes regardless of the console encoding. -- `readfromjson` raises `JSONReadError("Could not read JSON file")` when the file cannot be opened; only parse failures keep the `Invalid JSON File` message. -- `Json2xml.to_xml` raises `InvalidDataError` instead of `TypeError` for unsupported values such as a Mapping that is not a dict. -- `json2xml.backend_selector.ConversionRequest` and `has_special_keys` are removed. Use `json2xml.dicttoxml.SerializerConfig`, which the selector now shares with the serializer, and `rust_renders_identically` for the payload gate. -- `json2xml_rs.dicttoxml` called directly with tuples, sets, iterators, or arbitrary objects raises `TypeError` in 0.6.0; the `json2xml` wrapper routes such payloads to Python as before. +- `JSONReadError`, `StringReadError`, and `URLReadError` messages keep their existing prefixes and append the decoder message after a colon. Callers matching on the prefix are unaffected; callers comparing whole messages should match on the prefix. +- A leading U+FEFF in string input is dropped before parsing. No other input handling changed. ## Package Versions -- Python package: `json2xml==7.1.0` -- Rust accelerator: `json2xml-rs==0.6.0` -- Fast install: `pip install "json2xml[fast]==7.1.0"` +- Python package: `json2xml==7.1.1` +- Rust accelerator: `json2xml-rs==0.6.0` (unchanged) +- Fast install: `pip install "json2xml[fast]==7.1.1"` ## Verification -The release passed Ruff, ty, 650 Python tests with 100% statement coverage, Rust formatting, Clippy with warnings denied, 47 Rust unit tests, package builds, Twine metadata checks, an isolated fast-install smoke test, and the hosted Python and Rust compatibility matrices. +The release passed Ruff, ty 0.0.83, and 658 Python tests with 100% statement coverage on CPython and PyPy 3.10. No Rust sources changed. # json2xml_rs 0.6.0 diff --git a/json2xml/__init__.py b/json2xml/__init__.py index 55a3d4f..fbfb3ff 100644 --- a/json2xml/__init__.py +++ b/json2xml/__init__.py @@ -2,4 +2,4 @@ __author__ = """Vinit Kumar""" __email__ = "mail@vinitkumar.me" -__version__ = "7.1.0" +__version__ = "7.1.1" diff --git a/pyproject.toml b/pyproject.toml index c983727..e63405e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "json2xml" -version = "7.1.0" +version = "7.1.1" description = "Simple Python Library to convert JSON to XML" readme = "README.rst" requires-python = ">=3.10" diff --git a/uv.lock b/uv.lock index d39d34a..059c3f3 100644 --- a/uv.lock +++ b/uv.lock @@ -185,7 +185,7 @@ wheels = [ [[package]] name = "json2xml" -version = "7.1.0" +version = "7.1.1" source = { editable = "." } dependencies = [ { name = "defusedxml" }, From bb2f800a6511822784f8eca2e25cef4243fde4df Mon Sep 17 00:00:00 2001 From: Vinit Kumar Date: Wed, 23 Sep 2026 12:29:07 +0530 Subject: [PATCH 2/2] Keep the 7.1.0 entry in RELEASE_NOTES.md --- RELEASE_NOTES.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index f8f06ea..2551df0 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -24,6 +24,37 @@ Released 2026-09-23. The release passed Ruff, ty 0.0.83, and 658 Python tests with 100% statement coverage on CPython and PyPy 3.10. No Rust sources changed. +# json2xml 7.1.0 + +Released 2026-09-03. + +## Highlights + +- Enforces conversion depth and item limits inside the native payload walk when `json2xml-rs>=0.6.0` is installed, so the accelerated path no longer pays for a second Python-level traversal. A 2,000-record conversion drops from 7.1 ms to 1.4 ms. +- Keeps tuples on the Python serializer, closing the last known case where the two backends rendered the same payload differently. +- Writes identical CLI output to stdout and `--output` files: UTF-8 bytes ending in exactly one newline. +- Accepts numbers and other scalars in `dicttoxml_fast.escape_xml` and `wrap_cdata` whichever backend is active, and raises `InvalidDataError` from `Json2xml.to_xml` for every value the serializer rejects. +- Loads the optional Rust backend through one tested function that also keeps working with `json2xml-rs` 0.5.0. + +## Behaviour changes and migration guidance + +- Files written with `--output` now end with a single newline, matching stdout. Stdout is written as UTF-8 bytes regardless of the console encoding. +- `readfromjson` raises `JSONReadError("Could not read JSON file")` when the file cannot be opened; only parse failures keep the `Invalid JSON File` message. +- `Json2xml.to_xml` raises `InvalidDataError` instead of `TypeError` for unsupported values such as a Mapping that is not a dict. +- `json2xml.backend_selector.ConversionRequest` and `has_special_keys` are removed. Use `json2xml.dicttoxml.SerializerConfig`, which the selector now shares with the serializer, and `rust_renders_identically` for the payload gate. +- `json2xml_rs.dicttoxml` called directly with tuples, sets, iterators, or arbitrary objects raises `TypeError` in 0.6.0; the `json2xml` wrapper routes such payloads to Python as before. + +## Package Versions + +- Python package: `json2xml==7.1.0` +- Rust accelerator: `json2xml-rs==0.6.0` +- Fast install: `pip install "json2xml[fast]==7.1.0"` + +## Verification + +The release passed Ruff, ty, 650 Python tests with 100% statement coverage, Rust formatting, Clippy with warnings denied, 47 Rust unit tests, package builds, Twine metadata checks, an isolated fast-install smoke test, and the hosted Python and Rust compatibility matrices. + + # json2xml_rs 0.6.0 Released 2026-09-03.