Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multipath cannot work for path #259

Open
Freed-Wu opened this issue Jan 29, 2024 · 5 comments
Open

multipath cannot work for path #259

Freed-Wu opened this issue Jan 29, 2024 · 5 comments

Comments

@Freed-Wu
Copy link
Contributor

export XDG_DATA_DIRS=/usr/share:/usr/local/share
❯ ptpython
In [1]: from platformdirs import site_data_path
In [2]: site_data_path(multipath=True)
PosixPath('/usr/share')

Why not

In [2]: site_data_path(multipath=True)
[PosixPath('/usr/share'), PosixPath('/usr/local/share')]

Related issue: NixOS/nixpkgs#282076

@Sachaa-Thanasius
Copy link

site_data_path is explicitly documented as returning only one path, even with multipath passed in as True. Have you considered using site_data_dir(multipath=True) for your use case?

@Freed-Wu
Copy link
Contributor Author

Freed-Wu commented Feb 9, 2024

Now I use [Path(dir) for dir in site_data_dir(multipath=True).split(":")]

site_data_path is explicitly documented as returning only one path

Why it cannot return multi paths?

@Sachaa-Thanasius
Copy link

Sachaa-Thanasius commented Feb 10, 2024

As a bystander, I can't speak for the developers of this library, but if I had to guess? It might be an established convention in the library for *_path methods to return a single path, even on Unix systems, even with multipath given. If that's strange, consider a more explicit feature/bugfix request and maybe a PR.

@Freed-Wu
Copy link
Contributor Author

If that's strange

So is it a bug need to be fixed or a correct feature which will not be changed?

@Sachaa-Thanasius
Copy link

I would personally consider this a known API feature, but I’m not you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants