【问题标题】:Exception: Unable to serialize node of type <class 'set'> on calling getuser in ebay-sdk python异常:在 ebay-sdk python 中调用 getuser 时无法序列化类型为 <class 'set'> 的节点
【发布时间】:2018-01-28 22:40:26
【问题描述】:

我正在使用ebay-sdk Python usage documentation

我收到此错误

Exception: Unable to serialize node of type <class 'set'> ({'genuinefeatherbuys2011'})

这是我的代码(我用“x”替换了一些数据)

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())

【问题讨论】:

    标签: python ebay-sdk


    【解决方案1】:

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

    请参阅下面的改编代码:

    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())
    

    【讨论】:

      猜你喜欢
      • 2015-07-01
      • 1970-01-01
      • 1970-01-01
      • 2011-02-06
      • 1970-01-01
      • 1970-01-01
      • 2022-11-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多