This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: open() doc: default value for buffering is -1, not None
Type: Stage: resolved
Components: Documentation, Interpreter Core, IO Versions: Python 3.1, Python 3.2, Python 3.3
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, ezio.melotti, georg.brandl, pitrou, vstinner
Priority: normal Keywords: patch

Created on 2010-07-06 21:58 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
open_doc_buffering.patch vstinner, 2010-07-06 21:58
Messages (5)
msg109434 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-07-06 21:58
Examples:
 * open(filename) works
 * open(filename, buffering=-1) works
 * open(filename, buffering=None) fails

In the code:
 * _pyio.open(): default value is -1, type is int, no default value in the docstring
 * _io.open(): default value is not specified (C function), type is int, default value in the docstring is None

In the doc:
 * open() default value is None

The default value should be -1 everywhere. None is rejected by io.open (_io) and _pyio.open.

Attached patch fixes _io.open() docstring Python documentation.
msg109975 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-07-11 09:33
Applied as r82801.
msg109981 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-07-11 10:15
Éric, I appreciate your wanting to help, but I don't think setting the stage after the fact makes much sense, especially since it is going away anyway...
msg109985 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-07-11 10:22
I think it's still better to set it correctly. Even assuming that it will go away, if the stage is set correctly it will be easier to convert it to something else if necessary (e.g. if the stage is left on "patch review" it might be turned to "needs review" even if it gets closed).
msg109987 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-07-11 10:29
Well, of course I don't want to make you unhappy, but don't ever expect me to make such a useless change myself :)  Especially when an issue is closed, nobody is going to look at it again except by accident.
History
Date User Action Args
2022-04-11 14:57:03adminsetgithub: 53430
2010-07-11 10:29:06georg.brandlsetmessages: + msg109987
2010-07-11 10:22:39ezio.melottisetnosy: + ezio.melotti
messages: + msg109985
2010-07-11 10:15:58georg.brandlsetmessages: + msg109981
2010-07-11 09:42:15eric.araujosetstage: resolved
2010-07-11 09:33:49georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg109975

resolution: accepted
2010-07-06 21:58:08vstinnercreate