[tor-bugs] #23859 [Core Tor/Stem]: stem parse_file doesn't handle stdin

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Oct 14 17:46:36 UTC 2017


#23859: stem parse_file doesn't handle stdin
-------------------------------+--------------------
     Reporter:  teor           |      Owner:  atagar
         Type:  defect         |     Status:  new
     Priority:  Medium         |  Milestone:
    Component:  Core Tor/Stem  |    Version:
     Severity:  Normal         |   Keywords:
Actual Points:                 |  Parent ID:
       Points:                 |   Reviewer:
      Sponsor:                 |
-------------------------------+--------------------
 The code looks like:

 {{{
 from sys import stdin

 from stem.descriptor import parse_file

 new_micro_digests = set()

 for desc in parse_file(stdin, validate = True):
     new_micro_digests.add(desc.digest)
 }}}

 The stack trace looks like:

 {{{
 $ cat 2017-10-14-17-05-00-micro | ./get_micro_fp.py
 Traceback (most recent call last):
   File "./get_micro_fp.py", line 9, in <module>
     for desc in parse_file(stdin, validate = True):
   File "/Users/dev/stem/stem/descriptor/__init__.py", line 196, in
 parse_file
     initial_position = descriptor_file.tell()
 IOError: [Errno 29] Illegal seek
 }}}

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


More information about the tor-bugs mailing list