Opened 4 years ago

Closed 4 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 Changed 4 years ago by Aymeric Augustin

Owner: changed from nobody to Aymeric Augustin

comment:3 Changed 4 years ago by Aymeric Augustin <aymeric.augustin@…>

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