[issue327] Crash during update download with slow network

Neil Bird at Labix Tracker tracker at labix.org
Thu Sep 6 03:58:37 PDT 2007


New submission from Neil Bird <neil at fnxweb.com>:

I have been regularly getting a crash from smart while downloading.  I have
pinned this down to the fact that we are behind a virus-scanning firewall which
manifests as exceedingly slow downloads for the first ~10% of each file,
followed by a near-immediate final ~90%.  The smart status line cannot cope with
such slow download speeds:  if the 'hours' left field is very very large, the
format specifier throws an exception.

Here is the patch that I have applied which prevents the crash:

--- /tmp/strtools.py    2007-09-06 11:33:20.000000000 +0100
+++ /usr/lib/python2.5/site-packages/smart/util/strtools.py     2007-07-05
10:17:26.000000000 +0100
@@ -81,7 +81,9 @@
     else:
         minutes, seconds = divmod(time, 60)
         hours, minutes = divmod(minutes, 60)
-        if hours > 0:
+        if hours > 999:
+            return "Stalled"
+        elif hours > 0:
             return "%02ih%02im%02is" % (hours, minutes, seconds)
         elif minutes > 0:
             return "%02im%02is" % (minutes, seconds)

----------
messages: 1189
nosy: FNX
priority: urgent
project: smart
status: unread
title: Crash during update download with slow network

_______________________________________
Labix issue tracker <tracker at labix.org>
<http://tracker.labix.org/issue327>
_______________________________________



More information about the Smart mailing list