shutil – Python Pathlib path object not converting to string
shutil – Python Pathlib path object not converting to string
The problem is here:
str = str(pdf.stem)
Youre overwriting the value str
, so starting from the 2nd iteration of your loop, str
no longer refers to the built-in str
function. Choose a different name for this variable.