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

Illegal characters in target paths result in crash #4

Open
perepichka opened this issue Apr 22, 2021 · 1 comment
Open

Illegal characters in target paths result in crash #4

perepichka opened this issue Apr 22, 2021 · 1 comment
Labels

Comments

@perepichka
Copy link

Deflacue will fail to split FLAC files when Album/Band names contain illegal characters on Windows.

In my case, the album name is titled: What I Have to Hide...

The code in the process_cue method creates an additional folder structure on top of the target path using the artist name, album name, and date. In my case, it attempts to create the following: [base_directory]\\Night of Suicide\\2006 - What I Have to Hide.... However, _create_target_path method used to create this folder uses os.makedirs, which has the brilliant behavior of silently pruning the three dots at the end, creating [base_directory]\\Night of Suicide\\2006 - What I Have to Hide instead. Subsequently, the reference to the target path is now incorrect and SoX will fail as it attempts to write to the directory with the 3 dots, which does not exist.

There exists a sanitize function in process_cue, which can be extended to remove illegal characters. Additionally/alternatively, it would be nice to have an optional flag to disable the entire prepending system and simply have deflacue output to the exact directory the user passes.

I can make a PR for either or both, let me know.

@idlesign idlesign added the bug label Apr 23, 2021
@idlesign
Copy link
Owner

os.makedirs, which has the brilliant behavior of silently pruning the three dots at the end

That comes from the OS layer.
See https://bugs.python.org/issue22744#msg230101 - so a workaround might be to sanitize those on Windows.
Pull request is welcome.

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

No branches or pull requests

2 participants