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

Codec error in some CSV exports #584

Closed
simonw opened this issue Oct 7, 2019 · 2 comments
Closed

Codec error in some CSV exports #584

simonw opened this issue Oct 7, 2019 · 2 comments
Labels
bug csv minor Minor bugs (not high priority)

Comments

@simonw
Copy link
Owner

simonw commented Oct 7, 2019

Got this exploring my Swarm checkins:

448DBFC4-71F8-4846-83C0-BEA511B2157A

/swarm/stickers.csv?stickerType=messageOnly&_size=max

@simonw simonw added bug minor Minor bugs (not high priority) labels Oct 7, 2019
@simonw simonw changed the title Code error in some CSV exports Codec error in some CSV exports Oct 7, 2019
@simonw
Copy link
Owner Author

simonw commented Oct 7, 2019

writer = csv.writer(LimitedWriter(r, self.ds.config("max_csv_mb")))

@simonw
Copy link
Owner Author

simonw commented Oct 18, 2019

It looks like this is the problem:

async def write(self, chunk):
await self.send(
{
"type": "http.response.body",
"body": chunk.encode("latin-1"),
"more_body": True,
}
)

That should be utf-8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug csv minor Minor bugs (not high priority)
Projects
None yet
Development

No branches or pull requests

1 participant