question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Returning `Path` instead of `str` instances

See original GitHub issue

As mentioned in https://github.com/ActiveState/appdirs/issues/79, I’ve been working on another fork of appdirs, but would rather hold off on publishing that and focus all efforts in one place.

I mostly have two changes in places:

  • Drop support for ancient python versions (there’s little point in a new library supporting Pythons that re long past their EOL, and that just holds back on keeping the library alive).
  • Change the return type of directories to Path instance, to make usage on consumer libraries easier. This kinda means it’s not a 100% drop-in replacement, but rather an upgrade (e.g.: like a major).

Maybe it would make sense to have a platformdirs==1.0.0 release, which is functionally identical to appdirs (to allow seamless switching), and then start merging in any non-backwards-compatible changes. Thoughts?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:23 (22 by maintainers)

github_iconTop GitHub Comments

3reactions
gaborbernatcommented, Jul 22, 2021
user_data_path
user_config_path
user_cache_path
user_state_path
user_log_path
site_data_path
site_config_path

And yes.

1reaction
gaborbernatcommented, Jul 23, 2021

Done by #27.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Convert a str to path type? - python - Stack Overflow
The code is expecting that the file path is returned from a pygtk browser window (via another function). I want to call the...
Read more >
click.Path returns str, not pathlib.Path · Issue #405 · pallets/click
We just add click.PATH and use it in examples instead of click.Path , therefore encouraging click.PATH without breaking changes. This would be less ......
Read more >
Path Operations - Essential Java Classes - Oracle Help Center
If the Path is relative, it returns an absolute path. If the Path contains any redundant elements, it returns a path with those...
Read more >
Best Practice: Working with Paths in Python - Part 1 - b.telligent
Solution 1 – the hideous variant. Simply avoid the Windows separator and instead write the path using Linux separators only: path_dir: str = ......
Read more >
pathlib — Object-oriented filesystem paths — Python 3.11.1 ...
Pure paths are useful in some special cases; for example: ... PathLike interface which returns a string, or another path object:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found