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
parent
f5335f22bb
commit
b551098d59
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue