2
我之前从未遇到过使用过泡沫的问题,直到我点击了这个WSDL。 (这只是导致问题的部分)python suds - WSDL包含带重音符号的枚举值
<s:simpleType name="ProductFormat">
<s:restriction base="s:string">
<s:enumeration value="Papier"/>
<s:enumeration value="Numérique"/>
<s:enumeration value="PapierEtNumérique"/>
</s:restriction>
</s:simpleType>
正如你所看到的,是在价值观和肥皂水口音,当我尝试创建嗡嗡响:
product_format = self.client.factory.create('ProductFormat')
这是的结束回溯:
File "/home/andre/Documents/archambault/apps/onix/management/commands/import_sogides_onix.py", line 58, in get_catalog
product_format = self.client.factory.create('ProductFormat')
File "/home/andre/Documents/archambault/envs/lib/python2.6/site-packages/suds/client.py", line 240, in create
setattr(result, e.name, e.name)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 3: ordinal not in range(128)
看起来像Suds不喜欢Numérique的“é”(位置3)。据你所知,有没有办法避免编辑client.py?
感谢
感谢Paulo,你确认我的恐惧。我在玩e.name和decode(),但是当它工作时,它找不到“Numérique”了。我不想转换它,所以我写在这里.. – LeSuspect 2012-03-13 16:20:25
@ user112342:对不起,听到这一点。你很急吗?可能是我可以为你修复它,我可以通过Internet URL访问这个Web服务吗? – 2012-03-13 16:59:24
不错,你提供,但它的密码保护......虽然谢谢! – LeSuspect 2012-03-13 17:28:19