From f4b508d395f382d098f90afb8d3f1d1f08c76d8b Mon Sep 17 00:00:00 2001 From: Neubda Date: Wed, 27 Jul 2016 15:27:15 +0200 Subject: [PATCH 1/8] Solve UnicodeEncodeError on output I got an "UnicodeEncodeError: 'ascii' codec can't encode character u'\xf3' in position 22: ordinal not in range(128)" in line 644 when the server had a non ascii character in the sponsors name. --- speedtest_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speedtest_cli.py b/speedtest_cli.py index d93d5c3..67d2e3a 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -641,7 +641,7 @@ def speedtest(): servers = closestServers(config['client']) if not args.simple: - print_('Testing from %(isp)s (%(ip)s)...' % config['client']) + print_(('Testing from %(isp)s (%(ip)s)...' % config['client']).encode('utf-8', 'ignore')) if args.server: try: From db218c989ebb09b08db56d8d430aaa0be294c48f Mon Sep 17 00:00:00 2001 From: Neubda Date: Wed, 27 Jul 2016 16:28:04 +0200 Subject: [PATCH 2/8] cosmetical change The Travis CI build failed. Splitted line 644. --- speedtest_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/speedtest_cli.py b/speedtest_cli.py index 67d2e3a..b4d5d85 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -641,7 +641,8 @@ def speedtest(): servers = closestServers(config['client']) if not args.simple: - print_(('Testing from %(isp)s (%(ip)s)...' % config['client']).encode('utf-8', 'ignore')) + print_(('Testing from %(isp)s (%(ip)s)... + ' % config['client']).encode('utf-8', 'ignore')) if args.server: try: From a2cfb1db3506bb375435819c746b36237d36f095 Mon Sep 17 00:00:00 2001 From: Neubda Date: Wed, 27 Jul 2016 16:38:26 +0200 Subject: [PATCH 3/8] Update speedtest_cli.py --- speedtest_cli.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/speedtest_cli.py b/speedtest_cli.py index b4d5d85..28514c6 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -641,8 +641,8 @@ def speedtest(): servers = closestServers(config['client']) if not args.simple: - print_(('Testing from %(isp)s (%(ip)s)... - ' % config['client']).encode('utf-8', 'ignore')) + print_(('Testing from %(isp)s (%(ip)s)...' + % config['client']).encode('utf-8', 'ignore')) if args.server: try: From 290a1b9ec6b4120e85e48e6620e93ae506be4870 Mon Sep 17 00:00:00 2001 From: Neubda Date: Wed, 27 Jul 2016 16:47:41 +0200 Subject: [PATCH 4/8] removed trailing whithspace --- speedtest_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speedtest_cli.py b/speedtest_cli.py index 28514c6..f55da5d 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -641,7 +641,7 @@ def speedtest(): servers = closestServers(config['client']) if not args.simple: - print_(('Testing from %(isp)s (%(ip)s)...' + print_(('Testing from %(isp)s (%(ip)s)...' % config['client']).encode('utf-8', 'ignore')) if args.server: From 2dc2780bd5703e6ec83b41c8a12d48c6971d1e42 Mon Sep 17 00:00:00 2001 From: Neubda Date: Wed, 27 Jul 2016 16:57:38 +0200 Subject: [PATCH 5/8] reformatting print command The Travis CI build failed E128 continuation line under-indented for visual indent --- speedtest_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speedtest_cli.py b/speedtest_cli.py index f55da5d..3b0ac49 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -642,7 +642,7 @@ def speedtest(): if not args.simple: print_(('Testing from %(isp)s (%(ip)s)...' - % config['client']).encode('utf-8', 'ignore')) + % config['client']).encode('utf-8', 'ignore')) if args.server: try: From 0d324a671aa2bffdcfc45d057bdc17aec2d4d7c3 Mon Sep 17 00:00:00 2001 From: Neubda Date: Thu, 28 Jul 2016 09:24:19 +0200 Subject: [PATCH 6/8] Testing suite reports python 3.2 not supported --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e8b3a20..b15b5ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ env: - TOXENV=py25 - TOXENV=py26 - TOXENV=py27 - - TOXENV=py32 +# - TOXENV=py32 # Testing suite reports python 3.2 not supported - TOXENV=py33 - TOXENV=py34 - TOXENV=pypy From c80e7e16175734720f2a57c2d183c035f53503df Mon Sep 17 00:00:00 2001 From: Neubda Date: Thu, 28 Jul 2016 09:30:43 +0200 Subject: [PATCH 7/8] Update .travis.yml --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b15b5ee..ec1ad95 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,6 @@ env: - TOXENV=py25 - TOXENV=py26 - TOXENV=py27 -# - TOXENV=py32 # Testing suite reports python 3.2 not supported - TOXENV=py33 - TOXENV=py34 - TOXENV=pypy From 3b8ddb5ea2e60f50c7762fb731a712061c9eabd6 Mon Sep 17 00:00:00 2001 From: Neubda Date: Thu, 28 Jul 2016 09:44:31 +0200 Subject: [PATCH 8/8] error in Python 2.4 test --- speedtest_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/speedtest_cli.py b/speedtest_cli.py index 3b0ac49..c9edc9c 100755 --- a/speedtest_cli.py +++ b/speedtest_cli.py @@ -445,7 +445,7 @@ def closestServers(client, all=False): root = ET.fromstring(''.encode().join(serversxml)) elements = root.getiterator('server') except AttributeError: # Python3 branch - root = DOM.parseString(''.join(serversxml)) + root = DOM.parseString(''.encode().join(serversxml)) elements = root.getElementsByTagName('server') except SyntaxError: raise SpeedtestCliServerListError