Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

another win32 bug fixed in images pipeline (regression tests already covered it)

Pablo Hoffmandaf86144c815
diff --git a/scrapy/contrib/pipeline/images.py b/scrapy/contrib/pipeline/images.py
index 8d1cfad0c..564001509 100644
--- a/scrapy/contrib/pipeline/images.py
+++ b/scrapy/contrib/pipeline/images.py
@@ -195,7 +195,10 @@ class ImagesPipeline(MediaPipeline):
super(ImagesPipeline, self).__init__()
def _get_store(self, uri):
- scheme = urlparse.urlparse(uri).scheme
+ if os.path.isabs(uri): # to support win32 paths like: C:\\some\dir
+ scheme = 'file'
+ else:
+ scheme = urlparse.urlparse(uri).scheme
store_cls = self.STORE_SCHEMES[scheme]
return store_cls(uri)