Skip to content

Commit

Permalink
Fixing potential UnicodeError
Browse files Browse the repository at this point in the history
  • Loading branch information
karalics committed Sep 1, 2017
1 parent d5d8da9 commit bc590de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ New features:

Bug fixes:

- *add item here*
- Fixing UnicodeError when the @@z3cform_validate_field view sends
a filename with type unicode. (collective.easyform in our case)


2.0.3 (2017-07-03)
Expand Down
2 changes: 2 additions & 0 deletions plone/formwidget/namedfile/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def toFieldValue(self, value):
return self.field.missing_value

else:
if isinstance(value, unicode):
value = value.encode('utf-8')
return self.field._type(data=str(value))


Expand Down

0 comments on commit bc590de

Please sign in to comment.