Lukáš Duběda <loo...@duber.cz> wrote:

> Hi there,
> 
> I hope someone out there could help me out with this problem.
> 
> I have a API written in Python (CPython that is) that relies on
> some of the CPython modules, such as ssl and httplib.
> 
> The problem is, when I call the API and its methods via IronPython
> I get IOError: "System.IO.IOException: Unable to write data to the
> transport connection: Cannot access a disposed object."

I re-wrote the SSL module for CPython back in 2007, and as part of that
delved into the socket and httplib modules, further than I wanted to go.
The httplib module relies on the socket module's not actually closing
the socket when it gets GC'd.  It passes the file descriptor off to a
callback function, and drops the socket object, assuming that the file
descriptor will stay open so the callback function can read from it,
until someone (presumably the callback function) closes it.  (This
apparently was originally done to work around the absence of dup() on
Windows.)  I believe it was re-engineered in py3, but am not sure what
the status is in py2.  I could easily see this leading to something
similar to what you're seeing.

Bill
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to