Skip to content

Commit

Permalink
Merge bitcoin#14788: tests: Possible fix the permission error when th…
Browse files Browse the repository at this point in the history
…e tests open the cookie file

d6b3790 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 bitcoin#14446

Tree-SHA512: e7055c7ca26a6eadbbe19e4eef08ffee61cd17de79b30af2f0d090f0ad81ca24815e3c7e034e5e30d47c580bb0b221b3955e9ff2fcec2274fbf7b9232ab0cdc7
  • Loading branch information
MarcoFalke committed Dec 7, 2018
2 parents 9390217 + d6b3790 commit 2753285
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/functional/test_framework/util.py
Original file line number Diff line number Diff line change
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 2753285

Please sign in to comment.