From 485c2d8af127cea4e82f0dc5241e3a34de3ca08c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 16 Oct 2015 16:43:49 +0530 Subject: [PATCH] Fix bug when using writefile in duktape --- src/duktape/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/duktape/__init__.py b/src/duktape/__init__.py index ee07b5793b..0e3c157ab9 100644 --- a/src/duktape/__init__.py +++ b/src/duktape/__init__.py @@ -128,9 +128,10 @@ def writefile(path, data, enc='utf-8'): with open(path, 'wb') as f: f.write(data) except UnicodeEncodeError as e: - return '', 'Failed to encode the data for file: %s with specified encoding: %s' % (path, enc) + return ['', 'Failed to encode the data for file: %s with specified encoding: %s' % (path, enc)] except EnvironmentError as e: return [errno.errorcode[e.errno], 'Failed to write to file: %s with error: %s' % (path, e.message or e)] + return [None, None] class Function(object):