50 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
115
views
Python's shutil.ignore_patterns not working despite given valid glob pattern
I'm trying to write a script for which I want to copy a git repository, but without the .git folder. Here is my entire code:
import shutil
shutil.copytree([src], [dst], ignore=shutil.ignore_patterns('*...
0
votes
1
answer
135
views
Python shutil.copytree: [WinError 32] The process cannot access the file because it is being used by another process
On GitHub I share an PyInstaller generated exe-File (file1.exe). The idea is an automatized update process if there is a new version of the file. On every start of file1.exe the program checks if ...
0
votes
1
answer
130
views
How to copy a directory structure along with specific file extensions?
I've been trying for days now and searched online for solutions and I only found problems similar to mine which didn't help me. The best I managed so far is to copy the entire structure with all files ...
0
votes
1
answer
1k
views
Alternative for python shutils.copytree?
recently i built a tool, which is able to copy files and directories to a selected location. I used the shutil.copy function for copying files and the shutil.copytree function for copying directories. ...
0
votes
2
answers
106
views
Moving folder contents to another -- CopyTree not working
I am trying to move the contents from one folder to another while excluding some types of files. The script used so far,
OD_daily_files = "C:\\Users\\" + checkuser + "\\Gas South\\SRM ...
2
votes
0
answers
719
views
shutil.copytree unable to avoid FileExistsError Python 3.7
I know that with Python 3.8 has been introduced 'dirs_exist_ok=True' argument but I am constrained on Python 3.7
I have tried with no success
shutil.copytree(homePath, dst, symlinks=False, ignore=None)...
1
vote
0
answers
308
views
Retry a copy acitivity in python if a network error is given?
I'm currently trying to create a python script. One of the steps is that it shall create a copy of a folder, including subfolders, and checks beforehand if the folder already exists. If yes, then it ...
0
votes
0
answers
426
views
Python shutil.copytree - WinError 267 Directory name is invalid
I am trying to copy a Sentinel 2 folder tree using the Python function shutil.copytree. I have handled paths with the os package to prevent errors derived from bad path names. However, when calling ...
0
votes
0
answers
181
views
PyInstaller created exe giving access denies while copying file
I have written a code to copy the directory tree structure to another folder using Python:
try:
shutil.copytree(srcfolder, dstfolder, ignore = shutil.ignore_patterns(IGNORE_EXTENSIONS))
except ...
0
votes
1
answer
267
views
shutil.copytree copy along with source directory name as well
Folder1:
tree
.
├── abc.json
├── pqr.bson
├── subdir
│ ├── abc.json
│ ├── pqr.bson
│ └── xyz.json
└── xyz.json
1 directory, 6 files
import os
import shutil
sourcefolder="./Folder1"
...
0
votes
0
answers
135
views
Copying a folder over with Shutil while saving to a file within it. What will happen?
Two different areas of my code deal with a directory. One copies the directory every 6 minutes to a new location. The other randomly will save to a file within the directory on rare occasion. I ...
0
votes
0
answers
419
views
Does shutil.copy2 (and copytree) could be considered success (files copied are identical) if no exception
In a Python project, at some point we copy data with shutil.copy2 and shutil.copytree and we have seen after a while that some files are corrupted, but we are not sure if this is the Python copy or ...
-5
votes
1
answer
2k
views
Python. Copy Files and Folders to existing directory [closed]
How can I copy all contents (including folders) from folder A to the existing folder B with Python?
0
votes
1
answer
320
views
Trying to use copytree to copy over subfolders recursively in Python
I'm working on a code that will copy over subfolders of certain directories to a new directory. I feel like I've tried everything but I can't seem to get them to copy. Only the folder and files the ...
0
votes
1
answer
300
views
How to copy folders with same names recursively to another folder in Google Colab
I have 10 folds, with 2 folders in each fold face, and background, I want to copy different folds inside train, validate folders so the train or validate will have face, background from different ...