[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] GETCONF provides an empty string for CommaList and RouterList



commit fc35ea1a74b6f9a95b6d1c2d21069f837dc725bb
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sat Feb 6 15:38:41 2016 -0800

    GETCONF provides an empty string for CommaList and RouterList
    
    Workaround for a tor bug...
    
      https://trac.torproject.org/projects/tor/ticket/18263
---
 stem/response/getconf.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/stem/response/getconf.py b/stem/response/getconf.py
index 03d4e19..9d786fc 100644
--- a/stem/response/getconf.py
+++ b/stem/response/getconf.py
@@ -48,6 +48,14 @@ class GetConfResponse(stem.response.ControlMessage):
       else:
         key, value = (line.pop(), None)
 
+      # Tor's CommaList and RouterList have a bug where they map to an empty
+      # string when undefined rather than None...
+      #
+      # https://trac.torproject.org/projects/tor/ticket/18263
+
+      if value == '':
+        value = None
+
       if key not in self.entries:
         self.entries[key] = []
 

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits