fix adding torrents on windows
This commit is contained in:
parent
9ed37e070c
commit
d4cfebadbc
|
@ -683,7 +683,7 @@ class AddTorrentDialog(component.Component):
|
|||
for i, f in enumerate(torrent_filenames):
|
||||
client.core.add_torrent_file(
|
||||
os.path.split(f)[-1],
|
||||
base64.encodestring(open(f).read()),
|
||||
base64.encodestring(open(f, "rb").read()),
|
||||
torrent_options[i])
|
||||
if torrent_magnets:
|
||||
client.core.add_torrent_magnets(torrent_magnets, torrent_magnet_options)
|
||||
|
|
|
@ -420,7 +420,7 @@ class WebApi(JSONComponent):
|
|||
"""
|
||||
for torrent in torrents:
|
||||
filename = os.path.basename(torrent["path"])
|
||||
fdump = base64.encodestring(open(torrent["path"], "r").read())
|
||||
fdump = base64.encodestring(open(torrent["path"], "rb").read())
|
||||
log.info("Adding torrent from file `%s` with options `%r`",
|
||||
filename, torrent["options"])
|
||||
client.core.add_torrent_file(filename, fdump, torrent["options"])
|
||||
|
|
Loading…
Reference in New Issue