homepage

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.

Author jannkruse
Recipients docs@python, jannkruse
Date 2011年07月26日.21:20:19
SpamBayes Score 3.330669e-16
Marked as misclassified No
Message-id <1311715219.77.0.164344328426.issue12642@psf.upfronthosting.co.za>
In-reply-to
Content
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! ;)
History
Date User Action Args
2011年07月26日 21:20:19jannkrusesetrecipients: + jannkruse, docs@python
2011年07月26日 21:20:19jannkrusesetmessageid: <1311715219.77.0.164344328426.issue12642@psf.upfronthosting.co.za>
2011年07月26日 21:20:19jannkruselinkissue12642 messages
2011年07月26日 21:20:19jannkrusecreate

AltStyle によって変換されたページ (->オリジナル) /