-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
feat: support for empty file names #436
base: main
Are you sure you want to change the base?
Conversation
Arf, I apologize for leaving your issue unanswered for so long! I remember that back when I first saw the issue, I thought that allowing empty names could cause problems in other places because beet plugins often just assume that the name can't be empty. I wanted to look into it more in depth but eventually I just forgot and never got back to you. I still don't have a clear answer though. I've always felt like Mojang doesn't even know that empty names are allowed. If it was never intended, they could very well make it an error the moment they realize and a bunch of packs would break. It just seems like a bug that's bound to be fixed sooner or later so I generally avoid relying on it. But it's true that as a build tool, |
Yeah it always seemed very hacky to me to use empty filenames, just writing |
Yeah you have to commit the snapshots |
load.py.mcfunction | ['.py', '.mcfunction'] | ['.py', '.mcfunction'] | ||
.py.mcfunction | ['.mcfunction'] | ['.py', '.mcfunction'] | ||
aaa...mcfunction | ['.', '.', '.mcfunction'] | ['.', '.', '.mcfunction'] | ||
...mcfunction | [] | ['.', '.', '.mcfunction'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does ...minecraft
result in .
being returned twice, but ..minecraft
not returning .
once?
The function with an empty name
.mcfunction
is currently not supported by beet atm.This PR fixes this issue by modifying the code where the extensions of a file are calculated (in
beet/library/utils.py
).Q/A
Where does the problem come from ? : In the python pathlib, the first suffix is skip if the filename start with a dot
Why is it a problem ? : Because minecraft loads these functions as usual, and other datapackers rely on this behavior.