Bug#977143: libtorrent-rasterbar10: Python argument types in torrent_handle.move_storage(torrent_handle, str) did not match C++ signature

2021-01-06 Thread Braiam
Package: python3-libtorrent
Version: 1.2.9-0.2+b2
Tags: patch

This also affects python3-libtorrent and therefore deluged.

There is a patch upstream already merged[1] which I include
a quilt patch of.

[1]: 
https://github.com/arvidn/libtorrent/commit/386596aa88a19dcba3d4f5925dbce3c517065ea2

-- 
Braiam
fix regression in python binding for move_storage()
--- a/bindings/python/src/converters.cpp
+++ b/bindings/python/src/converters.cpp
@@ -23,6 +23,7 @@
 #include "libtorrent/peer_class.hpp"
 #include "libtorrent/pex_flags.hpp"
 #include "libtorrent/string_view.hpp"
+#include "libtorrent/storage_defs.hpp"
 #include 
 #include 
 
@@ -342,6 +343,30 @@
 }
 };
 
+template
+struct to_enum_class
+{
+   using underlying_type = typename std::underlying_type::type;
+
+   to_enum_class()
+   {
+converter::registry::push_back(
+, , type_id()
+);
+}
+
+static void* convertible(PyObject* x)
+{
+return PyNumber_Check(x) ? x : nullptr;
+}
+
+static void construct(PyObject* x, converter::rvalue_from_python_stage1_data* data)
+{
+void* storage = ((converter::rvalue_from_python_storage*)data)->storage.bytes;
+data->convertible = new (storage) T(static_cast(static_cast(extract(object(borrowed(x));
+}
+};
+
 template
 struct from_bitfield_flag
 {
@@ -495,6 +520,7 @@
 to_strong_typedef();
 to_strong_typedef();
 to_strong_typedef();
+to_enum_class();
 to_bitfield_flag();
 to_bitfield_flag();
 to_bitfield_flag();


Bug#977143: libtorrent-rasterbar10: Python argument types in torrent_handle.move_storage(torrent_handle, str) did not match C++ signature

2020-12-11 Thread Adam Sjøgren
Package: libtorrent-rasterbar10
Version: 1.2.9-0.2+b1
Severity: normal

Dear Maintainer,

Deluge has an option to move the files downloaded by a torrent to another
directory. That functionality recently stopped working. In ~/.xsession-errors
this traceback seems to be related:

Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/ui/gtk3/gtkui.py", line 246, in 
start
reactor.run()
  File "/usr/lib/python3/dist-packages/twisted/internet/_glibbase.py", line 
301, in run
self._run()
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1649, in main
return _Gtk_main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/twisted/internet/_glibbase.py", line 
333, in _simulate
self.runUntilCurrent()
---  ---
  File "/usr/lib/python3/dist-packages/twisted/internet/base.py", line 913, in 
runUntilCurrent
call.func(*call.args, **call.kw)
  File "/usr/lib/python3/dist-packages/deluge/core/torrentmanager.py", line 
1293, in on_alert_torrent_finished
torrent.move_storage(torrent.options['move_completed_path'])
  File "/usr/lib/python3/dist-packages/deluge/core/torrent.py", line 1248, in 
move_storage
self.handle.move_storage(dest, flags=2)
Boost.Python.ArgumentError: Python argument types in
torrent_handle.move_storage(torrent_handle, str)
did not match C++ signature:
move_storage(libtorrent::torrent_handle {lvalue}, 
std::__cxx11::basic_string, std::allocator > 
path, libtorrent::move_flags_t 
flags=libtorrent.move_flags_t.always_replace_files)

18:06:48 [CRITICAL][twisted   :154 ] Unhandled Error
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/deluge/ui/gtk3/gtkui.py", line 246, in 
start
reactor.run()
  File "/usr/lib/python3/dist-packages/twisted/internet/_glibbase.py", line 
301, in run
self._run()
  File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 1649, in main
return _Gtk_main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/twisted/internet/_glibbase.py", line 
333, in _simulate
self.runUntilCurrent()
---  ---
  File "/usr/lib/python3/dist-packages/twisted/internet/base.py", line 913, in 
runUntilCurrent
call.func(*call.args, **call.kw)
  File "/usr/lib/python3/dist-packages/deluge/core/torrentmanager.py", line 
1293, in on_alert_torrent_finished
torrent.move_storage(torrent.options['move_completed_path'])
  File "/usr/lib/python3/dist-packages/deluge/core/torrent.py", line 1248, in 
move_storage
self.handle.move_storage(dest, flags=2)
Boost.Python.ArgumentError: Python argument types in
torrent_handle.move_storage(torrent_handle, str)
did not match C++ signature:
move_storage(libtorrent::torrent_handle {lvalue}, 
std::__cxx11::basic_string, std::allocator > 
path, libtorrent::move_flags_t 
flags=libtorrent.move_flags_t.always_replace_files)

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 5.9.0-4-amd64 (SMP w/12 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libtorrent-rasterbar10 depends on:
ii  libc6   2.31-5
ii  libgcc-s1   10.2.1-1
ii  libssl1.1   1.1.1i-1
ii  libstdc++6  10.2.1-1

libtorrent-rasterbar10 recommends no packages.

Versions of packages libtorrent-rasterbar10 suggests:
pn  libtorrent-rasterbar-dbg  

-- no debconf information