Skip to content

Commit

Permalink
Account for LC_CTYPE of UTF-8
Browse files Browse the repository at this point in the history
For more information see:

* http://bugs.python.org/issue18378
* aws#945
  • Loading branch information
jamesls committed Feb 2, 2015
1 parent a5c8468 commit 5010452
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bin/aws
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
import sys
import os

if os.environ.get('LC_CTYPE', '') == 'UTF-8':
os.environ['LC_CTYPE'] = 'en_US.UTF-8'
import awscli.clidriver


Expand Down
7 changes: 7 additions & 0 deletions tests/integration/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ def test_pagination_with_text_output(self):
p = aws('iam list-users --output text')
self.assertEqual(p.rc, 0)

def test_bad_lc_ctype_env_var_is_handled(self):
# Test for bad LC_CTYPE on Mac OS X.
base_env_vars = os.environ.copy()
base_env_vars['LC_CTYPE'] = 'UTF-8'
p = aws('iam list-users', env_vars=base_env_vars)
self.assertEqual(p.rc, 0)


if __name__ == '__main__':
unittest.main()

0 comments on commit 5010452

Please sign in to comment.