🔨 handle OSError cases where traceback frames occur from built…#13964
Merged
Carreau merged 3 commits intoMar 30, 2023
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… files
Hello. I'm not very familiar with open source contributions, so please bear with me if I'm a bit inexperienced.
Introduction
First of all, let me explain the background. I've been using the
_render_traceback_method of the traceback object, provided by theIPython.core.interactiveshell.InteractiveShellobject that you created, in theshowtracebackmethod. Thanks to this, I was able to create better error messages. I appreciate it. The following issue is related to the use of this method.Description
I noticed that in the recent
8.11version, code was added to generate a traceback when the source code is too long. In this case, if theetb.tb_frameobject is a built file or something similar, theinspect.getsourcelines(etb.tb_frame)method may raise an error. So I implemented a change to set themax_lento the minimum value and avoid the following condition when anOSErroroccurs. I think this approach can handle cases where errors occur while using theinspect.getsourcelines()method.If there is anything I have done wrong or any procedures I should follow, please let me know. I would greatly appreciate it if you could leave a comment and I will make the necessary changes immediately. Thank you.