Fix multi_rpc test for hosts that dont default to utf8

Otherwise the utf8 written to bitcoin.conf throws an exception when
read from get_auth_cookie
This commit is contained in:
Matt Corallo 2017-07-06 22:04:46 -04:00
parent 5af6572534
commit bc7d1032f8

View File

@ -236,7 +236,7 @@ def get_auth_cookie(datadir, n):
user = None user = None
password = None password = None
if os.path.isfile(os.path.join(datadir, "bitcoin.conf")): if os.path.isfile(os.path.join(datadir, "bitcoin.conf")):
with open(os.path.join(datadir, "bitcoin.conf"), 'r') as f: with open(os.path.join(datadir, "bitcoin.conf"), 'r', encoding='utf8') as f:
for line in f: for line in f:
if line.startswith("rpcuser="): if line.startswith("rpcuser="):
assert user is None # Ensure that there is only one rpcuser line assert user is None # Ensure that there is only one rpcuser line