Fix error decoding macro icon#174
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes an error in macro icon decoding by removing the base64 decoding step and synchronizes signal signatures between macro and non-macro addon installers. The changes address issue #173 related to macro icon handling.
- Removes base64 decoding from icon data when copying macro icons
- Updates the MacroInstaller failure signal to match the signature used by other installer classes
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| addonmanager_macro.py | Removes base64.b64decode() call when writing icon data to fix decoding errors |
| addonmanager_installer.py | Adds string parameter to MacroInstaller failure signal for consistency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| with open(os.path.join(macro_dir, filename), "wb") as f: | ||
| f.write(base64.b64decode(self.icon_data)) | ||
| f.write(self.icon_data) | ||
| except (OSError, UnicodeDecodeError, binascii.Error) as e: |
There was a problem hiding this comment.
The exception handling includes binascii.Error which is no longer relevant since base64 decoding has been removed. This exception type should be removed from the except clause.
Suggested change
| except (OSError, UnicodeDecodeError, binascii.Error) as e: | |
| except (OSError, UnicodeDecodeError) as e: |
e51a29a to
9742407
Compare
Also fixes the error-handling code itself to synchronize the signal signatures between installing an Macro and non-Macro addon.
9742407 to
7ef0500
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Also fixes the error-handling code itself to synchronize the signal signatures between installing a Macro and non-Macro addon. Fixes #173 .