Repository navigation
Conversation
The parser advanced two characters before checking that an escape character was present, so a trailing backslash was reported one position past EOF.
af6c2f9 to
c70b6e8
Compare
The unfinished-escape path no longer falls through to the unknown-escape branch, so that branch had no test and coverage dropped below 100%.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #314 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 4 4
Lines 535 537 +2
Branches 100 101 +1
=========================================
+ Hits 535 537 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Python 3.14 lists _types in the standard library, so flake8-builtins A005 fails on src/tomli/_types.py. That file is a private submodule and does not replace the stdlib module.
2026-10-05: resolve the configuration conflict without changing the escape-position fix.
|
I put together a small test-only commit on top of It adds six subcases: LF and CRLF inputs, each with a Unicode character in a basic string, multiline basic string, or quoted key. They check the normalized On Python 3.14.4 with the checked-in pure Python source, all six passed on this PR's head. The same method on base Only one test method is added; no parser changes. I haven't run the full suite, coverage, Black/pre-commit, type checks, compiled wheels, or the Python/platform matrix. One small suggestion: keep these combined Unicode/newline cases with whichever position convention is ultimately chosen. They help catch accidental mixing of raw input offsets with normalized character coordinates. |
|
Added your test-only commit 5bd41ff unchanged, preserving your authorship. I reran the six subcases with CPython 3.12.2: all six fail against base |
Fixes #312
An unfinished basic-string escape at the end of the document was reported one character past EOF.
parse_basic_str_escapealways advanced by two before noticing that no escape character remained, and that index was stored onTOMLDecodeError.The error is now raised at the backslash itself, which is inside the document. The same path covers basic strings, multiline basic strings, and quoted keys.
The regression coverage also checks LF and CRLF documents containing a Unicode character before the unfinished escape, across basic strings, multiline basic strings, and quoted keys. It verifies the normalized document, character position, line, and column together. The test-only addition is @carlitogwapito's original commit, preserved with its authorship.
Validation on Windows, CPython 3.12.2, using the pure-Python source:
python -m unittest: 21 test methods, 20 passed and the existing Python 3.15+ lazy-import test skipped.8479ed2902bafb7be7ac5f4431d42201ea640361and pass at5bd41ff6228a30bcbe28be49a1cd84970c41a9a0. The existing line/column control passes on both sources.