utf-8 filenames
This commit is contained in:
parent
413848638b
commit
7d712445bf
1 changed files with 2 additions and 0 deletions
|
@ -26,6 +26,8 @@ def get_info_hash(torrentFile):
|
||||||
def get_torrent_info(data=None, file=None):
|
def get_torrent_info(data=None, file=None):
|
||||||
from bencode import bencode
|
from bencode import bencode
|
||||||
if file:
|
if file:
|
||||||
|
if isinstance(file, unicode):
|
||||||
|
file = file.encode('utf-8')
|
||||||
with open(file, 'rb') as f:
|
with open(file, 'rb') as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue