diff --git a/ox/torrent/__init__.py b/ox/torrent/__init__.py index 888b9a4..992e8d5 100644 --- a/ox/torrent/__init__.py +++ b/ox/torrent/__init__.py @@ -26,6 +26,8 @@ def get_info_hash(torrentFile): def get_torrent_info(data=None, file=None): from bencode import bencode if file: + if isinstance(file, unicode): + file = file.encode('utf-8') with open(file, 'rb') as f: data = f.read()