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
Describe the bug
There is encoding error about 'cp949'
File "/home/taltal/git/gnu6/venv/lib/python3.10/site-packages/slowapi/extension.py", line 159, in __init__
self.app_config = Config(
File "/home/taltal/git/gnu6/venv/lib/python3.10/site-packages/starlette/config.py", line 66, in __init__
self.file_values = self._read_file(env_file)
File "/home/taltal/git/gnu6/venv/lib/python3.10/site-packages/starlette/config.py", line 121, in _read_file
for line in input_file.readlines():
UnicodeDecodeError: 'cp949' codec can't decode byte 0xec in position 3: illegal multibyte sequence
When I modify the encoding like this, it is enable to handle error
venv/lib/python3.10/site-packages/starlette/config.py/classConfigclassConfig
...
def_read_file(self, file_name: str|Path) ->dict[str, str]:
file_values: typing.Dict[str, str] = {}
withopen(file_name, encoding='utf-8') asinput_file: # There was no "encoding='utf-8'"forlineininput_file.readlines():
line=line.strip()
if"="inlineandnotline.startswith("#"):
key, value=line.split("=", 1)
key=key.strip()
value=value.strip().strip("\"'")
file_values[key] =valuereturnfile_values
To Reproduce
Show us your code, only copy the relevant parts, the shorter it is, the easier it is to help you.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Your app (please complete the following information):
fastapi or starlette?
Version?
slowapi version (have you tried with the latest version)?
Using FastAPI, and starlette also, but the source code is related with starlette
FastAPI version: 0.109.2
starlette version: 0.36.3
slowapi version: 0.1.9
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
There is encoding error about 'cp949'
When I modify the encoding like this, it is enable to handle error
To Reproduce
Show us your code, only copy the relevant parts, the shorter it is, the easier it is to help you.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Your app (please complete the following information):
Using FastAPI, and starlette also, but the source code is related with starlette
FastAPI version: 0.109.2
starlette version: 0.36.3
slowapi version: 0.1.9
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: