Skip to content

Fix missing f-string prefixes on error messages#167

Merged
mflaxman merged 1 commit intomainfrom
fix-missing-fstring-prefixes
Mar 3, 2026
Merged

Fix missing f-string prefixes on error messages#167
mflaxman merged 1 commit intomainfrom
fix-missing-fstring-prefixes

Conversation

@jimmysong
Copy link
Collaborator

Summary

Five error message strings contained {variable} interpolation syntax but were missing the f prefix, causing the literal text like "{key_record_str}" to appear in error messages instead of the actual variable value.

Fixes

File Line Error type Variable(s)
bcur.py 88 BCURStringFormatError {xofy_parts}
descriptor.py 81 ValueError {key_record_str}
descriptor.py 85 ValueError {parts[-2]}, {key_record_str}
hd.py 712 ValueError {pub_version}
psbt.py 776 SuspiciousTransaction {hdpubkey_map}, {self}

Test plan

  • These are all in error-raising paths — existing tests still pass
  • No behavioral change other than error messages now showing actual values

🤖 Generated with Claude Code

Strings with {variable} interpolation were missing the f prefix,
causing the literal text "{variable}" to appear in error messages
instead of the variable's value.

- bcur.py:88 — BCURStringFormatError message
- descriptor.py:81,85 — ValueError messages (2 instances)
- hd.py:712 — ValueError message
- psbt.py:776 — SuspiciousTransaction message

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mflaxman
Copy link
Collaborator

mflaxman commented Mar 3, 2026

Good catch

@mflaxman mflaxman merged commit 62406e4 into main Mar 3, 2026
5 of 30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants