> So the loop really should be: > > for line in fh.split("\n"): > ... Ah, apologies. Forgot that we're in Python 3 land. We have to be consistent with the types a lot more. This should be: for line in fh.split(b"\n"): ... Apologies. I should have tested with a Python 3 interpreter in hand.