Repository navigation
Fix six review defects in parsing, export and job handling - #1
Merged
Merged
Conversation
- Measure pasted text by UTF-8 bytes, not characters, before parsing it on the GUI thread, so multibyte input over 10 MiB moves to a worker. - Give each DiskRows iteration its own read offset so concurrent or nested iterations no longer corrupt each other, and release the temporary file through close(), a with block or weakref.finalize instead of __del__. - Decide numeric cells by significant digits of the value, so 1e16 and 10000000000000000 both become numbers while 16+ digit values stay text. - Turn OS errors while saving into ConversionError subclasses that keep errno, winerror and filename; a file held open by Excel reports "locked" and is still a PermissionError for existing callers. - Add a Cancel button and a quit confirmation for running jobs. Jobs stop at checkpoints without changing the destination, and each export works in its own scratch folder; the next export to the same folder removes any that a crash or forced exit left behind. - Pad every ODS row to the sheet width and declare its columns. Verified on Windows 10 with Python 3.14.7: 36 unit tests (16 existing unchanged, 20 new), verify_formats.py, the --smoke-check, a PyInstaller build run from a clean folder, read-back of every export in Excel 16, saving over a workbook open in Excel, forced termination during saves, and the real window driven on screen for cancel and quit. Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes six defects found in a multi-model review of 0.2.0. External APIs are unchanged, and the 16 existing tests in
test_converter.pypass without edits.Changes
EDITOR_THRESHOLD(10 MiB) by character count, so up to ~30 MB of Korean text parsed on the GUI threadexceeds_editor_limit()measures UTF-8 bytes; used byapp.pyandparse_tableDiskRows.__iter__calledseek(0)on a shared handle, so concurrent or nested iterations corrupted each other; cleanup relied on__del__close(),with,weakref.finalize, andTable.close()1e16became a number while10000000000000000stayed textDecimal.normalize()rounding)PermissionErrorExportPermissionError(codelocked) is both aConversionErrorand aPermissionError, keeping errno, winerror, filename and the cause; short retries for transient lockscloseEventsilently ignored closes during jobs;delete=Falsetemp files survived a killed process.tablyfern-*.partialfolder that the next export to the same folder removes if a crash left itVerification
Windows 10, Python 3.14.7, Excel 16 (build 20326), synthetic samples only.
python -m unittest discover: 36 tests (16 existing + 20 new intest_regressions.py)verify_formats.py: 182 verified exports, 5 batch formats, same asmainapp.py --smoke-checkandscripts/build.py(frozen smoke check, ZIP SHA256); the ZIP also ran from a fresh folder with no Python on PATHmainraisesPermissionError(WinError 5); this branch reportslocked, leaves the file unchanged and leaves no temp filesmainleaves 28 to 92 MB temp files permanently; this branch leaves a.partialfolder that the next save removesNotes for review
mainfor about 0.53 s on this PC, below the 5 s Windows needs to show "Not Responding". This branch keeps the longest freeze under about 0.15 s, but large pastes now spool to disk, so that preview takes about 1.5 s instead of 0.5 s.10000000000000000now export as numeric cells (1E+16in Excel) instead of text.🤖 Generated with Claude Code