[Console] Ensure opening torrent files in binary mode

This commit is contained in:
Calum Lind 2017-02-12 11:26:31 +00:00
parent e3b8aaf276
commit 4619b31aa3
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ def add_torrent(t_file, options, success_cb, fail_cb, ress):
continue
filename = os.path.split(f)[-1]
with open(f) as _file:
with open(f, 'rb') as _file:
filedump = base64.encodestring(_file.read())
client.core.add_torrent_file(

View File

@ -386,7 +386,7 @@ class AddTorrents(BaseMode):
filename = m
directory = os.path.join(*self.path_stack[:self.path_stack_pos])
path = os.path.join(directory, filename)
with open(path) as _file:
with open(path, 'rb') as _file:
filedump = base64.encodestring(_file.read())
t_options = {}
if result['location']['value']: