Can Python fix vcard files?

Dotan Cohen dotancohen at
Tue Oct 14 04:00:47 CEST 2008

2008/10/14  <skip at>:
> Off the top of my head I don't know (and it may well vary by Python
> version).  Just leave out the dangerous parts of the loop to check:
>    for f in glob.glob('*.vcf'):
>        # corrupt data
>        uncooked = open(f, 'rb').read()
>        # fix it
>        cooked = uncooked.replace('\n ', '')
>        # and write it to the bit bucket
>        open(os.path.devnull, 'wb').write(cooked)
> Skip

Thanks, Skip. I don't quite follow but I've got enough to google on
now. In any case I see that there are unicode-specific parts to TFM so
I'm rather faithful that any gotchas will be spelled out there.


Dotan Cohen


More information about the Python-list mailing list