<p dir="auto">The .mobi file of the documentation has gone missing, does anyone know the whereabouts of it?</p>
<p dir="auto">EDIT: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="18261440" data-permission-text="Title is private" data-url="https://github.com/pallets/flask/issues/841" data-hovercard-type="issue" data-hovercard-url="/pallets/flask/issues/841/hovercard" href="https://github.com/pallets/flask/issues/841">#841</a></p>
<p dir="auto">I'm trying to use <code class="notranslate">mido</code> package with <code class="notranslate">flask</code>. I noticed a couple issues.</p>
<ol dir="auto">
<li>
<p dir="auto"><code class="notranslate">mido.get_input_names()</code> : doesn't recognize a new ports that opened after the <code class="notranslate">flask</code> server started.</p>
</li>
<li>
<p dir="auto">If a port closed (ex: <code class="notranslate">VMPK Output</code>) after it was called by, calling the same function  <code class="notranslate">mido.get_input_names()</code> throws the <code class="notranslate">subject</code> error (even it is a<code class="notranslate">browser page refresh</code> or a <code class="notranslate">form submit</code>.</p>
</li>
</ol>
<ul dir="auto">
<li>Thought, this could be an issue with <code class="notranslate">mido</code>, I opened a ticket there.</li>
<li>But the same code <strong>works fine in <code class="notranslate">Quart</code></strong> framework though]</li>
</ul>
<h3 dir="auto">Expected Behavior (for #. 1)</h3>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import mido
from flask import Flask, jsonify

app = Flask(__name__)

@app.route('/')
def home():
    return jsonify({'message': mido.get_input_names()})


# Home Page loading for the first time :  
#........ ['IAC Driver Bus 1', 'Network Session 1']

# Open `VMPK` and Refresh the page:  
#....... Expected Output:  ['IAC Driver Bus 1', 'Network Session 1', 'VMPK Output']"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s1">mido</span>
<span class="pl-k">from</span> <span class="pl-s1">flask</span> <span class="pl-k">import</span> <span class="pl-v">Flask</span>, <span class="pl-s1">jsonify</span>

<span class="pl-s1">app</span> <span class="pl-c1">=</span> <span class="pl-v">Flask</span>(<span class="pl-s1">__name__</span>)

<span class="pl-en">@<span class="pl-s1">app</span>.<span class="pl-en">route</span>(<span class="pl-s">'/'</span>)</span>
<span class="pl-k">def</span> <span class="pl-en">home</span>():
    <span class="pl-k">return</span> <span class="pl-en">jsonify</span>({<span class="pl-s">'message'</span>: <span class="pl-s1">mido</span>.<span class="pl-en">get_input_names</span>()})


<span class="pl-c"># Home Page loading for the first time :  </span>
<span class="pl-c">#........ ['IAC Driver Bus 1', 'Network Session 1']</span>

<span class="pl-c"># Open `VMPK` and Refresh the page:  </span>
<span class="pl-c">#....... Expected Output:  ['IAC Driver Bus 1', 'Network Session 1', 'VMPK Output']</span></pre></div>
<h3 dir="auto">Actual Behavior</h3>

<div class="highlight highlight-text-python-traceback notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="['IAC Driver Bus 1', 'Network Session 1']"><pre class="notranslate">['IAC Driver Bus 1', 'Network Session 1']</pre></div>
<h3 dir="auto">Expected Behavior (For #. 2)</h3>

<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Open `VMPK`; Start the `app`; Home Page loading for the first time :  
#........ ['IAC Driver Bus 1', 'Network Session 1', 'VMPK Output',  'VMPK Output']

# *Close* `VMPK`; Refresh the browser  
#....... Expected Output:  ['IAC Driver Bus 1', 'Network Session 1']"><pre class="notranslate"><span class="pl-c"># Open `VMPK`; Start the `app`; Home Page loading for the first time :  </span>
<span class="pl-c">#........ ['IAC Driver Bus 1', 'Network Session 1', 'VMPK Output',  'VMPK Output']</span>

<span class="pl-c"># *Close* `VMPK`; Refresh the browser  </span>
<span class="pl-c">#....... Expected Output:  ['IAC Driver Bus 1', 'Network Session 1']</span></pre></div>
<h3 dir="auto">Actual Behavior</h3>

<div class="highlight highlight-text-python-traceback notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="TypeError
TypeError: '&lt;' not supported between instances of 'NoneType' and 'str'

Traceback (most recent call last)
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 2464, in __call__
return self.wsgi_app(environ, start_response)
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 2450, in wsgi_app
response = self.handle_exception(e)
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/_compat.py&quot;, line 39, in reraise
raise value
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 2447, in wsgi_app
response = self.full_dispatch_request()
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/_compat.py&quot;, line 39, in reraise
raise value
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 1950, in full_dispatch_request
rv = self.dispatch_request()
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py&quot;, line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File &quot;/Users/dacodekid/dev/flask-issue/app.py&quot;, line 9, in home
return jsonify({'message': mido.get_input_names()})
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/mido/backends/backend.py&quot;, line 169, in get_input_names
devices = self._get_devices(**self._add_api(kwargs))
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/mido/backends/backend.py&quot;, line 163, in _get_devices
return self.module.get_devices(**self._add_api(kwargs))
File &quot;/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/mido/backends/rtmidi.py&quot;, line 55, in get_devices
for name in sorted(input_names | output_names):
TypeError: '&lt;' not supported between instances of 'NoneType' and 'str'
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the &quot;Traceback&quot; headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

dump() shows all variables in the frame
dump(obj) dumps all that's known about the object"><pre class="notranslate">TypeError
<span class="pl-en">TypeError</span>: <span class="pl-s">'&lt;' not supported between instances of 'NoneType' and 'str'</span>

Traceback (most recent call last)
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py", line 2464, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py", line 2450, in wsgi_app
response = self.handle_exception(e)
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py", line 1867, in handle_exception
reraise(exc_type, exc_value, tb)
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/Users/dacodekid/dev/flask-issue/app.py", line 9, in home
return jsonify({'message': mido.get_input_names()})
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/mido/backends/backend.py", line 169, in get_input_names
devices = self._get_devices(**self._add_api(kwargs))
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/mido/backends/backend.py", line 163, in _get_devices
return self.module.get_devices(**self._add_api(kwargs))
File "/Users/dacodekid/dev/flask-issue/venv/lib/python3.8/site-packages/mido/backends/rtmidi.py", line 55, in get_devices
for name in sorted(input_names | output_names):
<span class="pl-en">TypeError</span>: <span class="pl-s">'&lt;' not supported between instances of 'NoneType' and 'str'</span>
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

dump() shows all variables in the frame
dump(obj) dumps all that's known about the object</pre></div>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Python version: 3.7.3</li>
<li>Flask version: 1.1.2</li>
<li>Werkzeug version: 1.0.1</li>
</ul>
<h3 dir="auto">Pip packages</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="click==7.1.2
Flask==1.1.2
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
mido==1.2.9
python-rtmidi==1.4.1
Werkzeug==1.0.1"><pre class="notranslate"><code class="notranslate">click==7.1.2
Flask==1.1.2
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
mido==1.2.9
python-rtmidi==1.4.1
Werkzeug==1.0.1
</code></pre></div>