hughsie · GitHub

One of my deps in my webapp started doing from multiprocessing import shared_memory but I'm using python3.6 in my container and that's not available. I didn't notice this until we came to deploy the new version, and flask gave the super unhelpful:

Error: While importing 'webppname', an ImportError was raised.

...It doesn't show me what import was missing, or any clue on how to debug this. I kinda expected setting FLASK_ENV=development or FLASK_DEBUG=True would show me the full traceback so I could immediately just identify and revert that one dep, but alas not. This instead took the sysadmin several hours to debug :/

To reproduce, just do:

from foo import bar

...anywhere in your webapp, then try to use the flask CLI. e.g. ./env36/bin/flask run

Environment:

  • Python version: 3.6
  • Flask version: 2.0.2 in production, but with git master I see the same thing.

Read the original on github.com ↗