[IronPython] ironptython xml-rpc how?

Curt Hagenlocher curt at hagenlocher.org
Thu Feb 21 14:18:43 CET 2008


On Thu, Feb 21, 2008 at 4:35 AM,  <henry at cs.its.ac.id> wrote:
>
>  File System, line unknown, in Read
> IOError: Unable to read data from the transport connection: Cannot access
> a disposed object.
> Object name: 'System.Net.Sockets.Socket'..

This is a known issue in IronPython.  You can work around it by using
Seo's implementation of the socket module.  If you're not already
using it, download "IronPython Community Edition" from
http://fepy.sourceforge.net.  Then to replace the built-in socket
module, you'll need to do something like this:

import os, sys, imp
sys.modules['socket'] = module = imp.new_module('socket')
execfile('..\\lib\\socket.py', module.__dict__)
import xmlrpclib
server = xmlrpclib.Server('http://localhost:4567')
month = server.getMonth(2002, 8)

I've tested this and it works.

(Code shamelessly stolen from Birsch's recent BeautifulSoup example.)

--
Curt Hagenlocher
curt at hagenlocher.org



More information about the Ironpython-users mailing list