[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [pyonionoo/master] Handle bridges without any flags in summary file.
commit c4b4561f3d7184ee2a9a6e2efc048b32383f71c1
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
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!")
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits