You’re calling c.available and that’s returning a list, but then you’re accessing c directly to try and access a member of that list. Try, for example:
I have collectd running my python script every 1 minute. As I was investigating things, in a python repl, the script got run (by collectd) while I had a client in my repl. I can reproduce this behaviour, so I reckon that was it.