BadColorString from deluge-console info

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

BadColorString from deluge-console info

Post by jbrid »

Hi,
I recently upgraded to Ubuntu 20.04 and am getting an error when executing the 'deluge-console info' command. I have about 1,000 torrents. The info list displays about 50 of them and then hits this error:

Code: Select all

Error getting torrent info: [Failure instance: Traceback: <class 'deluge.ui.console.utils.colors.BadColorString'>: Number of 
/usr/lib/python3/dist-packages/deluge/transfer.py:129:_handle_complete_message
/usr/lib/python3/dist-packages/deluge/ui/client.py:133:message_received
/usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:460:callback
/usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:568:_startRunCallbacks
--- <exception caught here> ---
/usr/local/lib/python3.8/dist-packages/twisted/internet/defer.py:654:_runCallbacks
/usr/lib/python3/dist-packages/deluge/ui/console/cmdline/commands/info.py:184:on_torrents_status
/usr/lib/python3/dist-packages/deluge/ui/console/cmdline/commands/info.py:453:show_info
/usr/lib/python3/dist-packages/deluge/ui/console/main.py:499:write
/usr/lib/python3/dist-packages/deluge/ui/console/utils/colors.py:141:strip_colors
/usr/lib/python3/dist-packages/deluge/ui/console/utils/colors.py:122:check_tag_count
I rely heavily on deluge-console so I appreciate any help with this error.

Versions:

Code: Select all

deluge-console 2.0.3
libtorrent: 1.1.13.0
Python: 3.8.5
OS: Linux Ubuntu 20.04 focal
Thanks.
jbrid
Member
Member
Posts: 10
Joined: Mon Apr 16, 2012 5:23 pm

Re: BadColorString from deluge-console info

Post by jbrid »

I removed the torrent that is died on, and it worked properly, with no error. The offending torrent had an exclamation point followed by a closing brace:

Code: Select all

!}
I suspect that's the characters combination that made if fail, because I have other torrents with exclamation points and braces in the name (non-consecutive) and those are displayed properly.
mhertz
Moderator
Moderator
Posts: 2195
Joined: Wed Jan 22, 2014 5:05 am
Location: Denmark

Re: BadColorString from deluge-console info

Post by mhertz »

Good catch! I tried reproduce yesterday but couldn't and looked at the reported code, but couldn't make sence of much honestly, relating, as noob at coding. Glad to hear you workaround'ed it and thx for reporting workaround/solution back. Indeed the called strip_colors() function of deluge/ui/console/utils/colors.py returns a list of torrents with color-codes removed, and those color-codes start and end with '!{' and '!}' ;)
Post Reply