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

Always use syspath conversions (#3690 split up, part 2) #4848

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

wisp3rwind
Copy link
Member

Follow-up to #4830:

I've had #3690 in the pipeline for a long time; and it has grown too big to look at in one piece. This is just the first commit rebased on master. It is still quite big, but only touches test code, so should be safe (assuming CI is green).

This is part 2, which mostly concerns plugins (except for a small fix to the artresizer module such that it's internally consistent).

Copy link
Member

@sampsyo sampsyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very very cool—these all seem right to me.

I'll use this space to again lament that Python 3 went in the direction it did for paths; I think the paths-are-str approach was worth trying but did not work out in the end, and now it's too late to change.

@sampsyo sampsyo merged commit 6c741d5 into beetbox:master Jul 18, 2023
14 checks passed
@wisp3rwind wisp3rwind deleted the pr_add_syspath_2 branch July 18, 2023 19:02
@wisp3rwind
Copy link
Member Author

I'll use this space to again lament that Python 3 went in the direction it did for paths; I think the paths-are-str approach was worth trying but did not work out in the end, and now it's too late to change.

One more place where I think Rust is getting it right — by having an OS-dependent type instead of trying to abstract away too much.

On the other hand, I wonder whether there's really any need to support non-UTF-8 paths these days.

@sampsyo
Copy link
Member

sampsyo commented Jul 18, 2023

Yeah, the Rust approach makes a lot of sense to me. But you're right—if we were building beets from scratch today, it would be tempting to simply reject all files with non-UTF-8 names. Crashing seems perhaps too harsh, but (for example) simply logging a message and skipping any nonconforming file could work!

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.

2 participants