Opened 9 months ago

Last modified 2 months ago

#23859 new defect

stem parse_file doesn't handle stdin

Reported by: teor Owned by: atagar
Priority: Medium Milestone:
Component: Core Tor/Stem Version:
Severity: Normal Keywords: descriptor easy
Cc: 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):

The stack trace looks like:

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

Child Tickets

Change History (1)

comment:1 Changed 2 months ago by atagar

Keywords: descriptor easy added
Note: See TracTickets for help on using tickets.