profile
viewpoint

Ask questionsOSError: [Errno 22] Invalid argument:

我在项目的baike目录下运行scrapy crawl baike,结果报错“OSError: [Errno 22] Invalid argument: 'D:\code\program\WEB_KG-master\baike\logs\Sun_Mar_22_21:30:37_2020.log' ”,请问该怎么解决呢?感激不尽! }69AD$0HQQX15)QEG(3DB8G

lixiang0/WEB_KG

Answer questions lixiang0

@lixiang0 更改datefmt='%d-%b-%y %H:%M:%S'中的:改为_ ,有同样的问题 WEB_KG_0\WEB_KG_0\baike\spiders\baike.py", line 17, in format='%(levelname)s - %(asctime)s - %(message)s', datefmt='%d-%b-%y %H_%M_%S') File "e:\anaconda3\lib\logging__init__.py", line 1895, in basicConfig h = FileHandler(filename, mode) File "e:\anaconda3\lib\logging__init__.py", line 1087, in init StreamHandler.init(self, self.open()) File "e:\anaconda3\lib\logging__init_.py", line 1116, in _open return open(self.baseFilename, self.mode, encoding=self.encoding) Thanks

D:\code\program\WEB_KG-master\baike\logs\Sun_Mar_22_21:30:37_2020.log中logs目录有吗?

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List