[issue12315] Improve http.client.HTTPResponse.read documentation

2011-06-19 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d801b570b1dd by Senthil Kumaran in branch '3.2':
Fix closes Issue12315 - Updates to http.client documentation.
http://hg.python.org/cpython/rev/d801b570b1dd

--
nosy: +python-dev
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12315] Improve http.client.HTTPResponse.read documentation

2011-06-17 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The patch does 3 things:

1. clarify that 'amt' in 'the next amt bytes' means 'amount'.

I do not think this is necessary; 'the next blah bytes' is clear. Actually, 
'amt' really means 'number', not 'amount', which would imply that 'amt' is a 
float, not an int. 'amt' was a poor choice of parameter name and should have 
been 'n' or 'nbytes' I presume it has to be an int, not a float. Since it is 
passed on to the socket file wrapper, I suspect that io.rawiobase."read(n=-1) 
Read up to n bytes from the object and return them. As a convenience, if n is 
unspecified or -1, readall() is called. Otherwise, only one system call is ever 
made. Fewer than n bytes may be returned if the operating system call returns 
fewer than n bytes.

If 0 bytes are returned, and n was not 0, this indicates end of file. If the 
object is in non-blocking mode and no bytes are available, None is returned."
applies, but I am not really sure.

2. Add an example after the entry for .read().
This seems out of place since there is already a section for examples. All 
three of the existing examples use response.read. One of them could be enlarged 
slightly to read in chunks if an example is needed.

3. Document .closed
If it were mentioned that HTTPResponse is a subclass of RawIOBase, and perhaps 
it should be, the existence of .closed might be inferred. But since not 
everything is implemented, and since .closed is useful to iterate (as should be 
the example), I agree this should be added.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12315] Improve http.client.HTTPResponse.read documentation

2011-06-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +orsenthil
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12315] Improve http.client.HTTPResponse.read documentation

2011-06-10 Thread harobed

New submission from harobed :

This is a patch to improve http.client.HTTPResponse.read documentation.

What do you think about ?

--
assignee: docs@python
components: Documentation
files: improve_http.client_documentation.patch
keywords: patch
messages: 138129
nosy: docs@python, harobed
priority: normal
severity: normal
status: open
title: Improve http.client.HTTPResponse.read documentation
versions: Python 3.3
Added file: 
http://bugs.python.org/file22321/improve_http.client_documentation.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com