Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RecursionError #629

Open
ZeddShi opened this issue Feb 18, 2021 · 1 comment
Open

RecursionError #629

ZeddShi opened this issue Feb 18, 2021 · 1 comment

Comments

@ZeddShi
Copy link

ZeddShi commented Feb 18, 2021

问题描述 (Description)

ComponentOAuth.get_wechat_user_info (获取用户信息)的请求中如果出现40001的错误码,刷新access_token逻辑错误

wechatpy.component.py 的 ComponentOAuth类

 self.component.fetch_access_token()
 kwargs["params"]["component_access_token"] = self.component.access_token
 return self._request(method=method, url_or_endpoint=url, **kwargs)

文档 对于接口 /sns/userinfo只提到了access_token这个参数,所以无法接收 component_access_token 参数,这样会导致一直刷新返回的状态码还是40001,最终递归错误。

配置信息 (Environment/Version)

  • OS Linux
  • Python 3.6
  • wechatpy 2.0.0a1

重现步骤 (Reproducing)

  1. 使用一个错误的access_token
  2. 尝试调用 ComponentOAuth.get_wechat_user_info 该接口
  3. 出现无限递归
@messense
Copy link
Member

messense commented Mar 3, 2021

@ZeddShi 可以尝试 PR 修复

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants