Repository navigation
fix: name a directory given to Project.save or Project.load - #79
Conversation
Project.save onto an existing directory raised PermissionError (WinError 5) from the final os.replace on Windows, after writing its temporary file, and Project.load raised PermissionError there too; other platforms raise IsADirectoryError. Both now check the path first and raise IsADirectoryError naming it and the method, on every platform, before anything is written. Signed-off-by: Jae Hoon Seo <jaehoon.seo@inha.ac.kr>
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
📖 1 file modified Preview · build overview · CableXSec · built Dec. 2, 2026, 7:03 p.m. UTC |
Problem
Project.savegiven an existing directory wrote its temporary file and then failed inos.replacewithPermissionError: [WinError 5] Access is deniedon Windows.Project.loadgiven a directory also raisedPermissionErroron Windows. Linux and macOS raiseIsADirectoryError, so the same mistake gave a different, unhelpful error depending on the platform.Change
A private helper,
_not_a_directory, checks the path before anything is written or read. It raisesIsADirectoryError(errno.EISDIR) naming the method and the path:Project.saveandProject.loadcall it first. A missing file still raises the nativeFileNotFoundError, as before.Tests
test_save_and_load_name_a_directory_on_every_platform: both methods raiseIsADirectoryErrorwith the named message, nothing is written into the directory, and no temporary file is left behind.tests/test_project.pyandtests/test_project_v2.py: 105 passed locally (Windows, Python 3.11).ruff check,ruff format --checkandmypypass.