Opened 5 years ago

Closed 5 years ago

Last modified 5 weeks ago

#3246 closed bug (Invalid)

rencode.loads() error

Reported by: Pat Owned by:
Priority: major Milestone: 2.0.0
Component: Core Version: develop
Keywords: Cc:


Built deluge from develop on archlinux. Install and start the daemon with systemctl. Start deluge-console. The local daemon is not shown as contactable.

The log shows:

14:47:38.112 [WARNING ][deluge.transfer :136 ] Failed to decompress (25 bytes) and load serialized data with rencode: loads() got an unexpected keyword argument 'decode_utf8'

Running 'python2', importing rencode and calling loads() manually it does accept the 'decode_utf8' keyword.

If I use inspect in to show in the log the function signature for loads() it says: ArgSpec(args=x, varargs=None, keywords=None, defaults=None) which does not match the behavior in the interactive session ie no 'decode_utf8' keyword param.

There is a bug against rencode on github which appears to be the same issue:

I note that the call to rencode.dumps() in transfer_message() in does not do any utf8 encoding, so I tried just removing the 'decode_utf8=True' arg, but I get: 9:29:29.127 [INFO ][deluge.core.rpcserver :171 ] Deluge Client connection made from: 19:29:29.155 [INFO ][deluge.core.rpcserver :197 ] Deluge client disconnected: Connection to the other side was lost in a non-clean fashion: Connection lost.

I may be unable to access the internet in the next week (China!). Apologies for any delay in responding to updates on this.

Change History (5)

comment:1 by Calum, 5 years ago

Component: UnknownCore
Milestone: needs verified2.0.0
Version: other (please specify)develop (git)

comment:2 by Pat, 5 years ago

This problem has now gone away.

I never traced the exact source of the fault, but I did come to realise that the advice on the archlinux wiki - to use its package manager 'pacman' to manage packages - conflicted with the deluge script which appears to use setuptools to install its own packages.

By the time I had purged all the python modules, reinstalled using pacman and rebuilt, then the error seemed to have gone away.

I recommend that this bug should be closed. A positive result from this would probably be guidance on the wiki for building on archlinux. Perhaps I could write that. Or a pacman package to build deluge from the dev branch.

comment:3 by Pat, 5 years ago

Resolution: Invalid
Status: newclosed

comment:4 by Calum, 5 years ago

This is an odd issue and would be interesting to know what version of rencode was installed. Anyway thanks for updating

comment:5 by Pat, 5 years ago

I'm sorry but I think the state is lost now. I assume the installed C Library version of rencode conflicted with the python module in some way.

For me the takeaway from this is that there seem to be two different ways of doing things that clash:

1) A python install script might use pip or setuptools to download the modules required for the build.

2) Advice on the archlinux wiki states something like "don't use pip to install extra python modules, you should always use the archlinux package tool pacman"

I suppose the long-term solution for this would be for python build scripts to have a way of requesting the package tool for whatever distribution the linux is built on to do the module install. However, if such mechanism exists I am not aware of it!

Wiki instructions to build deluge on archlinux are probably a more realistic short-term win.

Note: See TracTickets for help on using tickets.