[Python-Dev] more on httplib

Moshe Zadka Moshe Zadka <moshez@math.huji.ac.il>
Sun, 11 Jun 2000 14:58:28 +0300 (IDT)


On Sun, 11 Jun 2000, Greg Stein wrote:

>   3) I want to remove a "feature" of the old HTTP class. This would be a
>      change in behavior, but (IMO) minor. Specifically, if the Status-Line
>      is malformed, the old httplib.py would return (-1, <malformed line>,
>      None) and store <file ob hooked to socket> into self.file. Nominally,
>      that file object allows a client to read more data from the socket
>      after the parse problem on the malformed Status-Line. I think it is
>      useless, unused by any clients out there, and it causes me pain to
>      provide it :-)  I'd like to just store None into self.file

What do the old docs say about this?

\begin{methoddesc}{getfile}{}
Return a file object from which the data returned by the server can be
read, using the \method{read()}, \method{readline()} or
\method{readlines()} methods.
\end{methoddesc}

So why not put a "dummy" file: one whose read(), readline() or readlines() 
act as if it was at EOF?
(IOW, the Pythonic equivalent of open("/dev/null"))


-- 
Moshe Zadka <moshez@math.huji.ac.il>
http://www.oreilly.com/news/prescod_0300.html
http://www.linux.org.il -- we put the penguin in .com