我在编写一些代码时遇到了一些困难,这些代码是用来将多个文件的“最后修改”日期写入CSV文档的。我让其他一切都正常工作,但是这个函数返回: FileNotFoundError: [WinError 2] The system cannot find the file specified: 'filenamesoandso.docx(".docx"): if file.endswith(&q
在我维护的(遗留)代码中,人们正在使用WindowsError。我可以继续用OSError替换所有事件,但是遗憾的是,winerror属性被使用了,只在三种情况下--即123: mtime = int(os.path.getmtime(self._s)) if werr.winerror !_showUnicodeError() if werr.