Title: HTTPConnection.set_debuglevel has no information about level range
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.1, Python 3.2, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: JTMoon79, docs@python, r.david.murray
Priority: normal Keywords:

Created on 2010-12-14 19:22 by JTMoon79, last changed 2010-12-15 02:20 by r.david.murray. This issue is now closed.

Messages (6)
msg123974 - (view) Author: JamesThomasMoon1979 (JTMoon79) Date: 2010-12-14 19:22
Function HTTPConnection.set_debuglevel(level)
There is no range of acceptable debug levels.
What should be the difference in set_debuglevel(1) and set_debuglevel(1000)?
If the documentation lists the levels this would save users from needing to do tedious trial-error experimentation.

msg123976 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-14 19:44
Or, since this is Python, they could look at the code and find out that all levels above zero are equivalent.  (If I had to guess I'd say 'level' was either future proofing or designed for the use of subclasses).

But you are right, this should be mentioned in the documentation.  Care to propose a patch?
msg123991 - (view) Author: JamesThomasMoon1979 (JTMoon79) Date: 2010-12-14 23:33
Hi David,
Currently the 3.1 documentation reads:
    Set the debugging level (the amount of debugging output printed). The default debug level is 0, meaning no debugging output is printed."""
How about:
    Set the debug level.  The debug level is the amount of debugging output printed. 
The default debug level is 0, meaning no debugging output is printed.
Currently, any debug level value greater than 0 prints the same amount of debugging output.
debugging output is printed to stdout."""

Information is from the file C:\Python\ActivePython3.1.2.3\Lib\http\
msg123992 - (view) Author: JamesThomasMoon1979 (JTMoon79) Date: 2010-12-14 23:35
> Care to propose a patch?
oops.  I just found
I'll get around to creating a PEP sometime soon.
msg123999 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-15 01:41
I think a PEP is a bit of overkill for a small doc update :)  A patch would be fine...but I can also just make the change.  I'll probably tweak your wording a bit.
msg124002 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2010-12-15 02:20
I've committed a fix in r87256.  I looked at the code some more and tried to be a precise as possible without getting too wordy.  (The fix will get backported by and by.)
Date User Action Args
2010-12-15 02:20:34r.david.murraysetstatus: open -> closed
nosy: r.david.murray, docs@python, JTMoon79
messages: + msg124002

resolution: fixed
stage: resolved
2010-12-15 01:41:29r.david.murraysetnosy: r.david.murray, docs@python, JTMoon79
messages: + msg123999
2010-12-14 23:35:55JTMoon79setmessages: + msg123992
2010-12-14 23:33:33JTMoon79setmessages: + msg123991
2010-12-14 19:44:10r.david.murraysetversions: + Python 2.7, Python 3.2
nosy: + r.david.murray

messages: + msg123976

type: behavior
2010-12-14 19:22:41JTMoon79create