`os.removedirs()` should define whether it follows symlinks
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Documentation
Many functions in os do not properly specify whether or not they follow symlinks. The Files and Directories even slightly implies that the default is more to follow symlinks (and only with follow_symlinks=False not).
For some functions (like os.rmdir() one might argue this is not important because they're the counterparts of well-known POSIX/C functions and for them it's well-defined.
But e.g. os.removedirs() seem to have no such counterpart and since the documentation doesn't mention anything, the current behaviour (which AFAICS is not following symlinks) might just be some implementation detail.
For os.removedirs() there are even two interesting cases in e.g. os.removedirs("a/b/c/d"):
- if
d(i.e. the final pathname component) is a symlink to a directory the referred directory is not removed (at least not in the current code, which usesos.rmdir()on the pathname) - if e.g.
bis a symlink to a directory, which contains onlyc/d, thenbis followed whenrmdiringa/b/c/danda/b/cbut is not followed whenrmdiringa/b(and the target ofbisn’t removed).
All this kinda follows the spirit of POSIX' pathname resolution, but still it would IMO be nice to have it clearly defined.
Cheers,
Chris.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con la sección «Files and Directories» de la documentación de Python y las entradas de os.removedirs() y os.rmdir(). Documenta si os.removedirs() sigue los enlaces simbólicos para los componentes de ruta final e intermedios, de modo que el comportamiento descrito en el issue sea explícito y coherente con la semántica documentada.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- documentation
- Tipo de issue
- Documentación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 40/100