#29006 closed Bug (fixed)
DecimalField.clean() crashes on sNaN values
Reported by: | Tim Graham | Owned by: | Tim Graham |
---|---|---|---|
Component: | Forms | Version: | 2.0 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
>>> from django.forms import DecimalField >>> DecimalField(max_digits=4, decimal_places=2) >>> f.clean('sNan') .... File "django/django/forms/fields.py", line 148, in clean self.validate(value) File "django/django/forms/fields.py", line 354, in validate if not math.isfinite(value): ValueError: cannot convert signaling NaN to float
Note:
See TracTickets
for help on using tickets.
PR