deluge_torrent_complete: fixes for python2.6