diff options
author | Lee Ball <43632885+catleeball@users.noreply.github.com> | 2019-03-27 16:47:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-27 16:47:15 -0700 |
commit | 81a0ab5bba3ffefbe7604b05dfe1de3a44d2df32 (patch) | |
tree | 2064dcd2c15b0abd5c9aed2dc513810538e362c0 | |
parent | af1f1dda65db03f7d7c9823157ad48b568053be6 (diff) | |
download | boto-81a0ab5bba3ffefbe7604b05dfe1de3a44d2df32.tar.gz |
Returned get_utf8_value for mturk dependency
-rw-r--r-- | boto/utils.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/boto/utils.py b/boto/utils.py index 12223849..1a503fa7 100644 --- a/boto/utils.py +++ b/boto/utils.py @@ -862,6 +862,20 @@ def notify(subject, body=None, html_body=None, to_string=None, boto.log.exception('notify failed') +def get_utf8_value(value): + if isinstance(value, bytes): + value.decode('utf-8') + return value + + if not isinstance(value, six.string_types): + value = six.text_type(value) + + if isinstance(value, six.text_type): + value = value.encode('utf-8') + + return value + + def mklist(value): if not isinstance(value, list): if isinstance(value, tuple): |