Django

Code

Ticket #2914 (closed: fixed)

Opened 2 years ago

Last modified 7 months ago

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

Reported by: dev@simon.net.nz Assigned to: adrian
Milestone: Component: Template system
Version: SVN Keywords:
Cc: dev@simon.net.nz Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

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

2914.diff (0.6 kB) - added by dev@simon.net.nz on 10/16/06 03:54:52.

Change History

10/16/06 03:54:52 changed by dev@simon.net.nz

  • attachment 2914.diff added.

11/06/06 22:58:10 changed by jacob

  • status changed from new to closed.
  • resolution set to fixed.

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

05/18/08 18:18:52 changed by joe@intrusion.org

  • needs_better_patch set to 1.
  • 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


Add/Change #2914 ([patch] filesizeformat can raise TypeError in MySQL when None is returned.)




Change Properties
Action