Skip to content

Commit a0b15eb

Browse files
frostmingclaude
andauthored
chore: release 0.15.2 (#668)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 18e7f98 commit a0b15eb

4 files changed

Lines changed: 1689 additions & 4 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,34 @@
22

33
## [Unreleased]
44

5+
## [0.15.2] - 2026-10-16
6+
7+
### Changed
8+
9+
- Write the ESC control character as `\u001b` instead of `\e`, which is only valid in TOML 1.1, so the output stays readable by TOML 1.0 parsers such as `tomllib`. ([#641](https://github.com/python-poetry/tomlkit/pull/641))
10+
- `key_value()` now raises `UnexpectedCharError` on anything other than whitespace or a comment after the pair, instead of silently discarding it (e.g. `key_value("a = 1 b = 2")`), matching `parse()`. ([#594](https://github.com/python-poetry/tomlkit/pull/594))
11+
- `integer()` given a string now validates it against the TOML integer grammar and keeps the original text, so grouping underscores (e.g. `integer("1_000")`) survive `dumps()`; strings that are not valid TOML integers (e.g. `"010"`) now raise `ValueError`. ([#336](https://github.com/python-poetry/tomlkit/issues/336))
12+
- Add a `fold` argument to `DateTime` and `Time`, mirroring the stdlib, and carry `fold` through `item()`, arithmetic (including datetime subtraction) and `unwrap()`, so a folded local time no longer converts an hour off. ([#619](https://github.com/python-poetry/tomlkit/issues/619), [#623](https://github.com/python-poetry/tomlkit/pull/623), [#626](https://github.com/python-poetry/tomlkit/pull/626))
13+
- Declare the project metadata in the PEP 621 `[project]` table; building from source now requires `poetry-core>=2.2.0`. ([#607](https://github.com/python-poetry/tomlkit/pull/607), [#609](https://github.com/python-poetry/tomlkit/pull/609))
14+
515
### Fixed
616

717
- Fix valid TOML being rejected when an out-of-order table reopens an implicit super-table with a dotted key: `[a.b.c]` then `[a]` with `b.z = 1` extends the implicit `a.b` super-table rather than redefining it (stdlib `tomllib` accepts it), so it now parses and round-trips instead of raising `Redefinition of an existing table`. The concrete-table case (`[a.b]` then `[a]` `b.z = 1`) stays rejected. ([#565](https://github.com/python-poetry/tomlkit/pull/565))
18+
- Fix uppercase `E` exponent after a leading-zero mantissa (e.g. `0E2`) being rejected as an invalid number while `0e2` parsed fine. ([#586](https://github.com/python-poetry/tomlkit/pull/586))
19+
- Fix non-lowercase special floats (e.g. `Inf`, `NaN`, `-INF`) being accepted; TOML only allows lowercase `inf` and `nan`, so they now raise `ParseError`. ([#628](https://github.com/python-poetry/tomlkit/pull/628))
20+
- Fix parse errors reporting the wrong line and column in documents with CRLF or mixed line endings. ([#642](https://github.com/python-poetry/tomlkit/pull/642))
21+
- Fix `item()` reordering the keys of an inline table (dict-valued keys were forced last) under the default `sort_keys=False`. ([#546](https://github.com/python-poetry/tomlkit/issues/546))
22+
- Fix `unwrap()` moving a key to the end after its value was replaced (e.g. `doc["b"] = 9`), while `dumps()` and `keys()` kept the original order. ([#591](https://github.com/python-poetry/tomlkit/pull/591))
823
- Fix appending a key to a parsed inline table that uses `", "` separators emitting a bare `","` for the new entry, leaving the table inconsistently spaced (e.g. `{x = 1, y = 2,z = 3}`). ([#595](https://github.com/python-poetry/tomlkit/pull/595))
24+
- Fix an emptied array of tables being dropped from the output: it now renders as `key = []`, placed and keyed relative to the nearest table header so it parses back into the same table. ([#567](https://github.com/python-poetry/tomlkit/pull/567))
25+
- Fix a single-line array whose last element is a trailing comment (e.g. from `add_line(value, comment=...)`) rendering its closing `]` on the comment line, producing unparseable output. ([#580](https://github.com/python-poetry/tomlkit/issues/580))
26+
- Fix `del array[start:stop:step]` with a negative or omitted bound removing the wrong elements from the rendered output. ([#599](https://github.com/python-poetry/tomlkit/pull/599))
27+
- Fix array slice assignment mutating the array before raising `ValueError("slice assignment is not supported")`. ([#600](https://github.com/python-poetry/tomlkit/pull/600))
28+
- Fix `String.__add__` splicing the appended text into a basic string without escaping it, so appending a quote or backslash produced invalid TOML. ([#612](https://github.com/python-poetry/tomlkit/pull/612))
29+
- Fix a bare carriage return in a multiline string producing invalid TOML: it is now escaped as `\r` in a multiline basic string and rejected with `InvalidStringError` in a multiline literal string; CRLF line endings are left intact. ([#539](https://github.com/python-poetry/tomlkit/pull/539))
30+
- Fix a tz-aware `datetime.time` rendering with a UTC offset (e.g. `07:32:00+02:00`), which TOML local times do not allow; it now renders as a local time. ([#613](https://github.com/python-poetry/tomlkit/pull/613))
31+
- Fix arithmetic on a signed float producing `+-0.0` (e.g. `-1.5` times `0`), which does not parse. ([#629](https://github.com/python-poetry/tomlkit/pull/629))
32+
- Fix two `Bool` items never comparing equal to each other; they now compare by value. ([#660](https://github.com/python-poetry/tomlkit/pull/660))
933

1034
## [0.15.1] - 2026-07-17
1135

@@ -33,7 +57,6 @@
3357
- Fix invalid serialization with a duplicated comma when appending or inserting into a comma-first formatted array. ([#499](https://github.com/python-poetry/tomlkit/pull/499))
3458
- Fix `ParseError` when a sub-table extends the last element of an array of tables after an unrelated table. ([#261](https://github.com/python-poetry/tomlkit/issues/261))
3559
- Fix unparseable serialization when adding a key to a dotted-key table inside an inline table. ([#500](https://github.com/python-poetry/tomlkit/pull/500))
36-
- Fix `item()` reordering the keys of an inline table (dict-valued keys were forced last) under the default `sort_keys=False`. ([#546](https://github.com/python-poetry/tomlkit/issues/546))
3760
- Fix a table replaced by a plain value being serialized inside the preceding table's body when other tables follow; the value now moves before the first table like other root-level values. ([#504](https://github.com/python-poetry/tomlkit/issues/504))
3861
- Fix assigning a table over a dotted key (e.g. `doc["a"] = {...}` where `a` came from `a.b = ...`): the dotted prefix was duplicated onto the new `[a]` header, and the header then swallowed any sibling that follows it on round-trip. The replacement now renders as a plain table and, when needed, moves before the inline entries (values and dotted keys) it would otherwise capture. ([#513](https://github.com/python-poetry/tomlkit/issues/513), [#524](https://github.com/python-poetry/tomlkit/issues/524))
3962
- Restore `dumps()` rendering mapping-like wrappers around a parsed document (e.g. `dotty_dict`'s `Dotty`) through their delegated `as_string`, preserving the original table order and layout instead of re-encoding through a plain dict — a 0.15.0 regression. ([#482](https://github.com/python-poetry/tomlkit/issues/482))
@@ -510,7 +533,8 @@
510533
- Fixed handling of super tables with different sections.
511534
- Fixed raw strings escaping.
512535

513-
[unreleased]: https://github.com/python-poetry/tomlkit/compare/0.15.1...master
536+
[unreleased]: https://github.com/python-poetry/tomlkit/compare/0.15.2...master
537+
[0.15.2]: https://github.com/python-poetry/tomlkit/releases/tag/0.15.2
514538
[0.15.1]: https://github.com/python-poetry/tomlkit/releases/tag/0.15.1
515539
[0.15.0]: https://github.com/python-poetry/tomlkit/releases/tag/0.15.0
516540
[0.14.0]: https://github.com/python-poetry/tomlkit/releases/tag/0.14.0

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "tomlkit"
3-
version = "0.15.1"
3+
version = "0.15.2"
44
description = "Style preserving TOML library"
55
authors = [
66
{ name = "Sébastien Eustace", email = "[email protected]" },

‎tomlkit/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from tomlkit.api import ws
2828

2929

30-
__version__ = "0.15.1"
30+
__version__ = "0.15.2"
3131
__all__ = [
3232
"TOMLDocument",
3333
"aot",

0 commit comments

Comments
 (0)