classification
Title: os.listdir() documentation error
Type: Stage:
Components: Documentation Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, steve21
Priority: normal Keywords:

Created on 2008-11-24 07:00 by steve21, last changed 2008-11-24 19:57 by georg.brandl. This issue is now closed.

Messages (2)
msg76307 - (view) Author: Steve (steve21) Date: 2008-11-24 07:00
The documentation entry for os.listdir(path) at
 html docs at http://docs.python.org/dev/3.0/library/os.html#module-os
says:

"os.listdir(path)
   Return a list containing the names of the entries in the directory.
The list is in arbitrary order. It does not include the special entries
. and .. even if they are present in the directory. Availability: Unix,
Windows.

    This function can be called with a bytes or string argument. In the
bytes case, all filenames will be listed as returned by the underlying
API. In the string case, filenames will be decoded using the file system
encoding, and skipped if a decoding error occurs."

The problem is that nowhere it the above documentation does it describe
what the 'path' argument should be !

However, if I do
$ Python3.0
>>> import os
>>> help(os.listdir)   # it does describe 'path'
Help on built-in function listdir in module posix:

listdir(...)
    listdir(path) -> list_of_strings

    Return a list containing the names of the entries in the directory.

            path: path of directory to list

    The list is in arbitrary order.  It does not include the special
    entries '.' and '..' even if they are present in the directory.


It looks like the html docs are missing some information and out of sync
with the module docs.
msg76358 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-11-24 19:57
Should be fixed in r67368.
History
Date User Action Args
2008-11-24 19:57:32georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg76358
2008-11-24 07:00:55steve21create