In D14729 we implemented zeroing the cached password in memory when a the owner widget is destructed.
This causes an issue when the password is initially cached by a parent widget (AvaDelegationWidget) and then passed to a child widget (AuxiliaryKeysDialog), because python passes a reference to the password. So when the child widget is destructed, the password is zeroed in memory also for the parent widget, which then causes an error when the parent widget tries to use it to decrypt the wallet.
File "/home/pierre/dev/bitcoin-abc/electrum/electrumabc/bitcoin.py", line 296, in aes_decrypt_with_iv return strip_PKCS7_padding(data) File "/home/pierre/dev/bitcoin-abc/electrum/electrumabc/bitcoin.py", line 267, in strip_PKCS7_padding raise InvalidPadding("invalid padding byte (large)") electrumabc.bitcoin.InvalidPadding: invalid padding byte (large)
Only zero the pwd memory in the del method of the widget that initialized the bytearray, so child widgets will not clear it if they received the reference via their init method.
Depends on D15708