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

atagar at torproject.org atagar at torproject.org
Sat Feb 6 23:39:40 UTC 2016


commit fc35ea1a74b6f9a95b6d1c2d21069f837dc725bb
Author: Damian Johnson <atagar at torproject.org>
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] = []
 



More information about the tor-commits mailing list