About "os.R_OK" in general.py (#8909)

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.
pull/8915/head
Code-Bat 2022-08-09 22:59:36 +08:00 committed by GitHub
parent f5335f22bb
commit b551098d59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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