[xml] python 3 testing
- From: Patrick Welche <prlw1 cam ac uk>
- To: xml gnome org
- Subject: [xml] python 3 testing
- Date: Thu, 3 Oct 2013 18:44:12 +0100
One change with Python 3 is that all strings are now unicode strings.
I have just been trying to port itstool to Python 3, and see the
following:
Traceback (most recent call last):
File "../itstool", line 1289, in <module>
fout.write(doc._doc.serialize('utf-8'))
UnicodeEncodeError: 'ascii' codec can't encode character '\u2192' in position 1027: ordinal not in range(128)
_doc is a libxml2.createFileParserCtxt(filename).doc()
Just calling fout.write(doc._doc.serialize()) instead should to the right
thing? (It gets rid of the error...)
Cheers,
Patrick
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]