<p dir="auto"><a href="https://github.com/pallets/markupsafe/issues/286" data-hovercard-type="issue" data-hovercard-url="/pallets/markupsafe/issues/286/hovercard">This</a> issue in markupsafe is transitively included in flask, so even applications running Flask 1.1.4 are crashing on startup.</p>
<p dir="auto">Here is a sample stack trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/&lt;...&gt;/bin/superset&quot;, line 33, in &lt;module&gt;
    sys.exit(load_entry_point('apache-superset==1.4.1', 'console_scripts', 'superset')())
  File &quot;/opt/bb/bin/superset&quot;, line 25, in importlib_load_entry_point
    return next(matches).load()
  File &quot;/&lt;...&gt;/lib/python3.9/importlib/metadata.py&quot;, line 77, in load
    module = import_module(match.group('module'))
  File &quot;/&lt;...&gt;/lib/python3.9/importlib/__init__.py&quot;, line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1030, in _gcd_import
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1007, in _find_and_load
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 972, in _find_and_load_unlocked
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 228, in _call_with_frames_removed
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1030, in _gcd_import
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 1007, in _find_and_load
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 986, in _find_and_load_unlocked
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 680, in _load_unlocked
  File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 850, in exec_module
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 228, in _call_with_frames_removed
  File &quot;/&lt;...&gt;/lib/python3.9/site-packages/superset/__init__.py&quot;, line 18, in &lt;module&gt;
    from flask import current_app, Flask
  File &quot;/&lt;...&gt;/lib/python3.9/site-packages/flask/__init__.py&quot;, line 14, in &lt;module&gt;
    from jinja2 import escape
  File &quot;/&lt;...&gt;/lib/python3.9/site-packages/jinja2/__init__.py&quot;, line 12, in &lt;module&gt;
    from .environment import Environment
  File &quot;/&lt;...&gt;/lib/python3.9/site-packages/jinja2/environment.py&quot;, line 25, in &lt;module&gt;
    from .defaults import BLOCK_END_STRING
  File &quot;/&lt;...&gt;/lib/python3.9/site-packages/jinja2/defaults.py&quot;, line 3, in &lt;module&gt;
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File &quot;/&lt;...&gt;/lib/python3.9/site-packages/jinja2/filters.py&quot;, line 13, in &lt;module&gt;
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/&lt;...&gt;/lib/python3.9/site-packages/markupsafe/__init__.py)"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "/&lt;...&gt;/bin/superset", line 33, in &lt;module&gt;
    sys.exit(load_entry_point('apache-superset==1.4.1', 'console_scripts', 'superset')())
  File "/opt/bb/bin/superset", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/&lt;...&gt;/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/&lt;...&gt;/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "&lt;frozen importlib._bootstrap&gt;", line 1030, in _gcd_import
  File "&lt;frozen importlib._bootstrap&gt;", line 1007, in _find_and_load
  File "&lt;frozen importlib._bootstrap&gt;", line 972, in _find_and_load_unlocked
  File "&lt;frozen importlib._bootstrap&gt;", line 228, in _call_with_frames_removed
  File "&lt;frozen importlib._bootstrap&gt;", line 1030, in _gcd_import
  File "&lt;frozen importlib._bootstrap&gt;", line 1007, in _find_and_load
  File "&lt;frozen importlib._bootstrap&gt;", line 986, in _find_and_load_unlocked
  File "&lt;frozen importlib._bootstrap&gt;", line 680, in _load_unlocked
  File "&lt;frozen importlib._bootstrap_external&gt;", line 850, in exec_module
  File "&lt;frozen importlib._bootstrap&gt;", line 228, in _call_with_frames_removed
  File "/&lt;...&gt;/lib/python3.9/site-packages/superset/__init__.py", line 18, in &lt;module&gt;
    from flask import current_app, Flask
  File "/&lt;...&gt;/lib/python3.9/site-packages/flask/__init__.py", line 14, in &lt;module&gt;
    from jinja2 import escape
  File "/&lt;...&gt;/lib/python3.9/site-packages/jinja2/__init__.py", line 12, in &lt;module&gt;
    from .environment import Environment
  File "/&lt;...&gt;/lib/python3.9/site-packages/jinja2/environment.py", line 25, in &lt;module&gt;
    from .defaults import BLOCK_END_STRING
  File "/&lt;...&gt;/lib/python3.9/site-packages/jinja2/defaults.py", line 3, in &lt;module&gt;
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/&lt;...&gt;/lib/python3.9/site-packages/jinja2/filters.py", line 13, in &lt;module&gt;
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/&lt;...&gt;/lib/python3.9/site-packages/markupsafe/__init__.py)
</code></pre></div>
<p dir="auto">Environment:</p>
<ul dir="auto">
<li>Python version: 3.9</li>
<li>Flask version: 1.1.4</li>
</ul>
<p dir="auto">Since the update of <a href="https://itsdangerous.palletsprojects.com/en/2.1.x/changes/#version-2-1-0" rel="nofollow">itsdangerous module</a> to version 2.1.0, Flask 1.1.2 fails to run.<br>
This is because Flask’s requirements.txt indicates to install <code class="notranslate">itsdangerous</code> &gt;= 0.24, it automatically installs the newest version which leads to using deprecated feature.<br>
I can do a workaround in my project’s requirements.txt to install <code class="notranslate">itsdangerous</code> &lt;= 2.0.1 before installing Flask but is it possible to fix the requirements.txt in Flask to install <code class="notranslate">itsdangerous</code> not upper than 2.0.1?</p>
<p dir="auto">To replicate the bug,</p>
<ol dir="auto">
<li>install Flask 1.1.2</li>
<li><code class="notranslate">flask run</code> in terminal</li>
<li>it will produce <code class="notranslate">ImportError: cannot import name 'json' from 'itsdangerous'</code></li>
</ol>
<p dir="auto">Thank you in advance.</p>
<p dir="auto">Environment:</p>
<ul dir="auto">
<li>Python version: 3.8</li>
<li>Flask version: 1.1.2</li>
</ul>