summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLee Ball <43632885+catleeball@users.noreply.github.com>2019-03-27 20:33:46 -0700
committerGitHub <noreply@github.com>2019-03-27 20:33:46 -0700
commit335ad9e0347df5ceb0e70e01d161690a0412499a (patch)
tree9dd8796757faf6b11e3a94d534b7b13af1cb31fd
parentce9288bb882ce438f5a5363b6f22d5ab3bc47672 (diff)
downloadboto-335ad9e0347df5ceb0e70e01d161690a0412499a.tar.gz
Utf8able now coerces objects to strings
-rw-r--r--boto/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/boto/utils.py b/boto/utils.py
index ed39c253..b74ee767 100644
--- a/boto/utils.py
+++ b/boto/utils.py
@@ -1109,6 +1109,8 @@ def get_utf8able_str(s, errors='strict'):
makes sure that any bytes passed in can be decoded using the
utf-8 codec (and raises a UnicodeDecodeError if not).
"""
+ if not isinstance(s, (text_type, binary_type)):
+ s = str(s)
if six.PY2:
# We want to return utf-8 encoded bytes.
if isinstance(s, six.text_type):