diff --git a/util/registry/test/test_torrent.py b/util/registry/test/test_torrent.py new file mode 100644 index 000000000..4b909bd1e --- /dev/null +++ b/util/registry/test/test_torrent.py @@ -0,0 +1,4 @@ +from util.registry.torrent import make_torrent + +def test_make_torrent_unicode_url(): + make_torrent('foo', unicode('bar'), 10, 20, 'hello world') diff --git a/util/registry/torrent.py b/util/registry/torrent.py index 90f053d4c..3d3452dad 100644 --- a/util/registry/torrent.py +++ b/util/registry/torrent.py @@ -55,7 +55,7 @@ def make_torrent(name, webseed, length, piece_length, pieces): return bencode.bencode({ 'announce': ANNOUNCE_URL + "?jwt=" + jwt_from_infodict(info_dict), - 'url-list': webseed, + 'url-list': str(webseed), 'encoding': 'UTF-8', 'created by': REGISTRY_TITLE, 'creation date': int(time.time()),