Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
gh-141781: Fix pdb line prefix binding#141779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
gh-141781: Fix pdb line prefix binding#141779
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Most changes to Pythonrequire a NEWS entry. Add one using theblurb_it web app or theblurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
gaogaotiantian commentedNov 24, 2025
Okay even though this is not an officially documented behavior, it has been like this for a long time and there is some comments in the source code about it. Also it does not cost us too much to revert the behavior back (the old behavior also makes more sense). In order to prevent cases like this happen in the future, could you also add a quick regression test on it? To make sure changing Also, even though minor, this still is still a behavior change. You need to add a news entry to it. Click the failed Let me know if you are stuck. |
pareshjoshij commentedNov 24, 2025
Thank you@gaogaotiantian sir for the guidance. Please let me know if anything needs to be adjusted or improved. Thank you again for your help.❤️ |
Remove unnecessary newline in test case.
Added a test for function finding with encoding cookie.
gaogaotiantian commentedNov 25, 2025
Okay this behavior has been like this since the beginning, at least 25 years ago. However I still don't think it makes sense to be like this. I won't backport this because it's hardly a bug fix and it's definitely not a regression. Let's just silently fix this and keep this as an unsupported undocumented thing. |
da1d468 intopython:mainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Description
This PR fixes a logic issue in
pdb.print_stack_entry. Previously,prompt_prefixusedline_prefixas a default argument, which caused the value to be bound at definition time (when the module is imported).This prevented users from customizing
pdb.line_prefixdynamically after import, as the function would continue using the initial value.Changes:
prompt_prefixtoNone.line_prefixifprompt_prefixisNone._get_tb_and_exceptions("tracecack" -> "traceback").Linked Issue
Fixes#141781