title: TypeError: unhashable type: 'dict' for python
body: <p>I'm trying to setup a cron auto delete file on Deluge torrent client, code is as following:</p>
  
  <pre><code>import sys
  import os
  import subprocess
  import logging
  from datetime import datetime, date, time, timedelta
  from deluge.ui.client import client
  import deluge.component as component
  from deluge.log import LOG as log
  from twisted.internet import reactor
  logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
  
  def printData(dresult):
      if dresult:
          print "Command executed with result: ", dresult
      else:
         sys.stderr.write(str(failure))
  
  def on_connect_success(result):
      def on_get_torrent_value(value):
          for torrent in value:
               seedtime = datetime.fromtimestamp(value[torrent]["seeding_time"]) - datetime.fromtimestamp(0)
               if value[torrent]["label"] in labels and value[torrent]["is_finished"] == True and seedtime &gt;= timedelta(hours = totalseedtime):
                     --- multiple of commands ---
          client.disconnect()
          reactor.stop()
  
      client.core.get_torrents_status({}, ["name", "is_finished", "save_path", "seeding_time", "label"]).addCallback(on_get_torrent_value)
      client.core.remove_torrent({}, remove_data = False).addCallbacks(printData)
  
  d.addCallback(on_connect_success)
  
  def on_connect_fail(result):
      print "result:", result
  
  d.addErrback(on_connect_fail)
  
  reactor.run()
  </code></pre>
  
  <p>When executed, the debug log returned:</p>
  
  <pre><code>DEBUG:deluge:ConfigManager started..
  INFO:deluge:Connecting to daemon at 127.0.0.1:58846..
  INFO:deluge:Connected to daemon at 127.0.0.1:58846..
  ERROR:deluge:RPCError Message Received!
  --------------------------------------------------------------------------------
  RPCRequest: core.remove_torrent({}, remove_data=False)
  --------------------------------------------------------------------------------
    File "/usr/local/lib/python2.7/dist-packages/deluge-1.3.11-py2.7.egg/deluge/core/rpcserver.py", line 299, in dispatch
      ret = self.factory.methods[method](*args, **kwargs)
    File "/usr/local/lib/python2.7/dist-packages/deluge-1.3.11-py2.7.egg/deluge/core/core.py", line 326, in remove_torrent
      return self.torrentmanager.remove(torrent_id, remove_data)
    File "/usr/local/lib/python2.7/dist-packages/deluge-1.3.11-py2.7.egg/deluge/core/torrentmanager.py", line 568, in remove
      torrent_name = self.torrents[torrent_id].get_status(["name"])["name"]
  
  TypeError: unhashable type: 'dict'
  --------------------------------------------------------------------------------
  Unhandled error in Deferred:
  Unhandled Error
  Traceback (most recent call last):
  Failure: deluge.ui.client.DelugeRPCError: &lt;deluge.ui.client.DelugeRPCError object at 0x1aeae50&gt;
  INFO:deluge:Connection lost to daemon at 127.0.0.1:58846 reason: Connection to the other side was lost in a non-clean fashion: Connection lost.
  </code></pre>
  
  <p>I understand that the dic I pass to client.core.remove_torrent is something wrong in format, but dont know how to fix it. Any help in much appreciate! Thanks so much in advance.</p>