Skip to content

fix: every RedisList operation on a wrong-type key is a TypeError; bytes-like elements (#15) - #16

Merged
thorwhalen merged 3 commits into
masterfrom
fix/redislist-wrongtype-15
Oct 13, 2026
Merged

thorwhalen merged 3 commits into
masterfrom
fix/redislist-wrongtype-15

Conversation

@thorwhalen

Copy link
Copy Markdown
Member

Closes #15. Reads, slices, len, iteration, append, extend, insert, pop and the MutableSequence mixins on a key holding a string/hash/... now raise TypeError (cause: the ResponseError), consistent with [i]=/del; other Redis errors pass through. clear() checks the type and deletes in one WATCH/MULTI transaction, so it no longer destroys a non-list key. Bytes-like list elements (bytearray, memoryview, also a codec's output) are sent as their bytes, in RedisList and in the store's list path. _wrapped_class_of reads dol's new _wrapped_class/_delegation_attr (i2mint/dol#131) with the old closure read as fallback; it still refuses a subclass that has its own __init__.

Adversarial Opus review: the list fix held; it confirmed two regressions in the new _wrapped_class_of (subclass with own __init__ built half-initialised; mixin between wrapper and Store skipped) — fixed, with a test each. fakeredis only.

🤖 Generated with Claude Code

thorwhalen and others added 3 commits October 13, 2026 14:26
…tes-like elements (#15)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t__ and honours mixins in the MRO (review of #15)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…er attributes (#15)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit 9fc86ed into master Oct 13, 2026
8 checks passed
@thorwhalen
thorwhalen deleted the fix/redislist-wrongtype-15 branch October 13, 2026 14:48
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.

RedisList: other operations on a wrong-type key leak a raw ResponseError; memoryview elements in lists

1 participant