<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">In flask website use tutorials, in the third step <code class="notranslate">flask run</code> to run my web, appear this mistake.<br>
In py files line first, I use the <code class="notranslate"># - coding: utf-8 --</code> specified utf-8.<br>
I'm writing code in Pycharm. Start the web with the CMD run command.<br>
I copy the project directory into ubuntu and it works.<br>
No related problems were found on the Internet.<br>
Please give us some ideas and solve this problem.<br>
thank you</p>
<p dir="auto">Below is a screenshot of the Pycharm</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/63dc5b0efee48a3d938202d860f1321d5883586949380089bb22d511727db3d4/687474703a2f2f6f6e6f3376623872662e626b742e636c6f7564646e2e636f6d2f46695139764667774d39644e726432397a5730674869464e555573382e706e67"><img src="https://camo.githubusercontent.com/63dc5b0efee48a3d938202d860f1321d5883586949380089bb22d511727db3d4/687474703a2f2f6f6e6f3376623872662e626b742e636c6f7564646e2e636f6d2f46695139764667774d39644e726432397a5730674869464e555573382e706e67" alt="" data-canonical-src="http://ono3vb8rf.bkt.clouddn.com/FiQ9vFgwM9dNrd29zW0gHiFNUUs8.png" style="max-width: 100%;"></a></p>
<p dir="auto">Tell us what should happen.</p>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="kevin@DESKTOP-5KM5T43:~/workspaces/flaskr$ flask run
 * Serving Flask app &quot;flaskr&quot;
 * Forcing debug mode on
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 244-441-781"><pre class="notranslate">kevin@DESKTOP-5KM5T43:<span class="pl-k">~</span>/workspaces/flaskr$ flask run
 <span class="pl-k">*</span> Serving Flask app <span class="pl-s"><span class="pl-pds">"</span>flaskr<span class="pl-pds">"</span></span>
 <span class="pl-k">*</span> Forcing debug mode on
 <span class="pl-k">*</span> Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
 <span class="pl-k">*</span> Restarting with stat
 <span class="pl-k">*</span> Debugger is active<span class="pl-k">!</span>
 <span class="pl-k">*</span> Debugger PIN: 244-441-781</pre></div>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Tell us what happens instead.</p>
<div class="highlight highlight-text-python-traceback notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="D:\workspace\development\python\WebProject\flaskr&gt;flask run
 * Serving Flask app &quot;flaskr&quot;
 * Forcing debug mode on
 * Restarting with stat
  File &quot;D:\ProgramData\Anaconda3\Scripts\flask.exe&quot;, line 1
SyntaxError: Non-UTF-8 code starting with '\x90' in file D:\ProgramData\Anaconda3\Scripts\flask.exe on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details"><pre class="notranslate">D:\workspace\development\python\WebProject\flaskr&gt;flask run
 * Serving Flask app "flaskr"
 * Forcing debug mode on
 * Restarting with stat
  File <span class="pl-s">"D:\ProgramData\Anaconda3\Scripts\flask.exe"</span>, line <span class="pl-c1">1</span>
<span class="pl-en">SyntaxError</span>: <span class="pl-s">Non-UTF-8 code starting with '\x90' in file D:\ProgramData\Anaconda3\Scripts\flask.exe on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details</span></pre></div>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Operating system</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="OS name: Microsoft Windows 10 professional edition
OS version: 10.0.16299 temporary lack of Build 16299"><pre class="notranslate"><code class="notranslate">OS name: Microsoft Windows 10 professional edition
OS version: 10.0.16299 temporary lack of Build 16299
</code></pre></div>
<ul dir="auto">
<li>Python version:</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="D:\workspace\development\python\WebProject\flaskr&gt;python --version
Python 3.6.3 :: Anaconda, Inc."><pre class="notranslate"><code class="notranslate">D:\workspace\development\python\WebProject\flaskr&gt;python --version
Python 3.6.3 :: Anaconda, Inc.
</code></pre></div>
<ul dir="auto">
<li>Flask version:</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="D:\workspace\development\python\WebProject\flaskr&gt;python -m flask --version
Flask 0.12.2
Python 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)]"><pre class="notranslate"><code class="notranslate">D:\workspace\development\python\WebProject\flaskr&gt;python -m flask --version
Flask 0.12.2
Python 3.6.3 |Anaconda, Inc.| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)]
</code></pre></div>
<ul dir="auto">
<li>Werkzeug version:</li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Werkzeug (0.12.2)"><pre class="notranslate"><code class="notranslate">Werkzeug (0.12.2)
</code></pre></div>
<p dir="auto">I am running apistar on python 3 and encountering an issue that has lead me to the werkzeug reloader.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="(fresh) C:\Users\uskaxb07\PycharmProjects\testapi&gt;apistar run
Starting up...
 * Restarting with stat
  File &quot;C:\Users\uskaxb07\env\fresh\Scripts\apistar.exe&quot;, line 1
SyntaxError: Non-UTF-8 code starting with '\x90' in file C:\Users\uskaxb07\env\fresh\Scripts\apistar.exe on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details"><pre class="notranslate"><code class="notranslate">(fresh) C:\Users\uskaxb07\PycharmProjects\testapi&gt;apistar run
Starting up...
 * Restarting with stat
  File "C:\Users\uskaxb07\env\fresh\Scripts\apistar.exe", line 1
SyntaxError: Non-UTF-8 code starting with '\x90' in file C:\Users\uskaxb07\env\fresh\Scripts\apistar.exe on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
</code></pre></div>
<p dir="auto">Removing the <code class="notranslate">use_reloader</code>  from the call to<code class="notranslate"> run_simple()</code> works. After digging into a couple of comments I found  that <a href="https://github.com/pallets/werkzeug/blob/master/werkzeug/_reloader.py#L118">https://github.com/pallets/werkzeug/blob/master/werkzeug/_reloader.py#L118</a> is doing some encoding to latin1 but only when the os is windows and the python version is 2. Could this be causing the Non-UTF-8 Syntax Error that I am recieving in python3?</p>