cjlucas/rtorrent-python — Issue #3: Fatal error when creating a File object
Author: cjlucas
Created: 2011-11-13 00:04:07+00:00
State: open
Labels: Priority - High, Type - Defect

```
In [6]: r = rtorrent.RTorrent("http://192.168.1.134:81")

In [8]: t = r.get_torrents()[0]

In [9]: t
Out[9]:

In [11]: t.poll()
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/Users/chris/Dropbox/code/python/rtorrent-python/ in ()
----> 1 t.poll()

/Users/chris/Dropbox/code/python/rtorrent-python/rtorrent/torrent.pyc in poll(self)
165 self.get_peers()
166 self.get_trackers()
--> 167 self.get_files()
168
169 def update(self):

/Users/chris/Dropbox/code/python/rtorrent-python/rtorrent/torrent.pyc in get_files(self)
123 results_dict[m.varname] = rtorrent.rpc.process_result(m, r)
124
--> 125 self.files.append(File(self._p, self.info_hash, **results_dict))
126
127 # add proper index positions for each file (based on the file offset)

/Users/chris/Dropbox/code/python/rtorrent-python/rtorrent/file.pyc in __init__(self, _p, info_hash, **kwargs)
30 setattr(self, k, kwargs.get(k, None))
31
---> 32 self.rpc_id = "{0}:f{1}".format(self.info_hash, self.index) #: unique id to pass to rTorrent
33
34 def __repr__(self):

AttributeError: File instance has no attribute 'index'
```

Python: 3.2