Since we're silently ignoring it, couldn't this simply be `line = line.lstrip(codecs.BOM_UTF8):`?