Temp file cleanup error on Windows with OSError 145
totoroyyb opened this issue · comments
Yibo Yan commented
Describe the bug
Python 3.88 on Windows still seems to have some problems cleaning up temp files.
I've noticed a workaround already applied here:
pydriller/pydriller/repository.py
Lines 202 to 206 in 3f9b6a5
However, it doesn't catch the case I encountered. On Python 3.88 + Windows, it throws WinError 145
, "Not an empty folder" as an OSError
.
To Reproduce
I encountered such error by running this:
from pydriller import Repository, Commit
url = "https://github.com/hyperledger/cactus.git"
for commit in Repository(url, filepath='GOVERNANCE.md').traverse_commits():
for file in commit.modified_files:
if file.filename == "GOVERNANCE.md":
print(f"Author: {commit.author.name}, change type: {file.change_type.name}, diff: \n {file.diff_parsed}")
OS Version:
Windows
Python 3.88