pytho****@googl*****
pytho****@googl*****
2011年 3月 20日 (日) 00:14:20 JST
2 new revisions: Revision: a9396b92a829 Author: cocoatomo <cocoa****@gmail*****> Date: Sat Mar 19 08:01:41 2011 Log: library/xmlrpclib.rst translation completed http://code.google.com/p/python-doc-ja/source/detail?r=a9396b92a829 Revision: c65d634e7cf9 Author: cocoatomo <cocoa****@gmail*****> Date: Sat Mar 19 08:08:13 2011 Log: merge http://code.google.com/p/python-doc-ja/source/detail?r=c65d634e7cf9 ============================================================================== Revision: a9396b92a829 Author: cocoatomo <cocoa****@gmail*****> Date: Sat Mar 19 08:01:41 2011 Log: library/xmlrpclib.rst translation completed http://code.google.com/p/python-doc-ja/source/detail?r=a9396b92a829 Modified: /library/xmlrpclib.rst ======================================= --- /library/xmlrpclib.rst Sun Nov 14 16:42:45 2010 +++ /library/xmlrpclib.rst Sat Mar 19 08:01:41 2011 @@ -266,7 +266,7 @@ import xmlrpclib def python_logo(): - with open("python_logo.jpg") as handle: + with open("python_logo.jpg", "rb") as handle: return xmlrpclib.Binary(handle.read()) server = SimpleXMLRPCServer(("localhost", 8000)) @@ -282,7 +282,7 @@ import xmlrpclib proxy = xmlrpclib.ServerProxy("http://localhost:8000/") - with open("fetched_python_logo.jpg", "w") as handle: + with open("fetched_python_logo.jpg", "wb") as handle: handle.write(proxy.python_logo().data) .. _fault-objects: @@ -368,12 +368,12 @@ .. In the following example we're going to intentionally cause a :exc:`ProtocolError` by providing an invalid URI:: -次の例では、不正なURIを利用して、故意に :exc:`ProtocolError` を発生させてい ます。 :: +次の例では、XMLRPC サーバを指していない URI を利用して、故意 に :exc:`ProtocolError` を発生させています。 :: import xmlrpclib - # create a ServerProxy with an invalid URI - proxy = xmlrpclib.ServerProxy("http://invalidaddress/") + # create a ServerProxy with an URI that doesn't respond to XMLRPC requests + proxy = xmlrpclib.ServerProxy("http://www.google.com/") try: proxy.some_method() ============================================================================== Revision: c65d634e7cf9 Author: cocoatomo <cocoa****@gmail*****> Date: Sat Mar 19 08:08:13 2011 Log: merge http://code.google.com/p/python-doc-ja/source/detail?r=c65d634e7cf9