Use add_pattern
over add_mime_type
for FileFilters
#3221
Merged
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.
Description
Since 51.0, functionality with importing Bottle configurations via a YAML file have shown strange symptoms on a subset of Linux distributions. Until 51.5, this was limited to being unable to choose "All Files" as an option, but versions 51.6-51.10 now result in no filter being available, resulting in a complete inability to choose a YAML file. Attempts to circumvent this result in errors. Upon further investigation, it was found such symptoms existed on all file chooser dialogs.
After investigation, it was found that these versions differed in how the file patterns were defined. In 51.0+, the
add_mime_type
function is used whereas version 50.2 usesadd_pattern
for the YAML file filter. Reverting these filters to usingadd_pattern
results in the filters now appearing as intended and being fully functional.This comes with an unfortunate caveat in avoiding (what I believe to be) best practice in using the equivalent media types and their internationalised descriptions. However, I believe that this is necessary in order to preserve the intended functionality.
It is unknown why this problem happens in the first place as local proof of concepts using this same protocol do not experience the same issue. My hope is that this pull request would eventually be made redundant when the true cause for this issue is discovered and addressed.
Fixes #3154
Type of change
How Has This Been Tested?