#34000 closed Bug (fixed)
Fix numberformat.py "string index out of range" when null
Reported by: | Jimmy Angelakos | Owned by: | Jimmy Angelakos |
---|---|---|---|
Component: | Utilities | Version: | 4.1 |
Severity: | Normal | Keywords: | |
Cc: | Graham Coster | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
When:
if str_number[0] == "-"
encounters a number field that's null when formatting for the admin list_display this causes an
IndexError: string index out of range
I can attach the proposed fix here, or open a pull request on GitHub if you like?
Attachments (2)
Change History (14)
by , 2 years ago
Attachment: | 4375ad983f2adbfdd091a1e92a847dd108d04c02.patch added |
---|
comment:1 by , 2 years ago
Needs tests: | set |
---|---|
Triage Stage: | Unreviewed → Accepted |
Please provide a pull request, including a test.
comment:2 by , 2 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 2 years ago
Regression test added and pull request submitted (attaching as patch).
This is a crashing bug, I wonder if it should be backported?
comment:4 by , 2 years ago
Needs tests: | unset |
---|
comment:5 by , 2 years ago
Needs tests: | set |
---|---|
Owner: | removed |
Status: | assigned → new |
comment:6 by , 2 years ago
Needs tests: | unset |
---|
comment:7 by , 2 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
comment:8 by , 2 years ago
Cc: | added |
---|
comment:9 by , 2 years ago
Owner: | set to |
---|---|
Patch needs improvement: | set |
Status: | new → assigned |
Triage Stage: | Ready for checkin → Accepted |
This is a crashing bug, I wonder if it should be backported?
This a long standing issue (Django < 1.11). Per our backporting policy this means it doesn't qualify for a backport. See Django’s release process for more details.
comment:10 by , 2 years ago
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
proposed fix patch