Skip to content

Commit

Permalink
Fixing an issue that came up while fixing aws/aws-cli#593.
Browse files Browse the repository at this point in the history
  • Loading branch information
garnaat committed Jan 14, 2014
1 parent 47e069f commit c47f501
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
4 changes: 3 additions & 1 deletion botocore/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ def store_value_query(self, value, built_params, label):
label = label.format(label=self.get_label())
else:
label = self.get_label()
built_params[label] = str(value)
if not isinstance(value, six.text_type):
value = str(value)
built_params[label] = value

def build_parameter_query(self, value, built_params, label=''):
value = self.validate(value)
Expand Down
10 changes: 10 additions & 0 deletions tests/unit/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,16 @@ def test_string(self):
p.build_parameter_query(value=1,
built_params=d)

def test_utf8_string(self):
p = botocore.parameters.StringParameter(None, name='foo')
d = {}
value = '\u65e5\u672c\u8a9e'
p.build_parameter_query(value, d)
self.assertEqual(d['foo'], value)
with self.assertRaises(botocore.exceptions.ValidationError):
p.build_parameter_query(value=1,
built_params=d)

def test_integer(self):
p = botocore.parameters.IntegerParameter(None, name='foo')
d = {}
Expand Down

0 comments on commit c47f501

Please sign in to comment.