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
My app API uses versioning (Microsoft.AspNetCore.Mvc.Versioning) with version info in the media type Content-Type header).
Thus, the responses are like this:
however, the FastResponse.text doesn't expect that Content-Type can have anything else after the charset=utf-8; and uses the rest of the value as content encoding.
self.encoding = self.headers.get("content-type", "").partition("charset=")[2] or "utf-8"
Getting this error:
LookupError: unknown encoding: utf-8; api-version=3.0
[2023-10-06 19:37:47,444] Andrews-Mac-Studio.local/ERROR/locust.user.task: unknown encoding: utf-8; api-version=3.0
Traceback (most recent call last):
File "/opt/homebrew/lib/python3.11/site-packages/locust/user/task.py", line 347, in run
self.execute_next_task()
File "/opt/homebrew/lib/python3.11/site-packages/locust/user/task.py", line 378, in execute_next_task
self.execute_task(self._task_queue.pop(0))
File "/opt/homebrew/lib/python3.11/site-packages/locust/user/task.py", line 499, in execute_task
task(self.user)
File "/Users/andrew/Dev/temp.py", line 10, in index
with self.rest("POST",
File "/opt/homebrew/Cellar/python@3.11/3.11.5/Frameworks/Python.framework/Versions/3.11/lib/python3.11/contextlib.py", line 137, in __enter__
return next(self.gen)
^^^^^^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/locust/contrib/fasthttp.py", line 379, in rest
if resp.text is None:
^^^^^^^^^
File "/opt/homebrew/lib/python3.11/site-packages/locust/contrib/fasthttp.py", line 465, in text
Prerequisites
Description
My app API uses versioning (Microsoft.AspNetCore.Mvc.Versioning) with version info in the media type Content-Type header).
Thus, the responses are like this:
however, the FastResponse.text doesn't expect that Content-Type can have anything else after the
charset=utf-8;
and uses the rest of the value as content encoding.Getting this error:
Command line
locust -f temp.py --headless --host http://localhost:8888 -u 1 -r 1
Locustfile contents
Python version
Python 3.11.5
Locust version
locust 2.17.0 from /opt/homebrew/lib/python3.11/site-packages/locust (python 3.11.5)
Operating system
Mac OS 14.0 (23A344)
The text was updated successfully, but these errors were encountered: