Skip to content

fix: wrong-type list key is a TypeError; bytearray/memoryview stored as strings (#12) - #14

Merged
thorwhalen merged 2 commits into
masterfrom
fix/wrong-type-bytearray-12
Oct 13, 2026
Merged

thorwhalen merged 2 commits into
masterfrom
fix/wrong-type-bytearray-12

Conversation

@thorwhalen

@thorwhalen thorwhalen commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Fixes #12.

  1. del lst[i] / lst[i] = v on a key holding a Redis string reported IndexError. Now WRONGTYPE -> TypeError (key untouched); 'no such key' / 'index out of range' stay IndexError; other ResponseErrors (READONLY, OOM...) are no longer disguised and propagate unchanged.
  2. RedisPersister[k] = bytearray/memoryview was stored as a list of ints; now a string (bytes(v)).

Adversarial review (Opus): goals met on fakeredis/redis-py (RESP2/3, decode_responses). Confirmed and fixed: the classifier read the key's name out of a pipeline's quoted command (a key named WRONGTYPE turned an IndexError into TypeError; a READONLY on a key named no such key became IndexError), and pass-through errors became their own __cause__; now only the server's words are classified and a bare raise re-raises. Out of scope, filed: other list operations on wrong-type keys still leak raw errors; bytes-like list elements.

🤖 Generated with Claude Code

thorwhalen and others added 2 commits October 13, 2026 14:15
…as strings (#12)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…review of #14)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@thorwhalen
thorwhalen merged commit e7d836c into master Oct 13, 2026
8 checks passed
@thorwhalen
thorwhalen deleted the fix/wrong-type-bytearray-12 branch October 13, 2026 14:19
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/RedisPersister: wrong-type key reported as IndexError; bytearray stored as int list

1 participant