Truncate long path components for MusicBrainz titles (#453) - #706
Open
ajzrva-sys wants to merge 1 commit into
Open
ajzrva-sys wants to merge 1 commit into
ajzrva-sys wants to merge 1 commit into
Conversation
Finish the approach from PR whipper-team#672 (lcorbasson) so extremely long release/track titles no longer raise ENAMETOOLONG during makedirs or flac writes. - truncate_filename: NAME_MAX via existing-ancestor pathconf with a 255-byte fallback; optional reserve= for extensions the caller appends - truncate_path_components + getPath: truncate every template segment, reserving room on the last component for .flac/.log/.cue - cdrdao TOC copy truncates directory components before makedirs - cd rip truncates the final track path after appending .flac Closes whipper-team#453. Closes whipper-team#565. Completes whipper-team#672. Signed-off-by: ajzrva-sys <ajzrva-sys@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Finishes the long-path work from PR #672 (@lcorbasson) for issues #453 / #565.
Review notes on #672
get_existing_parentcould returnNone→ crash on.encode().flac/.log/.cueappended aftergetPath()cdrdaomakedirsstill used untruncated directory segments (the traceback in Unable to rip CD with extremely long title #453)This PR
truncate_filename(path, has_file_ext=True, reserve=0)with safename_max_for()getPathtruncates every template segment; last component reserves extension bytes+ '.flac'makedirsVerification
test_common_common+test_common_program— 16/16 OKCloses #453
Closes #565
Related #672