Make it configurable whether shutil.copytree copies stat() information
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
Feature or enhancement
Proposal:
When copying a tree of files, it is sometimes useful for them to have default stat() information (file permissions, mtime and so on), instead of it being copied from the source files, for example when copying files from a read-only location to a temporary location where they may be modified or deleted later, but shutil.copytree unconditionally copies stat() information.
In a script that I wrote, I worked around the lack of this feature by monkey-patching the shutil.copystat function to do nothing, but this is clearly not a robust approach.
Ideally I would like to be able to turn off the stat() copying behavior by passing a named argument to copytree, such as:
shutil.copytree(src, dst, copystat=False)
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
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
Empieza leyendo shutil.copytree y shutil.copystat para entender dónde se copia la información de stat. Comprueba el comportamiento y las pruebas existentes de shutil y, después, define el comportamiento configurable para que, al copiar, la información de stat se pueda conservar u omitir según se solicite.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- operating-systems
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 48/100