search-index rebuild -i
show traceback on fail
#6329
Merged
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/--force
flag is provided. This is done by thecgitb.text
function.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 theLocalProxy
object, it fails. Builtingetattr
expects/catches anAttributeError
when property is not available, butLocalProxy
raises anRuntimeError
. In this way, we can't get traceback at all.There are two options:
LocalProxy
and 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.