Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError #1506

Closed
2 tasks done
SergeyPotekhin opened this issue Feb 11, 2022 · 1 comment
Closed
2 tasks done

TypeError #1506

SergeyPotekhin opened this issue Feb 11, 2022 · 1 comment

Comments

@SergeyPotekhin
Copy link

Checklist

  • 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

@Kludex
Copy link
Sponsor Member

Kludex commented Feb 11, 2022

FastAPI doesn't support Starlette 0.18.0.

Use/see tiangolo/fastapi#4483 .

@Kludex Kludex closed this as completed Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants