Error when trying to write unicode xml to zipfile

Martin martin.clausen at gmail.com
Mon Jul 9 19:11:24 EDT 2007


I get below error when trying to write unicode xml to a zipfile.

    zip.writestr('content.xml', content.toxml())
  File "/usr/lib/python2.4/zipfile.py", line 460, in writestr
    zinfo.CRC = binascii.crc32(bytes)       # CRC-32 checksum
UnicodeEncodeError: 'ascii' codec can't encode character u'\u25cf' in
position 2848: ordinal not in range(128)

Any ideas?

Martin




More information about the Python-list mailing list