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

Correct the fallback handling when an icon cannot be loaded. #2559

Merged
merged 4 commits into from
May 7, 2024

Conversation

freakboy3742
Copy link
Member

@freakboy3742 freakboy3742 commented May 7, 2024

If the macOS backend can't find the icon file, it is currently raised as a ValueError. This should be a FileNotFound error, so that fallback logic is activated.

It also modifies the icon lookup logic to ask specifically for a .icns resource, rather than relying on CFBundleIconFile to provide the extension.

Fixes #2558.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@freakboy3742 freakboy3742 requested review from mhsmith and removed request for mhsmith and rmartin16 May 7, 2024 05:59
Comment on lines +137 to +138
def test_create_fallback_unloadable(monkeypatch, app, capsys):
"""If a resource exists, but can't be loaded, an error is raised."""
Copy link
Member

Choose a reason for hiding this comment

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

This should be documented. Right now the Icon documentation doesn't mention the possibility of raising any exceptions at all.

@freakboy3742 freakboy3742 requested a review from mhsmith May 7, 2024 22:10
@mhsmith mhsmith merged commit bbf0bfb into beeware:main May 7, 2024
34 checks passed
@freakboy3742 freakboy3742 deleted the icon-fallback-fix branch May 7, 2024 22:21
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.

Cannot run helloworld on macOS after 0.4.3 release
2 participants