[tor-commits] [stem/master] Just provide bytes for address errors

atagar at torproject.org atagar at torproject.org
Sun Jan 21 02:04:04 UTC 2018


commit 407ed1cef0444290a7ab4cb80db460727cddd4b0
Author: Damian Johnson <atagar at torproject.org>
Date:   Sat Jan 20 12:12:59 2018 -0800

    Just provide bytes for address errors
    
    Spec doesn't specify what form errors take and I don't have any examples. Just
    providing the bytes the socket gives us. We might change the value in the
    future to be something more useful.
---
 stem/client/__init__.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/stem/client/__init__.py b/stem/client/__init__.py
index b0da7aae..7705e59d 100644
--- a/stem/client/__init__.py
+++ b/stem/client/__init__.py
@@ -266,7 +266,12 @@ class Address(Field):
         self.value = ':'.join(['%04x' % Size.SHORT.unpack(value[i * 2:(i + 1) * 2]) for i in range(8)])
         self.value_bin = value
     else:
-      self.value, self.value_bin = None, None  # TODO: implement
+      # The spec doesn't really tell us what form to expect errors to be. For
+      # now just leaving the value unset so we can fill it in later when we
+      # know what would be most useful.
+
+      self.value = None
+      self.value_bin = value
 
   @staticmethod
   def pop(content):





More information about the tor-commits mailing list