summaryrefslogtreecommitdiffstats
path: root/deluge/tests/test_torrent.py
diff options
context:
space:
mode:
authorCalum Lind <calumlind+deluge@gmail.com>2018-07-28 19:49:57 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2018-09-14 16:06:06 +0100
commitd5133f789a09345e3f56f959663b3c271e62cfd6 (patch)
tree314b0942932fd4a3204a100c949542532b0bf3d2 /deluge/tests/test_torrent.py
parent1cce6a297c0552f1d307ffcf06ed0f816f8e706d (diff)
downloaddeluge-d5133f789a09345e3f56f959663b3c271e62cfd6.tar.gz
deluge-d5133f789a09345e3f56f959663b3c271e62cfd6.tar.bz2
deluge-d5133f789a09345e3f56f959663b3c271e62cfd6.zip
[Py2to3] Fix opening torrent files in byte mode
Diffstat (limited to 'deluge/tests/test_torrent.py')
-rw-r--r--deluge/tests/test_torrent.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/deluge/tests/test_torrent.py b/deluge/tests/test_torrent.py
index 773dd8b04..39cd47554 100644
--- a/deluge/tests/test_torrent.py
+++ b/deluge/tests/test_torrent.py
@@ -129,7 +129,7 @@ class TorrentTestCase(BaseTestCase):
raise unittest.SkipTest('unexpected end of file in bencoded string')
options = {'seed_mode': True}
filename = common.get_test_data_file('test_torrent.file.torrent')
- with open(filename) as _file:
+ with open(filename, 'rb') as _file:
filedump = b64encode(_file.read())
torrent_id = self.core.add_torrent_file(filename, filedump, options)
torrent = self.core.torrentmanager.torrents[torrent_id]
@@ -147,7 +147,7 @@ class TorrentTestCase(BaseTestCase):
raise unittest.SkipTest('unexpected end of file in bencoded string')
options = {'seed_mode': True, 'add_paused': True}
filename = common.get_test_data_file('test_torrent.file.torrent')
- with open(filename) as _file:
+ with open(filename, 'rb') as _file:
filedump = b64encode(_file.read())
torrent_id = self.core.add_torrent_file(filename, filedump, options)
torrent = self.core.torrentmanager.torrents[torrent_id]
@@ -193,7 +193,7 @@ class TorrentTestCase(BaseTestCase):
)
filename = common.get_test_data_file('test_torrent.file.torrent')
- with open(filename) as _file:
+ with open(filename, 'rb') as _file:
filedump = _file.read()
resume_data = utf8_encode_structure(resume_data)
torrent_id = self.core.torrentmanager.add(