binance-common: rest_api.send_request() / send_signed_request() raise TypeError: 'function' object is not subscriptable
评估
调研方向
错误的下标位于 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,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
binance/binance-connector-python 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 85/100
-
USDⓈ-M exchangeInfo:请明确 POSITION_RISK_CONTROL / positionControlSide 的语义与枚举可能已有人在做 @Tyagiquamar 于 23 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 15/100
binance/binance-connector-python#575 · 6 条评论 ·
-
[Bug] Response models declare numeric fields as strict `str`, causing silent fallback of `.data()` to raw dict (simple-earn & staking)可能已有人在做 @Tyagiquamar 于 69 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 68/100
binance/binance-connector-python#553 · 2 条评论 ·
-
难度 5/5 一周以上 新手友好度 20/100
-
难度 5/5 一周以上 新手友好度 30/100
binance/binance-connector-python#464 · 1 条评论 · 5 个 reaction ·
查看 binance/binance-connector-python 的全部 Issue
相似的 Issue
-
app: scripts status: backlog type: housekeeping
难度 1/5 1-3 小时 新手友好度 88/100
netbox-community/netbox-scripts#239 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
LmeSzinc/AzurLaneAutoScript#6194 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 79/100
micronaut-projects/micronaut-core#14585 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
langgenius/graphon#443 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复