From 59105ec639c3acdba09f284fee80b0866bb79497 Mon Sep 17 00:00:00 2001 From: "omar.zhou" Date: Mon, 12 Oct 2020 14:00:16 +0800 Subject: [PATCH] Fixed the bug #4251, and fixed a minor bug which causes of OS default character. (#4646) * bug fixed bug description: 1, environment: OS which default character is not 'UTF-8'. For example windows 10 which default character is 'gbk'. 2, operation: python setup.py install Traceback (most recent call last): File "setup.py", line 149, in long_description=open("README.rst", "r").read(), UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 41: illegal multibyte sequence * bug #4251 fixed https://github.com/iterative/dvc/issues/4251 * bug #4251 fixed https://github.com/iterative/dvc/issues/4251 * Revert "bug #4251 fixed https://github.com/iterative/dvc/issues/4251" This reverts commit f524c727 * Revert "bug #4251 fixed https://github.com/iterative/dvc/issues/4251" This reverts commit fa5db477 * Fix bug #4251 We can check if the source exists by using `dep.exists` Co-authored-by: zwh --- dvc/repo/get_url.py | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dvc/repo/get_url.py b/dvc/repo/get_url.py index 7aad361e8..5430637c6 100644 --- a/dvc/repo/get_url.py +++ b/dvc/repo/get_url.py @@ -16,6 +16,7 @@ def get_url(url, out=None): (dep,) = dependency.loads_from(None, [url]) (out,) = output.loads_from(None, [out], use_cache=False) - dep.save() + if not dep.exists: + raise dep.DoesNotExistError(dep) dep.download(out) out.save() diff --git a/setup.py b/setup.py index 10196cb57..844d1efe8 100644 --- a/setup.py +++ b/setup.py @@ -146,7 +146,7 @@ setup( name="dvc", version=version, description="Git for data scientists - manage your code and data together", - long_description=open("README.rst", "r").read(), + long_description=open("README.rst", "r", encoding="UTF-8").read(), author="Dmitry Petrov", author_email="dmitry@dvc.org", download_url="https://github.com/iterative/dvc",