Skip to content

Commit eb6b100

Browse files
committed
Merge bitcoin/bitcoin#32286: test: Handle empty string returned by CLI as None in RPC tests
a4041c7 test: Handle empty string returned by CLI as None in RPC tests (Brandon Odiwuor) Pull request description: Partially Fixes bitcoin/bitcoin#32264 Some tests are failing when `bitcoin-cli` returns an empty string. This change treats an empty response as `None`. See bitcoin/bitcoin#32264 (comment) This fixes the error for: - feature_bip68_sequence.py - feature_nulldummy.py - feature_signet.py - mining_mainnet.py - rpc_scanblocks.py - rpc_scantxoutset.py - wallet_descriptor.py --descriptors ACKs for top commit: maflcko: lgtm ACK a4041c7 achow101: ACK a4041c7 pablomartin4btc: ACK a4041c7 mzumsande: ACK a4041c7 Tree-SHA512: 2f1a416a18e0b3eebdb014c2e2e8dadf1d46b15c231cb61f577d47f5e551994ab0e2aeb7c179c01be7c1f07ebc03476236d29cf2d04c358ffb1fae985aa385c9
2 parents 33df4ae + a4041c7 commit eb6b100

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/functional/test_framework/test_node.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,8 @@ def send_cli(self, clicommand=None, *args, **kwargs):
919919
# Ignore cli_stdout, raise with cli_stderr
920920
raise subprocess.CalledProcessError(returncode, p_args, output=cli_stderr)
921921
try:
922+
if not cli_stdout.strip():
923+
return None
922924
return json.loads(cli_stdout, parse_float=decimal.Decimal)
923925
except (json.JSONDecodeError, decimal.InvalidOperation):
924926
return cli_stdout.rstrip("\n")

0 commit comments

Comments
 (0)