Code

Opened 8 years ago

Closed 7 years ago

Last modified 6 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:

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@… 8 years ago.

Download all attachments as: .zip

Change History (3)

Changed 8 years ago by dev@…

comment:1 Changed 7 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 6 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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.