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: gwahl@… 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:2 by Aymeric Augustin, 12 years ago

Owner: changed from nobody to Aymeric Augustin

comment:3 by Aymeric Augustin <aymeric.augustin@…>, 12 years ago

Resolution: fixed
Status: newclosed

In 3174b5f2f5bb0b0a6b775a1a50464b6bf2a4b067:

Fixed #18982 - Caught TypeError in DateField.clean

Thanks gwahl at fusionbox com.

Note: See TracTickets for help on using tickets.
Back to Top