Open LucidOne opened 5 years ago
I'd appreciate that, too.
@pmiddend #123 is working on it, but there's a design issue.
Hmm. Path
does not implement str
, so having functions that return different types in different environments (as #123 does) would be real rough on compatibility and type checking (e.g. #75).
My inclination would be to add a new parallel interface. So for anyone doing from appdirs import import AppDirs
it'll keep working like it always has, and people who want Paths can do from appdirs.paths import AppPaths
or somesuch.
The stinker is, when writing code to provide both Path
and string version of things, it's usually easier and safer to start with the Path
version and then convert to string when necessary, instead of doing most of the path building old string-manipulation style. But this library is quite careful about always using the os.path
functions and the inputs are going to be hard-coded values from the application instead of scary user input, so it's probably fine to build strings and convert.
[…keturn does some experiments…]
Wait, what?
pathlib.Path
does not throw InsecurePath
if you do something like user_state_dir().joinpath('saves', '/etc/passwd')
?
HECK okay fine forget anything I said about "safety." Carry on!
Any thoughts on pathlib support?