From d9d1f25883905067ace7a28319f429d167bbaa62 Mon Sep 17 00:00:00 2001 From: Fredrik Tolf Date: Sun, 8 Nov 2015 03:52:16 +0100 Subject: [PATCH] Don't require memory for multipart discard on close. --- wrw/form.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wrw/form.py b/wrw/form.py index 7f4930d..e89901d 100644 --- a/wrw/form.py +++ b/wrw/form.py @@ -81,7 +81,9 @@ class formpart(object): return ret def close(self): - self.fillbuf(-1) + while True: + if self.read(8192) == b"": + break def __enter__(self): return self -- 2.11.0