From 4cf68a4e3deb6992364965e130ea5fd18c828190 Mon Sep 17 00:00:00 2001 From: pcdinh Date: Tue, 25 Oct 2016 14:39:07 +0700 Subject: [PATCH] Renamed funtion file() to send_file() because `file` is a reserved built-in symbol. Redefine `file` can caused unpredictable issues --- sanic/response.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanic/response.py b/sanic/response.py index d0e64cea..859f7d02 100644 --- a/sanic/response.py +++ b/sanic/response.py @@ -153,7 +153,7 @@ def html(body, status=200, headers=None): content_type="text/html; charset=utf-8") -async def file(location, mime_type=None, headers=None): +async def send_file(location, mime_type=None, headers=None): filename = path.split(location)[-1] async with open_async(location, mode='rb') as _file: