python / python/cpython

os.stat()’s follow_symlinks is a bit ambigously described

Aberta
#96,402 4 comentários 1 reação 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

docs
Linguagem predominante
Python
Estrelas
77.2k
Forks
36k
Métricas de merge de PRs
Métricas de PR pendentes

Descrição

Documentation

There are numerous functions which take a pathname and and argument like follow_symlinks.

For most of these, the argument follow_symlinks is not further explained in the function itself, but people will rather have to resort to https://docs.python.org/3/library/os.html#files-and-directories where things are rather exactly described.

However, the description of os.stat() has:

This function normally follows symlinks; to stat a symlink add the argument follow_symlinks=False, or use lstat().

Which is however only half correct, because what it actually means is:

When the last component of the path is a symbolic link, the function normally follows it. Symbolic links in the path that are not the last component, are always followed.

Similar, the paragraph below for windows, also uses wording that implies any name-surrogate reparse points, i.e. not only if the last pathname component is one.
No idea what Windows does, but if that's also wrong, it should be corrected accordingly. Also in the "Changed in" entry for that.

AFAICS, the other functions of os have it correctly described (by simply not describing it).

Thanks,
Chris.

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Direção de pesquisa

Comece pela documentação de os.stat() e pela seção vinculada Files and Directories. Esclareça que follow_symlinks se aplica ao último componente do nome do caminho e, em seguida, verifique e corrija, se necessário, a redação correspondente para Windows e a entrada Changed in; a documentação deve descrever ambos os comportamentos com precisão.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
python
Domínio
documentation
Tipo de issue
Documentação
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
48/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.