GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — pdb loses local variable change after command longlist · Issue #101673 · python/cpython Closed Labels type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error DescriptionBug reportIn pdb, def main(): a = 1 breakpoint() print(a) main() -> print(a) (Pdb) p a 1 (Pdb) !a = 2 (Pdb) p a 2 (Pdb) ll 1 def main(): 2 a = 1 3 breakpoint() 4 -> print(a) (Pdb) p a 1 (Pdb) s 1 --Return-- As you can tell, The reason lies in if inspect.isframe(obj) and obj.f_globals is obj.f_locals: As a result, the local variable changes will be erased. The original reason to check if if inspect.isframe(obj) and obj.f_code.co_name == "<module>": It might not be the most delicate way, but I can't think of a situation where this won't work. I did this change locally and I have confirmed:
I'll make a PR soon and please let me know if there are any concerns about the fix. Your environment
Linked PRsReacted by Oleg Iarygin, xpf629629, Travis, zyckk4, Harry, OysterMax, kelerensheng, Yao Xiao, Daniel Hahler and 3willows Activity
MetadataMetadataAssigneesLabelstype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |