Skip to content

Commit 209706e

Browse files
committed
rename to _MAXIMUM_BUFFER_SIZE
1 parent 0ab4592 commit 209706e

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@ are always available. They are listed here in alphabetical order.
14061406
given, the default buffering policy works as follows:
14071407

14081408
* Binary files are buffered in fixed-size chunks; the size of the buffer
1409-
is max(min(blocksize, MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE)
1409+
is max(min(blocksize, _MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE)
14101410
when the device block size is available.
14111411
On most systems, the buffer will typically be 128 kilobytes long.
14121412

Lib/_pyio.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
valid_seek_flags.add(os.SEEK_HOLE)
2424
valid_seek_flags.add(os.SEEK_DATA)
2525

26-
# open() uses max(min(blocksize, MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE)
26+
# open() uses max(min(blocksize, _MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE)
2727
# when the device block size is available.
2828
DEFAULT_BUFFER_SIZE = 128 * 1024 # bytes
29-
MAXIMUM_BUFFER_SIZE = 8192 * 1024 # bytes
29+
_MAXIMUM_BUFFER_SIZE = 8192 * 1024 # bytes
3030

3131
# NOTE: Base classes defined here are registered with the "official" ABCs
3232
# defined in io.py. We don't use real inheritance though, because we don't want
@@ -126,7 +126,7 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None,
126126
given, the default buffering policy works as follows:
127127
128128
* Binary files are buffered in fixed-size chunks; the size of the buffer
129-
is max(min(blocksize, MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE)
129+
is max(min(blocksize, _MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE)
130130
when the device block size is available.
131131
On most systems, the buffer will typically be 128 kilobytes long.
132132
@@ -244,7 +244,7 @@ def open(file, mode="r", buffering=-1, encoding=None, errors=None,
244244
buffering = -1
245245
line_buffering = True
246246
if buffering < 0:
247-
buffering = max(min(raw._blksize, MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE)
247+
buffering = max(min(raw._blksize, _MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE)
248248
if buffering < 0:
249249
raise ValueError("invalid buffering size")
250250
if buffering == 0:

Modules/_io/_iomodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ PyDoc_STRVAR(module_doc,
6262
" An int containing the default buffer size used by the module's buffered\n"
6363
" I/O classes.\n"
6464
"\n"
65-
"MAXIMUM_BUFFER_SIZE\n"
65+
"_MAXIMUM_BUFFER_SIZE\n"
6666
"\n"
6767
" An int containing the maximum buffer size used by the module's buffered\n"
6868
" I/O classes.\n"
@@ -136,7 +136,7 @@ the size of a fixed-size chunk buffer. When no buffering argument is
136136
given, the default buffering policy works as follows:
137137
138138
* Binary files are buffered in fixed-size chunks; the size of the buffer
139-
is max(min(blocksize, MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE)
139+
is max(min(blocksize, _MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE)
140140
when the device block size is available.
141141
On most systems, the buffer will typically be 128 kilobytes long.
142142
@@ -204,7 +204,7 @@ static PyObject *
204204
_io_open_impl(PyObject *module, PyObject *file, const char *mode,
205205
int buffering, const char *encoding, const char *errors,
206206
const char *newline, int closefd, PyObject *opener)
207-
/*[clinic end generated code: output=aefafc4ce2b46dc0 input=e1e2d41c6e922cbe]*/
207+
/*[clinic end generated code: output=aefafc4ce2b46dc0 input=a35153cf2829c537]*/
208208
{
209209
size_t i;
210210

@@ -372,7 +372,7 @@ _io_open_impl(PyObject *module, PyObject *file, const char *mode,
372372
if (blksize_obj == NULL)
373373
goto error;
374374
buffering = PyLong_AsLong(blksize_obj);
375-
buffering = Py_MAX(Py_MIN(buffering, MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE);
375+
buffering = Py_MAX(Py_MIN(buffering, _MAXIMUM_BUFFER_SIZE), DEFAULT_BUFFER_SIZE);
376376
Py_DECREF(blksize_obj);
377377
if (buffering == -1 && PyErr_Occurred())
378378
goto error;

Modules/_io/_iomodule.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ extern Py_ssize_t _PyIO_find_line_ending(
7979
extern int _PyIO_trap_eintr(void);
8080

8181
#define DEFAULT_BUFFER_SIZE (128 * 1024) /* bytes */
82-
#define MAXIMUM_BUFFER_SIZE (8192 * 1024) /* bytes */
82+
#define _MAXIMUM_BUFFER_SIZE (8192 * 1024) /* bytes */
8383

8484
/*
8585
* Offset type for positioning.

Modules/_io/clinic/_iomodule.c.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)