复现问题:
按照下面的步骤可以复现问题:
LOG_LEVEL=DEBUG BaiduPCS-Py server --path '/my/pan'
问题出现
问题截图:
root@4G-wifi:~# BaiduPCS-Py server --path '/my/pan'
Server running on http://localhost:8000/my/pan/
(v0.7.6) System ERROR: Cannot specify Depends for type <class 'starlette.responses.Response'>
运行日志:
2023-04-05 18:31:28,021 | DEBUG | app: app: System Error: Traceback (most recent call last):
File "/usr/local/lib/python3.9/dist-packages/baidupcs_py/app/app.py", line 118, in wrap
return func(*args, *kwargs)
File "/usr/local/lib/python3.9/dist-packages/baidupcs_py/app/app.py", line 177, in wrap
return func(args, **kwargs)
File "/usr/local/lib/python3.9/dist-packages/baidupcs_py/app/app.py", line 1766, in server
start_server(
File "/usr/local/lib/python3.9/dist-packages/baidupcs_py/commands/server.py", line 203, in start_server
make_http_server(path)
File "/usr/local/lib/python3.9/dist-packages/baidupcs_py/commands/server.py", line 157, in make_http_server
async def http_server(response: Response = Depends(handle_request)):
File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 661, in decorator
self.add_api_route(
File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 600, in add_api_route
route = route_class(
File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 446, in init
self.dependant = get_dependant(path=self.path_format, call=self.endpoint)
File "/usr/local/lib/python3.9/dist-packages/fastapi/dependencies/utils.py", line 303, in get_dependant
type_annotation, depends, param_field = analyze_param(
File "/usr/local/lib/python3.9/dist-packages/fastapi/dependencies/utils.py", line 425, in analyze_param
assert depends is None, f"Cannot specify Depends for type {type_annotation!r}"
AssertionError: Cannot specify Depends for type <class 'starlette.responses.Response'>
复现问题: 按照下面的步骤可以复现问题: LOG_LEVEL=DEBUG BaiduPCS-Py server --path '/my/pan' 问题出现
问题截图: root@4G-wifi:~# BaiduPCS-Py server --path '/my/pan' Server running on http://localhost:8000/my/pan/ (v0.7.6) System ERROR: Cannot specify
Depends
for type <class 'starlette.responses.Response'>运行环境: OS:Debian GNU/Linux 11 (bullseye) Python 3.9.2 BaiduPCS App v0.7.6
运行日志: 2023-04-05 18:31:28,021 | DEBUG | app:
app
: System Error: Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/baidupcs_py/app/app.py", line 118, in wrap return func(*args, *kwargs) File "/usr/local/lib/python3.9/dist-packages/baidupcs_py/app/app.py", line 177, in wrap return func(args, **kwargs) File "/usr/local/lib/python3.9/dist-packages/baidupcs_py/app/app.py", line 1766, in server start_server( File "/usr/local/lib/python3.9/dist-packages/baidupcs_py/commands/server.py", line 203, in start_server make_http_server(path) File "/usr/local/lib/python3.9/dist-packages/baidupcs_py/commands/server.py", line 157, in make_http_server async def http_server(response: Response = Depends(handle_request)): File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 661, in decorator self.add_api_route( File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 600, in add_api_route route = route_class( File "/usr/local/lib/python3.9/dist-packages/fastapi/routing.py", line 446, in init self.dependant = get_dependant(path=self.path_format, call=self.endpoint) File "/usr/local/lib/python3.9/dist-packages/fastapi/dependencies/utils.py", line 303, in get_dependant type_annotation, depends, param_field = analyze_param( File "/usr/local/lib/python3.9/dist-packages/fastapi/dependencies/utils.py", line 425, in analyze_param assert depends is None, f"Cannot specifyDepends
for type {type_annotation!r}" AssertionError: Cannot specifyDepends
for type <class 'starlette.responses.Response'>2023-04-05 18:31:38,379 | DEBUG | app:
app
: _teardown: start 2023-04-05 18:31:38,380 | DEBUG | app:app
: _teardown: endAdditional context / 补充内容 无