jefflovejapan / drench

A simple BitTorrent client in Python
MIT License
73 stars 15 forks source link

Not ported to Python3 #1

Open DarkRedman opened 10 years ago

DarkRedman commented 10 years ago

I tried to fix all the code of Drench in Python 3 in tparser.py I changed

def _readchar(bstring):
    for char in bstring:
        yield str(char)

But I can't fix this code

    def get_len(i=''):
        len_str = str(i)
        next_char = next(reader)
        if next_char == 'e':  # The line that collapses the dictionary
            return None
        while next_char is not ':':
            len_str += next_char
            next_char = next(reader)
        else:
            return int(len_str)

since an error "StopIteration" occurs when I read a torrent file.

That sucks :-1:

jefflovejapan commented 9 years ago

Thanks for taking a look. Unfortunately, I haven't had time to commit to the project, but if you stumble across a workable fix I'd accept a patch.