From 5b0c9df14c7d41b2d8ec8beeac99943958b36ec7 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Sat, 7 Jul 2007 21:31:18 -0700
Subject: [PATCH] web: survive bogus URIs when displaying sizes

---
 src/allmydata/webish.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

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
-- 
2.45.2