Open rmartin16 opened 5 days ago
This would remove the need to give flatpaks whole file system access, making it a lot more secure.
FWIW: The primary reason for avoiding a platformdirs dependency was that platformdirs didn't have any support for iOS or Android - and it was problematic to submit patches for those platforms, because iOS and Android weren't officially supported platforms.
Now that isn't the case, adding a platformdirs dependency would make more sense (assuming patches upstream have been submitted and accepted).
However, this bug notwithstanding, we've essentially got an implementation of platformdirs functionality, so I'm not sure we gain much by replacing a (mostly) working implementation with an external dependency.
So - my inclination would be to add the handling necessary to honour XDG variables natively to Toga, and leave it at that.
It may also be worth evaluating the situation on Windows; it can be a bit more complicated than even the XDG environment variables on Linux since the Windows registry is involved as well....and Windows is likely more relevant to enterprise.
Describe the bug
Toga makes assumptions about which file paths to use for
toga.Paths
; this can conflict with local machine configuration that should affect arbitrary application storage. For instance, on GTK, if I configure my XDG env vars to something other than the default values, then Toga will ignore this.Steps to reproduce
For the system, configure application storage with values other than the default and run a Toga app that creates filesystem content.
Expected behavior
Toga should respect local machine configuration for application storage. Given this configuration can be complex on any given platform, the
platformdirs
package provides nice abstractions. In the least, their logic should be used on Desktop, I think. Outside of Linux distros going rogue....this is also probably important for enterprise environments where IT wants apps to work in a certain way.Screenshots
No response
Environment
Logs
No response
Additional context
I see that https://github.com/beeware/toga/pull/1964 confirms the same default behavior as
platformdirs
....but it seemed to have been a foregone conclusion thatplatformdirs
would not become a dependency for Toga.