Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#2914 closed defect (fixed)

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

Reported by: dev@… Owned by: adrian
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@… 9 years ago.

Download all attachments as: .zip

Change History (3)

Changed 9 years ago by dev@…

comment:1 Changed 9 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:2 Changed 7 years ago by joe@…

  • Patch needs improvement set
  • Version set to 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