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

Re: [tor-bugs] #10725 [BridgeDB]: Write a Completely Spec-Compliant Bridge Descriptor Parser



#10725: Write a Completely Spec-Compliant Bridge Descriptor Parser
-----------------------------+------------------------------
     Reporter:  sysrqb       |      Owner:
         Type:  enhancement  |     Status:  new
     Priority:  normal       |  Milestone:
    Component:  BridgeDB     |    Version:
   Resolution:               |   Keywords:  bridgedb-parsers
Actual Points:               |  Parent ID:
       Points:               |
-----------------------------+------------------------------

Comment (by sysrqb):

 Replying to [comment:6 atagar]:
 > I think this is a mistake. Stem handles the @type annotations. In fact,
 Karsten added them on my request. :P
 >
 > If you go through either parse_file() or the descriptor reader (which
 are the two ways you should be getting descriptors) then the @type
 annotation is used to determine the document type...

 Except for when this is specifically checked before _parse_file() is
 called. :(
 https://gitweb.torproject.org/stem.git/blob/HEAD:/stem/descriptor/networkstatus.py#l1460

 {{{
     document_file = io.BytesIO(raw_content)
     published_line =
 stem.util.str_tools._to_unicode(document_file.readline())

     if published_line.startswith("published "):
       ...
     elif validate:
       raise ValueError("Bridge network status documents must start with a
 'published' line:\n%s" % stem.util.str_tools._to_unicode(raw_content))
 }}}

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/10725#comment:8>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs