We could also just do a ``for key, value in sorted(cp.items('playlist')): if key.starswith('file'): yield value`` which might be more robust with respect to "bad" pls files.