Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os.listdir() documentation error #48654

Closed
steve21 mannequin opened this issue Nov 24, 2008 · 2 comments
Closed

os.listdir() documentation error #48654

steve21 mannequin opened this issue Nov 24, 2008 · 2 comments
Assignees
Labels
docs Documentation in the Doc dir

Comments

@steve21
Copy link
Mannequin

steve21 mannequin commented Nov 24, 2008

BPO 4404
Nosy @birkenfeld

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/birkenfeld'
closed_at = <Date 2008-11-24.19:57:32.722>
created_at = <Date 2008-11-24.07:00:54.879>
labels = ['docs']
title = 'os.listdir() documentation error'
updated_at = <Date 2008-11-24.19:57:32.720>
user = 'https://bugs.python.org/steve21'

bugs.python.org fields:

activity = <Date 2008-11-24.19:57:32.720>
actor = 'georg.brandl'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2008-11-24.19:57:32.722>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2008-11-24.07:00:54.879>
creator = 'steve21'
dependencies = []
files = []
hgrepos = []
issue_num = 4404
keywords = []
message_count = 2.0
messages = ['76307', '76358']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'steve21']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue4404'
versions = ['Python 3.0']

@steve21
Copy link
Mannequin Author

steve21 mannequin commented Nov 24, 2008

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.

@steve21 steve21 mannequin assigned birkenfeld Nov 24, 2008
@steve21 steve21 mannequin added the docs Documentation in the Doc dir label Nov 24, 2008
@birkenfeld
Copy link
Member

Should be fixed in r67368.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant