Python 挂在 apache 的 lxml.etree.XMLSchema(tree) 上mod_wsgi
Python 时, Python 会挂起
lxml.etree.XMLSchema(tree)
当我在 apache 服务器 + mod_wsgi (Windows) 上使用
一切都正常
当我使用 Django 开发服务器时 -如果您知道针对 XSD 的其他不错的 XML 验证解决方案,那么
,请告诉我更新:
I我正在使用soaplib,它使用lxml
logger.debug("building schema...") self.schema = etree.XMLSchema(etree.parse(f)) logger.debug("schema %r built, cleaning up..." % self.schema)
我在apache日志中看到“构建架构...”,但我没有看到“架构%r已构建,正在清理...”
更新2: 我用 MSVS 2010 Visual C++ 构建了 lxml 2.3;之后它在这条线上崩溃
self.schema = etree.XMLSchema(etree.parse(f))with Unhandled exception at 0x7c919af2 in httpd.exe: 0xC0000005: Access violation writing location 0x00000010.
Python hangs on
lxml.etree.XMLSchema(tree)
when I use it on apache server + mod_wsgi (Windows)
When I use Django dev server - all works fine
if you know about other nice XML validation solution against XSD, tell me pls
Update:
I'm using soaplib, which uses lxml
logger.debug("building schema...") self.schema = etree.XMLSchema(etree.parse(f)) logger.debug("schema %r built, cleaning up..." % self.schema)
I see "building schema..." in apache logs, but I don't see "schema %r built, cleaning up..."
Update 2:
I built lxml 2.3 with MSVS 2010 visual C++; afterwards it crashes on this line
self.schema = etree.XMLSchema(etree.parse(f))
with Unhandled exception at 0x7c919af2 in httpd.exe: 0xC0000005: Access violation writing location 0x00000010.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我使用的解决方法是设置:
WSGIApplicationGroup %{GLOBAL}
更多详细信息可以在此处找到。
The work around that I used, is to set:
WSGIApplicationGroup %{GLOBAL}
More details can be found here.
我遇到了同样的问题(lxml 2.2.6,mod_wsgi 3.2)。解决此问题的方法是将文件或文件名传递给构造函数:XMLSchema(file=)。
I had the same problem (lxml 2.2.6, mod_wsgi 3.2). A work around for this is to pass a file or filename to the constructor: XMLSchema(file=).
我在 Linux 系统上也遇到了类似的问题。尝试安装更新版本的 libxml2 并重新安装 lxml,至少这对我来说是这样。
I had a similar problem on a Linux system. Try installing a more recent version of libxml2 and reinstalling lxml, at least that's what did it for me.