1,186 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
1
answer
105
views
what does shutil.rmtree(d, ignore_errors=True) do?
I was working with shutil module. My file structure looked like this projects/backend/--3-5 repos-- .
In one of the repo's views.py I used
for d in destDirs:
shutil.rmtree(d, ignore_errors=True)
...
2
votes
2
answers
80
views
How to prevent [WinError 3] using shutil.move on .mp3 files whose artist tags contain '&' or '('?
I'm writing a Python script that:
Notes all files in the working directory
Reads the artist tag with the mutagen library
Uses regex to grab the first-mentioned artist as the 'main artist'
Creates a ...
3
votes
3
answers
128
views
download large file from URL using python
I have a task to download around 16K+ ( max size is of 1GB) files from given URL to location. Files are of different format like pdf, ppt, doc, docx, zip, jpg, iso etc.
So had written below piece of ...
1
vote
1
answer
68
views
Python 3 how to zip the contents and folder that are in another folder
I want to have a folder called 'product_a1' in a folder called 'product_a1' with a text file and process flag files such as 'completed' file. I want to zip the entire thing so it can be put onto a ...
0
votes
1
answer
574
views
Using pathlib and shutil.move not moving file into subfolder that does exist
On MacOS I am looping through the source folder of pdf's and checking the destination folder if the there is an existing subfolder with the same name as the file. I am encountering a problem when I ...
0
votes
0
answers
39
views
Does Python's shutil.make_archive write temporary files when compressing a directory?
We are using shutil.make_archive to zip a directory. This is being done in a pod (docker container) in Kubernetes. Sometimes the pod crashes when the directory is being zipped. The pod is showing an ...
1
vote
1
answer
114
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
0
answers
212
views
Can't properly close pdfium PDF before using shutil to move it
I am using pypdfium2 to read text from a PDF and then later move it to a different folder, but I am getting the same error telling me that it is open and can't be moved.
How do I properly close the ...
-2
votes
1
answer
80
views
How do I run a Python file on my Mac that reads and writes txt files to my external hardrive? [closed]
I currently have a folder full of epubs that I would like to read, a folder of epubs I've already read and would like to read again, and a corresponding file with the names of the epub files in each. ...
0
votes
1
answer
70
views
Permission denied while overwriting python application
I made a crude auto-updating application using python, and made exe file using freeze-cx.
First, the app check whether a file of newest version is available on the firebase server, and download the ...
0
votes
3
answers
2k
views
How do I fix this simple FileNotFound error in Python? [duplicate]
I'm making a simple code with the shutil module of copying another contents of a file and had a FileNotFound error, which I want to use the file name instead of pasting the file path every single time....
0
votes
1
answer
126
views
Why I can't copy file with Shutil?
When I try to copy file in new path with shutil like this:
shutil.copy("data/Обзор кассационной практики Судебной коллегии по уголовным делам Верховного Суда Российской Федерации за первое ...
0
votes
1
answer
151
views
Python: Shutil.move sometimes causes PermissionError [Winerror 17/32]
I have a script running that at a certain stage has to move a lot of files from an internal drive to a network drive using:
for filename in os.listdir(finished_folder):
source_file_path = os.path....
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 ...
-1
votes
1
answer
145
views
PermissionError: [Errno 13] Permission denied. How can I rewrite a code to place a folder "a" which is in folder "b" to folder "c" [closed]
def tdata_move():
number_of_acc = len([file for file in os.scandir(fr"D:\tdata for accs")])
for item in range(0, number_of_acc):
for folder in os.listdir(r"D:\tdata for ...