[tor-commits] [stem/master] Interpreter's /info errored for relays without contact info

atagar at torproject.org atagar at torproject.org
Fri Jun 6 15:40:16 UTC 2014


commit d81dafbdd9cf4baa8f7f53a78b8badf818af4667
Author: Damian Johnson <atagar at torproject.org>
Date:   Fri Jun 6 08:35:35 2014 -0700

    Interpreter's /info errored for relays without contact info
    
    Issue caught by zoltan...
    
      >>> /info 74.3.165.39
      Traceback (most recent call last):
        File "/usr/bin/tor-prompt", line 8, in <module>
          stem.interpreter.main()
        File "/usr/lib/python3.4/site-packages/stem/interpreter/__init__.py", line 116, in main
          response = interpreter.run_command(user_input)
        File "/usr/lib/python3.4/site-packages/stem/util/conf.py", line 276, in wrapped
          return func(*args, config = config, **kwargs)
        File "/usr/lib/python3.4/site-packages/stem/interpreter/commands.py", line 318, in run_command
          output = self.do_info(arg)
        File "/usr/lib/python3.4/site-packages/stem/interpreter/commands.py", line 229, in do_info
          contact = contact.replace(alias, '@')
      AttributeError: 'NoneType' object has no attribute 'replace'
---
 docs/change_log.rst          |    4 ++++
 stem/interpreter/commands.py |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/docs/change_log.rst b/docs/change_log.rst
index 58fca66..6e9a13c 100644
--- a/docs/change_log.rst
+++ b/docs/change_log.rst
@@ -40,6 +40,10 @@ Unreleased
 The following are only available within Stem's `git repository
 <download.html>`_.
 
+ * **Interpreter**
+
+  * The /info command errored for relays without contact information.
+
 .. _version_1.2:
 
 Version 1.2
diff --git a/stem/interpreter/commands.py b/stem/interpreter/commands.py
index 5473628..2679e4c 100644
--- a/stem/interpreter/commands.py
+++ b/stem/interpreter/commands.py
@@ -220,7 +220,7 @@ class ControlInterpretor(code.InteractiveConsole):
     lines.append(format('flags: ', *BOLD_OUTPUT) + ', '.join(ns_desc.flags))
     lines.append(format('exit policy: ', *BOLD_OUTPUT) + exit_policy_label)
 
-    if server_desc:
+    if server_desc and server_desc.contact:
       contact = stem.util.str_tools._to_unicode(server_desc.contact)
 
       # clears up some highly common obscuring



More information about the tor-commits mailing list