You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The bug is reproducible against the latest release or master.
There are no similar issues or pull requests to fix it yet.
Describe the bug
uvicorn --host 0.0.0.0 --port 9000 app:app
INFO: Started server process [71014]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)
INFO: 127.0.0.1:58114 - "GET / HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 364, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in call
return await self.app(scope, receive, send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/fastapi/applications.py", line 212, in call
await super().call(scope, receive, send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/applications.py", line 119, in call
await self.middleware_stack(scope, receive, send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 181, in call
raise exc
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 159, in call
await self.app(scope, receive, _send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/exceptions.py", line 87, in call
raise exc
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/exceptions.py", line 76, in call
await self.app(scope, receive, sender)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/routing.py", line 659, in call
await route.handle(scope, receive, send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/routing.py", line 259, in handle
await self.app(scope, receive, send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/routing.py", line 61, in app
response = await func(request)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/fastapi/routing.py", line 216, in app
solved_result = await solve_dependencies(
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/fastapi/dependencies/utils.py", line 465, in solve_dependencies
response = response or Response(
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/responses.py", line 50, in init
self.init_headers(headers)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-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'
Steps to reproduce the bug
Python 3.10
Code app.py:
from fastapi import FastAPI
from fastapi.responses import JSONResponse
app = FastAPI()
@app.get("/")
async def read_root():
return JSONResponse(status_code=200, content={"Success":"Ok!"})
uvicorn --host 0.0.0.0 --port 9000 app:app
Expected behavior
No response
Actual behavior
No response
Debugging material
No response
Environment
Linux Manjaro
Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux
starlette 0.18.0
Additional context
No response
The text was updated successfully, but these errors were encountered:
Checklist
master
.Describe the bug
uvicorn --host 0.0.0.0 --port 9000 app:app
INFO: Started server process [71014]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:9000 (Press CTRL+C to quit)
INFO: 127.0.0.1:58114 - "GET / HTTP/1.1" 500 Internal Server Error
ERROR: Exception in ASGI application
Traceback (most recent call last):
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 364, in run_asgi
result = await app(self.scope, self.receive, self.send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 75, in call
return await self.app(scope, receive, send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/fastapi/applications.py", line 212, in call
await super().call(scope, receive, send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/applications.py", line 119, in call
await self.middleware_stack(scope, receive, send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 181, in call
raise exc
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/middleware/errors.py", line 159, in call
await self.app(scope, receive, _send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/exceptions.py", line 87, in call
raise exc
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/exceptions.py", line 76, in call
await self.app(scope, receive, sender)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/routing.py", line 659, in call
await route.handle(scope, receive, send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/routing.py", line 259, in handle
await self.app(scope, receive, send)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/routing.py", line 61, in app
response = await func(request)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/fastapi/routing.py", line 216, in app
solved_result = await solve_dependencies(
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/fastapi/dependencies/utils.py", line 465, in solve_dependencies
response = response or Response(
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-packages/starlette/responses.py", line 50, in init
self.init_headers(headers)
File "/home/rds/venvs/new_deploy_test/venv/lib/python3.10/site-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'
Steps to reproduce the bug
Python 3.10
Code app.py:
uvicorn --host 0.0.0.0 --port 9000 app:app
Expected behavior
No response
Actual behavior
No response
Debugging material
No response
Environment
Linux Manjaro
Python 3.10.2 (main, Jan 15 2022, 19:56:27) [GCC 11.1.0] on linux
starlette 0.18.0
Additional context
No response
The text was updated successfully, but these errors were encountered: