I'm getting the error shown in the title. Here is the traceback:
2020-01-13T05:03:49.967604+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/aiohttp_debugtoolbar/middlewares.py", line 57, in toolbar_middleware
2020-01-13T05:03:49.967606+00:00 app[web.1]: return (yield from handler(request))
2020-01-13T05:03:49.967608+00:00 app[web.1]: File "/app/handlers/utils/web.py", line 139, in inner
2020-01-13T05:03:49.967610+00:00 app[web.1]: return await func(request, prepare_response, filepath, **func_kwargs)
2020-01-13T05:03:49.967612+00:00 app[web.1]: File "/app/handlers/csv2html.py", line 37, in csv2html
2020-01-13T05:03:49.967614+00:00 app[web.1]: await response.write(reader.to_html())
2020-01-13T05:03:49.967616+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/aiohttp/web_response.py", line 416, in write
2020-01-13T05:03:49.967618+00:00 app[web.1]: "data argument must be byte-ish (%r)" % type(data)
2020-01-13T05:03:49.967620+00:00 app[web.1]: AssertionError: data argument must be byte-ish (<class 'str'>)
Disconnected from log stream. There may be events happening that you do not see here! Attempting to reconnect...
2020-01-13T05:03:49.967602+00:00 app[web.1]: response = await handler(request)
2020-01-13T05:03:49.967604+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/aiohttp_debugtoolbar/middlewares.py", line 57, in toolbar_middleware
2020-01-13T05:03:49.967606+00:00 app[web.1]: return (yield from handler(request))
2020-01-13T05:03:49.967608+00:00 app[web.1]: File "/app/handlers/utils/web.py", line 139, in inner
2020-01-13T05:03:49.967610+00:00 app[web.1]: return await func(request, prepare_response, filepath, **func_kwargs)
2020-01-13T05:03:49.967612+00:00 app[web.1]: File "/app/handlers/csv2html.py", line 37, in csv2html
2020-01-13T05:03:49.967614+00:00 app[web.1]: await response.write(reader.to_html())
2020-01-13T05:03:49.967616+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/aiohttp/web_response.py", line 416, in write
2020-01-13T05:03:49.967618+00:00 app[web.1]: "data argument must be byte-ish (%r)" % type(data)
2020-01-13T05:03:49.967620+00:00 app[web.1]: AssertionError: data argument must be byte-ish (<class 'str'>)
The app is an api for another app. It uses aiohttp and is hosted at heroku. This particular function being called is supposed to convert csv into html.
I can show more code if you'd like, but I don't think that is needed. Correct me if I'm wrong. Can anyone help with this? Thanks in advance.