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

locust doesn't escape the double quotes in the csv output #1417

Closed
tobeczm opened this issue Jun 8, 2020 · 2 comments
Closed

locust doesn't escape the double quotes in the csv output #1417

tobeczm opened this issue Jun 8, 2020 · 2 comments
Labels

Comments

@tobeczm
Copy link

tobeczm commented Jun 8, 2020

Describe the bug

    @task(1)
    def get(self, size):
        self.client.get("/cash/{}".format(size), name='{"scenario":"get cashes","path":"/cash/[amount]","arguments":[{"size":1}]}'))

Expected behavior

the quotes should be escaped as below:

"Type","Name",...
"GET","{""scenario"": ""get cashes"", ""path"": ""/cash/[amount]"", ""arguments"": [{""size"": 1}]}", ...

Actual behavior

in the csv output is looks as below, the quotes are not escaped.

"Type","Name",...
"GET","{"scenario": "get cashes", "path": "/cash/[amount]", "arguments": [{"size": 1}]}", ...

Steps to reproduce

Environment

  • OS:
  • Python version:3.8
  • Locust version: 1.0.2
  • Locust command line that you ran:
  • Locust file contents (anonymized if necessary):
@tobeczm tobeczm added the bug label Jun 8, 2020
@tobeczm tobeczm changed the title locust doesn't escaped the double quotes in the csv output locust doesn't escap the double quotes in the csv output Jun 8, 2020
@tobeczm tobeczm changed the title locust doesn't escap the double quotes in the csv output locust doesn't escape the double quotes in the csv output Jun 8, 2020
@heyman
Copy link
Member

heyman commented Jun 8, 2020

Thanks for reporting!

We should consider using the python builtin csv module for generating the CSV data.

@cyberw
Copy link
Collaborator

cyberw commented Jun 16, 2020

fixed by #1428!

@cyberw cyberw closed this as completed Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants