Skip to content

Commit d6b3790

Browse files
committed
tests: check readability of cookie file
1 parent 2607c38 commit d6b3790

File tree

1 file changed

+1
-1
lines changed
  • test/functional/test_framework

1 file changed

+1
-1
lines changed

test/functional/test_framework/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ def get_auth_cookie(datadir):
326326
if line.startswith("rpcpassword="):
327327
assert password is None # Ensure that there is only one rpcpassword line
328328
password = line.split("=")[1].strip("\n")
329-
if os.path.isfile(os.path.join(datadir, "regtest", ".cookie")):
329+
if os.path.isfile(os.path.join(datadir, "regtest", ".cookie")) and os.access(os.path.join(datadir, "regtest", ".cookie"), os.R_OK):
330330
with open(os.path.join(datadir, "regtest", ".cookie"), 'r', encoding="ascii") as f:
331331
userpass = f.read()
332332
split_userpass = userpass.split(':')

0 commit comments

Comments
 (0)