fix(dfm): handle non-directory entries in ~/.config scan#95
Merged
Conversation
scan_dotfiles called _find_config_file before verifying the path was a directory, so a regular file at ~/.config/<name> (e.g. mimeapps.list) caused os.listdir to raise NotADirectoryError and crash window init. Reorder the check so _find_config_file only runs on directories, and harden _find_config_file itself against NotADirectoryError / FileNotFoundError as defense in depth.
3 tasks
VictorGSchneider
added a commit
that referenced
this pull request
May 16, 2026
Follow-up to #95. Two more warnings observed when launching `dfm`: ``` Adwaita-WARNING: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported. Please use AdwStyleManager:color-scheme instead. Gtk-WARNING: Failed to set text 'Notes & Tags' from markup due to error parsing markup: Entity did not end with a semicolon... Gtk-WARNING: Failed to set text 'Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)' from markup due to error parsing markup... ``` ## Commits ### `fix(dfm): escape Pango markup in row titles from config comments` `Adw.PreferencesRow` titles and subtitles are parsed as Pango markup, so config keys/comments containing `&` or `<` (e.g. the oh-my-zsh `.zshrc` comment "Caution: ... in zsh < 5.7.1") triggered repeated `Failed to set text from markup` Gtk warnings on every row redraw. - Run `field.key` and `field.comment` through `GLib.markup_escape_text` before passing them to `Adw.SwitchRow` / `Adw.ActionRow` in `window_config_page_fields.py`. Single escape point in `create_field_row` covers every field type (toggle, slider, color, number, path, keybind, font, text). - Fix the literal `'Notes & Tags'` group title to `'Notes & Tags'` in `window_config_page_sections.py`. ### `fix(theme): drop deprecated prefer-dark-theme from gtk-4.0 settings` libadwaita ignores `gtk-application-prefer-dark-theme` and prints `Adwaita-WARNING: Using GtkSettings:gtk-application-prefer-dark-theme with libadwaita is unsupported` on every GTK4 app launch. Dark mode for GTK4 / libadwaita is already driven by the gsettings key `org.gnome.desktop.interface color-scheme = 'prefer-dark'`, which `theme/pacman-hooks/stoa-theme-enforce` sets (line 44). So removing the deprecated line is a no-op for visual behaviour and silences the warning. Kept in `theme/gtk-3.0/settings.ini` — the key is still valid for GTK3. ## Test plan - [x] `python3 -m py_compile` on the touched DFM modules. - [x] Inspected the diff against current `main` (post-#95 merge). - [ ] Manual: launch `dfm` after `git pull` — the three warnings above should be gone. (Run `sudo /usr/local/bin/stoa-theme-enforce` once if `gsettings get org.gnome.desktop.interface color-scheme` doesn't already return `'prefer-dark'`.) --- _Generated by [Claude Code](https://claude.ai/code/session_01E7fz8T8EWW7toDHo3UmAwG)_
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.
scan_dotfiles called _find_config_file before verifying the path was a directory, so a regular file at ~/.config/ (e.g. mimeapps.list) caused os.listdir to raise NotADirectoryError and crash window init.
Reorder the check so _find_config_file only runs on directories, and harden _find_config_file itself against NotADirectoryError / FileNotFoundError as defense in depth.