Commit ebb6b844 by James Tanner

Catch unicode unescape failures in copy action plugin

parent 12c812f0
......@@ -58,7 +58,11 @@ class ActionModule(object):
# now we need to unescape it so that the newlines are evaluated properly
# when writing the file to disk
if content:
content = content.decode('unicode-escape')
if isinstance(content, unicode):
try:
content = content.decode('unicode-escape')
except UnicodeDecodeError:
pass
if (source is None and content is None and not 'first_available_file' in inject) or dest is None:
result=dict(failed=True, msg="src (or content) and dest are required")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment