Message141183
The documentation page
http://docs.python.org/release/2.6.6/library/functions.html?highlight=open#open
describes the open() built-in function as
open(filename[, mode[, bufsize]])
but the Python interpreter complains:
Python 2.6.6 (r266:84292, Dec 27 2010, 00:02:40)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>>
>>> file_descriptor = open(filename='/spam')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Required argument 'name' (pos 1) not found
>>>
>>>
>>> file_descriptor = open(name='/spam', bufsize=-1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'bufsize' is an invalid keyword argument for this function
>>>
>>>
>>> file_descriptor = open(name='/spam', buffering=-1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
IOError: [Errno 2] No such file or directory: '/spam'
>>> _
So the documentation page should read
open(name[, mode[, buffering]])
---- ---------
instead, note 'name' not 'filename' and 'buffering' not 'bufsize'.
Maybe it's relevant, because Debian/stable still ships with
Python 2.6.6 and I guess the Python 2.7.x documentation has
the same bug.
The """docstring""" does already reflect that correctly.
PS:
This is my first bug report. I hope I did this right.
Mercy, please! ;) |
|
Date |
User |
Action |
Args |
2011-07-26 21:20:19 | jannkruse | set | recipients:
+ jannkruse, docs@python |
2011-07-26 21:20:19 | jannkruse | set | messageid: <1311715219.77.0.164344328426.issue12642@psf.upfronthosting.co.za> |
2011-07-26 21:20:19 | jannkruse | link | issue12642 messages |
2011-07-26 21:20:19 | jannkruse | create | |
|