[tor-commits] [stem/master] Stripping off the 'opt ' keyline prefix

atagar at torproject.org atagar at torproject.org
Mon Mar 26 00:10:01 UTC 2012


commit 47f21c97da50392d4d0be38d7292bca920d716df
Author: Damian Johnson <atagar at torproject.org>
Date:   Sun Mar 18 14:39:13 2012 -0700

    Stripping off the 'opt ' keyline prefix
---
 stem/descriptor/server_descriptor.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/stem/descriptor/server_descriptor.py b/stem/descriptor/server_descriptor.py
index d0f343c..2b92f5c 100644
--- a/stem/descriptor/server_descriptor.py
+++ b/stem/descriptor/server_descriptor.py
@@ -94,7 +94,13 @@ class ServerDescriptorV2(Descriptor):
     exit_policy_lines = []
     
     for line in contents.split("\n"):
-      line_match = KEYWORD_LINE.match()
+      # Some lines have an 'opt ' for backward compatability. They should be
+      # ignored. This prefix is being removed in...
+      # https://trac.torproject.org/projects/tor/ticket/5419
+      
+      line = line.lstrip("opt ")
+      
+      line_match = KEYWORD_LINE.match(line)
       
       if not line_match:
         raise ValueError("Line contains invalid characters: %s" % line)





More information about the tor-commits mailing list