From 7aa49e4e7dfba8ae3713b2d0f755f463018ebc4b Mon Sep 17 00:00:00 2001 From: Anton Piskunov Date: Wed, 27 Jan 2021 20:46:39 +0300 Subject: [PATCH] Fix unicode issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stacktrace: - Error querying Корбина Телеком (E) [195.14.50.21:country_ru,nearby,regional,ipv4,refused]: rayed.com.: Timeout - Error querying Корбина Телеком (E) [195.14.50.21:country_ru,nearby,regional,ipv4,refused]: developers.facebook.com.: Timeout - Error querying Корбина Телеком (E) [195.14.50.21:country_ru,nearby,regional,ipv4,refused]: www.froala.com.: Timeout - Error querying UltraDNS [156.154.70.1:ipv4,preferred,country_us]: blog.n1mda.ru.: Timeout - Error querying Internal-1-254 (192) [192.168.1.254:internal,ipv4,country_ca]: blog.n1mda.ru.: Timeout - Error querying Rejector [95.154.128.32:country_ru,filtered,ipv4]: alpinelinux.org.: Timeout - Error querying Hurricane Electric [74.82.42.42:global,ipv4,country_us]: dash.cloudflare.com.: Timeout - Benchmark finished. Traceback (most recent call last): File "./namebench.py", line 77, in namebench.Execute() File "/Volumes/Corporate/namebench/libnamebench/cli.py", line 126, in Execute self.RunAndOpenReports() File "/Volumes/Corporate/namebench/libnamebench/cli.py", line 81, in RunAndOpenReports print "\n%s\n" % self.reporter.CreateReport(format='ascii') File "/Volumes/Corporate/namebench/libnamebench/reporter.py", line 253, in CreateReport csv_link=csv_link File "/Volumes/Corporate/namebench/nb_third_party/jinja2/environment.py", line 868, in render return self.environment.handle_exception(exc_info, True) File "templates/ascii.tmpl", line 3, in top-level template code {% for item in lowest_latency %}{{ "%-16.16s %s %2.5f\n"|format(item[0], item[1], item[2]) }}{% endfor %} File "/Volumes/Corporate/namebench/nb_third_party/jinja2/filters.py", line 443, in do_format return soft_unicode(value) % (kwargs or args) UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128) --- namebench.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/namebench.py b/namebench.py index 1e9f294..ebe64f3 100755 --- a/namebench.py +++ b/namebench.py @@ -1,4 +1,6 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- + # Copyright 2009 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License");