diff options
author | MarcoFalke <falke.marco@gmail.com> | 2018-12-07 13:03:45 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2018-12-07 13:03:47 -0500 |
commit | 2753285be72dd051cf2987ca5c80d0b149914020 (patch) | |
tree | a7ff30cc79373985dc7d22814c205e9dfbc6a015 /test | |
parent | 93902170445186984744cc1e1be2f8a69c9c99e6 (diff) | |
parent | d6b3790d1a41030f4ac83556fdbe9f019b9b4e59 (diff) |
Merge #14788: tests: Possible fix the permission error when the tests open the cookie file
d6b3790d1a tests: check readability of cookie file (Chun Kuan Lee)
Pull request description:
This PR would wait until the `.cookie` file is readable
Possible fix no. 5 `PermissionError` in #14446
Tree-SHA512: e7055c7ca26a6eadbbe19e4eef08ffee61cd17de79b30af2f0d090f0ad81ca24815e3c7e034e5e30d47c580bb0b221b3955e9ff2fcec2274fbf7b9232ab0cdc7
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/test_framework/util.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index b355816d8b..d0a78d8dfd 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -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(':') |