dispatch: handle writing unicode to file properly

This commit is contained in:
Brian S. Stephan 2015-07-11 08:09:53 -05:00
parent e2d4e29750
commit 6bf2732d7f
1 changed files with 1 additions and 1 deletions

View File

@ -93,7 +93,7 @@ class DispatchMessage(generics.GenericAPIView):
filename = os.path.abspath(action.destination)
log.debug("sending '%s' to file %s", text, filename)
with open(filename, 'w') as f:
f.write(text)
f.write(text.encode('utf8'))
f.write(b'\n')
new_data = copy.deepcopy(message.data)