Skip to content

Honor custom encoders when exporting TOML front matter - #148

Closed
00200200 wants to merge 1 commit into
eyeseast:mainfrom
00200200:codex/honor-toml-export-encoder
Closed

00200200 wants to merge 1 commit into
eyeseast:mainfrom
00200200:codex/honor-toml-export-encoder

Conversation

@00200200

Copy link
Copy Markdown

TOMLHandler.export accepts keyword options but drops them before calling toml.dumps. As a result, passing TomlPathlibEncoder still writes values such as PurePosixPath('assets/logo.svg') into metadata instead of the intended path string. Forward the export options to toml.dumps, matching the YAML and JSON handlers.

Tests cover direct handler export and post round trips with POSIX and Windows path values. The direct export assertion and both round-trip cases fail before the fix. With the fix, all 69 tests and 2 subtests pass using the CI pytest command with doctests, Python 3.12.11, toml 0.10.2 and pyaml 26.7.0. Mypy passes all 4 source files. Local testing was on macOS; the full Python/OS matrix has not been run.

Prepared with OpenAI Codex assistance.

@00200200

Copy link
Copy Markdown
Author

I'm withdrawing this small, unsolicited TOML encoder change while reducing my open PR backlog. The branch is retained; this is not a claim that the underlying behavior is already fixed.

@00200200 00200200 closed this Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant