Windson Yang <wiwind...@outlook.com> added the comment:
I added a PR for like this: .. note:: You should specify the "xmlcharrefreplace" error handler when open a file with specified encoding:: writer = open( filename, "w", encoding="utf-8", errors="xmlcharrefreplace") doc.writexml(writer, "", " ", "utf-8") ---------- nosy: +Windson Yang _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue18911> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com