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
email(), hostname(), uuid(), and cron() leak AttributeError for truthy non-string input #601
Invalid input should return ValidationError (or raise that validation error in r_ve mode), not leak an implementation-level AttributeError.
Why this matters
Validators are often applied to form, JSON, or otherwise untrusted data where the type is not guaranteed. A wrong type should be reported through the same validation-error path as any other invalid value, rather than crashing the caller.
I did not include the IP address validators here because their non-string behavior is already tracked separately in #578.
Possible resolution
Add targeted isinstance(value, str) guards in the affected validators before calling string methods, while preserving the existing special handling of UUID objects in uuid(). Targeted guards avoid hiding unrelated implementation bugs.
I would be happy to open a PR with these guards and regression tests.
Activity