Opened 18 years ago

Closed 18 years ago

Last modified 16 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: 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)

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

Download all attachments as: .zip

Change History (3)

by dev@…, 18 years ago

Attachment: 2914.diff added

comment:1 by Jacob, 18 years ago

Resolution: fixed
Status: newclosed

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

comment:2 by joe@…, 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.
Back to Top