fix(saves): an old save that could not be deleted can still be read #2318
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2318
Loading…
Reference in a new issue
No description provided.
Delete branch "pepe999/Longshot:fix/saves-leftover-readable"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
After an import,
scripts/longshot_saves.pydeletes the save that was there. Where a delete is refused, it sets the file or folder writable and tries once more; what still can't be deleted stays, and the message says "delete it by hand". It setS_IWRITEalone, which on Linux is mode 0200: the folder left can't be listed, read or deleted by hand any more, and neither can the player's old save in it.Now write is added to the mode it has. On Windows nothing changes: only the read-only bit is looked at there.
On
main:test_old_save_that_cannot_be_deletedwith the new lines. It did not see this before: it skips a folder it can't enter, and as root, as in CI, everything can be read.How often a player meets it isn't known: on Linux a delete is refused for an immutable file or a network folder, not for a read-only file. The save imported and its backup are not affected.
Testing
Tested: Linux, no game run (the game doesn't run this script).
tests/test_longshot_saves.pywith the new lines fails onmain("slot_00": no read in its mode) and passes here, with Python 3.12 and 3.15.tests/run_all.py --strictas a user who isn't root, in a container set up asci.yml's job: 937 passed, 2 failed, 18 skipped; the 2 fail onmaintoo (test_dev_packs, test_pipeline_state_computes: #2311).Still to test: None.
Measurements
Nothing to measure: the mode given to a file whose delete was refused.
Risks
None known: a delete refused for the read-only bit on Windows still has it cleared (
test_read_only_file_in_the_old_save). A revert is enough.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
mainand passes here.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
WIP: fix(saves): an old save that could not be deleted can still be readto fix(saves): an old save that could not be deleted can still be read