internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: iterative/dvc

Issue:
ImportError: sys.meta_path is None on repo in script
**Please provide information about your setup**
DVC version(i.e. `dvc --version`), Platform and method of installation (pip, homebrew, pkg Mac, exe (Windows), DEB(Linux), RPM(Linux))

Dvc installed via `pip install -e ."[all,test]"` in virtualenv with `Python 3.6.8`.

Reproduction:
1. Create repo:
```
#!/bin/bash
rm -rf repo
mkdir repo
cd repo
set -e
set -x

git init >> /dev/null && dvc init -q
```

2. Try to initialize it in script:
```
from dvc.repo import Repo
repo = Repo("repo")
```

3. Result:
```
Exception ignored in: <object repr() failed>
Traceback (most recent call last):
  File "/home/prd/development/tools/venvs/dvc3.6/lib/python3.6/site-packa
ges/flufl/lock/_lockfile.py", line 331, in __del__
  File "/home/prd/development/tools/venvs/dvc3.6/lib/python3.6/site-packa
ges/flufl/lock/_lockfile.py", line 326, in finalize
  File "/home/prd/development/tools/venvs/dvc3.6/lib/python3.6/site-packa
ges/flufl/lock/_lockfile.py", line 285, in unlock
  File "/home/prd/development/tools/venvs/dvc3.6/lib/python3.6/site-packa
ges/flufl/lock/_lockfile.py", line 312, in is_locked
  File "/home/prd/development/tools/venvs/dvc3.6/lib/python3.6/site-packa
ges/flufl/lock/_lockfile.py", line 459, in _touch
ImportError: sys.meta_path is None, Python is likely shutting down
```

4. Something to start with:
if we `del repo` before the end of the script, the problem does not occur.


Discussion:
@pared this doesn't happen during normal CLI operation, right?
@efiop correct, it seems like its in-script use issue.
@Suor FYI ^ , maybe you have any ideas :)
@efiop flufl locks have destructor, heh. It's their issue and they even [have it reported](https://gitlab.com/warsaw/flufl.lock/issues/7) 7 months ago, with no reaction.

We can use workaround provided there or just make `.__del__()` noop, not sure we need it.

Resolving patch:
diff --git a/dvc/lock.py b/dvc/lock.py
--- a/dvc/lock.py
+++ b/dvc/lock.py
@@ -87,6 +87,17 @@ def _set_claimfile(self, pid=None):
                     self._tmp_dir, filename + ".lock"
                 )
 
+        # Fix for __del__ bug in flufl.lock [1] which is causing errors on
+        # Python shutdown [2].
+        # [1] https://gitlab.com/warsaw/flufl.lock/issues/7
+        # [2] https://github.com/iterative/dvc/issues/2573
+        def __del__(self):
+            try:
+                if self._owned:
+                    self.finalize()
+            except ImportError:
+                pass
+
 
 else:
     import zc.lockfile


Test patch:
Repository: iterative/dvc

Issue:
pull: wrong warning on pulling import stage
Script to reproduce:

```
mkdir test
dvc import https://github.com/iterative/example-get-started model.pkl
git add .
git commit -am "init"
cd ..
git clone test test1
cd test1
dvc pull
```

outputs only:

```
WARNING: DVC-file 'model.pkl.dvc' is locked. Its dependencies are not going to be checked out.
```

I think there should be no warning, especially considering that it has done the job - pulled the `model.pkl`. Like we discussed in #2667 there should be some statistics instead.




Discussion:
Hi, I will give this a try for Hacktoberfest if that's okay?
@sadielbartholomew absolutely! let us know if you need any help.

Resolving patch:
diff --git a/dvc/repo/checkout.py b/dvc/repo/checkout.py
--- a/dvc/repo/checkout.py
+++ b/dvc/repo/checkout.py
@@ -50,12 +50,6 @@ def _checkout(
         total=total, unit="file", desc="Checkout", disable=total == 0
     ) as pbar:
         for stage in stages:
-            if stage.locked:
-                logger.warning(
-                    "DVC-file '{path}' is locked. Its dependencies are"
-                    " not going to be checked out.".format(path=stage.relpath)
-                )
-
             failed.extend(
                 stage.checkout(force=force, progress_callback=pbar.update_desc)
             )
diff --git a/dvc/repo/pull.py b/dvc/repo/pull.py
--- a/dvc/repo/pull.py
+++ b/dvc/repo/pull.py
@@ -1,6 +1,11 @@
 from __future__ import unicode_literals
 
-from . import locked
+import logging
+
+from dvc.repo import locked
+
+
+logger = logging.getLogger(__name__)
 
 
 @locked


Test patch:
Repository: iterative/dvc

Issue:
Unable to add file to DVC - Getting a 'win32timezone' error
DVC version: 0.66.9
Platform: Windows 10 x64
Method of installation: exe

I am busy going through the "Getting Started" section of the website and on the [Add Files](https://dvc.org/doc/get-started/add-files) section I am running the `dvc add data/data.xml` command to add the data.xml file to DVC.

I get the following error:
`ERROR: unexpected error - No module named 'win32timezone'`
and the file is not added.



Discussion:
I just observed the same problem.
I had some old versions of dvc installed via scoop and tested with them.
The problem was not present in 0.66.3 and is present in 0.66.6.
I don't have 0.66.4 and 0.66.5 installed and afaik it's not easy to install old versions with scoop.
As a workaround, creating a Python virtual environment and installing dvc via pip allows me add the file as expected. The library which provides the win32timezone module is pywin32.
I managed to install 0.66.5 and the problem is not present there, so it seems to have been introduced between 0.66.5 and 0.66.6.
Here a code comparison between the two versions:
https://github.com/iterative/dvc/compare/ee70822bd434adb36c41e20c63939af69bf0bc64..522579be1ebde78992853a2dc25af3b06893c466
Hi @chris-steenkamp @nightscape ! Thanks for the report! Indeed, looks like it is a bug related to our binary packages (windows exe, mac pkg and linux deb/rpm). A workaround for that is to uninstall dvc and install it from `pip`, `brew` or `conda`. Investigating the issue right now.
@chris-steenkamp @nightscape Btw, guys, could you please share why you've chosen to use our exe installer instead of installing using pip or conda?
@chris-steenkamp @nightscape One more thing, could you run that command with `-v` added (e.g. `dvc add data -v`) and share the full log, please?

EDIT: nevermind, I am able to reproduce;
```
ERROR: unexpected error - No module named 'win32timezone'
------------------------------------------------------------
Traceback (most recent call last):
  File "dvc\main.py", line 50, in main
  File "dvc\command\add.py", line 25, in run
  File "dvc\repo\__init__.py", line 35, in wrapper
  File "dvc\repo\scm_context.py", line 4, in run
  File "dvc\repo\add.py", line 48, in add
  File "dvc\repo\add.py", line 84, in _create_stages
  File "dvc\stage.py", line 484, in create
  File "dvc\stage.py", line 380, in _stage_fname
  File "dvc\utils\fs.py", line 73, in contains_symlink_up_to
  File "dvc\system.py", line 268, in is_symlink
  File "dvc\system.py", line 191, in _getdirinfo
ModuleNotFoundError: No module named 'win32timezone'
----------------------------------
```

Resolving patch:
diff --git a/scripts/hooks/hook-dvc.system.py b/scripts/hooks/hook-dvc.system.py
new file mode 100644
--- /dev/null
+++ b/scripts/hooks/hook-dvc.system.py
@@ -0,0 +1,4 @@
+import os
+
+if os.name == "nt":
+    hiddenimports = ["win32file"]


Test patch:
Repository: iterative/dvc

Issue:
lock: improve error message when .dvc/lock is taken
https://github.com/iterative/dvc/pull/2519#discussion_r326844119


Discussion:
related: #2559 
related: https://discordapp.com/channels/485586884165107732/485596304961962003/633654336110460929
related:
https://discordapp.com/channels/485586884165107732/485596304961962003/640511613698441217

it's tempting to make it p-0 ... we keep answering the same question over and over again
@efiop Shall I assign this to myself?
@algomaster99 yes, feel free to take it

Resolving patch:
diff --git a/dvc/lock.py b/dvc/lock.py
--- a/dvc/lock.py
+++ b/dvc/lock.py
@@ -15,6 +15,12 @@
 
 DEFAULT_TIMEOUT = 5
 
+FAILED_TO_LOCK_MESSAGE = (
+    "cannot perform the command because another DVC process seems to be "
+    "running on this project. If that is not the case, manually remove "
+    "`.dvc/lock` and try again."
+)
+
 
 class LockError(DvcException):
     """Thrown when unable to acquire the lock for dvc repo."""
@@ -71,10 +77,7 @@ def lock(self):
             try:
                 super(Lock, self).lock(timedelta(seconds=DEFAULT_TIMEOUT))
             except flufl.lock.TimeOutError:
-                raise LockError(
-                    "cannot perform the cmd since DVC is busy and "
-                    "locked. Please retry the cmd later."
-                )
+                raise LockError(FAILED_TO_LOCK_MESSAGE)
 
         def _set_claimfile(self, pid=None):
             super(Lock, self)._set_claimfile(pid)
@@ -119,10 +122,7 @@ def _do_lock(self):
             try:
                 self._lock = zc.lockfile.LockFile(self.lockfile)
             except zc.lockfile.LockError:
-                raise LockError(
-                    "cannot perform the cmd since DVC is busy and "
-                    "locked. Please retry the cmd later."
-                )
+                raise LockError(FAILED_TO_LOCK_MESSAGE)
 
         def lock(self):
             try:
diff --git a/dvc/main.py b/dvc/main.py
--- a/dvc/main.py
+++ b/dvc/main.py
@@ -9,7 +9,6 @@
 from dvc.exceptions import DvcParserError
 from dvc.exceptions import NotDvcRepoError
 from dvc.external_repo import clean_repos
-from dvc.lock import LockError
 from dvc.logger import FOOTER
 from dvc.remote.pool import close_pools
 from dvc.utils.compat import is_py2
@@ -48,9 +47,6 @@ def main(argv=None):
 
         cmd = args.func(args)
         ret = cmd.run()
-    except LockError:
-        logger.exception("failed to lock before running a command")
-        ret = 250
     except ConfigError:
         logger.exception("configuration error")
         ret = 251


Test patch:
Repository: iterative/dvc

Issue:
use non-blocking multithreaded progress I/O
continuing discussion from #2697

- use the old non-blocking approach
  + https://github.com/iterative/dvc/blob/0.35.6/dvc/progress.py#L51
- use blocking upon completion
  + https://github.com/iterative/dvc/blob/0.35.6/dvc/progress.py#L70
- depends on https://github.com/tqdm/tqdm/issues/838 -> https://github.com/tqdm/tqdm/pull/839


Discussion:

Resolving patch:
diff --git a/dvc/progress.py b/dvc/progress.py
--- a/dvc/progress.py
+++ b/dvc/progress.py
@@ -3,6 +3,7 @@
 
 import logging
 import sys
+from threading import RLock
 
 from funcy import merge
 from tqdm import tqdm
@@ -10,6 +11,7 @@
 from dvc.utils import env2bool
 
 logger = logging.getLogger(__name__)
+tqdm.set_lock(RLock())
 
 
 class Tqdm(tqdm):
@@ -76,6 +78,7 @@ def __init__(
             leave=leave,
             desc=desc,
             bar_format="!",
+            lock_args=(False,),
             **kwargs
         )
         if bar_format is None:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -76,7 +76,7 @@ def run(self):
     "funcy>=1.12",
     "pathspec>=0.6.0",
     "shortuuid>=0.5.0",
-    "tqdm>=4.36.1,<5",
+    "tqdm>=4.38.0,<5",
     "packaging>=19.0",
     "win-unicode-console>=0.5; sys_platform == 'win32'",
     "pywin32>=225; sys_platform == 'win32'",


Test patch:
Repository: iterative/dvc

Issue:
permissions are not set right for directories DVC creates
* Potentially affects shared cache group logic which can be a security issue?
* Affects all local commands that create directories which is also a security issue.

**For example: **

`dvc get https://github.com/iterative/dataset-registry get-started/data.xml -o data/data.xml`

creates an intermediate directory `data` with `0o777` permissions on Mac in `~` and `/tmp`:

```
drwxrwxrwx  3 ivan  wheel    96B Nov 13 12:47 data
```

It might be related to this [note](https://docs.python.org/3/library/os.html#os.makedirs): 

> Changed in version 3.7: The mode argument no longer affects the file permission bits of newly-created intermediate-level directories.

It also can be reproduced on Linux. More context here - https://discordapp.com/channels/485586884165107732/565699007037571084/644272213331279872



Discussion:
`umask(0o022)` in `utils:makedirs` ~solves this~ forces 755 mode


Resolving patch:
diff --git a/dvc/utils/__init__.py b/dvc/utils/__init__.py
--- a/dvc/utils/__init__.py
+++ b/dvc/utils/__init__.py
@@ -152,9 +152,12 @@ def makedirs(path, exist_ok=False, mode=None):
         _makedirs(path, exist_ok=exist_ok)
         return
 
-    umask = os.umask(0)
+    # utilize umask to set proper permissions since Python 3.7 the `mode`
+    # `makedirs` argument no longer affects the file permission bits of
+    # newly-created intermediate-level directories.
+    umask = os.umask(0o777 - mode)
     try:
-        _makedirs(path, exist_ok=exist_ok, mode=mode)
+        _makedirs(path, exist_ok=exist_ok)
     finally:
         os.umask(umask)
 
diff --git a/dvc/utils/compat.py b/dvc/utils/compat.py
--- a/dvc/utils/compat.py
+++ b/dvc/utils/compat.py
@@ -85,8 +85,6 @@ def _makedirs(name, mode=0o777, exist_ok=False):
             if e.errno != errno.EEXIST:
                 raise
         cdir = os.curdir
-        if isinstance(tail, bytes):
-            cdir = bytes(os.curdir, "ASCII")
         if tail == cdir:
             return
     try:


Test patch:
diff --git a/tests/func/test_utils.py b/tests/func/test_utils.py
--- a/tests/func/test_utils.py
+++ b/tests/func/test_utils.py
@@ -1,6 +1,10 @@
+# encoding: utf-8
 import filecmp
 import os
 import shutil
+import stat
+
+import pytest
 
 from dvc import utils
 from tests.basic_env import TestDvc
@@ -69,3 +73,18 @@ def test_boxify(self):
         )
 
         assert expected == utils.boxify("message")
+
+
+@pytest.mark.skipif(os.name == "nt", reason="Not supported for Windows.")
+def test_makedirs_permissions(tmpdir):
+    dir_mode = 0o755
+    os.chdir(str(tmpdir))
+    intermediate_dir = "тестовая-директория"
+    test_dir = os.path.join(intermediate_dir, "data")
+
+    assert not os.path.exists(intermediate_dir)
+
+    utils.makedirs(test_dir, mode=dir_mode)
+
+    assert stat.S_IMODE(os.stat(test_dir).st_mode) == dir_mode
+    assert stat.S_IMODE(os.stat(intermediate_dir).st_mode) == dir_mode
Repository: iterative/dvc

Issue:
remote default with no argument removes default
Running `dvc remote default` with no argument sets default remote to `None`.
According to [documentation](https://dvc.org/doc/command-reference/remote/default) this should show the default remote though.

Setting default remote:
```
>>dvc remote default my_remote
>>git diff
... 
+[core]
+remote = my_remote
...
```

This should query the default, but sets default to `None`:
```
>>dvc remote default
>>git diff
...
+[core]
+remote = None
```
DVC version: 0.66.11
OS: Ubuntu 18.04.2 LTS
Method: From repository




Discussion:
Hi @kaiogu !

This is definitely a bug on our side. Need to modify https://github.com/iterative/dvc/blob/0.69.0/dvc/command/remote.py#L51 to just `logger.info()` the existing value.

Thanks for the feedback!
Hi @efiop, thanks for developing DVC!

I could give it a try if you haven't already!
@kaiogu Sure, please go ahead! Let us know if you have any questions, we will be happy to help with it! 

Resolving patch:
diff --git a/dvc/command/remote.py b/dvc/command/remote.py
--- a/dvc/command/remote.py
+++ b/dvc/command/remote.py
@@ -48,9 +48,13 @@ def run(self):
 
 class CmdRemoteDefault(CmdRemoteConfig):
     def run(self):
-        self.remote_config.set_default(
-            self.args.name, unset=self.args.unset, level=self.args.level
-        )
+        if self.args.name is None and not self.args.unset:
+            name = self.remote_config.get_default(level=self.args.level)
+            print(name)
+        else:
+            self.remote_config.set_default(
+                self.args.name, unset=self.args.unset, level=self.args.level
+            )
         return 0
 
 
diff --git a/dvc/remote/config.py b/dvc/remote/config.py
--- a/dvc/remote/config.py
+++ b/dvc/remote/config.py
@@ -151,3 +151,8 @@ def set_default(self, name, unset=False, level=None):
         self.config.set(
             Config.SECTION_CORE, Config.SECTION_CORE_REMOTE, name, level=level
         )
+
+    def get_default(self, level=None):
+        return self.config.get(
+            Config.SECTION_CORE, Config.SECTION_CORE_REMOTE, level=level
+        )


Test patch:
diff --git a/tests/func/test_remote.py b/tests/func/test_remote.py
--- a/tests/func/test_remote.py
+++ b/tests/func/test_remote.py
@@ -145,6 +145,13 @@ def test(self):
         self.assertEqual(default, None)
 
 
+def test_show_default(dvc_repo, capsys):
+    assert main(["remote", "default", "foo"]) == 0
+    assert main(["remote", "default"]) == 0
+    out, _ = capsys.readouterr()
+    assert out == "foo\n"
+
+
 class TestRemoteShouldHandleUppercaseRemoteName(TestDvc):
     upper_case_remote_name = "UPPERCASEREMOTE"
Repository: iterative/dvc

Issue:
DVC exits with code 0 even if there was an error
Tested with dvc 0.70 from apt on Ubuntu:
```
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.2 LTS
Release:	18.04
Codename:	bionic
```

Can be easily reproduced with docker. The following example shows pulling from a nonexistent repository but the same problem is with errors of any kind.

**Steps to reproduce**
Create a following Dockerfile:
```
FROM ubuntu:18.04

RUN apt update
RUN apt install -y wget
RUN wget https://dvc.org/deb/dvc.list -O /etc/apt/sources.list.d/dvc.list
RUN apt update 
RUN apt install -y dvc
WORKDIR /work
RUN dvc init --no-scm
CMD bash -c 'dvc pull -r bleble && echo "command succesfull, but should not be"'
```

Build it:
`$ docker build . -t dvc-bug`

Run it:
`$ docker run -it dvc-bug`

**Obtained result**
```
ERROR: failed to pull data from the cloud - config file error: unable to find remote section 'bleble'

Having any troubles?. Hit us up at https://dvc.org/support, we are always happy to help!
command succesfull, but should not be
```

**Expected result**
No `command succesfull, but should not be` text in the output.

Mentioned earlier in #2038 


Discussion:
Hi @peper0 !

Thank you for a very convenient reproducer! Indeed, I can reproduce this bug with binary dvc, but not with dvc installed from pip/brew/conda/etc. As a workaround, could you try installing dvc from one of those sources (i suppose pip will be the most convenient for you) and let us know if that works?

Related https://github.com/iterative/dvc/issues/2760 https://github.com/iterative/dvc/issues/2768
Looks like even things like `dvc non-existing-command` don't result in non-zero code for pyinstaller-built images. Investigating...

Resolving patch:
diff --git a/dvc/__main__.py b/dvc/__main__.py
--- a/dvc/__main__.py
+++ b/dvc/__main__.py
@@ -6,4 +6,4 @@
 from dvc.main import main
 
 if __name__ == "__main__":
-    main(sys.argv[1:])
+    sys.exit(main(sys.argv[1:]))


Test patch:
Repository: iterative/dvc

Issue:
Reliance on relative path for `.dvc/tmp/gdrive-user-credentials.json`

DVC versions 75.1 and 77.0, Linux, installed via pip

`dvc status -r gdrive_remote` works when I run it from the top directory of the repository, but it fails when I run it from a subdirectory, with output

     /home/eamon/venv/lib/python3.7/site-packages/oauth2client/_helpers.py:255: UserWarning:    Cannot access .dvc/tmp/gdrive-user-credentials.json: No such file or directory
     warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
    Go to the following link in your browser:

        https://accounts.google.com/o/oauth2/auth?client_id=my_id&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.appdata&access_type=offline&response_type=code&approval_prompt=force

    Enter verification code: 4/uQEMOYFiR17UwfHzYPaaSI7_ujyVYnEkv2W2qb_bVEVywcyetGTQs5Q
Authentication successful.
ERROR: failed to obtain data status - Credentials file cannot be symbolic link

A file containing the output with the verbose option enabled is here:

[output.txt](https://github.com/iterative/dvc/files/3962850/output.txt)





Discussion:

Resolving patch:
diff --git a/dvc/remote/gdrive.py b/dvc/remote/gdrive.py
--- a/dvc/remote/gdrive.py
+++ b/dvc/remote/gdrive.py
@@ -57,7 +57,7 @@ class RemoteGDrive(RemoteBASE):
     path_cls = CloudURLInfo
     REQUIRES = {"pydrive": "pydrive"}
     GDRIVE_USER_CREDENTIALS_DATA = "GDRIVE_USER_CREDENTIALS_DATA"
-    DEFAULT_USER_CREDENTIALS_FILE = ".dvc/tmp/gdrive-user-credentials.json"
+    DEFAULT_USER_CREDENTIALS_FILE = "gdrive-user-credentials.json"
 
     def __init__(self, repo, config):
         super(RemoteGDrive, self).__init__(repo, config)
@@ -82,7 +82,8 @@ def init_drive(self):
             if os.getenv(RemoteGDrive.GDRIVE_USER_CREDENTIALS_DATA)
             else self.config.get(
                 Config.SECTION_GDRIVE_USER_CREDENTIALS_FILE,
-                self.DEFAULT_USER_CREDENTIALS_FILE,
+                os.path.join(self.repo.tmp_dir,
+                             self.DEFAULT_USER_CREDENTIALS_FILE),
             )
         )
 


Test patch:
Repository: iterative/dvc

Issue:
Reliance on relative path for `.dvc/tmp/gdrive-user-credentials.json`

DVC versions 75.1 and 77.0, Linux, installed via pip

`dvc status -r gdrive_remote` works when I run it from the top directory of the repository, but it fails when I run it from a subdirectory, with output

     /home/eamon/venv/lib/python3.7/site-packages/oauth2client/_helpers.py:255: UserWarning:    Cannot access .dvc/tmp/gdrive-user-credentials.json: No such file or directory
     warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
    Go to the following link in your browser:

        https://accounts.google.com/o/oauth2/auth?client_id=my_id&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.appdata&access_type=offline&response_type=code&approval_prompt=force

    Enter verification code: 4/uQEMOYFiR17UwfHzYPaaSI7_ujyVYnEkv2W2qb_bVEVywcyetGTQs5Q
Authentication successful.
ERROR: failed to obtain data status - Credentials file cannot be symbolic link

A file containing the output with the verbose option enabled is here:

[output.txt](https://github.com/iterative/dvc/files/3962850/output.txt)





Discussion:

Resolving patch:
diff --git a/dvc/remote/gdrive.py b/dvc/remote/gdrive.py
--- a/dvc/remote/gdrive.py
+++ b/dvc/remote/gdrive.py
@@ -57,7 +57,7 @@ class RemoteGDrive(RemoteBASE):
     path_cls = CloudURLInfo
     REQUIRES = {"pydrive": "pydrive"}
     GDRIVE_USER_CREDENTIALS_DATA = "GDRIVE_USER_CREDENTIALS_DATA"
-    DEFAULT_USER_CREDENTIALS_FILE = ".dvc/tmp/gdrive-user-credentials.json"
+    DEFAULT_USER_CREDENTIALS_FILE = "gdrive-user-credentials.json"
 
     def __init__(self, repo, config):
         super(RemoteGDrive, self).__init__(repo, config)
@@ -82,7 +82,9 @@ def init_drive(self):
             if os.getenv(RemoteGDrive.GDRIVE_USER_CREDENTIALS_DATA)
             else self.config.get(
                 Config.SECTION_GDRIVE_USER_CREDENTIALS_FILE,
-                self.DEFAULT_USER_CREDENTIALS_FILE,
+                os.path.join(
+                    self.repo.tmp_dir, self.DEFAULT_USER_CREDENTIALS_FILE
+                ),
             )
         )
 


Test patch: