Solved.
The problem is that there is a new curriculum file called .[your file] generated automatically, and then python API will read this file and raised the other error:
raise JSONDecodeError(“Expecting value”, s, err.value) from None
Just delete the .[your file] then it will work.
Plus: The system generates a file called .DS_Store automatically, it is still possible to result in the above problem, just delete it.
But I still don’t know why this file is generated. And why sometimes raised the UnicodeDecodeError, but I have tried using open(location, encoding = “ISO-8859-1”) then this error disappeared. Then delete the specific encoding it will work. BTW, even I specify the encoding = “utf-8”, it still raised the unicodeDecodeError… I have no idea about these encoding and decoding stuff…
转载自GitHub上的问答。
简而言之,就是把所读取文件夹里的.DS_Store文件删除掉,就可以了