首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >异常:在ebay-sdk python中调用getuser时无法序列化<class 'set'>类型的节点

异常:在ebay-sdk python中调用getuser时无法序列化<class 'set'>类型的节点
EN

Stack Overflow用户
提问于 2018-01-29 06:40:27
回答 1查看 98关注 0票数 0

我正在使用ebay-sdk Python usage documentation

我得到了这个错误

代码语言:javascript
复制
Exception: Unable to serialize node of type <class 'set'> ({'genuinefeatherbuys2011'})

下面是我的代码(我用‘x’替换了一些数据)

代码语言:javascript
复制
from ebaysdk.trading import Connection as Trading
from ebaysdk.exception import ConnectionError


key_id  = 'x'
dev_id  = 'x'
cert_id = 'x'
mytoken = 'x'

try:
    api = Trading(appid=key_id, devid=dev_id, certid=cert_id, token=mytoken, config_file=None)
    response = api.execute('GetUser', {'genuinefeatherbuys2011'})
    print(response.dict())
    print(response.reply)
except ConnectionError as e:
    print(e)
    print(e.response.dict())
EN

回答 1

Stack Overflow用户

发布于 2018-01-29 06:59:20

所以我在检查样本的时候找到了解决方案。需要添加'UserID':

参见下面的改编代码:

代码语言:javascript
复制
try:
    api = Trading(appid=key_id, devid=dev_id, certid=cert_id, token=mytoken, config_file=None)
    response = api.execute('GetUser', {'UserID': 'sallyma789'})
    print(response.dict())
    print(response.reply)
except ConnectionError as e:
    print(e)
    print(e.response.dict())
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48492133

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档