simplify.real_code blanks t-strings, so renames inside them edit the wrong offset

Open Beginner friendly
#913 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 7 days

@sean0407 is already working on this.

Since Oct 24, 2026.

  • #915 by @sean0407 — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
83/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
devtools

Research direction

Start by reading simplify.real_code and get_any_string_pattern, which the issue identifies as the places that blank string contents and match string prefixes. Check how f-strings are handled, then reproduce the reported rename in the issue on Python 3.14. Done means t-strings preserve their interpolation text during renaming and the result no longer changes {a} to {ab}.

Written by the indexing model from the issue text.

Description

simplify.real_code replaces the text of every string except f-strings ("f" in prefix), and
get_any_string_pattern's prefix [bBfFrRuU]{,4} has no t. On Python 3.14 a t-string's interpolations are
therefore blanked, and renaming a in def h():\n a = 1\n f(t"{a}(", ")") gives t"{ab}(". Accepting
t in the prefix and keeping t-strings' text like f-strings' fixes it.

Dominant language
Python
Stars
2.2k
Forks
197
Avg merge
2d 13h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-rope/rope

All issues in python-rope/rope

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.