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
Fix stacklevel misattribution on delegated bytes-deprecation warnings
SetManager.add()/add_with_encoding() and HumanName's constructor/full_name
setter each had a fixed stacklevel that only pointed at the real caller
when the bytes-deprecation warning fired on the direct-call path. Going
through the wrapper (add() -> add_with_encoding(), __init__ -> setter)
added a stack frame, so the warning was misattributed to nameparser's
own internals instead of the caller's code.
Extract the shared decode+warn logic into a private helper
(_add_normalized / _apply_full_name) that each public entry point calls
directly with its own correct stacklevel, verified empirically that both
call paths now attribute to the user's line. Also add the missing
.. deprecated:: note to add()'s docstring, tighten a weak match= test
assertion, fix present-tense wording in test comments, and add a test
for remove()/discard() with mixed present+missing members in one call.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0 commit comments