[Deluge] #3518: Unhandled ValueError in colors.py causes startup crash

12 views
Skip to first unread message

Deluge

unread,
Apr 10, 2022, 8:09:00 PM4/10/22
to delug...@googlegroups.com
#3518: Unhandled ValueError in colors.py causes startup crash
----------------------------+------------------------
Reporter: fedevx | Type: bug
Status: new | Priority: major
Milestone: needs verified | Component: Console UI
Version: master | Keywords:
----------------------------+------------------------
deluge-console 2.0.5
libtorrent: 2.0.5.0
Python: 3.10.4
OS: Linux Arch Linux ARM
Shell: Zsh

As mentioned in the Summary, deluge-console crashes with the following
traceback:

{{{
Traceback (most recent call last):
File "/usr/bin/deluge-console", line 33, in <module>
sys.exit(load_entry_point('deluge==2.0.5', 'console_scripts', 'deluge-
console')())
File "/usr/lib/python3.10/site-packages/deluge/ui/console/__init__.py",
line 19, in start
Console().start()
File "/usr/lib/python3.10/site-packages/deluge/ui/console/console.py",
line 164, in start
return deluge.common.run_profiled(
File "/usr/lib/python3.10/site-packages/deluge/common.py", line 1351, in
run_profiled
return func(*args)
File "/usr/lib/python3.10/site-packages/deluge/ui/console/console.py",
line 159, in run
return c.start_ui()
File "/usr/lib/python3.10/site-packages/deluge/ui/console/main.py", line
164, in start_ui
wrapper(self.run)
File "/usr/lib/python3.10/curses/__init__.py", line 94, in
wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/python3.10/site-packages/deluge/ui/console/main.py", line
252, in run
colors.init_colors()
File "/usr/lib/python3.10/site-
packages/deluge/ui/console/utils/colors.py", line 110, in init_colors
counter = define_pair(counter, 'white', 'grey', curses.COLOR_WHITE,
241)
File "/usr/lib/python3.10/site-
packages/deluge/ui/console/utils/colors.py", line 91, in define_pair
curses.init_pair(counter, fg, bg)
ValueError: Color number is greater than COLORS-1 (7).
}}}

A quick change in line [https://git.deluge-
torrent.org/deluge/tree/deluge/ui/console/utils/colors.py#n94 94] of
colors.py from:

{{{ except curses.error as ex: }}}

to:

{{{ except (curses.error, ValueError) as ex: }}}

Allows the program to continue and works as expected but you are welcome
to dig into the root cause of the actual issue.

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3518>
Deluge <https://deluge-torrent.org/>
Deluge Project

Deluge

unread,
May 1, 2022, 4:15:48 PM5/1/22
to delug...@googlegroups.com
#3518: Unhandled ValueError in colors.py causes startup crash
-------------------------+--------------------
Reporter: fedevx | Owner:
Type: bug | Status: closed
Priority: major | Milestone: 2.1.0

Component: Console UI | Version: master
Resolution: Fixed | Keywords:
-------------------------+--------------------
Changes (by Cas):

* status: new => closed
* resolution: => Fixed
* milestone: needs verified => 2.1.0


Comment:

Thanks for reporting, looks like a change in Python 3.10 and fixed via
[cd63efd93]

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3518#comment:1>

Reply all
Reply to author
Forward
0 new messages