Skip to content

Reloader picks wrong module when Flask is run with the pydev debugger #1607

@davidism

Description

@davidism

This is a weird situation where the #1416 fix to make python -m reloading more correct actually exposed an issue with PyDev. It rewrites python -m flask to python flask (which is clearly not correct), while Python itself rewrites it to python /path/to/flask_entry_point.py. Werkzeug still correctly detects that we were run as a module, but since sys.argv[0] is no longer a path but the module name, it incorrectly decides that there is a module named flask.flask in the current directory.

Originally posted by @davidism in pallets/flask#3297 (comment)

Metadata

Metadata

Assignees

No one assigned

    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