From: Brian Warner Date: Sun, 8 Jul 2007 04:31:18 +0000 (-0700) Subject: web: survive bogus URIs when displaying sizes X-Git-Url: https://git.rkrishnan.org/components/com_hotproperty/frontends/%3C?a=commitdiff_plain;h=5b0c9df14c7d41b2d8ec8beeac99943958b36ec7;p=tahoe-lafs%2Ftahoe-lafs.git web: survive bogus URIs when displaying sizes --- diff --git a/src/allmydata/webish.py b/src/allmydata/webish.py index 4f675f54..2951787b 100644 --- a/src/allmydata/webish.py +++ b/src/allmydata/webish.py @@ -124,7 +124,11 @@ class Directory(rend.Page): #ctx.fillSlots("uri", T.a(href=dl_uri_url)[html.escape(uri)]) #extract and display file size - ctx.fillSlots("size", unpack_uri(target.get_uri())['size']) + try: + size = unpack_uri(target.get_uri())['size'] + except AssertionError: + size = "?" + ctx.fillSlots("size", size) elif IDirectoryNode.providedBy(target): # directory