张晨的个人博客

python3报错ValueError: All strings must be XML compatible: Unicode or ASCII

张晨的个人博客2020-07-28综合技术 4824 2A+A-

在使用python3 docx 处理word文档时遇到报错:

ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters


原因是需要输出的字符中含有ASCII编码:ETX

找到并替换掉后,python代码正常运行,供类似问题解决参考



文章关键词
python3
发表评论