Skip to content

Local variables not available in debug console in version 1.0 #1746

@cgarrard

Description

@cgarrard

Take this simple script:

from werkzeug.wrappers import Request, Response

some_global_variable = True

@Request.application
def application(request):
    msg = 'Hello, World!'
    return Response(msg2)

if __name__ == '__main__':
    from werkzeug.serving import run_simple
    run_simple('localhost', 4000, application,
               use_reloader=True, use_debugger=True, use_evalex=True)

As expected, the application crashes when it tries to create the response because msg2 doesn't exist. With version 0.16.1 and Python 3.8, I can view the value of the msg variable in the debug console. But if I upgrade to version 1.0, msg is no longer defined. Global variables are available, however. Here's a screenshot:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions