digitalsatori, 我爱死你了,用你的建议就成功解决问题了,谢谢啦!!!
xmroger
-
问题:ebay connector模块中libxml2.parseDoc()方法不存在? -
问题:ebay connector模块中libxml2.parseDoc()方法不存在?最近印度公司把ebay connector开源了,但是使用起来会有一些问题,其中包括在下载ebay产品模板规格的时候对得到的xml字符串进行解释时会出错
category.py中的第1119行
catalog_en = results.get('CatalogEnabled',False)
if catalog_en == 'true' :
cr.execute("UPDATE category_master SET catlog_enabled='True' where id=%s"%(ids[0]))
cr.execute("UPDATE category_master SET attribute_set_id=%s where id=%s"%(results.get('AttributeSetID',False),ids[0]))
attribute_set_id = self.browse(cr,uid,ids[0]).attribute_set_id
attribute = self.pool.get('sale.shop').call(cr, uid, inst_lnk, 'GetAttributesCS',attribute_set_id,siteid)[color=red](1119行) doc = libxml2.parseDoc(attribute)[/color]
报错信息:
Environment Information :
System : Windows-32bit
OS Name : nt
Operating System Release :
Operating System Version : 32bit
Operating System Architecture : 32bit
Operating System Locale : zh_CN.cp936
Python Version : 2.5.2
OpenERP-Client Version : 6.0.3
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
File "E:\Devspace\OE6\server\bin\netsvc.py", line 489, in dispatch
result = ExportService.getService(service_name).dispatch(method, auth, params)
File "E:\Devspace\OE6\server\bin\service\web_services.py", line 599, in dispatch
res = fn(db, uid, *params)
File "E:\Devspace\OE6\server\bin\osv\osv.py", line 122, in wrapper
return f(self, dbname, *args, **kwargs)
File "E:\Devspace\OE6\server\bin\osv\osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "E:\Devspace\OE6\server\bin\osv\osv.py", line 167, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "E:\Devspace\OE6\server\bin\addons\eBay_Connector\category.py", line 1119, in get_attribute
doc = libxml2.parseDoc(attribute)
[color=red]AttributeError: 'module' object has no attribute 'parseDoc'[/color]
在ebay connector中已经自带了libxml2目录,里面有libxml2 python binding的程序及c语言的底层执行程序。在eclipse中,libxml2.后面也会自动查询出parseDoc(cur)这个方法。实在搞不明白运行时为什么会报找不到libxml2.parseDoc这个方法的错误。
希望以上的错误描述足够明确,也希望有人能帮忙解决这个问题。谢谢!