Hmmm... wont pystring::split() split the whitespace within "BEGIN METADATA".  I.e., we want to check that line.startswith(BEGIN METADATA), or instead line.size()>=2 and line[0] == BEGIN and line[1] == METADATA?