fetchers.py 文件源码

python
阅读 79 收藏 0 点赞 0 评论 0

项目:BioDownloader 作者: biomadeira 项目源码 文件源码
def _download(self):
        try:
            try:
                import urllib.request
                from urllib.error import URLError, HTTPError
                with urllib.request.urlopen(self.url) as response, \
                        open(self.outputfile_origin, 'wb') as outfile:
                    shutil.copyfileobj(response, outfile)
            except (AttributeError, ImportError):
                import urllib
                urllib.urlretrieve(self.url, self.outputfile_origin)
        except (URLError, HTTPError, IOError, Exception) as e:
            logger.debug("Unable to retrieve %s for %s", self.url, e)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号