You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ValueError: invalid literal for int() with base 10: b'i1e'
The private field of the info dict in the torrent metadata description should be of int type. Sometimes it has a bytes value b'i1e'. That value corresponds to the bencoded int value 1. It seems that some torrents files have their metadata incorrectly encoded, with the private field encoded twice: first, it is bencoded 1 -> b'i1e', and then it is bencoded again during the usual process of encoding the entire meta info dict.
To avoid the crash, an additional check should be added to the code that reads the attribute value.
The value b'i1e' means that the intention of the torrent's author was to set private=1 for the torrent. But as the value is technically incorrect, we can fall back to the default property value private=0 when interpreting this incorrect value.
The text was updated successfully, but these errors were encountered:
Sometimes
TorrentDef.is_private()
method crashes with the following error:The
private
field of theinfo
dict in the torrent metadata description should be ofint
type. Sometimes it has a bytes valueb'i1e'
. That value corresponds to the bencoded int value1
. It seems that some torrents files have their metadata incorrectly encoded, with theprivate
field encoded twice: first, it is bencoded1
->b'i1e'
, and then it is bencoded again during the usual process of encoding the entire meta info dict.To avoid the crash, an additional check should be added to the code that reads the attribute value.
The value
b'i1e'
means that the intention of the torrent's author was to setprivate=1
for the torrent. But as the value is technically incorrect, we can fall back to the default property valueprivate=0
when interpreting this incorrect value.The text was updated successfully, but these errors were encountered: