Use bytes() on keys to be hashable in Python3 #2243
No reviewers
Labels
No Label
bug
build
dependencies
developers
documentation
duplicate
enhancement
formatting
invalid
legal
mobile
obsolete
packaging
performance
protocol
question
refactoring
regression
security
test
translation
usability
wontfix
No Milestone
No project
No Assignees
1 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Bitmessage/PyBitmessage-2024-12-21#2243
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "kashikoibumi/bytes-key"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This patch is a preparation to migration to Python3.
Use bytes() on keys to be hashable in Python3.
Hash keys used in hashtables must be hashable.
Although it is not problem in Python2, it is a problem in Python3.
When slice or memoryview of mutable byte array is used as hash key in Python3, an exception is raised.
To resolve the problem, this patch convert hash keys to immutable bytes by using bytes() function.