diff --git a/deluge/ui/console/modes/add_util.py b/deluge/ui/console/modes/add_util.py index 5782c323d..a07484313 100644 --- a/deluge/ui/console/modes/add_util.py +++ b/deluge/ui/console/modes/add_util.py @@ -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( diff --git a/deluge/ui/console/modes/addtorrents.py b/deluge/ui/console/modes/addtorrents.py index 617bff3d3..3a7fa0640 100644 --- a/deluge/ui/console/modes/addtorrents.py +++ b/deluge/ui/console/modes/addtorrents.py @@ -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']: