From 9bce4eb925794528b21b4cdb0f7777ac24ffd7c2 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 17 Nov 2015 22:30:43 +0900 Subject: [PATCH] doc: Use binary input mode in RPC example python code --- doc/manual-src/en/aria2c.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/manual-src/en/aria2c.rst b/doc/manual-src/en/aria2c.rst index cce97da1..a830fbf3 100644 --- a/doc/manual-src/en/aria2c.rst +++ b/doc/manual-src/en/aria2c.rst @@ -2305,7 +2305,7 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') - >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read())) + >>> s.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read())) '2089b05ecca3d829' .. function:: aria2.addMetalink([secret], metalink[, options[, position]]) @@ -2351,7 +2351,7 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. >>> import xmlrpclib >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') - >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4').read())) + >>> s.aria2.addMetalink(xmlrpclib.Binary(open('file.meta4', mode='rb').read())) ['2089b05ecca3d829'] .. function:: aria2.remove([secret], gid) @@ -3395,7 +3395,7 @@ For information on the *secret* parameter, see :ref:`rpc_auth`. >>> s = xmlrpclib.ServerProxy('http://localhost:6800/rpc') >>> mc = xmlrpclib.MultiCall(s) >>> mc.aria2.addUri(['http://example.org/file']) - >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent').read())) + >>> mc.aria2.addTorrent(xmlrpclib.Binary(open('file.torrent', mode='rb').read())) >>> r = mc() >>> tuple(r) ('2089b05ecca3d829', 'd2703803b52216d1')