beetbox / beetbox/beets

Remove legacy byte-path compatibility helpers

Open
#6,973 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

Part of: #1409

Depends on: all #6809 child issues and the `prune_dirs` Path-only cleanup.

## Problem

`displayable_path`, `bytestring_path`, `syspath`, and broad `os.fsdecode` usage exist to support the old byte-path model. Once runtime APIs use `Path` and SQL encoding is private to the database boundary, these helpers become misleading compatibility surface area.

## Expected behavior

- Remove `displayable_path`, `bytestring_path`, and `syspath` from `beets.util`.
- Replace user-facing path formatting with normal string formatting of `Path` values.
- Replace filesystem calls with `Path` methods or standard library calls that accept `Path`.
- Keep byte decoding only where the input is genuinely byte data from SQL, persisted state, or an external binary API.
- Preserve Windows behavior covered by existing tests or replace deleted helper tests with boundary-focused tests.

## Suggested fix

Delete the helpers after their callers have migrated. Update remaining call sites in core, UI, plugins, tests, and docs so byte conversion is no longer treated as a general-purpose path utility.

## Acceptance criteria

- No callers import the deleted helpers.
- Remaining `os.fsdecode` or `os.fsencode` calls are tied to explicit serialization boundaries.
- User-facing path output remains stable.
- `poe test` and `poe lint` pass with coverage at or above 80%.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the helpers in beets.util, their callers across core, UI, plugins, tests, and docs, and the dependent #6809 child issues plus prune_dirs cleanup. Remove the compatibility surface only after callers migrate, then run poe test and poe lint; done means no deleted-helper imports, boundary-only byte conversion, stable path output, and at least 80% coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.