Opened 12 years ago
Closed 12 years ago
#18982 closed Bug (fixed)
DateField.clean raises TypeError when passed NUL bytes. Should be ValidationError.
Reported by: | Owned by: | Aymeric Augustin | |
---|---|---|---|
Component: | Forms | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
When a DateField (or any BaseTemporalField) tries to clean a value with a NUL byte (like 'a\x00b'
), the call to strptime()
raises an uncaught TypeError. It should raise a ValidationError instead, because 'a\x00b'
is not a valid date.
I have a patch for this, pull request to come.
Change History (3)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Owner: | changed from | to
---|
comment:3 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Pull request: https://github.com/django/django/pull/380