mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
bpo-33239: Fix default value of 'buffering' parameter in docs of tempfile.* functions (GH-21763)
`None` doesn't work:
```python
>>> import tempfile
>>> tempfile.TemporaryFile(buffering=None)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/sergey/tmp/cpython-dev/Lib/tempfile.py", line 607, in TemporaryFile
return _io.open(fd, mode, buffering=buffering,
TypeError: 'NoneType' object cannot be interpreted as an integer
```
Automerge-Triggered-By: @vsajip
This commit is contained in:
parent
c75330605d
commit
b48389d950
1 changed files with 3 additions and 3 deletions
|
|
@ -31,7 +31,7 @@ is recommended to use keyword arguments for clarity.
|
|||
|
||||
The module defines the following user-callable items:
|
||||
|
||||
.. function:: TemporaryFile(mode='w+b', buffering=None, encoding=None, newline=None, suffix=None, prefix=None, dir=None, *, errors=None)
|
||||
.. function:: TemporaryFile(mode='w+b', buffering=-1, encoding=None, newline=None, suffix=None, prefix=None, dir=None, *, errors=None)
|
||||
|
||||
Return a :term:`file-like object` that can be used as a temporary storage area.
|
||||
The file is created securely, using the same rules as :func:`mkstemp`. It will be destroyed as soon
|
||||
|
|
@ -72,7 +72,7 @@ The module defines the following user-callable items:
|
|||
Added *errors* parameter.
|
||||
|
||||
|
||||
.. function:: NamedTemporaryFile(mode='w+b', buffering=None, encoding=None, newline=None, suffix=None, prefix=None, dir=None, delete=True, *, errors=None)
|
||||
.. function:: NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None, newline=None, suffix=None, prefix=None, dir=None, delete=True, *, errors=None)
|
||||
|
||||
This function operates exactly as :func:`TemporaryFile` does, except that
|
||||
the file is guaranteed to have a visible name in the file system (on
|
||||
|
|
@ -93,7 +93,7 @@ The module defines the following user-callable items:
|
|||
Added *errors* parameter.
|
||||
|
||||
|
||||
.. function:: SpooledTemporaryFile(max_size=0, mode='w+b', buffering=None, encoding=None, newline=None, suffix=None, prefix=None, dir=None, *, errors=None)
|
||||
.. function:: SpooledTemporaryFile(max_size=0, mode='w+b', buffering=-1, encoding=None, newline=None, suffix=None, prefix=None, dir=None, *, errors=None)
|
||||
|
||||
This function operates exactly as :func:`TemporaryFile` does, except that
|
||||
data is spooled in memory until the file size exceeds *max_size*, or
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue