From 42945b5eb9f3a738f8dfb10448d7ea0242bb8b59 Mon Sep 17 00:00:00 2001 From: Alex <3616006651@qq.com> Date: Tue, 9 Aug 2022 09:44:03 +0800 Subject: [PATCH] The notes says "Return True if directory has write permissions", however, the code below is "os.R_OK", I think "os.W_OK" is preferred. --- utils/general.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/general.py b/utils/general.py index 85f98cb140b9..8469773f17f2 100755 --- a/utils/general.py +++ b/utils/general.py @@ -69,7 +69,7 @@ def is_kaggle(): def is_writeable(dir, test=False): # Return True if directory has write permissions, test opening a file with write permissions if test=True if not test: - return os.access(dir, os.R_OK) # possible issues on Windows + return os.access(dir, os.W_OK) # possible issues on Windows file = Path(dir) / 'tmp.txt' try: with open(file, 'w'): # open file with write permissions