Skip to content

BUG preserve deduperreload source line numbers 馃 - #15390

Open
LouisDeconinck wants to merge 1 commit into
ipython:mainfrom
LouisDeconinck:fix/deduperreload-traceback-15359
Open

LouisDeconinck wants to merge 1 commit into
ipython:mainfrom
LouisDeconinck:fix/deduperreload-traceback-15359

Conversation

@LouisDeconinck

@LouisDeconinck LouisDeconinck commented Sep 10, 2026

Copy link
Copy Markdown

Fixes #15359.

deduperreload was round-tripping undecorated module functions through ast.unparse() and reparsing them, which discarded the original AST line metadata. Compile the original AST for that path so reloaded functions retain the source line used in tracebacks. Decorated functions and methods keep the existing reconstruction path because their wrapper handling depends on it.

Adds focused regression coverage for preserving the reloaded function's source line.

馃 Disclosure: this change was prepared with AI assistance.

@Carreau Carreau changed the title BUG preserve deduperreload source line numbers 馃馃崋 BUG preserve deduperreload source line numbers 馃 Sep 11, 2026
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.

deduperreload gives invalid tracebacks in reloaded functions

1 participant