rtorrent-cleanup
rtorrent-cleanup copied to clipboard
RuntimeError: Maximum recursion depth exceeded
When trying to run this code. I ran into an issue "RuntimeError: Maximum recursion depth exceeded"
return walk(exp, index + endsub) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 58, in walk endsub = walk(exp[index:], 1) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 47, in walk return walk(exp, endchar + 1) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 58, in walk endsub = walk(exp[index:], 1) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 52, in walk strlength = stringlength(exp, index) File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 33, in stringlength n = int(collapse(num)) # Collapse them, and turn them into an int. File "/home/bobokun/install/rtorrent-cleanup/bencode.py", line 20, in collapse return reduce(lambda x, y: x + y, data) RuntimeError: maximum recursion depth exceeded bobokun@raspberrypi ~/install/rtorrent-cleanup $
An earlier version works for me, the version I used was the commit "rename main script".
You can use this version by going "git checkout 8bb439fd9d0019ce2393bbf23412ab376a4479d2"
just tried that version but I'm still getting a similar error
return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 59, in walk return walk(exp, index + endsub) File "/home/bobokun/scripts/bencode.py", line 58, in walk endsub = walk(exp[index:], 1) File "/home/bobokun/scripts/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/scripts/bencode.py", line 47, in walk return walk(exp, endchar + 1) File "/home/bobokun/scripts/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/scripts/bencode.py", line 58, in walk endsub = walk(exp[index:], 1) File "/home/bobokun/scripts/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/scripts/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/scripts/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/scripts/bencode.py", line 53, in walk return walk(exp, index + strlength) File "/home/bobokun/scripts/bencode.py", line 52, in walk strlength = stringlength(exp, index) File "/home/bobokun/scripts/bencode.py", line 33, in stringlength n = int(collapse(num)) # Collapse them, and turn them into an int. File "/home/bobokun/scripts/bencode.py", line 20, in collapse return reduce(lambda x, y: x + y, data) RuntimeError: maximum recursion depth exceeded
Oops I closed the issue by accident.
I'm having this issue as well. I've also checked out a different branch as per https://github.com/ntv1000/rtorrent-cleanup/issues/1#issuecomment-181917177 with a different issue and no success.
@bobokun did you ever find a solution to cleaning rtorrent + sessions/downloads?
This problem comes either from a torrent-file that is somehow corrupted or the bencode module that I copied from someone else. The problem with this is that I would need to have the torrent file that is causing this error. If anyone of you would be willing to provide it I could take a look at it. (keep in mind that I would see what the torrent is for or in case it is from a private tracker I would have your announce key a´nd you would have to take my word for it that I don't use it maliciously)
You can also try to add
import sys
sys.setrecursionlimit(15000)
at the top of rtorrent_cleanup.py
.