gurudesh/pytracebugs huggingface dataset:
# Buggy code
def _download_file(
    self, from_info, to_info, name, no_progress_bar, file_mode, dir_mode
):
    makedirs(to_info.parent, exist_ok=True, mode=dir_mode)

    logger.debug("Downloading '%s' to '%s'", from_info, to_info)
    name = name or to_info.name

    tmp_file = tmp_fname(to_info)

    try:
        self._download(from_info, tmp_file, name=name, no_progress_bar=no_progress_bar)
    except Exception as e:
        return self._handle_transfer_exception(from_info, to_info, e, "download")

    move(tmp_file, to_info, mode=file_mode)

    return 0


# Traceback (AttributeError)
Traceback (most recent call last):
File "d:\miniconda3\lib\site-packages\dvc\main.py", line 49, in main
ret = cmd.run()
File "d:\miniconda3\lib\site-packages\dvc\command\get_url.py", line 17, in run
Repo.get_url(self.args.url, out=self.args.out)
File "d:\miniconda3\lib\site-packages\dvc\repo\get_url.py", line 17, in get_url
(dep,) = dependency.loads_from(None, [url])
File "d:\miniconda3\lib\site-packages\dvc\dependency\__init__.py", line 83, in loads_from
ret.append(_get(stage, s, info))
File "d:\miniconda3\lib\site-packages\dvc\dependency\__init__.py", line 68, in _get
return LocalDependency(stage, p, info)
File "d:\miniconda3\lib\site-packages\dvc\output\local.py", line 25, in __init__
super().__init__(stage, path, *args, **kwargs)
File "d:\miniconda3\lib\site-packages\dvc\output\base.py", line 98, in __init__
self.path_info = self._parse_path(remote, path)
File "d:\miniconda3\lib\site-packages\dvc\output\local.py", line 40, in _parse_path
p = self.stage.wdir / p
AttributeError: 'NoneType' object has no attribute 'wdir'

# Fixed code
def _download_file(
    self, from_info, to_info, name, no_progress_bar, file_mode, dir_mode
):
    makedirs(to_info.parent, exist_ok=True, mode=dir_mode)

    logger.debug("Downloading '%s' to '%s'", from_info, to_info)
    name = name or to_info.name

    tmp_file = tmp_fname(to_info)

    self._download(from_info, tmp_file, name=name, no_progress_bar=no_progress_bar)

    move(tmp_file, to_info, mode=file_mode)
# Buggy code
def __init__(self, url):
    p = urlparse(url)
    assert not p.query and not p.params and not p.fragment
    assert p.password is None

    self.fill_parts(p.scheme, p.hostname, p.username, p.port, p.path)


# Traceback (AssertionError)
2020-02-29 21:01:49,849 ERROR: unexpected error
------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ivan/Projects/dvc/dvc/main.py", line 49, in main
ret = cmd.run()
File "/Users/ivan/Projects/dvc/dvc/command/imp_url.py", line 16, in run
self.args.url, out=self.args.out, fname=self.args.file
File "/Users/ivan/Projects/dvc/dvc/repo/__init__.py", line 28, in wrapper
ret = f(repo, *args, **kwargs)
File "/Users/ivan/Projects/dvc/dvc/repo/scm_context.py", line 4, in run
result = method(repo, *args, **kw)
File "/Users/ivan/Projects/dvc/dvc/repo/imp_url.py", line 20, in imp_url
accompany_outs=True,
File "/Users/ivan/Projects/dvc/dvc/stage.py", line 534, in create
stage, kwargs.get("deps", []), erepo=kwargs.get("erepo", None)
File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 77, in loads_from
ret.append(_get(stage, s, info))
File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 61, in _get
return d(stage, p, info)
File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 101, in __init__
self.path_info = self._parse_path(remote, path)
File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 109, in _parse_path
return self.REMOTE.path_cls(path)
File "/Users/ivan/Projects/dvc/dvc/path_info.py", line 115, in __init__
assert not p.query and not p.params and not p.fragment
AssertionError
------------------------------------------------------------

# Fixed code
def __init__(self, url):
    p = urlparse(url)
    stripped = p._replace(params=None, query=None, fragment=None)
    super().__init__(stripped.geturl())
    self.params = p.params
    self.query = p.query
    self.fragment = p.fragment
# Buggy code
def from_parts(cls, scheme=None, host=None, user=None, port=None, path="", netloc=None):
    assert bool(host) ^ bool(netloc)

    if netloc is not None:
        return cls("{}://{}{}".format(scheme, netloc, path))

    obj = cls.__new__(cls)
    obj.fill_parts(scheme, host, user, port, path)
    return obj


# Traceback (AssertionError)
2020-02-29 21:01:49,849 ERROR: unexpected error
------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ivan/Projects/dvc/dvc/main.py", line 49, in main
ret = cmd.run()
File "/Users/ivan/Projects/dvc/dvc/command/imp_url.py", line 16, in run
self.args.url, out=self.args.out, fname=self.args.file
File "/Users/ivan/Projects/dvc/dvc/repo/__init__.py", line 28, in wrapper
ret = f(repo, *args, **kwargs)
File "/Users/ivan/Projects/dvc/dvc/repo/scm_context.py", line 4, in run
result = method(repo, *args, **kw)
File "/Users/ivan/Projects/dvc/dvc/repo/imp_url.py", line 20, in imp_url
accompany_outs=True,
File "/Users/ivan/Projects/dvc/dvc/stage.py", line 534, in create
stage, kwargs.get("deps", []), erepo=kwargs.get("erepo", None)
File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 77, in loads_from
ret.append(_get(stage, s, info))
File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 61, in _get
return d(stage, p, info)
File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 101, in __init__
self.path_info = self._parse_path(remote, path)
File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 109, in _parse_path
return self.REMOTE.path_cls(path)
File "/Users/ivan/Projects/dvc/dvc/path_info.py", line 115, in __init__
assert not p.query and not p.params and not p.fragment
AssertionError
------------------------------------------------------------

# Fixed code
def from_parts(
    cls,
    scheme=None,
    host=None,
    user=None,
    port=None,
    path="",
    netloc=None,
    params=None,
    query=None,
    fragment=None,
):
    assert bool(host) ^ bool(netloc)

    if netloc is not None:
        return cls(
            "{}://{}{}{}{}{}".format(
                scheme,
                netloc,
                path,
                (";" + params) if params else "",
                ("?" + query) if query else "",
                ("#" + fragment) if fragment else "",
            )
        )

    obj = cls.__new__(cls)
    obj.fill_parts(scheme, host, user, port, path)
    obj.params = params
    obj.query = query
    obj.fragment = fragment
    return obj
# Buggy code
def parts(self):
    return self._base_parts + self._path.parts


# Traceback (AssertionError)
2020-02-29 21:01:49,849 ERROR: unexpected error
------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ivan/Projects/dvc/dvc/main.py", line 49, in main
ret = cmd.run()
File "/Users/ivan/Projects/dvc/dvc/command/imp_url.py", line 16, in run
self.args.url, out=self.args.out, fname=self.args.file
File "/Users/ivan/Projects/dvc/dvc/repo/__init__.py", line 28, in wrapper
ret = f(repo, *args, **kwargs)
File "/Users/ivan/Projects/dvc/dvc/repo/scm_context.py", line 4, in run
result = method(repo, *args, **kw)
File "/Users/ivan/Projects/dvc/dvc/repo/imp_url.py", line 20, in imp_url
accompany_outs=True,
File "/Users/ivan/Projects/dvc/dvc/stage.py", line 534, in create
stage, kwargs.get("deps", []), erepo=kwargs.get("erepo", None)
File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 77, in loads_from
ret.append(_get(stage, s, info))
File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 61, in _get
return d(stage, p, info)
File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 101, in __init__
self.path_info = self._parse_path(remote, path)
File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 109, in _parse_path
return self.REMOTE.path_cls(path)
File "/Users/ivan/Projects/dvc/dvc/path_info.py", line 115, in __init__
assert not p.query and not p.params and not p.fragment
AssertionError
------------------------------------------------------------

# Fixed code
def parts(self):
    return self._base_parts + self._path.parts + self._extra_parts
# Buggy code
def url(self):
    return "{}://{}{}".format(self.scheme, self.netloc, self._spath)


# Traceback (AssertionError)
2020-02-29 21:01:49,849 ERROR: unexpected error
------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ivan/Projects/dvc/dvc/main.py", line 49, in main
ret = cmd.run()
File "/Users/ivan/Projects/dvc/dvc/command/imp_url.py", line 16, in run
self.args.url, out=self.args.out, fname=self.args.file
File "/Users/ivan/Projects/dvc/dvc/repo/__init__.py", line 28, in wrapper
ret = f(repo, *args, **kwargs)
File "/Users/ivan/Projects/dvc/dvc/repo/scm_context.py", line 4, in run
result = method(repo, *args, **kw)
File "/Users/ivan/Projects/dvc/dvc/repo/imp_url.py", line 20, in imp_url
accompany_outs=True,
File "/Users/ivan/Projects/dvc/dvc/stage.py", line 534, in create
stage, kwargs.get("deps", []), erepo=kwargs.get("erepo", None)
File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 77, in loads_from
ret.append(_get(stage, s, info))
File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 61, in _get
return d(stage, p, info)
File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 101, in __init__
self.path_info = self._parse_path(remote, path)
File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 109, in _parse_path
return self.REMOTE.path_cls(path)
File "/Users/ivan/Projects/dvc/dvc/path_info.py", line 115, in __init__
assert not p.query and not p.params and not p.fragment
AssertionError
------------------------------------------------------------

# Fixed code
def url(self):
    return "{}://{}{}{}{}{}".format(
        self.scheme,
        self.netloc,
        self._spath,
        (";" + self.params) if self.params else "",
        ("?" + self.query) if self.query else "",
        ("#" + self.fragment) if self.fragment else "",
    )
# Buggy code
def __eq__(self, other):
    if isinstance(other, (str, bytes)):
        other = self.__class__(other)
    return (
        self.__class__ == other.__class__
        and self._base_parts == other._base_parts
        and self._path == other._path
    )


# Traceback (AssertionError)
2020-02-29 21:01:49,849 ERROR: unexpected error
------------------------------------------------------------
Traceback (most recent call last):
File "/Users/ivan/Projects/dvc/dvc/main.py", line 49, in main
ret = cmd.run()
File "/Users/ivan/Projects/dvc/dvc/command/imp_url.py", line 16, in run
self.args.url, out=self.args.out, fname=self.args.file
File "/Users/ivan/Projects/dvc/dvc/repo/__init__.py", line 28, in wrapper
ret = f(repo, *args, **kwargs)
File "/Users/ivan/Projects/dvc/dvc/repo/scm_context.py", line 4, in run
result = method(repo, *args, **kw)
File "/Users/ivan/Projects/dvc/dvc/repo/imp_url.py", line 20, in imp_url
accompany_outs=True,
File "/Users/ivan/Projects/dvc/dvc/stage.py", line 534, in create
stage, kwargs.get("deps", []), erepo=kwargs.get("erepo", None)
File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 77, in loads_from
ret.append(_get(stage, s, info))
File "/Users/ivan/Projects/dvc/dvc/dependency/__init__.py", line 61, in _get
return d(stage, p, info)
File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 101, in __init__
self.path_info = self._parse_path(remote, path)
File "/Users/ivan/Projects/dvc/dvc/output/base.py", line 109, in _parse_path
return self.REMOTE.path_cls(path)
File "/Users/ivan/Projects/dvc/dvc/path_info.py", line 115, in __init__
assert not p.query and not p.params and not p.fragment
AssertionError
------------------------------------------------------------

# Fixed code
def __eq__(self, other):
    if isinstance(other, (str, bytes)):
        other = self.__class__(other)
    return (
        self.__class__ == other.__class__
        and self._base_parts == other._base_parts
        and self._path == other._path
        and self._extra_parts == other._extra_parts
    )
# Buggy code
def _make_repo(repo_url, rev=None):
    if not repo_url or urlparse(repo_url).scheme == "":
        assert rev is None, "Custom revision is not supported for local repo"
        yield Repo(repo_url)
    else:
        with external_repo(url=repo_url, rev=rev) as repo:
            yield repo


# Traceback (dvc.exceptions.NotDvcRepoError)
Traceback (most recent call last):
File "tests/open-test.py", line 6, in <module>
repo="git@github.com:iterative/df_sea_ice_no_header.git"
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter__
return next(self.gen)
File "/Users/drbidibombom/DVC-repos/api-tests/.env/lib/python3.7/site-packages/dvc/api.py", line 78, in _open
with _make_repo(repo, rev=rev) as _repo:
File "/usr/local/Cellar/python/3.7.6_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter__
return next(self.gen)
File "/Users/drbidibombom/DVC-repos/api-tests/.env/lib/python3.7/site-packages/dvc/api.py", line 98, in _make_repo
yield Repo(repo_url)
File "/Users/drbidibombom/DVC-repos/api-tests/.env/lib/python3.7/site-packages/dvc/repo/__init__.py", line 77, in __init__
root_dir = self.find_root(root_dir)
File "/Users/drbidibombom/DVC-repos/api-tests/.env/lib/python3.7/site-packages/dvc/repo/__init__.py", line 145, in find_root
raise NotDvcRepoError(root)
dvc.exceptions.NotDvcRepoError: you are not inside of a dvc repository (checked up to mount point '/')

# Fixed code
def _make_repo(repo_url, rev=None):
    if not repo_url or os.path.exists(repo_url):
        assert rev is None, "Custom revision is not supported for local repo"
        yield Repo(repo_url)
    else:
        with external_repo(url=repo_url, rev=rev) as repo:
            yield repo
# Buggy code
def append_doc_link(help_message, path):
    if not path:
        return help_message
    doc_base = "https://man.dvc.org/"
    return "{message}\nDocumentation: <{blue}{base}{path}{nc}>".format(
        message=help_message,
        base=doc_base,
        path=path,
        blue=colorama.Fore.CYAN,
        nc=colorama.Fore.RESET,
    )


# Traceback (flufl.lock._lockfile.NotLockedError)
dvc add -v -R model
DEBUG: Trying to spawn '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q', 'updater']'
DEBUG: Spawned '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q',
'updater']'
ERROR: unexpected error - Already unlocked
------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\main.py", line 48, in main
cmd = args.func(args)
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\command\base.py", line 48, in __init__
updater.check()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 54, in check
self._with_lock(self._check, "checking")
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 45, in _with_lock
func()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 338, in __exit__
self.unlock()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 287, in unlock
raise NotLockedError('Already unlocked')
flufl.lock._lockfile.NotLockedError: Already unlocked
------------------------------------------------------------


Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

# Fixed code
def append_doc_link(help_message, path):
    from dvc.utils import format_link

    if not path:
        return help_message
    doc_base = "https://man.dvc.org/"
    return "{message}\nDocumentation: {link}".format(
        message=help_message, link=format_link(doc_base + path)
    )
# Buggy code
def __init__(self, args):
    from dvc.repo import Repo
    from dvc.updater import Updater

    self.repo = Repo()
    self.config = self.repo.config
    self.args = args
    updater = Updater(self.repo.dvc_dir)
    updater.check()


# Traceback (flufl.lock._lockfile.NotLockedError)
dvc add -v -R model
DEBUG: Trying to spawn '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q', 'updater']'
DEBUG: Spawned '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q',
'updater']'
ERROR: unexpected error - Already unlocked
------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\main.py", line 48, in main
cmd = args.func(args)
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\command\base.py", line 48, in __init__
updater.check()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 54, in check
self._with_lock(self._check, "checking")
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 45, in _with_lock
func()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 338, in __exit__
self.unlock()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 287, in unlock
raise NotLockedError('Already unlocked')
flufl.lock._lockfile.NotLockedError: Already unlocked
------------------------------------------------------------


Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

# Fixed code
def __init__(self, args):
    from dvc.repo import Repo
    from dvc.updater import Updater

    self.repo = Repo()
    self.config = self.repo.config
    self.args = args
    hardlink_lock = self.config.config["core"].get("hardlink_lock", False)
    updater = Updater(self.repo.dvc_dir, hardlink_lock=hardlink_lock)
    updater.check()
# Buggy code
def run(self):
    import os
    from dvc.repo import Repo
    from dvc.updater import Updater

    root_dir = Repo.find_root()
    dvc_dir = os.path.join(root_dir, Repo.DVC_DIR)
    updater = Updater(dvc_dir)
    updater.fetch(detach=False)

    return 0


# Traceback (flufl.lock._lockfile.NotLockedError)
dvc add -v -R model
DEBUG: Trying to spawn '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q', 'updater']'
DEBUG: Spawned '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q',
'updater']'
ERROR: unexpected error - Already unlocked
------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\main.py", line 48, in main
cmd = args.func(args)
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\command\base.py", line 48, in __init__
updater.check()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 54, in check
self._with_lock(self._check, "checking")
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 45, in _with_lock
func()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 338, in __exit__
self.unlock()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 287, in unlock
raise NotLockedError('Already unlocked')
flufl.lock._lockfile.NotLockedError: Already unlocked
------------------------------------------------------------


Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

# Fixed code
def run(self):
    import os
    from dvc.repo import Repo
    from dvc.config import Config
    from dvc.updater import Updater

    root_dir = Repo.find_root()
    dvc_dir = os.path.join(root_dir, Repo.DVC_DIR)
    config = Config(dvc_dir, verify=False)
    hardlink_lock = config.config.get("core", {}).get("hardlink_lock", False)
    updater = Updater(dvc_dir, hardlink_lock=hardlink_lock)
    updater.fetch(detach=False)

    return 0
# Buggy code
def __init__(self, lockfile, tmp_dir=None):
    self.lockfile = lockfile
    self._lock = None


# Traceback (flufl.lock._lockfile.NotLockedError)
dvc add -v -R model
DEBUG: Trying to spawn '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q', 'updater']'
DEBUG: Spawned '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q',
'updater']'
ERROR: unexpected error - Already unlocked
------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\main.py", line 48, in main
cmd = args.func(args)
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\command\base.py", line 48, in __init__
updater.check()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 54, in check
self._with_lock(self._check, "checking")
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 45, in _with_lock
func()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 338, in __exit__
self.unlock()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 287, in unlock
raise NotLockedError('Already unlocked')
flufl.lock._lockfile.NotLockedError: Already unlocked
------------------------------------------------------------


Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

# Fixed code
def __init__(self, lockfile, friendly=False, **kwargs):
    self._friendly = friendly
    self.lockfile = lockfile
    self._lock = None
# Buggy code
def _do_lock(self):
    try:
        self._lock = zc.lockfile.LockFile(self.lockfile)
    except zc.lockfile.LockError:
        raise LockError(FAILED_TO_LOCK_MESSAGE)


# Traceback (flufl.lock._lockfile.NotLockedError)
dvc add -v -R model
DEBUG: Trying to spawn '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q', 'updater']'
DEBUG: Spawned '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q',
'updater']'
ERROR: unexpected error - Already unlocked
------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\main.py", line 48, in main
cmd = args.func(args)
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\command\base.py", line 48, in __init__
updater.check()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 54, in check
self._with_lock(self._check, "checking")
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 45, in _with_lock
func()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 338, in __exit__
self.unlock()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 287, in unlock
raise NotLockedError('Already unlocked')
flufl.lock._lockfile.NotLockedError: Already unlocked
------------------------------------------------------------


Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

# Fixed code
def _do_lock(self):
    try:
        with Tqdm(
            bar_format="{desc}",
            disable=not self._friendly,
            desc=(
                "If DVC froze, see `hardlink_lock` in {}".format(
                    format_link("man.dvc.org/config#core")
                )
            ),
        ):
            self._lock = zc.lockfile.LockFile(self.lockfile)
    except zc.lockfile.LockError:
        raise LockError(FAILED_TO_LOCK_MESSAGE)
# Buggy code
def files(self):
    return [self.lockfile]


# Traceback (flufl.lock._lockfile.NotLockedError)
dvc add -v -R model
DEBUG: Trying to spawn '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q', 'updater']'
DEBUG: Spawned '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q',
'updater']'
ERROR: unexpected error - Already unlocked
------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\main.py", line 48, in main
cmd = args.func(args)
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\command\base.py", line 48, in __init__
updater.check()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 54, in check
self._with_lock(self._check, "checking")
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 45, in _with_lock
func()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 338, in __exit__
self.unlock()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 287, in unlock
raise NotLockedError('Already unlocked')
flufl.lock._lockfile.NotLockedError: Already unlocked
------------------------------------------------------------


Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

# Fixed code
def files(self):
    return lkeep([self._lockfile, self._tmp_dir])
# Buggy code
def lock(self):
    try:
        self._do_lock()
        return
    except LockError:
        time.sleep(DEFAULT_TIMEOUT)

    self._do_lock()


# Traceback (flufl.lock._lockfile.NotLockedError)
dvc add -v -R model
DEBUG: Trying to spawn '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q', 'updater']'
DEBUG: Spawned '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q',
'updater']'
ERROR: unexpected error - Already unlocked
------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\main.py", line 48, in main
cmd = args.func(args)
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\command\base.py", line 48, in __init__
updater.check()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 54, in check
self._with_lock(self._check, "checking")
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 45, in _with_lock
func()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 338, in __exit__
self.unlock()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 287, in unlock
raise NotLockedError('Already unlocked')
flufl.lock._lockfile.NotLockedError: Already unlocked
------------------------------------------------------------


Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

# Fixed code
def lock(self):
    try:
        super(Lock, self).lock(timedelta(seconds=DEFAULT_TIMEOUT))
    except flufl.lock.TimeOutError:
        raise LockError(FAILED_TO_LOCK_MESSAGE)
# Buggy code
def __init__(self, dvc_dir):
    self.dvc_dir = dvc_dir
    self.updater_file = os.path.join(dvc_dir, self.UPDATER_FILE)
    self.lock = Lock(self.updater_file + ".lock", tmp_dir=os.path.join(dvc_dir, "tmp"))
    self.current = version.parse(__version__).base_version


# Traceback (flufl.lock._lockfile.NotLockedError)
dvc add -v -R model
DEBUG: Trying to spawn '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q', 'updater']'
DEBUG: Spawned '['c:\\users\\luisfelipe_melo_mora\\appdata\\local\\programs\\python\\python37-32\\python.exe', 'C:\\Users\\luisfelipe_melo_mora\\AppData\\Local\\Programs\\Python\\Python37-32\\Scripts\\dvc', 'daemon', '-q',
'updater']'
ERROR: unexpected error - Already unlocked
------------------------------------------------------------
Traceback (most recent call last):
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\main.py", line 48, in main
cmd = args.func(args)
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\command\base.py", line 48, in __init__
updater.check()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 54, in check
self._with_lock(self._check, "checking")
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\dvc\updater.py", line 45, in _with_lock
func()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 338, in __exit__
self.unlock()
File "c:\users\luisfelipe_melo_mora\appdata\local\programs\python\python37-32\lib\site-packages\flufl\lock\_lockfile.py", line 287, in unlock
raise NotLockedError('Already unlocked')
flufl.lock._lockfile.NotLockedError: Already unlocked
------------------------------------------------------------


Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!

# Fixed code
def __init__(self, dvc_dir, friendly=False, hardlink_lock=False):
    self.dvc_dir = dvc_dir
    self.updater_file = os.path.join(dvc_dir, self.UPDATER_FILE)
    self.lock = make_lock(
        self.updater_file + ".lock",
        tmp_dir=os.path.join(dvc_dir, "tmp"),
        friendly=friendly,
        hardlink_lock=hardlink_lock,
    )
    self.current = version.parse(__version__).base_version
# Buggy code
def _build_sqlite_uri(filename, options):
    # Convert filename to uri according to https://www.sqlite.org/uri.html, 3.1
    uri_path = filename.replace("?", "%3f").replace("#", "%23")
    if os.name == "nt":
        uri_path = uri_path.replace("\\", "/")
        uri_path = re.sub(r"^([a-z]:)", "/\\1", uri_path, flags=re.I)
    uri_path = re.sub(r"/+", "/", uri_path)

    # Empty netloc, params and fragment
    return urlunparse(("file", "", uri_path, "", urlencode(options), ""))


# Traceback (sqlite3.OperationalError)
dvc add Empty\ Document -v
/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/git/repo/base.py:129: UserWarning: The use of environment variables in paths is deprecated
for security reasons and may be removed in the future!!
warnings.warn("The use of environment variables in paths is deprecated" +
ERROR: unexpected error - unable to open database file
------------------------------------------------------------
Traceback (most recent call last):
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/main.py", line 49, in main
ret = cmd.run()
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/command/add.py", line 25, in run
fname=self.args.file,
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/repo/__init__.py", line 35, in wrapper
with repo.lock, repo.state:
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/state.py", line 136, in __enter__
self.load()
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/state.py", line 228, in load
self.database = _connect_sqlite(self.state_file, {"nolock": 1})
File "/home/mlburk/anaconda3/envs/tf-gpu/lib/python3.7/site-packages/dvc/state.py", line 495, in _connect_sqlite
return sqlite3.connect(uri, uri=True)
sqlite3.OperationalError: unable to open database file

# Fixed code
def _build_sqlite_uri(filename, options):
    # In the doc mentioned below we only need to replace ? -> %3f and
    # # -> %23, but, if present, we also need to replace % -> %25 first
    # (happens when we are on a weird FS that shows urlencoded filenames
    # instead of proper ones) to not confuse sqlite.
    uri_path = filename.replace("%", "%25")

    # Convert filename to uri according to https://www.sqlite.org/uri.html, 3.1
    uri_path = uri_path.replace("?", "%3f").replace("#", "%23")
    if os.name == "nt":
        uri_path = uri_path.replace("\\", "/")
        uri_path = re.sub(r"^([a-z]:)", "/\\1", uri_path, flags=re.I)
    uri_path = re.sub(r"/+", "/", uri_path)

    # Empty netloc, params and fragment
    return urlunparse(("file", "", uri_path, "", urlencode(options), ""))
# Buggy code
def _upload(self, from_file, to_info, **_kwargs):
    bucket = self.gs.bucket(to_info.bucket)
    blob = bucket.blob(to_info.path)
    blob.upload_from_filename(from_file)


# Traceback (dvc.exceptions.UploadError)
DEBUG: PRAGMA user_version;
DEBUG: fetched: [(3,)]
DEBUG: CREATE TABLE IF NOT EXISTS state (inode INTEGER PRIMARY KEY, mtime TEXT NOT NULL, size TEXT NOT NULL, md5 TEXT NOT NULL, timestamp TEXT NOT NULL)
DEBUG: CREATE TABLE IF NOT EXISTS state_info (count INTEGER)
DEBUG: CREATE TABLE IF NOT EXISTS link_state (path TEXT PRIMARY KEY, inode INTEGER NOT NULL, mtime TEXT NOT NULL)
DEBUG: INSERT OR IGNORE INTO state_info (count) SELECT 0 WHERE NOT EXISTS (SELECT * FROM state_info)
DEBUG: PRAGMA user_version = 3;
DEBUG: Preparing to upload data to 'gs://dse/dvc/dataset_20191004'
DEBUG: Preparing to collect status from gs://dse/dvc/dataset_20191004
DEBUG: Collecting information from local cache...
DEBUG: Path .dvc/cache/a7/a404b4826cca3b01dd5d8e6326de3e inode 7438277
DEBUG: SELECT mtime, size, md5, timestamp from state WHERE inode=?
DEBUG: fetched: [('1570168433714557952', '54785677', 'a7a404b4826cca3b01dd5d8e6326de3e', '1570174167312645120')]
DEBUG: UPDATE state SET timestamp = ? WHERE inode = ?
DEBUG: cache '.dvc/cache/a7/a404b4826cca3b01dd5d8e6326de3e' expected 'a7a404b4826cca3b01dd5d8e6326de3e' actual 'a7a404b4826cca3b01dd5d8e6326de3e'
DEBUG: Collecting information from remote cache...
DEBUG: Uploading '.dvc/cache/a7/a404b4826cca3b01dd5d8e6326de3e' to 'gs://dse/dvc/dataset_20191004/a7/a404b4826cca3b01dd5d8e6326de3e'
ERROR: failed to upload '.dvc/cache/a7/a404b4826cca3b01dd5d8e6326de3e' to 'gs://dse/dvc/dataset_20191004/a7/a404b4826cca3b01dd5d8e6326de3e' - ('Connection aborted.', timeout('The write operation timed out',))

Having any troubles? Hit us up at https://dvc.org/support, we are always happy to help!
DEBUG: SELECT count from state_info WHERE rowid=?
DEBUG: fetched: [(2,)]
DEBUG: UPDATE state_info SET count = ? WHERE rowid = ?
ERROR: failed to push data to the cloud - 1 files failed to upload
------------------------------------------------------------
Traceback (most recent call last):
File "dvc/command/data_sync.py", line 50, in run
File "dvc/repo/__init__.py", line 33, in wrapper
File "dvc/repo/push.py", line 28, in push
File "dvc/data_cloud.py", line 63, in push
File "dvc/remote/local/__init__.py", line 403, in push
File "dvc/remote/local/__init__.py", line 393, in _process
dvc.exceptions.UploadError: 1 files failed to upload

# Fixed code
def _upload(self, from_file, to_info, **_kwargs):
    bucket = self.gs.bucket(to_info.bucket)
    _upload_to_bucket(bucket, from_file)
# Buggy code
def _reproduce(self, target, single_item=False, **kwargs):
    import networkx as nx
    from dvc.stage import Stage

    stage = Stage.load(self, target)
    G = self.graph()[1]
    stages = nx.get_node_attributes(G, "stage")
    node = relpath(stage.path, self.root_dir)

    if single_item:
        ret = _reproduce_stage(stages, node, **kwargs)
    else:
        ret = _reproduce_stages(G, stages, node, **kwargs)

    return ret


# Traceback (TypeError)
(base) ➜  dvc-example git:(master) ✗ dvc repro -sf test.txt.dvc --verbose
DEBUG: Trying to spawn '['/Users/prihodad/anaconda3/bin/python', '-m', 'dvc', 'daemon', '-q', 'updater']'
DEBUG: Spawned '['/Users/prihodad/anaconda3/bin/python', '-m', 'dvc', 'daemon', '-q', 'updater']'
DEBUG: PRAGMA user_version;
DEBUG: fetched: [(3,)]
DEBUG: CREATE TABLE IF NOT EXISTS state (inode INTEGER PRIMARY KEY, mtime TEXT NOT NULL, size TEXT NOT NULL, md5 TEXT NOT NULL, timestamp TEXT NOT NULL)
DEBUG: CREATE TABLE IF NOT EXISTS state_info (count INTEGER)
DEBUG: CREATE TABLE IF NOT EXISTS link_state (path TEXT PRIMARY KEY, inode INTEGER NOT NULL, mtime TEXT NOT NULL)
DEBUG: INSERT OR IGNORE INTO state_info (count) SELECT 0 WHERE NOT EXISTS (SELECT * FROM state_info)
DEBUG: PRAGMA user_version = 3;
Reproducing 'test.txt.dvc'
DEBUG: SELECT count from state_info WHERE rowid=?
DEBUG: fetched: [(8,)]
DEBUG: UPDATE state_info SET count = ? WHERE rowid = ?
ERROR: unexpected error - run() got an unexpected keyword argument 'ignore_build_cache'
------------------------------------------------------------
Traceback (most recent call last):
File "/Users/prihodad/anaconda3/lib/python3.6/site-packages/dvc/main.py", line 40, in main
ret = cmd.run_cmd()
File "/Users/prihodad/anaconda3/lib/python3.6/site-packages/dvc/command/base.py", line 63, in run_cmd
return self.run()
File "/Users/prihodad/anaconda3/lib/python3.6/site-packages/dvc/command/repro.py", line 42, in run
recursive=self.args.recursive,
File "/Users/prihodad/anaconda3/lib/python3.6/site-packages/dvc/repo/scm_context.py", line 4, in run
result = method(repo, *args, **kw)
File "/Users/prihodad/anaconda3/lib/python3.6/site-packages/dvc/repo/reproduce.py", line 80, in reproduce
stages = _reproduce(self, target, **kwargs)
File "/Users/prihodad/anaconda3/lib/python3.6/site-packages/dvc/repo/reproduce.py", line 96, in _reproduce
ret = _reproduce_stage(stages, node, **kwargs)
File "/Users/prihodad/anaconda3/lib/python3.6/site-packages/dvc/repo/reproduce.py", line 22, in _reproduce_stage
stage = stage.reproduce(**kwargs)
File "/Users/prihodad/anaconda3/lib/python3.6/site-packages/dvc/stage.py", line 331, in reproduce
self.run(**kwargs)
TypeError: run() got an unexpected keyword argument 'ignore_build_cache'
------------------------------------------------------------

# Fixed code
def _reproduce(self, target, **kwargs):
    import networkx as nx
    from dvc.stage import Stage

    stage = Stage.load(self, target)
    G = self.graph()[1]
    stages = nx.get_node_attributes(G, "stage")
    node = relpath(stage.path, self.root_dir)

    return _reproduce_stages(G, stages, node, **kwargs)
# Buggy code
def run(self):
    logger.info(os.path.relpath(Repo.find_root()))
    return 0


# Traceback (ValueError)
ERROR: failed to pull data from the cloud - path is on mount 'F:', start on mount 'C:'
Traceback (most recent call last):
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\command\data_sync.py", line 46, in
do_run recursive=self.args.recursive,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\repo\pull.py", line 24, in pull
recursive=recursive,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\repo\fetch.py", line 27, in fetch
used, jobs, remote=remote, show_checksums=show_checksums
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\data_cloud.py", line 144, in pull
show_checksums=show_checksums,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 493, in pull
download=True,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 459, in _process
download=download,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 358, in status
local_exists = self.cache_exists(md5s)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 232, in cache_exists
return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 232, in <lambda>
return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\base.py", line 518, in changed_cache_file
actual = self.get_checksum(cache_info)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\base.py", line 275, in get_checksum
checksum = self.get_file_checksum(path_info)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 208, in get_file_checksum
return file_md5(path_info.path)[0]
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\utils\__init__.py", line 48, in file_md5                      logger.info(msg.format(os.path.relpath(fname)))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\ntpath.py", line 584, in relpath
path_drive, start_drive))                                                                                                                        ValueError: path is on mount 'F:', start on mount 'C:'

# Fixed code
def run(self):
    logger.info(relpath(Repo.find_root()))
    return 0
# Buggy code
def __init__(self, output):
    super(OutputNotFoundError, self).__init__(
        "unable to find stage file with output '{path}'".format(
            path=os.path.relpath(output)
        )
    )


# Traceback (ValueError)
ERROR: failed to pull data from the cloud - path is on mount 'F:', start on mount 'C:'
Traceback (most recent call last):
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\command\data_sync.py", line 46, in
do_run recursive=self.args.recursive,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\repo\pull.py", line 24, in pull
recursive=recursive,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\repo\fetch.py", line 27, in fetch
used, jobs, remote=remote, show_checksums=show_checksums
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\data_cloud.py", line 144, in pull
show_checksums=show_checksums,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 493, in pull
download=True,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 459, in _process
download=download,
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 358, in status
local_exists = self.cache_exists(md5s)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 232, in cache_exists
return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 232, in <lambda>
return list(filter(lambda md5: not self.changed_cache_file(md5), md5s))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\base.py", line 518, in changed_cache_file
actual = self.get_checksum(cache_info)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\base.py", line 275, in get_checksum
checksum = self.get_file_checksum(path_info)
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\remote\local\__init__.py", line 208, in get_file_checksum
return file_md5(path_info.path)[0]
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\site-packages\dvc\utils\__init__.py", line 48, in file_md5                      logger.info(msg.format(os.path.relpath(fname)))
File "c:\users\srg\appdata\local\continuum\anaconda3\envs\tf-keras\lib\ntpath.py", line 584, in relpath
path_drive, start_drive))                                                                                                                        ValueError: path is on mount 'F:', start on mount 'C:'

# Fixed code
def __init__(self, output):
    super(OutputNotFoundError, self).__init__(
        "unable to find stage file with output '{path}'".format(path=relpath(output))
    )