Closed sudhir-b closed 4 years ago
Could you please provide a sample code that is broken because of this? Due to the nature of how and where that code is used, I believe that if the code_context
is None that view_config
itself would already not be useful in any way shape or form, since Venusian will never be able to find it.
Please update this issue with more info and we can re-open it, but at this time I do not see any cause for us to worry about this case without an example.
Bug Report
Description
https://github.com/Pylons/pyramid/blob/5269b28e728a470b94f194bf8febd46278b1f356/src/pyramid/view.py#L235
The function
inspect.getframeinfo()
returns a named tuple.In
_get_info()
in theview_config
class, we subscript straight into the element at index 3 in the returned named tuple.However, the function
inspect.getframeinfo()
can return None as the third element, which will raise aTypeError
if unhandled.To Reproduce I'm unsure how to reproduce this from outside the Pyramid code base.
However, we should be able to trigger this error by adding the kwarg
context=0
to thegetframeinfo()
call.Expected behavior A user should expect the
None
case to be safely handled instead of triggering aTypeError
.