You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TupleManager string inputs: cryptic ValueError for bare strings, silent key/value shredding for 2-char elements #242
TupleManager (and RegexTupleManager) inherit dict.__init__ unchanged, so string inputs behave inconsistently with the guarded SetManager (#238):
fromnameparser.configimportConstants, TupleManagerConstants(capitalization_exceptions='ab')
# ValueError: dictionary update sequence element #0 has length 1; 2 is required# loud, but names no argument and suggests no fixTupleManager(['ab', 'cd']) # {'a': 'b', 'c': 'd'} — silentConstants(capitalization_exceptions=['ii']) # {'i': 'i'} — silent
The bare-string case fails loudly but cryptically (dict internals, ValueError where the sibling set-backed args now raise a friendly TypeError). The worse case is the silent one: an iterable of 2-character strings is a valid dict-update sequence, so each string shreds into a key/value pair with no error — same family as #238 through the mapping constructor.
Fix: give TupleManager an __init__ that rejects str/bytes outright (mirroring SetManager._reject_bare_string's message style) and rejects non-tuple string elements, closing the 2-char variant.
Found by review of PR #240 — pre-existing, unrelated to that change.
Activity
Update release log and AGENTS.md for #241, #239, #242, #244
Simplify SetManager/TupleManager guards from cleanup review
Restore v1.3/1.4 manager hardening in the shim (#221/#238/#241/#242/#260
Harden shim notification/validation paths and facade failure ordering