#2914 closed defect (fixed)
[patch] filesizeformat can raise TypeError in MySQL when None is returned.
Reported by: | Owned by: | Adrian Holovaty | |
---|---|---|---|
Component: | Template system | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | dev@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
If MySQLdb returns None for a value, then filesizeformat dies with "float() argument must be a string or a number".
I got the None following a custom SQL query ( SELECT SUM(foo) FROM table... ), where there were no entries in table.
Attachments (1)
Change History (3)
by , 18 years ago
comment:1 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 16 years ago
Patch needs improvement: | set |
---|---|
Version: | → SVN |
Related to this bug/fix ... but unrelated to the MySQL cause/effect ...
When a null string is passed to the filter, a ValueError is raised.
So, that TypeError could use a ValueError with it.
Leave ticket closed? -- or open a new ticket?
-- joe
Note:
See TracTickets
for help on using tickets.
(In [4044]) Fixed #2914: filesizeformat no longer dies on invalid values. Thanks, dev@…