the bencode package is in python-bittorrent now in ubuntu