The problem seems to be that the json format of tempfile is unreadable, modified as follows:
def _extract_refactorings(self, commits):
PATH_TO_REFMINER = os.path.join(Options.PYSZZ_HOME, 'tools/RefactoringMiner-2.0/bin/RefactoringMiner')
refactorings = dict()
for commit in commits:
if not commit in refactorings:
dirs = os.getcwd() + "\\temp\\"
# with tempfile.NamedTemporaryFile(mode='r+') as tmpfile:
log.info(f'Running RefMiner on {commit}')
os.system(
PATH_TO_REFMINER + " -c " + self._repository_path + " " + commit + " > " + dirs + "tmp.json")
with open(dirs + "tmp.json") as f:
refactorings[commit] = json.load(f)
if os.path.exists(dirs + "tmp.json"):
os.remove(dirs + "tmp.json")
return refactorings