Skip to content

gh-158217: Fix dbm.dumb bytearray keys - #158218

Open
Tony123-tech wants to merge 1 commit into
python:mainfrom
Tony123-tech:gh-158217-fix-dbm-dumb-bytearray-keys
Open

Tony123-tech wants to merge 1 commit into
python:mainfrom
Tony123-tech:gh-158217-fix-dbm-dumb-bytearray-keys

Conversation

@Tony123-tech

@Tony123-tech Tony123-tech commented Sep 26, 2026 •

Copy link
Copy Markdown

The isinstance check in _Database.setitem and related methods
accepted bytearray keys, but the in-memory index is a dict, and
bytearray is not hashable, so operations raised TypeError.

Convert bytearray keys to bytes before use in getitem,
setitem, delitem, and contains.

@Tony123-tech
Tony123-tech force-pushed the gh-158217-fix-dbm-dumb-bytearray-keys branch from 365e87f to c0ef434 Compare September 26, 2026 04:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant