# HG changeset patch # User John "Elwin" Edwards # Date 1452910370 0 # Node ID 67bcca6e3cb140b24997bdeb6b740b3601864bdd # Parent 5b6211e2e36f4a6a0cdc4f4ca34305f5ab6130dd Prevent crashes if no ttyrec files can be associated with a game. If the postprocessing step finds no ttyrec files created between a game's end and the previous game's end, it will no longer index an empty list and crash. The condition of finding no ttyrec files is still a bug that requires investigation. diff -r 5b6211e2e36f -r 67bcca6e3cb1 py/rlgall.py --- a/py/rlgall.py Sat Nov 21 20:01:41 2015 -0500 +++ b/py/rlgall.py Sat Jan 16 02:12:50 2016 +0000 @@ -226,8 +226,13 @@ lowlim = itsEntries[i-1]["endt"] hilim = itsEntries[i]["endt"] recs = [ k[1] for k in vfilekeys if lowlim <= k[0] < hilim ] - itsEntries[i]["startt"] = recnameToTS(recs[0]) - itsEntries[i]["ttyrecs"] = recs + if len(recs) == 0: + # There inexplicably are no files. TODO log an error. + itsEntries[i]["startt"] = lowlim + itsEntries[i]["ttyrecs"] = [] + else: + itsEntries[i]["startt"] = recnameToTS(recs[0]) + itsEntries[i]["ttyrecs"] = recs cur.close() conn.close() def putIntoDB(self, dictlist, conn):