Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Switch to importlib breaks scripts withapp.run() #5160

Closed
Milestone
@The-Compiler

Description

@The-Compiler

With a trivial scriptusingapp.run() such as:

fromflaskimportFlaskapp=Flask(__name__)if__name__=="__main__":app.run(debug=True)

The current gitmain breaks with:

Traceback (most recent call last):  File"/home/florian/tmp/flask/app.py", line3, in<module>    app= Flask(__name__)^^^^^^^^^^^^^^^  File"/home/florian/tmp/flask/src/flask/app.py", line376, in__init__    instance_path=self.auto_find_instance_path()^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/home/florian/tmp/flask/src/flask/app.py", line630, inauto_find_instance_path    prefix, package_path= find_package(self.import_name)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/home/florian/tmp/flask/src/flask/scaffold.py", line898, infind_package    package_path= _find_package_path(import_name)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"/home/florian/tmp/flask/src/flask/scaffold.py", line858, in_find_package_path    spec= importlib.util.find_spec(root_mod_name)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File"<frozen importlib.util>", line114, infind_specValueError:__main__.__spec__ is None

This seems to be a regression due to84e11a1 from#5157.

Environment:

  • Python version: 3.11.4
  • Flask version: git main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp