Skip to content

Bug report #6

@xiwen1

Description

@xiwen1

调用getPassage是出现以下错误。

找到公众号Mzg2MTg4MDcxMQ==
INFO: 127.0.0.1:10211 - "GET /api/search/author/%E6%AF%95%E5%AF%BC/1 HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\protocols\http\httptools_impl.py", line 436, in run_asgi
result = await app( # type: ignore[func-returns-value]
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 78, in call
return await self.app(scope, receive, send)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\applications.py", line 276, in call
await super().call(scope, receive, send)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\applications.py", line 122, in call
await self.middleware_stack(scope, receive, send)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 184, in call
raise exc
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\errors.py", line 162, in call
await self.app(scope, receive, _send)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\exceptions.py", line 79, in call
raise exc
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\middleware\exceptions.py", line 68, in call
await self.app(scope, receive, sender)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 21, in call
raise e
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\middleware\asyncexitstack.py", line 18, in call
await self.app(scope, receive, send)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 718, in call
await route.handle(scope, receive, send)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 276, in handle
await self.app(scope, receive, send)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\routing.py", line 66, in app
response = await func(request)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\routing.py", line 237, in app
raw_response = await run_endpoint_function(
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\fastapi\routing.py", line 165, in run_endpoint_function
return await run_in_threadpool(dependant.call, **values)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\starlette\concurrency.py", line 41, in run_in_threadpool
return await anyio.to_thread.run_sync(func, *args)
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio_backends_asyncio.py", line 937, in run_sync_in_worker_thread
return await future
File "C:\Users\xiwen\AppData\Local\Programs\Python\Python310\lib\site-packages\anyio_backends_asyncio.py", line 867, in run
result = context.run(func, *args)
File "C:\Users\xiwen\desktop\软创\WechatSpider\main.py", line 70, in getpassage
if page > num:
TypeError: '>' not supported between instances of 'str' and 'int'

另外api上这个接口的路由改成 /api/passages/{username}/{page},和接口文档保持一致

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions