From 7d712445bfb15b31376197b5f72c1dbe491bad77 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 11 Oct 2013 20:38:35 +0200 Subject: [PATCH] utf-8 filenames --- ox/torrent/__init__.py | 2 ++ 1 file changed, 2 insertions(+) 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()