refactor: drop change-log notes from parse_wallet except comments
What changed, and why it matters
This commit only removes historical changelog-style comments from the code and rewrites the remaining comments to describe the current behavior. No code logic was changed, so there is no security impact.
No action required; this is a non-functional documentation/comment cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a pure comment refactor in src/krux/wallet.py. It deletes references to ‘KeyboardInterrupt/SystemExit are no longer swallowed’ and ‘interrupts still propagate’ from three exception-handling blocks. The actual try/except structure and control flow remain identical. The commit message explicitly states this is a refactor requested during review on PR #898.
Changed components
src/krux/wallet.pyInspect captured patch +4 / −6
diff --git a/src/krux/wallet.py b/src/krux/wallet.py
index 6661460..663ceaa 100644
--- a/src/krux/wallet.py
+++ b/src/krux/wallet.py
@@ -455,8 +455,7 @@ def parse_wallet(wallet_data):
raise ValueError("invalid wallet format")
except Exception:
# Untrusted input: any non-KeyError parse failure (bad JSON, bad
- # descriptor) falls through to the next format. KeyboardInterrupt/
- # SystemExit are no longer swallowed.
+ # descriptor) falls through to the next format.
pass
# Try to parse as a key-value file
@@ -467,8 +466,7 @@ def parse_wallet(wallet_data):
except ValueError:
raise
except Exception:
- # Untrusted input: an unexpected parse failure means "invalid wallet";
- # interrupts (KeyboardInterrupt/SystemExit) still propagate.
+ # Untrusted input: an unexpected parse failure means "invalid wallet".
raise ValueError("invalid wallet format")
# Try to parse directly as a descriptor
@@ -476,8 +474,8 @@ def parse_wallet(wallet_data):
descriptor = Descriptor.from_string(wallet_data.strip())
return descriptor, None
except Exception:
- # Untrusted input: not a bare descriptor either; fall through to the final
- # raise. KeyboardInterrupt/SystemExit are no longer swallowed.
+ # Untrusted input: not a bare descriptor either; fall through to the
+ # final raise.
pass
raise ValueError("invalid wallet format")
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.