Skip to content

Commit

Permalink
encode unicode message as utf-8, not default encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
davisagli committed Oct 6, 2018
1 parent 9c6792c commit ccdec8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plone/dexterity/filerepresentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,10 +690,10 @@ def _getStream(self):
message = self._getMessage()
if six.PY2:
# message.as_string will return str in both Python 2 and 3
mode = 'w+b'
kw = {'mode': 'w+b'}
else:
mode = 'w+'
out = tempfile.TemporaryFile(mode=mode)
kw = {'mode': 'w+', 'encoding': 'utf-8'}
out = tempfile.TemporaryFile(**kw)
out.write(message.as_string())
self._size = out.tell()
out.seek(0)
Expand Down

0 comments on commit ccdec8b

Please sign in to comment.