Re: problem using urllib...

Jack Jansen (Jack.Jansen@cwi.nl)
Mon, 23 Jan 1995 22:25:08 GMT

"Ron Forrester" <rjf@aurora.pcg.com> writes:

>Guido (and friends), I jumped on your suggestion for using urllib, and had a
>bit of a problem. I am using python-1.1 built for Windows NT -- following is
>the output from the session:
> ....
> File "d:\python-1.1\lib\httplib.py", line 86, in getreply
> self.file = self.sock.makefile('r')
>AttributeError: makefile

>I haven't really investigated this, but it appears my python socket
>implementation is missing 'makefile'? Is that right?

I had the same problem when I implemented sockets on the Mac. The mac
sockets support is a wrapper around the underlying mactcp API. What I
did was to add a class that looks like a file object and implements
the needed calls by calling to the underlying mactcp object.

I haven't looked at httplib.py yet, only at ftplib.py, so it could be
that it needs functionality that is difficult/impossible to emulate
(using self.file.fileno() in select calls comes to mind) but so far
the workaround seems to have held.

-- 
--
Jack Jansen        | If I can't dance I don't want to be part of
Jack.Jansen@cwi.nl | your revolution             -- Emma Goldman
uunet!cwi.nl!jack    G=Jack;S=Jansen;O=cwi;PRMD=surf;ADMD=400net;C=nl