Skip to content

fix(screen): use an existing screen folder only when its bytes are equal - #2712

Draft
KartikP wants to merge 2 commits into
unified-model-interface-v2from
fix/screen-folder-equal-bytes
Draft

KartikP wants to merge 2 commits into
unified-model-interface-v2from
fix/screen-folder-equal-bytes

Conversation

@KartikP

@KartikP KartikP commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

When the move of a new screen folder fails because the folder is there, the existing folder was used when every file name was present, also when its bytes came from an older conversion. Now the existing folder is used only when each new file is equal in bytes to the file of the same name there (`filecmp.cmp(..., shallow=False)`). Else the old folder is moved aside, the new folder is moved in, and the old one is removed.

  • A half-written folder fails the same compare, so the separate pre-check and its limit sentence are deleted.
  • The work folder is removed on every path, also when an error is raised.
  • Folder name, file names and bytes of a normal run do not change.

Tests: a new case (a folder with every name and other bytes gives the new bytes; it failed on the old code with the old bytes); the two-writer test starts each round from no folder.

A folder with every name but other bytes (an older conversion) was used. The
new folder now takes its place; a half-written folder fails the same compare,
so the separate pre-check is gone. The work folder is removed on every path.

This branch has not been deployed

No deployments
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