【发布时间】:2013-12-24 04:22:13
【问题描述】:
我在运行 python 脚本时收到以下错误:
Traceback (most recent call last):
File "/var/scripts/SchoolClosureManager/SchoolClosureManager.py", line 210, in <module>
runnable.run()
File "/var/scripts/SchoolClosureManager/SchoolClosureManager.py", line 18, in run
reporter = SchoolClosureReporter(xml.name)
File "/var/scripts/SchoolClosureManager/SchoolClosureManager.py", line 40, in __init__
document = objectify.fromstring(xml, parser)
File "lxml.objectify.pyx", line 1826, in lxml.objectify.fromstring (src/lxml/lxml.objectify.c:18625)
File "lxml.etree.pyx", line 2532, in lxml.etree.fromstring (src/lxml/lxml.etree.c:48634)
File "parser.pxi", line 1536, in lxml.etree._parseMemoryDocument (src/lxml/lxml.etree.c:72156)
ValueError: Unicode strings with encoding declaration are not supported.
我发现了这个错误报告:https://bugs.launchpad.net/lxml/+bug/683069,基本上说这是一个错误,并且一直是Fixed in trunk rev. 79947
我可以只更新lxml dist-package 吗?
我目前在 Ubuntu 8.04 上运行 python2.6.5。
【问题讨论】:
-
我不同意那些投票结束这个问题的人,因为“关于通用计算硬件和软件的问题对于 Stack Overflow 来说是题外话除非它们直接涉及主要用于编程的工具 ”。
lxml对我来说似乎是一个编程工具。
标签: python linux ubuntu command-line python-2.6