[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-bugs] #10977 [Stem]: parse_file should warn if the user attempts to parse a tarball
#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
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs