search-index rebuild -i show traceback on fail#6329
Merged
Conversation
23e64c7 to
4bb501d
Compare
6c92801 to
aabfe8a
Compare
…d-force-traceback
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.
When the search index is rebuilt, error traceback is printed to the output if an error occurs, and
-i/--forceflag is provided. This is done by thecgitb.textfunction.The problem is that the mentioned function is doing something like
getattr(x, y, DEFAULT)in order to get the current value of variables inside a particular stack frame. As soon as it meets theLocalProxyobject, it fails. Builtingetattrexpects/catches anAttributeErrorwhen property is not available, butLocalProxyraises anRuntimeError. In this way, we can't get traceback at all.There are two options:
LocalProxyand rewrite__getattr__. As we already have extensions that are expectingRuntimeError, it may cause a problem. In addition, I don't want to rewrite the existing 3rd-party method just because it's not compatible with another existing 3rd-party methodtraceback.format_tb. We won't see local variables, but everyone still can see the place where the error happened and start debugging from there, so it's not such a big issueAs you may guess, I picked the second option.