Damian Johnson <atagar1@xxxxxxxxx> wrote: > Thanks! Patches applied and I've released a fixed version (1.4.1.1). > There were two issues... > > - If an error occurred while resolving connections for the first time > then a missing dictionary key caused that stacktrace you saw. Trystero > also reported this on irc. > > - The root cause of that failure was the issue that you found (being > unable to parse the ps output due to an unexpected decimal value). > > Dumb question, but are you sure that it's hh:mm.ss rather than > mm:ss.ss (ie, it's providing decimal seconds)? Looks like you're right, so my patch actual made it worse. Oops. I attached another one. Again only briefly tested, though. Fabian
From 89bde2e5412bc8a50df9a65b367fa5fb85394de5 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@xxxxxxxxxxxxx>
Date: Wed, 12 Jan 2011 18:53:23 +0100
Subject: [PATCH] Unbreak parseShortTimeLabel(). As Damian pointed out it's mm:ss.ss not hh:mm.ss
---
 src/util/uiTools.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/util/uiTools.py b/src/util/uiTools.py
index 07ea949..89fa1c3 100644
--- a/src/util/uiTools.py
+++ b/src/util/uiTools.py
@@ -333,7 +333,7 @@ def parseShortTimeLabel(timeEntry):
   """
   Provides the number of seconds corresponding to the formatting used for the
   cputime and etime fields of ps:
-  [[dd-]hh:]mm:ss or hh:mm.ss
+  [[dd-]hh:]mm:ss or mm:ss.ss
   
   If the input entry is malformed then this raises a ValueError.
   
@@ -349,14 +349,12 @@ def parseShortTimeLabel(timeEntry):
     days = int(timeEntry[:dateDivider])
     timeEntry = timeEntry[dateDivider+1:]
   
-  # normalise the seconds delimiter
-  timeEntry = timeEntry.replace(".", ":")
-  
   timeComp = timeEntry.split(":")
   if len(timeComp) == 3:
     hours, minutes, seconds = timeComp
   elif len(timeComp) == 2:
     minutes, seconds = timeComp
+    seconds = round(float(seconds))
   else:
     raise ValueError(errorMsg)
   
-- 
1.7.3.5
Attachment:
signature.asc
Description: PGP signature