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 摘要。