aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2023-08-08 20:01:29 +0200
committerTeddy Wing2023-08-08 20:01:29 +0200
commit71770f3e23f7a3a54ef29b53d8fce9982a8221cf (patch)
tree63d5a942ee9f9753fcd826b4f464ab799362ce99
parente29defb64605062d44fd029a1f524464627d1014 (diff)
downloadcws-status-71770f3e23f7a3a54ef29b53d8fce9982a8221cf.tar.bz2
cws-status: Investigate out of bounds error
Sometimes I was getting the following exception which caused the program to fail: $ cws-status 'AODocs - Universal' Traceback (most recent call last): File ".../cws-status/cws-status", line 117, in <module> matched_extensions.append((name, item_statuses[i])) IndexError: list index out of range Add a couple of print statements to see what's going on.
-rw-r--r--cws-status2
1 files changed, 2 insertions, 0 deletions
diff --git a/cws-status b/cws-status
index 42cd61b..2a26421 100644
--- a/cws-status
+++ b/cws-status
@@ -111,6 +111,8 @@ item_statuses = tree.xpath('//table[//th[text()="Item"]]/tbody/tr/td[7]/text()')
matched_extensions = []
for i, name in enumerate(item_names_versions):
+ print(i, name, item_names_versions, item_statuses)
+ print(i, item_statuses)
if re.search(regex, name):
matched_extensions.append((name, item_statuses[i]))