[Bug Report] bad add to dictionary at line 194 of info.py

General support for problems installing or using Deluge
jbrid
Member
Member
Posts: 10
Joined: Mon Apr 16, 2012 5:23 pm

[Bug Report] bad add to dictionary at line 194 of info.py

Postby jbrid » Thu Mar 04, 2021 8:29 pm

Hi all,
If I try to filter by torrent state using deluge-console, I get:

Code: Select all

$ deluge-console "info --state Seeding"
 'dict' object has no attribute 'state'
14:14:46 [ERROR   ][deluge.ui.console.cmdline.command                     :138 ] 'dict' object has no attribute 'state'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/ui/console/cmdline/command.py", line 135, in exec_command
    ret = self._commands[options.command].handle(options)
  File "/usr/lib/python3/dist-packages/deluge/ui/console/cmdline/commands/info.py", line 194, in handle
    status_dict.state = options.state
AttributeError: 'dict' object has no attribute 'state'
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/ui/console/cmdline/command.py", line 135, in exec_command
    ret = self._commands[options.command].handle(options)
  File "/usr/lib/python3/dist-packages/deluge/ui/console/cmdline/commands/info.py", line 194, in handle
    status_dict.state = options.state
AttributeError: 'dict' object has no attribute 'state'


After making the following change to info.py, it is working properly:

Code: Select all

$ diff /usr/lib/python3/dist-packages/deluge/ui/console/cmdline/commands/info.py /usr/lib/python3/dist-packages/deluge/ui/console/cmdline/commands/info.py.orig
194,195c194
<                 #status_dict.state = options.state
<                 status_dict = {'state': options.state}
---
>                 status_dict.state = options.state


Versions:

Code: Select all

deluge-console -v
deluge-console 2.0.3
libtorrent: 1.1.13.0
Python: 3.8.5
OS: Linux Ubuntu 20.04 focal

mhertz
Compulsive Poster
Compulsive Poster
Posts: 1069
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: [Bug Report] bad add to dictionary at line 194 of info.py

Postby mhertz » Thu Mar 04, 2021 9:17 pm

Thanks alot, appreciated! :) I reported this issue+fix to the bugtracker with your name and a link here-to, plus 3 other issues in consoleUI I know off additionally. Thanks again.

https://dev.deluge-torrent.org/ticket/3462#ticket


Return to “Support”

Who is online

Users browsing this forum: Google [Bot] and 14 guests