diff --git a/bindings/python/src/session.cpp b/bindings/python/src/session.cpp index 795658ed0e3..f3d13b38717 100644 --- a/bindings/python/src/session.cpp +++ b/bindings/python/src/session.cpp @@ -248,7 +248,7 @@ namespace } else if(key == "info_hash") { - if (boost::python::len(value) == 40) + if (boost::python::len(value) == 40 || boost::python::len(value) == 32) { p.info_hash = info_hash_t(sha1_hash( bytes(extract(value)).arr.data())); diff --git a/bindings/python/test.py b/bindings/python/test.py index 37444b5d984..e2f5cff47ab 100644 --- a/bindings/python/test.py +++ b/bindings/python/test.py @@ -172,7 +172,7 @@ def test_pickle_trackers(self): pickled_trackers = pickle.dumps(self.h.trackers()) unpickled_trackers = pickle.loads(pickled_trackers) self.assertEqual(unpickled_trackers[0]['url'], 'udp://tracker1.com') - self.assertEqual(unpickled_trackers[0]['endpoints'][0]['last_error']['value'], 0) + self.assertEqual(unpickled_trackers[0]['endpoints'][0]['info_hashes'][0]['last_error']['value'], 0) def test_file_status(self): self.setup()