Make it configurable whether shutil.copytree copies stat() information
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PRs
- Métricas de PR pendentes
Descrição
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
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece lendo shutil.copytree e shutil.copystat para entender onde as informações de stat são copiadas. Verifique o comportamento e os testes existentes de shutil e, em seguida, defina o comportamento configurável para que, durante a cópia, as informações de stat possam ser preservadas ou ignoradas conforme solicitado.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- operating-systems
- Tipo de issue
- Funcionalidade
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 48/100