[IronPython] FePy socket.py w/ _fileobject

Sanghyeon Seo sanxiyn at gmail.com
Sun Nov 12 02:51:12 CET 2006


2006/11/12, Christopher Baus <christopher at baus.net>:
> I copied the _fileobject class directly from the standard library and
> added it to socket.py.
>
> The end result is here:
> https://svn3.cvsdude.com/baus/s2/webapp/bin/Lib/s2/socket.py

Thank you for doing this. I should have done this long time ago.

> As I mentioned in a previous post, _fileobject is used by urllib2.  I
> think urllib2 is doing something fishy, but a lot of other packages depend
> on urllib2.

Yes, urllib2 is "wrong" here. In my opinion, the best solution is to
refactor "buffering and file emulation" part of socket.py to separate
module (say, UserFile?) and use that. Nobody bothered to do that.

> It seemed like the easiest thing to do was to provide the class for
> compatibility with CPython.

Yes, it is the easiest solution right now.

-- 
Seo Sanghyeon



More information about the Ironpython-users mailing list