Skip to content

Commit 29a1ee9

Browse files
author
Kevin McDonald
committed
Passes the LANG env var from tox to the tests
1 parent aafd947 commit 29a1ee9

2 files changed

Lines changed: 5 additions & 16 deletions

File tree

SoftLayer/CLI/core.py

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,6 @@
3434
if sys.stdout.isatty():
3535
DEFAULT_FORMAT = 'table'
3636

37-
# Attempt to set the locale for the user if the default encoding is
38-
# ascii. More information here:
39-
# http://click.pocoo.org/4/python3/#python-3-surrogate-handling
40-
import codecs
41-
import locale
42-
try:
43-
ENC = codecs.lookup(locale.getpreferredencoding()).name
44-
except Exception:
45-
ENC = 'ascii'
46-
47-
if ENC == 'ascii':
48-
try:
49-
locale.setlocale(locale.LC_ALL, 'C.UTF-8')
50-
except Exception:
51-
pass
52-
5337

5438
class CommandLoader(click.MultiCommand):
5539
"""Loads module for click."""
@@ -192,6 +176,7 @@ def output_result(ctx, result, timings=False, **kwargs):
192176
def main():
193177
"""Main program. Catches several common errors and displays them nicely."""
194178
exit_status = 0
179+
195180
try:
196181
cli.main()
197182
except SoftLayer.SoftLayerAPIError as ex:

tox.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
[tox]
22
envlist = py26,py27,py33,py34,pypy,analysis,coverage
3+
34
[testenv]
5+
setenv =
6+
LANG = {env:LANG:C.UTF-8}
7+
48
deps = -r{toxinidir}/tools/test-requirements.txt
59
commands = nosetests
610

0 commit comments

Comments
 (0)