None port leads to a cryptic error message #1689
Unanswered
anuramat
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
uvicorn version: 0.18.3
platform: macOS/apple silicon
minimal example:
error message:
Traceback (most recent call last): File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 1100, in emit msg = self.format(record) File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 943, in format return fmt.format(record) File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 678, in format record.message = record.getMessage() File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/logging/__init__.py", line 368, in getMessage msg = msg % self.args TypeError: %d format: a real number is required, not NoneType Call stack: File "/Users/arsen/dev/erdos/test.py", line 5, in <module> uvicorn.run(app, port=None) File "/Users/arsen/dev/erdos/venv/lib/python3.10/site-packages/uvicorn/main.py", line 576, in run server.run() File "/Users/arsen/dev/erdos/venv/lib/python3.10/site-packages/uvicorn/server.py", line 60, in run return asyncio.run(self.serve(sockets=sockets)) File "/opt/homebrew/Cellar/[email protected]/3.10.6_2/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/Users/arsen/dev/erdos/venv/lib/python3.10/site-packages/uvicorn/server.py", line 77, in serve await self.startup(sockets=sockets) File "/Users/arsen/dev/erdos/venv/lib/python3.10/site-packages/uvicorn/server.py", line 166, in startup self._log_started_message(listeners) File "/Users/arsen/dev/erdos/venv/lib/python3.10/site-packages/uvicorn/server.py", line 207, in _log_started_message logger.info( Message: 'Uvicorn running on %s://%s:%d (Press CTRL+C to quit)' Arguments: ('http', '127.0.0.1', None)
maybe add a None check?
Beta Was this translation helpful? Give feedback.
All reactions