From eaf9e40dc270a2dec5b3d57cc043c52d7fd3a2b6 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 29 Nov 2015 18:34:54 +0000 Subject: [PATCH] Web: increase subprocess memory limit and catch MemoryError appropriately. --- plugins/Web/plugin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Web/plugin.py b/plugins/Web/plugin.py index 287d7958c..8d363b8a1 100644 --- a/plugins/Web/plugin.py +++ b/plugins/Web/plugin.py @@ -100,9 +100,9 @@ def fetch_sandbox(f): def newf(self, irc, *args): try: replies = commands.process(process, self, irc, *args, - timeout=10, heap_size=1024*1024, + timeout=10, heap_size=10*1024*1024, pn=self.name(), cn=f.__name__) - except commands.ProcessTimeoutError: + except commands.ProcessTimeoutError, MemoryError: raise utils.web.Error(_('Page is too big or the server took ' 'too much time to answer the request.')) else: