Repository navigation
core: skip unreadable KDE config entries during save - #563
Merged
vikdevelop merged 1 commit intoNov 11, 2026
Merged
Conversation
Owner
|
Thank you for your contribution! |
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.
What
When saving KDE configuration, a single unreadable entry no longer aborts the whole backup: the entry is reported and skipped, and the remaining directories are still copied.
Why
On Kubuntu 26.10, saving fails with
shutil.Error ... [Errno 13] Permission deniedas soon as anyk*entry under~/.configor~/.local/sharecannot be read. In the report this is~/.config/kudu, a Chromium-based app whose storage files are locked while the app is running. The user gets no backup at all instead of a backup missing one file. Fixes #562.Reproduction
With a temporary HOME containing
~/.config/kudu/locked.db, keep that file open so reads fail (Linux:chmod 000,errno 13; Windows: exclusive open,WinError 32), then callSave.save_kde_config_data_dirs():This is the same
shutil.Errorraised in the issue's traceback. After the patch the same run prints:Root cause
src/core/de_config.py:346and:348calledshutil.copytree/shutil.copy2directly. Every other save path in this module goes through thesafe_copytree/safe_copyhelpers defined at the top of the file (28 call sites), whose contract is to log[ERR]and continue. This KDE-specific helper (added in 36876fd) missed the wrappers, so an unreadable entry propagates out ofSave.__init__and aborts the entire save.Verification
tests/test_kde_config_save.py(stdlibunittest, no new dependency):4689e84:python -m unittest discover -v→FAILED (errors=1),shutil.Error: ... locked.dbRan 3 tests ... OKpython -m compileall -q src+python -m unittest discover -vrun twice, both green.~/.local/share, dangling symlink. Save completes in all cases.kdeconnectexclusion and "nok*entries" behavior are covered by tests.Risk
[ERR]line is logged. This matches how the rest of the save pipeline already handles unreadable directories.k*entries now usesafe_copytree, which preserves symlinks (symlinks=True) instead of dereferencing them, consistent with the other directory copies inSave. I can keep the previous dereferencing behavior if that is preferred.shutil.rmtree) is unchanged.