Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Error 500 in Config with empty library #232

TheLabRatt opened this Issue · 1 comment

2 participants


Installing Mylar on various systems to test the lxml fix I spotted this.

If the library is empty visiting the Config page results in an Error 500:

Traceback (most recent call last):
  File "C:\mylar\cherrypy\", line 645, in respond
    response.body = self.handler()
  File "C:\mylar\cherrypy\lib\", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "C:\mylar\cherrypy\", line 29, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "C:\mylar\mylar\", line 993, in config
    COUNT_SIZE = helpers.human_size(CSIZE[0][0])
  File "C:\mylar\mylar\", line 140, in human_size
    num = float(size_bytes)
TypeError: float() argument must be a string or a number

This is because you haven't allowed for 0 bytes in the human_size function.
I'd fix it myself, but I'm not sure how all this GitHub stuff works yet, so here:

mylar/, Line 140

-    num = float(size_bytes)
+    num = float(0 if size_bytes is None else size_bytes)
@evilhero evilhero was assigned

Hah - yeah that's a bad part by me - should've caught the float problem. I'll commit the fix in abit, thanks for the catch :)

@evilhero evilhero closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.