-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fix Windows registry access mode when adding icons to file type associations #206
Merged
jaimergp
merged 6 commits into
conda:main
from
marcoesters:file-extension-regkey-access
May 10, 2024
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6f7ee9b
Open icon subkey with write access
marcoesters cacf002
Add icon to file_types test file
marcoesters f9aefed
Add news item
marcoesters 649ab1f
Add icon only to Windows tests
marcoesters 75f7fa0
Remove accidental tab
marcoesters 7402335
Update tests/data/jsons/file_types.json
marcoesters File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
### Enhancements | ||
|
||
* <news item> | ||
|
||
### Bug fixes | ||
|
||
* Fix Windows registry key access mode when adding icon file to file type association. (#191 via #206) | ||
|
||
### Deprecations | ||
|
||
* <news item> | ||
|
||
### Docs | ||
|
||
* <news item> | ||
|
||
### Other | ||
|
||
* <news item> |
This file contains 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
Oops, something went wrong.
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.
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.
Awesome catch!
We don't need this anywhere else for other keys, right? Thinking of file type association and so on.
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.
The only other key we open is here:
menuinst/menuinst/platforms/win_utils/registry.py
Lines 47 to 52 in 75f7fa0
This is done with write-only access as the default. However, we only write to subkeys and the documentation there is a little confusing:
However, when a subkey is not null, the source code suggests that they are always opened with
KEY_SET_VALUE
access: https://github.com/python/cpython/blob/6d419db10c84cacbb3862e2adc940342175bfce9/PC/winreg.c#L1787-L1796My interpretation is that the reason the icon fails is that we don't explicitly pass a subkey value, but instead operate on the key object itself.
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.
Got it. So for now no action needed but let's keep an eye for reports in case we need to pass more access flags. Thanks for the research!