New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IO buffering behaviour not properly documented #51794
Comments
Hello, "buffering is an optional integer used to set the buffering policy. By ----------- Only case of full buffering in the C iomodule :
if (buffering < 0) {
buffering = DEFAULT_BUFFER_SIZE;
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
{
struct stat st;
long fileno;
PyObject *res = PyObject_CallMethod(raw, "fileno", NULL);
if (res == NULL)
goto error;
fileno = PyInt_AsLong(res);
Py_DECREF(res);
if (fileno == -1 && PyErr_Occurred())
goto error;
#endif |
"Full buffering" means exactly what you discovered it means - enable a |
The docs have a different wording, which I suggest copying to the docstring: *buffering* is an optional integer used to set the buffering policy. By But now the question remains what the default is -- "full buffering" is |
"full" buffering actually uses a default or custom buffer size when you "full" buffering is the default for binary streams, as well as for text (I admit full buffering is a confusing name; what could we use instead? |
Here is a possible patch for the Doc. I suppose the docstrings need |
Yep, I knew "full buffering" didn't mean "fill my RAM until crash" :p |
Thank you, fixed in a lot of revisions. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: