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)
This is a weird situation where the #1416 fix to make
python -mreloading more correct actually exposed an issue with PyDev. It rewritespython -m flasktopython flask(which is clearly not correct), while Python itself rewrites it topython /path/to/flask_entry_point.py. Werkzeug still correctly detects that we were run as a module, but sincesys.argv[0]is no longer a path but the module name, it incorrectly decides that there is a module namedflask.flaskin the current directory.Originally posted by @davidism in pallets/flask#3297 (comment)