Opened 12 years ago

Closed 11 years ago

#2083 closed bug (Fixed)

Deluge & libtorrent 0.16, can't add magnetlinks

Reported by: DerFlob Owned by:
Priority: major Milestone:
Component: libtorrent Version: 1.3.5
Keywords: Cc:

Description

Hello, I'm using Deluge on Arch Linux, which updated libtorrent to 0.16. Unfortunately, Deluge 1.3.4 and 1.3.5 refuse to add magnetlinks since. A downgrade to libtorrent 0.15.10 "fixes" it. I'm running Deluge as daemon under my user, but also classic mode doesn't work. Adding torrents from a file and downloading still works. Another bug report about this at ArchLinux? FS: https://bugs.archlinux.org/task/29414

Debug output when trying to add a magnet link:

[DEBUG   ] 13:15:24 core:296 Attempting to add by magnet uri: magnet:?xt=urn:btih:e8b7331a45924868f8a1720fb5da9c4ea9d4fba8&dn=Ubuntu+11.04+Desktop+dvd+amd64+%28x64%29+.iso&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.ccc.de%3A80
[DEBUG   ] 13:15:24 torrentmanager:329 torrentmanager.add
[DEBUG   ] 13:15:24 configmanager:111 Getting config 'core.conf'
[DEBUG   ] 13:15:24 torrentmanager:430 options: {'max_download_speed': -1.0, 'auto_managed': True, 'move_completed_path': u'/home/flob', 'stop_at_ratio': False, 'prioritize_first_last_pieces': True, 'max_upload_slots': -1, 'file_priorities': [], 'move_completed': False, 'max_connections': -1, 'add_paused': False, 'download_location': '/home/flob/Downloads', 'mapped_files': {}, 'compact_allocation': False, 'max_upload_speed': 40.0, 'remove_at_ratio': False, 'stop_ratio': 2.0}
[ERROR   ] 13:15:24 rpcserver:303 Exception calling RPC request: No registered converter was able to produce a C++ rvalue of type boost::intrusive_ptr<libtorrent::torrent_info> from this Python object of type NoneType
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/deluge/core/rpcserver.py", line 298, in dispatch
    ret = self.factory.methods[method](*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/deluge/core/core.py", line 298, in add_torrent_magnet
    return self.torrentmanager.add(magnet=uri, options=options)
  File "/usr/lib/python2.7/site-packages/deluge/core/torrentmanager.py", line 452, in add
    handle = lt.add_magnet_uri(self.session, utf8_encoded(magnet), add_torrent_params)
TypeError: No registered converter was able to produce a C++ rvalue of type boost::intrusive_ptr<libtorrent::torrent_info> from this Python object of type NoneType

Change History (6)

comment:1 Changed 12 years ago by fernando_costa

I confirm the exact same issue. It happened afer I updated my Arch linux (not deluge itself). I tried to update deluge to see if the newer version solved the issue, but nothing different happened.

comment:2 Changed 12 years ago by Cas

  • Component changed from other to libtorrent
  • Type changed from defect to bug

We recommend to use libtorrent 0.15.10 with Deluge 1.3.x

comment:3 Changed 12 years ago by arvid

I believe this patch to libtorrent fixes it. Could anyone confirm?

Index: bindings/python/src/session.cpp
===================================================================
--- bindings/python/src/session.cpp	(revision 6789)
+++ bindings/python/src/session.cpp	(working copy)
@@ -153,7 +153,7 @@
         , std::vector<char>& rd, std::list<std::string>& string_storage)
     {
         // torrent_info objects are always held by an intrusive_ptr in the python binding
-        if (params.has_key("ti"))
+        if (params.has_key("ti") && !params.get("ti").is_none())
             p.ti = extract<intrusive_ptr<torrent_info> >(params["ti"]);
 
         if (params.has_key("info_hash"))

It's just a work-around for what appears to be Deluge passing in None as the tf? field in the dict.

comment:4 Changed 12 years ago by eternalsword

I can confirm that tweak works.

comment:5 Changed 12 years ago by borring

Seems to work fine using libtorrent 0.16.1

comment:6 Changed 11 years ago by Cas

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.