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

Use pathlib instead of beets's path handling #96

Merged
merged 1 commit into from
Aug 17, 2024
Merged

Conversation

geigerzaehler
Copy link
Owner

Internally, all paths are represented by Path instances instead of bytes. When we pass paths to beets code (Item.write, beets.art.embed_item) we explicitly convert it to bytes.

We replace the following beets utility functions with standard library versions that handle Paths.

  • beets.util.mkdirall -> Path.mkdir
  • beets.util.link -> Path.symlink_to
  • beets.util.copy -> shutil.copfyile
  • beets.util.samefile -> Path.__eq__

@geigerzaehler geigerzaehler marked this pull request as ready for review July 11, 2024 09:54
Internally, all paths are represented by `Path` instances instead of
`bytes`. When we pass paths to beets code (`Item.write`,
`beets.art.embed_item`) we explicitly convert it to `bytes`.

We replace the following beets utility functions with standard library
versions that handle `Path`s.

- `beets.util.mkdirall` -> `Path.mkdir`
- `beets.util.link` -> `Path.symlink_to`
- `beets.util.copy` -> `shutil.copfyile`
- `beets.util.samefile` -> `Path.__eq__ `
@geigerzaehler geigerzaehler merged commit 4effed8 into main Aug 17, 2024
11 of 13 checks passed
@geigerzaehler geigerzaehler deleted the unicode-path branch August 17, 2024 09:04
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

Successfully merging this pull request may close these issues.

1 participant