-
-
Notifications
You must be signed in to change notification settings - Fork 270
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
Allow special characters in bottle names #3140
Conversation
- use bottle names md5 hash for directory creation
Minor nitpick...your code comment says hash with MD5 and yet you are hashing with SHA256 (which will produce quite long filenames/paths). |
argh... initially I used MD5, but it did not pass the quality checks, due to weakness. Yes, I should have removed the comment. I will push an update when I got the time to do that. The point to use a hash is that using <, ', or the like in paths is a pain. The usual approach is to simply replace them with an underscore or something. But this will lead to '<<' and '>>' be the same '__'. So, as I mentioned before, there shouldn't be need for a 'normal' user to work directly in these directories. And everyone familar to the shell to do so shouldn't have a real problem working with hashes. Well, this is my humble opinion, of course. |
Would disabling the markup here not be enough? Why do we need to also change how directories are created? The less disconnection we have between the filesystem and the UI, the better. |
It might be enough to simply disable the markup. There is no need to change the way you create directories, if you don't like. |
In this case I don't think it is necessary since we already use |
SonarQube Quality Gate |
I can support this MR without hashing. |
Pylint result on modfied files:
|
Description
Currently, bottle names in the UI are treated as Pango markup. This causes problems when using special characters like '<'. To fix this, the sha256 hash of a bottles name is used to create the directory. This shouldn't be a problem as the bottles name for UI is taken from bottles.yml. So, the user will be able to use those characters now. One downside is that the directory for a bottle is not named like it is shown in the UI. On the other hand, Bottles is a manager for bottles and as a user it shouldn't require me to work manually within the filesystem.
These changes does not affect already existing bottles, as far as I could test it. It just works for newly created ones. Well, this is a kind of brute force attempt and might be tested by others as I'm sure I didn't seen all possible dialogs using a bottles name.
Fixes #(issue)
#3106
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes.
Provide instructions so we can reproduce.