FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: make metadata classes hashable by fixing __hash__ implementations by mmustafasenoglu · Pull Request #3002 · theupdateframework/python-tuf · GitHub

fix: make metadata classes hashable by fixing __hash__ implementations - #3002

Closed
mmustafasenoglu wants to merge 1 commit into
theupdateframework:developfrom
mmustafasenoglu:fix/hash-unhashable-dicts
Closed

fix: make metadata classes hashable by fixing __hash__ implementations#3002
mmustafasenoglu wants to merge 1 commit into
theupdateframework:developfrom
mmustafasenoglu:fix/hash-unhashable-dicts

Conversation

Copy link
Copy Markdown

Fixes TypeError: unhashable type: 'dict' for 8 metadata classes:

  • Signed, Root, MetaFile, Timestamp, Snapshot
  • Delegations, TargetFile, Targets, Metadata

Following the pattern from #2973 (Role/DelegatedRole):

  • Convert dicts to tuples of sorted items for hashability
  • Exclude unrecognized_fields (arbitrary nested JSON)
  • Preserve Python data model: equal objects produce equal hashes

All existing tests pass. Ready for review.

Fixes TypeError: unhashable type: 'dict' for 8 metadata classes:
- Signed, Root, MetaFile, Timestamp, Snapshot
- Delegations, TargetFile, Targets, Metadata

Following the pattern from #2973 (Role/DelegatedRole):
- Convert dicts to tuples of sorted items for hashability
- Exclude unrecognized_fields (arbitrary nested JSON)
- Preserve Python data model: equal objects produce equal hashes

Signed-off-by: Mustafa Senoglu <mmustafasenoglu0@gmail.com>
mmustafasenoglu requested a review from a team as a code owner August 26, 2026 10:45
Copilot AI lite review requested due to automatic review settings August 26, 2026 10:45

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

jku commented Aug 26, 2026
edited
Loading

Copy link
Copy Markdown
Member

Thanks but I'm closing for #2995 that is closer to complete and earlier.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

this is a bit spammy, maybe disable the automated reviews if you don't have credits.

jku closed this Aug 26, 2026
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL