Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Error 500 in Config with empty library #232

Closed
TheLabRatt opened this Issue · 1 comment

2 participants

@TheLabRatt

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\_cprequest.py", line 645, in respond
    response.body = self.handler()
  File "C:\mylar\cherrypy\lib\encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "C:\mylar\cherrypy\_cpdispatch.py", line 29, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "C:\mylar\mylar\webserve.py", line 993, in config
    COUNT_SIZE = helpers.human_size(CSIZE[0][0])
  File "C:\mylar\mylar\helpers.py", 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/helper.py, Line 140

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

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.