Fix for Python 3.5

This commit is contained in:
Simon Willison 2019-06-23 08:09:41 -07:00
commit 3bd5e14bc1

View file

@ -205,7 +205,7 @@ async def asgi_send_file(
if filename: if filename:
headers["Content-Disposition"] = 'attachment; filename="{}"'.format(filename) headers["Content-Disposition"] = 'attachment; filename="{}"'.format(filename)
first = True first = True
async with aiofiles.open(filepath, mode="rb") as fp: async with aiofiles.open(str(filepath), mode="rb") as fp:
if first: if first:
await asgi_start( await asgi_start(
send, send,