JohnDoee / deluge-client

A very lightweight pure-python Deluge RPC Client
MIT License
87 stars 14 forks source link

Too many values to unpack from RPCError #1

Closed ghost closed 8 years ago

ghost commented 8 years ago

A response of

[('BadLoginError', 'Username does not exist', '  File "/usr/lib/python2.7/dist-packages/deluge/core/rpcserver.py", line 260, in dispatch\n    ret = component.get("AuthManager").authorize(*args, **kwargs)\n  File "/usr/lib/python2.7/dist-packages/deluge/core/authmanager.py", line 87, in authorize\n    raise BadLoginError("Username does not exist")\n')]

(tried to log in with an empty username)

causes:

  File "D:/Git/Other/deluge-client/test.py", line 4, in <module>
    client.connect()
  File "D:/Git/Other/deluge-client\deluge_client\client.py", line 45, in connect
    result = self.call('daemon.login', self.username, self.password)
  File "D:/Git/Other/deluge-client\deluge_client\client.py", line 83, in call
    exception_type, exception_msg, traceback = data
ValueError: need more than 1 value to unpack
JohnDoee commented 8 years ago

I cleaned up the exception code and released version 1.0.3. Exceptions should work and look nicer now.

If you're not planning on distributing your project then I recommend using the Deluge client built into Deluge. It is more full-featured and better tested.