parse_file should warn if the user attempts to parse a tarball
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.