console won't start locally

General support for problems installing or using Deluge
Post Reply
zappeke

console won't start locally

Post by zappeke »

Hi

Had this problem with multiple versions, currently running:
deluged: 1.3.5
libtorrent: 0.15.9.0
deluge-console: 1.3.5

OS Peppermint ICE

I tried removing/reinstalling everything, deleting the config folder nothing helps, deluge-web works fine...

here's what I see when running console:

Code: Select all

deluge-console 
Traceback (most recent call last):
  File "/usr/bin/deluge-console", line 9, in <module>
    load_entry_point('deluge==1.3.5', 'console_scripts', 'deluge-console')()
  File "/usr/lib/pymodules/python2.6/deluge/ui/console/main.py", line 74, in start
    Console().start()
  File "/usr/lib/pymodules/python2.6/deluge/ui/console/main.py", line 71, in start
    ConsoleUI(self.args)
  File "/usr/lib/pymodules/python2.6/deluge/ui/console/main.py", line 198, in __init__
    curses.wrapper(self.run)
  File "/usr/lib/python2.6/curses/wrapper.py", line 44, in wrapper
    return func(stdscr, *args, **kwds)
  File "/usr/lib/pymodules/python2.6/deluge/ui/console/main.py", line 220, in run
    colors.init_colors()
  File "/usr/lib/pymodules/python2.6/deluge/ui/console/colors.py", line 94, in init_colors
    curses.init_pair(counter, getattr(curses, fg), getattr(curses, bg))
_curses.error: init_pair() returned ERR
This is only when I try to connect locally, when I connect from an ubuntu box remotely via deluge-console connection is possible.

any help is appreciated,

thx

Z
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: console won't start locally

Post by Cas »

It could be an issue with no support for curses colours. Could you try this code change in '/usr/lib/pymodules/python2.6/deluge/ui/console/colors.py':

Code: Select all

--- a/deluge/ui/console/colors.py
+++ b/deluge/ui/console/colors.py
@@ -84,6 +84,9 @@
 }
 
 def init_colors():
+    if not curses.has_colors():
+        return
+
     # Create the color_pairs dict
     counter = 1
     for fg in colors:
zappeke

Re: console won't start locally

Post by zappeke »

thx for a quick reply... but now I have a slightly different error...
Traceback (most recent call last):
File "/usr/bin/deluge-console", line 9, in <module>
load_entry_point('deluge==1.3.5', 'console_scripts', 'deluge-console')()
File "/usr/lib/pymodules/python2.6/deluge/ui/console/main.py", line 74, in start
Console().start()
File "/usr/lib/pymodules/python2.6/deluge/ui/console/main.py", line 71, in start
ConsoleUI(self.args)
File "/usr/lib/pymodules/python2.6/deluge/ui/console/main.py", line 198, in __init__
curses.wrapper(self.run)
File "/usr/lib/python2.6/curses/wrapper.py", line 44, in wrapper
return func(stdscr, *args, **kwds)
File "/usr/lib/pymodules/python2.6/deluge/ui/console/main.py", line 227, in run
self.screen.refresh()
File "/usr/lib/pymodules/python2.6/deluge/ui/console/screen.py", line 267, in refresh
self.add_string(0, self.topbar)
File "/usr/lib/pymodules/python2.6/deluge/ui/console/screen.py", line 242, in add_string
parsed = colors.parse_color_string(string, self.encoding)
File "/usr/lib/pymodules/python2.6/deluge/ui/console/colors.py", line 184, in parse_color_string
color_pair = curses.color_pair(color_pairs[(schemes[attrs[0]][0], schemes[attrs[0]][1])])
KeyError: ('yellow', 'blue')
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: console won't start locally

Post by Cas »

Hmm it will require more changes/testing to cope with only white-black color pair. If you create a ticket I can look into it further at some point.

In the meantime you may want to try a colour capable terminal.

Edit: Created ticket: http://dev.deluge-torrent.org/ticket/2099
Eva
New User
New User
Posts: 2
Joined: Thu Jul 25, 2013 5:54 am

Re: console won't start locally

Post by Eva »

I encountered this problem these days, and I figured something out.
This may be a little violent, but works well.
within '/usr/lib/pymodules/python2.6/deluge/ui/console/colors.py', change all the colors items to white and black, don't use other colors.
Post Reply