Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Unicode headers prevent script from running #2

Open
LukeShirnia opened this issue Mar 26, 2020 · 1 comment
Open

Bug: Unicode headers prevent script from running #2

LukeShirnia opened this issue Mar 26, 2020 · 1 comment

Comments

@LukeShirnia
Copy link

LukeShirnia commented Mar 26, 2020

Hey.

We regularly get issues with the traffic analyser not running on device with errors similar to:

Traceback (most recent call last):
  File "<stdin>", line 1885, in <module>
  File "<stdin>", line 1854, in main
  File "<stdin>", line 1652, in print_main_header
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-10: ordinal not in range(128)

A very simple solution of emptying the headers works. Eg:

class Title(object):
    line = u''
    traffic_analyser = u''
    log_info = u''
    log_result = u''
    general_info = u''

Ill look into more appropriate fix when I get a chance.

@459below
Copy link

This works for me:

diff --git a/traffic_analyser.py b/traffic_analyser.py
old mode 100644
new mode 100755
index 6119757..be0df23
--- a/traffic_analyser.py
+++ b/traffic_analyser.py
@@ -32,11 +32,11 @@ class Col(object):
 
 
 class Title(object):
-    line = u'●▬▬▬▬▬▬▬▬▬▬▬▬▬▬๑۩۩๑▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●'
-    traffic_analyser = u'▂▃▅▇█▓▒░۩۞۩ TRAFFIC ANALYSER ۩۞۩░▒▓█▇▅▃▂'
-    log_info = u'▂▃▅▇█▓▒░۩۞۩ LOGS INFO ۩۞۩░▒▓█▇▅▃▂'
-    log_result = u'▂▃▅▇█▓▒░۩۞۩ LOG RESULTS ۩۞۩░▒▓█▇▅▃▂'
-    general_info = u'▂▃▅▇█▓▒░۩۞۩ GENERAL INFO ۩۞۩░▒▓█▇▅▃▂'
+    line = '---'
+    traffic_analyser = '--- TRAFFIC ANALYSER ---'
+    log_info = '--- LOGS INFO ---'
+    log_result = '--- LOGS RESULT ---'
+    general_info = '--- GENERAL INFO ---'
 
 
 class CmdArgs(object):
@@ -1144,7 +1144,7 @@ class PrintData(object):
         if not self.cmd_args[
                 'opts'].select and 'cycle_all' not in self.cmd_args:
             print
-            print u'●▬▬▬▬▬▬▬▬▬▬▬▬▬▬๑۩۩๑▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬●'
+            print '---'
             print
             print ("✄ Results below are a combined collection of the log files"
                    " listed above. For per-log analysis consider using"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants