2023-10-14 00:00:29 |
Steve Langasek |
description |
$ lsb_release -rd
Description: Ubuntu 22.04 LTS
Release: 22.04
$ apt-cache policy python3-fastapi
python3-fastapi:
Installed: 0.63.0-2
Candidate: 0.63.0-2
Version table:
*** 0.63.0-2 500
500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
100 /var/lib/dpkg/status
Example:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"Status": "ok"}
Traceback:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/lib/python3/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
return await self.app(scope, receive, send)
File "/usr/lib/python3/dist-packages/fastapi/applications.py", line 199, in __call__
await super().__call__(scope, receive, send)
File "/usr/lib/python3/dist-packages/starlette/applications.py", line 119, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/lib/python3/dist-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc
File "/usr/lib/python3/dist-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/lib/python3/dist-packages/starlette/exceptions.py", line 87, in __call__
raise exc
File "/usr/lib/python3/dist-packages/starlette/exceptions.py", line 76, in __call__
await self.app(scope, receive, sender)
File "/usr/lib/python3/dist-packages/starlette/routing.py", line 659, in __call__
await route.handle(scope, receive, send)
File "/usr/lib/python3/dist-packages/starlette/routing.py", line 259, in handle
await self.app(scope, receive, send)
File "/usr/lib/python3/dist-packages/starlette/routing.py", line 61, in app
response = await func(request)
File "/usr/lib/python3/dist-packages/fastapi/routing.py", line 191, in app
solved_result = await solve_dependencies(
File "/usr/lib/python3/dist-packages/fastapi/dependencies/utils.py", line 483, in solve_dependencies
response = response or Response(
File "/usr/lib/python3/dist-packages/starlette/responses.py", line 50, in __init__
self.init_headers(headers)
File "/usr/lib/python3/dist-packages/starlette/responses.py", line 77, in init_headers
and not (self.status_code < 200 or self.status_code in (204, 304))
TypeError: '<' not supported between instances of 'NoneType' and 'int' |
[ Impact ]
The package can't be used at all in its current state because it doesn't work with one of its central dependencies. It creates a backtrace as seen in the original bug description on simple usage cases.
The bugfix makes the package compatible with the newer version of the dependency.
[ Test Plan ]
See the example code in the bug description, but for convenience I paste it here again:
Create a file "fastapi-test.py" with the following code:
-----
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"Status": "ok"}
-----
Then run that file with python interpreter.
[ Where problems could occur ]
The package isn't usable at all right now. It can't get worse than that, frankly speaking.
[Other info]
$ lsb_release -rd
Description: Ubuntu 22.04 LTS
Release: 22.04
$ apt-cache policy python3-fastapi
python3-fastapi:
Installed: 0.63.0-2
Candidate: 0.63.0-2
Version table:
*** 0.63.0-2 500
500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
100 /var/lib/dpkg/status
Example:
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"Status": "ok"}
Traceback:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/uvicorn/protocols/http/h11_impl.py", line 373, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/usr/lib/python3/dist-packages/uvicorn/middleware/proxy_headers.py", line 75, in __call__
return await self.app(scope, receive, send)
File "/usr/lib/python3/dist-packages/fastapi/applications.py", line 199, in __call__
await super().__call__(scope, receive, send)
File "/usr/lib/python3/dist-packages/starlette/applications.py", line 119, in __call__
await self.middleware_stack(scope, receive, send)
File "/usr/lib/python3/dist-packages/starlette/middleware/errors.py", line 181, in __call__
raise exc
File "/usr/lib/python3/dist-packages/starlette/middleware/errors.py", line 159, in __call__
await self.app(scope, receive, _send)
File "/usr/lib/python3/dist-packages/starlette/exceptions.py", line 87, in __call__
raise exc
File "/usr/lib/python3/dist-packages/starlette/exceptions.py", line 76, in __call__
await self.app(scope, receive, sender)
File "/usr/lib/python3/dist-packages/starlette/routing.py", line 659, in __call__
await route.handle(scope, receive, send)
File "/usr/lib/python3/dist-packages/starlette/routing.py", line 259, in handle
await self.app(scope, receive, send)
File "/usr/lib/python3/dist-packages/starlette/routing.py", line 61, in app
response = await func(request)
File "/usr/lib/python3/dist-packages/fastapi/routing.py", line 191, in app
solved_result = await solve_dependencies(
File "/usr/lib/python3/dist-packages/fastapi/dependencies/utils.py", line 483, in solve_dependencies
response = response or Response(
File "/usr/lib/python3/dist-packages/starlette/responses.py", line 50, in __init__
self.init_headers(headers)
File "/usr/lib/python3/dist-packages/starlette/responses.py", line 77, in init_headers
and not (self.status_code < 200 or self.status_code in (204, 304))
TypeError: '<' not supported between instances of 'NoneType' and 'int' |
|