Repository navigation
fix(corekit): let Windows reopen SeekableReader's buffer file (#2098) - #2105
Merged
Merged
Conversation
With buffer_save and no buffer_path the reader made a NamedTemporaryFile and read it back by name, which Windows refuses while it is open. The file is now made with mkstemp and removed on close, or by a weakref.finalize at collection; a caller's buffer_path is never removed.
Owner
Author
|
GOOD TO GO at
|
Owner
Author
|
Ready to merge at
This closes #2098. |
Contributor
|
Coverage: 91.53% (unit tier, Python 3.15,
Per-file detail: the |
This was referenced Oct 23, 2026
fix(protocols): convert capture timestamps without the platform's fromtimestamp limits (#2099)
#2111
Merged
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.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— bug fixesDescription of your pull request and other information
Closes #2098. With
buffer_save=Trueand nobuffer_path,SeekableReadercreated aNamedTemporaryFileand later reopened it by name inread/read1/readline/peek. Windows refuses that while the file is open, so--buffer-savefailed withPermissionError: [Errno 13].mkstemp, andclose()closes and deletes it. Aweakref.finalizedeletes it if the reader is collected unclosed. A caller-givenbuffer_pathis never deleted, and a failed open releases both the descriptor and the file.test_io_buffer_save_tempfile_2098_unitmakes a second open of an openNamedTemporaryFileraise, as Windows does. Without the fix it raisesPermissionError: [Errno 13]. The test also pins that the temp file is gone afterclose(), after collection and after anExtractor(buffer_save=True)run, and that a caller'sbuffer_pathsurvives.tests/corekit/test_io.pypasses.