Opened 12 years ago

Closed 11 years ago

Last modified 10 years ago

#2914 closed defect (fixed)

[patch] filesizeformat can raise TypeError in MySQL when None is returned.

Reported by: dev@… Owned by: Adrian Holovaty
Component: Template system Version: master
Severity: normal Keywords:
Cc: dev@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:


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)

2914.diff (589 bytes) - added by dev@… 12 years ago.

Download all attachments as: .zip

Change History (3)

Changed 12 years ago by dev@…

Attachment: 2914.diff added

comment:1 Changed 11 years ago by Jacob

Resolution: fixed
Status: newclosed

(In [4044]) Fixed #2914: filesizeformat no longer dies on invalid values. Thanks, dev@…

comment:2 Changed 10 years ago by joe@…

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.
Back to Top