tags: Python bug repair Correction PermissionError WinError 32 Process cannot be accessed
content
Open the PDF file first, get the content of the PDF file, use OS.RMove () to delete the file. At this time

Os.remove (source_path) Permissionerror: [Winerror 32] Another program is using this file, and the process cannot be accessed. : 'D: \\ PartTimejobs \\ ClassifyFilesByCluster \\ Resource \\ Source1 \\ 2011quantitative investigation of a Standard Test Shim for Magnetic.pdf'
Error code
# ---------------------2022430--------------TODO
content = []
for i in pdf.open(path).pages:
content.append(i.extract_text())
After the above code is opened, the file content is not closed after obtaining the file content
# ---------------------2022430--------------TODO
content = []
f = pdf.open(path)
for i in f.pages:
content.append(i.extract_text())
f.close()
After opening the file to get the content, close the file, and the final error was resolved.
Similar error reference:
When installing the python package with xgboost, the following error may occur: Because the terminal under Window is or the GBK encoding is displayed, the PIP source code is also modified. Open C: \ P...
Problem Description Kafka deployed in the Windows environment is hung after running for a period of time. View loglogs/server.log Discover the following errors: reason When the consumer's offset log i...
Article catalog First, error information Second, the solution First, error information FLUTTER Mixed Development Project: In the Android project, embed the flutter page, accidentally run the Flutter p...
Problem Description: Python3.7, using the library image inside PIL just wants to get the length and wide of the picture Newspaper is wrong D:\Python37-32\python.exe D:/pyFile/python_script/img_read.py...
Article catalog Problem 2. Code example 3. Reason 4. Solve Problem Python Flask Logging Log Reports An error "Another program is using this file, the process cannot be accessed" 2. Code exam...
When I recently dealt with strange problems, I made a low -level error, wasted a lot of time, and even watched the C code at the bottom of the JDK. The following test code is run by the Windows enviro...
I don't know which version begins, AS is always prompts the following errors, A simple solution: Switch toTerminal Window, direct inputgradlew -stop ,AgainbuildIt can be running normally....
The virtual machine suddenly reported an error after a certain system as follows: Seeing this interface, although I don’t know the specific reason for the error, I can roughly guess the reason f...
I can't shut down the virtual machine, so I restarted the computer directly, and it turned out like this after restarting. reason: .lck file is a disk lock file of VMWare software. Since the virtual d...
Today, the website deployed with IIS cannot be started locally. The default port of https is 443. In order to avoid the port starting with 4 on the local computer, I tried to use port 555, and the pro...