Closed GoogleCodeExporter closed 9 years ago
ah, yes, this function is still missing, as discussed a long time ago in issue
37. I'm not sure what it would take to implement it. I will ask the author of
the socket implementation if he thinks this would be difficult to add. so
perhaps an easy task, but I don't know.
Original comment by mark.duf...@gmail.com
on 18 Nov 2010 at 7:45
Dealing with HTTP connections needs this. Without it,
Python file I/O won't work on sockets. All you can do is "recv",
which no higher level code uses.
The HTTP library has to read the input up to the end of headers,
then return a Python file object which is ready to start returning the
"body" of the document. Since the socket has no idea where that
boundary is, and you can't rewind a socket, everybody has to be using
the same buffering system for that handoff to work.
(Converting "httplib.py" has been a big job. It doesn't
look much like the stock module any more, even though it does
much the same things. But it's close to working. "makefile" is a
showstopper, but should be the last thing I can't work around.)
John Nagle
Original comment by na...@animats.com
on 18 Nov 2010 at 8:14
thanks again for looking into httplib! I look forward to the result.
the cpython implementation of socket.makefile looks quite simple:
http://svn.python.org/view/python/trunk/Modules/socketmodule.c?revision=81029&vi
ew=markup
on UNIX it's just a call to 'dup' and 'fdopen'.. I'm not sure what
_open_osfhandle does under WIN32.
Original comment by mark.duf...@gmail.com
on 19 Nov 2010 at 7:07
I hadn't realized that "fdopen" works on sockets. That helps with the
buffering problem.
The main thing that "makefile" does is to create a Python file object and
connect it to "fdopen", I'm not clear on how to do that inside Shed Skin's
library. (Actually, I'm trying to avoid going into the internals of Shed Skin.)
Are you going to put "makefile" in the Shed Skin library soon?
Original comment by na...@animats.com
on 19 Nov 2010 at 7:29
I just did! could you please test if it at least compiles under WIN32..? :-)
Original comment by mark.duf...@gmail.com
on 20 Nov 2010 at 1:40
hello, hello. I just fixed some compiler errors for this under Windows, as part
of building a windows package for 0.7 again..
Original comment by mark.duf...@gmail.com
on 8 Dec 2010 at 7:51
I've been busy on other stuff, and will get back to Shed Skin
shortly. If you get 0.7 out, let me know; I don't have time
right now to build from the repository.
John Nagle
Original comment by na...@animats.com
on 8 Dec 2010 at 8:15
sorry if I didn't let you know about the 0.7 release. 0.7.1 is out already by
now.. not for Windows yet, though, but 0.7 should work.
Original comment by mark.duf...@gmail.com
on 27 Feb 2011 at 12:39
I guess we can close this one. if it still a problem for someone, they can open
a new issue. in any case, I will test if things at least compile as part of the
release process for windows.
Original comment by mark.duf...@gmail.com
on 25 May 2011 at 7:49
Original issue reported on code.google.com by
na...@animats.com
on 18 Nov 2010 at 7:34