From ddf2a604d1a9cfb30b89fdfb33f47ac56ba5e930 Mon Sep 17 00:00:00 2001 From: Dirk Guijt Date: Sat, 3 Feb 2018 03:07:07 +0100 Subject: [PATCH] changed 'file' variable to 'form_file' to prevent overwriting the reserved word --- sanic/request.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sanic/request.py b/sanic/request.py index e330e085..01863bd0 100644 --- a/sanic/request.py +++ b/sanic/request.py @@ -312,11 +312,11 @@ def parse_multipart_form(body, boundary): if field_name: post_data = form_part[line_index:-4] if file_name: - file = File(type=content_type, name=file_name, body=post_data) + form_file = File(type=content_type, name=file_name, body=post_data) if field_name in files: - files[field_name].append(file) + files[field_name].append(form_file) else: - files[field_name] = [file] + files[field_name] = [form_file] else: value = post_data.decode(content_charset) if field_name in fields: