config -s listen_interface → "invalid literal for float"

General support for problems installing or using Deluge
Post Reply
nixar
New User
New User
Posts: 3
Joined: Fri Nov 12, 2010 11:54 am

config -s listen_interface → "invalid literal for float"

Post by nixar »

This is on F13, running deluge 1.3.0

Code: Select all

$ deluge-console 'config -s listen_interface 192.168.0.2'
invalid literal for float(): 192.168.0.2 
[ERROR   ] 13:05:59 main:323 invalid literal for float(): 192.168.0.2 
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/deluge/ui/console/main.py", line 320, in do_command
    ret = self._commands[cmd].handle(*args, **options.__dict__)
  File "/usr/lib/python2.6/site-packages/deluge/ui/console/commands/config.py", line 98, in handle
    return self._set_config(*args, **options)
  File "/usr/lib/python2.6/site-packages/deluge/ui/console/commands/config.py", line 134, in _set_config
    val = simple_eval(options["set"][1] + " " + " ".join(args))
  File "/usr/lib/python2.6/site-packages/deluge/ui/console/commands/config.py", line 81, in simple_eval
    res = atom(src.next, src.next())
  File "/usr/lib/python2.6/site-packages/deluge/ui/console/commands/config.py", line 65, in atom
    return float(token[-1])
ValueError: invalid literal for float(): 192.168.0.2 
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/deluge/ui/console/main.py", line 320, in do_command
    ret = self._commands[cmd].handle(*args, **options.__dict__)
  File "/usr/lib/python2.6/site-packages/deluge/ui/console/commands/config.py", line 98, in handle
    return self._set_config(*args, **options)
  File "/usr/lib/python2.6/site-packages/deluge/ui/console/commands/config.py", line 134, in _set_config
    val = simple_eval(options["set"][1] + " " + " ".join(args))
  File "/usr/lib/python2.6/site-packages/deluge/ui/console/commands/config.py", line 81, in simple_eval
    res = atom(src.next, src.next())
  File "/usr/lib/python2.6/site-packages/deluge/ui/console/commands/config.py", line 65, in atom
    return float(token[-1])
ValueError: invalid literal for float(): 192.168.0.2 
Is there another way to set this value? (besides modifying core.conf and restarting the dæmon that is)

I use this command in my /etc/ppp/ip-up.local so that I can have deluge use the ppp0 interface.

By the way the terminology is all wrong, this is not an interface but a listen address.

Anyway, this looks like a really good program otherwise, keep up the good work.
nixar
New User
New User
Posts: 3
Joined: Fri Nov 12, 2010 11:54 am

Re: config -s listen_interface → "invalid literal for float"

Post by nixar »

Also I want to add that it took me 2h to figure out how to issue that command. The syntax is not explained anywhere in the doc. There is no example anywhere.
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: config -s listen_interface → "invalid literal for float"

Post by Cas »

nixar wrote:

Code: Select all

$ deluge-console 'config -s listen_interface 192.168.0.2'
invalid literal for float(): 192.168.0.2 
I think this is a bug.
Is there another way to set this value? (besides modifying core.conf and restarting the dæmon that is)
You can set the interface for deluged on startup using '-i'
By the way the terminology is all wrong, this is not an interface but a listen address.
This could be looked into.
nixar wrote:Also I want to add that it took me 2h to figure out how to issue that command. The syntax is not explained anywhere in the doc. There is no example anywhere.
We are aware there is no website documentation but the commands are all documented within the man pages and help.

Code: Select all

man deluge-console
man deluged
deluge-console --help
nixar
New User
New User
Posts: 3
Joined: Fri Nov 12, 2010 11:54 am

Re: config -s listen_interface → "invalid literal for float"

Post by nixar »

Thanks for the reply.
Cas wrote:
nixar wrote:Also I want to add that it took me 2h to figure out how to issue that command. The syntax is not explained anywhere in the doc. There is no example anywhere.
We are aware there is no website documentation but the commands are all documented within the man pages and help.

Code: Select all

man deluge-console
man deluged
deluge-console --help
Nope, I checked and in 1.3.0 at least, there is nowhere that says you have to type (in the deluge-console full screen interface)

Code: Select all

    config -s key value
and, on the command line

Code: Select all

deluge-console 'config -s key value'
By the way, I found a further problem. If the dæmon can't bind to the requested address, it silently ignores it and binds to 0.0.0.0. This is a problem because I (and I guess, many people who might want to use it) want my p2p traffic to go exclusively through my VPN. Another use case is people with a 3G connection; you might want to bind to wlan0 when you're at home and traffic is free, but definitely don't want it to go through the cell interface.
Cas
Top Bloke
Top Bloke
Posts: 3679
Joined: Mon Dec 07, 2009 6:04 am
Location: Scotland

Re: config -s listen_interface → "invalid literal for float"

Post by Cas »

Nope, I checked and in 1.3.0 at least, there is nowhere that says you have to type (in the deluge-console full screen interface)

Code: Select all

>>> help
add - Add a torrent
[...]
For help on a specific command, use "<command> --help"
>>> config --help
Usage: config [key1 [key2 ...]]
       config --set key value

Options:
  -s SET, --set=SET  set value for key
  -h, --help         show this help message and exit

Show and set configuration values
There has always been a help command in deluge-console.

By the way, I found a further problem. If the dæmon can't bind to the requested address, it silently ignores it and binds to 0.0.0.0. This is a problem because I (and I guess, many people who might want to use it) want my p2p traffic to go exclusively through my VPN. Another use case is people with a 3G connection; you might want to bind to wlan0 when you're at home and traffic is free, but definitely don't want it to go through the cell interface.
Not something I was aware off but it is quite a specialist use case. You can create a bug ticket for this problem.
Sian
New User
New User
Posts: 4
Joined: Fri Feb 19, 2010 8:39 am

Re: config -s listen_interface → "invalid literal for float"

Post by Sian »

Cas wrote:
By the way, I found a further problem. If the dæmon can't bind to the requested address, it silently ignores it and binds to 0.0.0.0. This is a problem because I (and I guess, many people who might want to use it) want my p2p traffic to go exclusively through my VPN. Another use case is people with a 3G connection; you might want to bind to wlan0 when you're at home and traffic is free, but definitely don't want it to go through the cell interface.
Not something I was aware off but it is quite a specialist use case. You can create a bug ticket for this problem.
Actually I was just searching the forums about exactly the same use case. So there are at least two people with that problem ;)

Anyway, I'll check the bug tickets and create one referencing this forum thread if necessary.
Sian
New User
New User
Posts: 4
Joined: Fri Feb 19, 2010 8:39 am

Re: config -s listen_interface → "invalid literal for float"

Post by Sian »

Regarding the initial problem (error when setting listen_interface due to failed type conversion).

I chanced line 65 in the ui/console/commands/config.py from the float type conversion

Code: Select all

return float(token[-1])
to a string type conversion

Code: Select all

return str(token[-1])
and now it apparently works.

Code: Select all

deluge-console 'config --set listen_interface 153.12.64.6'
Setting listen_interface to 153.12.64.6 ..
Configuration value successfully updated.
When checking core.conf, the changes show up. Don't know if the switch from float() to str() breaks any other functionality, though. But I don't mind, as I'm only intending to use deluge-console for changing the listen_interface.

Edit: BTW, does deluged use the new values at once, or does it take a restart? I usually check the interface/ip address clients are listening on with the "lsof" command, but for some reason only the port on localhost for communication with deluge-gtk etc. shows up. Rtorrent&Transmission-daemon f.e. show the listen_address and port for Bittorrent communication, as well as the interface:port (or socket) used for RPC when using lsof. Any ideas?
Post Reply