[tor-commits] [pyonionoo/master] Handle bridges without any flags in summary file.

gsathya at torproject.org gsathya at torproject.org
Tue Sep 25 16:56:38 UTC 2012


commit c4b4561f3d7184ee2a9a6e2efc048b32383f71c1
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Mon Sep 24 15:43:48 2012 -0400

    Handle bridges without any flags in summary file.
    
    Bridges without any flags have two subsequent spaces in the summary file.
    Pass a value for sep when calling split(), so that "consecutive delimiters
    are not grouped together and are deemed to delimit empty strings" (Python
    documentation).
---
 pyonionoo/parser.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/pyonionoo/parser.py b/pyonionoo/parser.py
index b917a92..4cfdd11 100644
--- a/pyonionoo/parser.py
+++ b/pyonionoo/parser.py
@@ -21,7 +21,7 @@ class Router:
         self.type = None
 
     def parse(self, raw_content):
-        values = raw_content.split()
+        values = raw_content.split(' ')
         if len(values) < 9:
             #raise Exception
             raise ValueError("Invalid router!")



More information about the tor-commits mailing list