Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#3246 closed bug (Invalid)

rencode.loads() error

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

Description

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 transfer.py 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: https://github.com/aresch/rencode/issues/15

I note that the call to rencode.dumps() in transfer_message() in transfer.py 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: 127.0.0.1:54980 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 Changed 5 years ago by Cas

  • Component changed from Unknown to Core
  • Milestone changed from needs verified to 2.0.0
  • Version changed from other (please specify) to develop (git)

comment:2 Changed 5 years ago by pjlbyrne

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 setup.py 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 Changed 5 years ago by pjlbyrne

  • Resolution set to Invalid
  • Status changed from new to closed

comment:4 Changed 5 years ago by Cas

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

comment:5 Changed 5 years ago by pjlbyrne

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.