binance-common: rest_api.send_request() / send_signed_request() raise TypeError: 'function' object is not subscriptable

未关闭 适合新手
#593 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@Amadeus-22 已经在做这个了。

开始于 2026年11月24日。

  • #594 来自 @Amadeus-22 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
62/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
python
领域
api

调研方向

错误的下标位于 clients/spot/src/binance_sdk_spot/rest_api/rest_api.py 的第 237 行和第 268 行附近,即调用 send_requestT 的位置。请检查普通函数 binance_common.utils.send_request 的签名,然后对 /api/v3/ping 运行 ping 以复现问题。当 send_request 和 send_signed_request 都能在不使用 [T] 的情况下正常工作,并且相同的修复已应用到全部 26 个 REST 客户端时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

Problem
Every generated client's RestAPI.send_request() and RestAPI.send_signed_request() return send_request[T](...) (e.g. clients/spot/src/binance_sdk_spot/rest_api/rest_api.py lines 237 and 268). binance_common.utils.send_request is a plain function, so the subscript raises before any request is sent. Both methods have failed this way since the modular clients were released.

Reproduction (binance-sdk-spot with binance-common 4.10.0)

from binance_sdk_spot.spot import Spot, ConfigurationRestAPI
client = Spot(config_rest_api=ConfigurationRestAPI(base_path="https://api.binance.com"))
client.rest_api.send_request("/api/v3/ping", "GET")
# TypeError: 'function' object is not subscriptable

send_signed_request("/api/v3/account", "GET") fails the same way.

Who is affected
Anyone calling an endpoint the SDK does not wrap yet through send_request / send_signed_request, on any of the 26 REST clients (grep -rln "send_request\[T\]" clients/*/src). Generated endpoint methods are not affected: they call send_request(...) without [T].

主要语言
Python
星标
3k
派生
718
平均合并
8 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

binance/binance-connector-python 的其他 Issue

查看 binance/binance-connector-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。