未验证 提交 b274f7ad 编写于 作者: K Kaipeng Deng 提交者: GitHub

fix download in windows (#3084)

上级 40cabbde
......@@ -18,6 +18,7 @@ from __future__ import print_function
import os
import os.path as osp
import sys
import yaml
import shutil
import requests
......@@ -349,6 +350,11 @@ def _download(url, path, md5sum=None):
logger.info("Downloading {} from {}".format(fname, url))
# NOTE: windows path join may incur \, which is invalid in url
if sys.platform == "win32":
url = url.replace('\\', '/')
req = requests.get(url, stream=True)
if req.status_code != 200:
raise RuntimeError("Downloading from {} failed with code "
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册