From 93dee4c76493820aca1cc6caebeae022f309cb05 Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Thu, 17 Jan 2013 22:08:56 -0500 Subject: [PATCH] Don't deliver empty resume_data parameter to session.add_torrent Fixes a libtorrent crash on python 2.7 on Windows --- deluge/core/torrentmanager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deluge/core/torrentmanager.py b/deluge/core/torrentmanager.py index 584524305..3dae4e0dc 100644 --- a/deluge/core/torrentmanager.py +++ b/deluge/core/torrentmanager.py @@ -376,7 +376,8 @@ class TorrentManager(component.Component): resume_data = self.legacy_get_resume_data_from_file(state.torrent_id) self.legacy_delete_resume_data(state.torrent_id) - add_torrent_params["resume_data"] = resume_data + if resume_data: + add_torrent_params["resume_data"] = resume_data else: # We have a torrent_info object or magnet uri so we're not loading from state. if torrent_info: @@ -431,7 +432,6 @@ class TorrentManager(component.Component): torrent_info.rename_file(index, fname.encode("utf-8")) add_torrent_params["ti"] = torrent_info - add_torrent_params["resume_data"] = "" #log.info("Adding torrent: %s", filename) log.debug("options: %s", options)