[tor-bugs] #10977 [Stem]: parse_file should warn if the user attempts to parse a tarball

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Feb 20 16:30:37 UTC 2014


#10977: parse_file should warn if the user attempts to parse a tarball
---------------------+------------------------
 Reporter:  karsten  |          Owner:  atagar
     Type:  defect   |         Status:  new
 Priority:  normal   |      Milestone:
Component:  Stem     |        Version:
 Keywords:           |  Actual Points:
Parent ID:           |         Points:
---------------------+------------------------
 The following code throws a ValueError at some point:

 {{{
 from stem.descriptor import parse_file
 for desc in parse_file('server-descriptors-2014-02.tar',
                        'server-descriptor 1.0'):
   pass
 }}}

 atagar and I figured out that `parse_file` is attempting to parse the
 tarball as text file.  And it actually finds text portions that are server
 descriptors.  But the tarball file also contains non-text stuff that makes
 stem unhappy.

 The solution is probably to warn if the input file to `parse_file` is a
 text file and not a binary file.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/10977>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list