Skip to content

Commit

Permalink
tests: check readability of cookie file
Browse files Browse the repository at this point in the history
  • Loading branch information
ken2812221 committed Nov 23, 2018
1 parent 2607c38 commit d6b3790
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/functional/test_framework/util.py
Expand Up @@ -326,7 +326,7 @@ def get_auth_cookie(datadir):
if line.startswith("rpcpassword="):
assert password is None # Ensure that there is only one rpcpassword line
password = line.split("=")[1].strip("\n")
if os.path.isfile(os.path.join(datadir, "regtest", ".cookie")):
if os.path.isfile(os.path.join(datadir, "regtest", ".cookie")) and os.access(os.path.join(datadir, "regtest", ".cookie"), os.R_OK):
with open(os.path.join(datadir, "regtest", ".cookie"), 'r', encoding="ascii") as f:
userpass = f.read()
split_userpass = userpass.split(':')
Expand Down

0 comments on commit d6b3790

Please sign in to comment.