A xdg-mime query will read .config/mimeapps.list first (https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-mime.in?id=ef8a58be4049697bb6347c3c5b8fff4d2b2deb86#n397). But setting a default application will write to .local/share/applications/mimeapps.list (https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-mime.in#n244). This way one can't change the default application, if .config/mimeapps.list was created by some means. Also, xdg-mime will fail with returncode 4 in that case, which isn't very descriptive.
Created attachment 123476 [details] [review] Fixes make_default_generic to write to the non deprecated generic path
Created attachment 123477 [details] Minimal test case, part 1
Created attachment 123478 [details] Minimal test case, part 2
Thanks, I'll review and commit soon.
Committed: https://cgit.freedesktop.org/xdg/xdg-utils/commit/?id=9dac27a442b0e44b3f235798b77715e26169500f Thanks!
*** Bug 99106 has been marked as a duplicate of this bug. ***
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.