scrapinghub / scrapyrt

HTTP API for Scrapy spiders
BSD 3-Clause "New" or "Revised" License
833 stars 162 forks source link

exceptions.IOError: [Errno 22] invalid mode ('ab') or filename: #56

Closed sujianqingfeng closed 7 years ago

sujianqingfeng commented 7 years ago

` 2017-03-21 19:23:40+0800 [scrapyrt] Unhandled Error Traceback (most recent call last): File "C:\Python27\lib\site-packages\twisted\web\http.py", line 1906, in allContentReceived req.requestReceived(command, path, version) File "C:\Python27\lib\site-packages\twisted\web\http.py", line 771, in requestReceived self.process() File "C:\Python27\lib\site-packages\twisted\web\server.py", line 190, in process self.render(resrc) File "C:\Python27\lib\site-packages\twisted\web\server.py", line 241, in render body = resrc.render(self) --- --- File "C:\Python27\lib\site-packages\scrapyrt\resources.py", line 24, in render result = resource.Resource.render(self, request) File "C:\Python27\lib\site-packages\twisted\web\resource.py", line 250, in render return m(request) File "C:\Python27\lib\site-packages\scrapyrt\resources.py", line 130, in render_GET return self.prepare_crawl(request_data, spider_data, kwargs) File "C:\Python27\lib\site-packages\scrapyrt\resources.py", line 201, in prepare_crawl spider_name, spider_data, max_requests, *args, *kwargs) File "C:\Python27\lib\site-packages\scrapyrt\resources.py", line 210, in run_crawl dfd = manager.crawl(args, kwargs) File "C:\Python27\lib\site-packages\scrapyrt\core.py", line 156, in crawl dfd = self.crawler_process.crawl(self.spider_name, *args, **kwargs) File "C:\Python27\lib\site-packages\scrapyrt\core.py", line 80, in crawl _cleanup_handler = setup_spider_logging(crawler.spider, self.settings) File "C:\Python27\lib\site-packages\scrapyrt\log.py", line 142, in setup_spider_logging handler = logging.FileHandler(filename, encoding=encoding) File "C:\Python27\lib\logging__init.py", line 913, in init StreamHandler.init(self, self._open()) File "C:\Python27\lib\logging__init__.py", line 945, in _open stream = codecs.open(self.baseFilename, self.mode, self.encoding) File "C:\Python27\lib\codecs.py", line 900, in open file = builtin__.open(filename, mode, buffering) exceptions.IOError: [Errno 22] invalid mode ('ab') or filename: u'E:\Py workspace\amazon_crawler\logs\asinspider\2017-03-21T19:23:40.156000.log'

`

chekunkov commented 7 years ago

hi @sujianqingfeng - this issue is fixed in https://github.com/scrapinghub/scrapyrt/pull/47