<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1485" rel="nofollow">http://projects.scipy.org/scipy/ticket/1485</a> on 2011-07-28 by trac user dobrokot, assigned to unknown.</em></p>
<p dir="auto">Python interpreter ignore unhandled exeptions after scipy.optimize import.</p>
<p dir="auto">For example, python script like</p>
<p dir="auto">import scipy.optimize<br>
raise Exception("error exit!")</p>
<p dir="auto">or like<br>
import scipy.optimize<br>
print mistyped_variable</p>
<p dir="auto">returns success exit code. This silently ignores mistakes in script when running from other process (bash or python subprocess.Popen).</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/scipy/ticket/1314" rel="nofollow">http://projects.scipy.org/scipy/ticket/1314</a> on 2010-10-18 by trac user markMiscavage, assigned to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/wnbell/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/wnbell">@wnbell</a>.</em></p>
<p dir="auto">I have this bug in a larger program but I've narrowed it down to a script consisting of just :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import sys
import scipy.sparse.sparsetools
sys.exit(&quot;EXIT&quot;)"><pre class="notranslate"><code class="notranslate">import sys
import scipy.sparse.sparsetools
sys.exit("EXIT")
</code></pre></div>
<p dir="auto">This will always exit with code 0. It seems it is the .pyd files in the sparsetools folder that are the source of this problem. I have the same problem in both 0.7.1 and 0.8.0 builds of scipy. I am using python 2.6 on a Windows 7 - 64 bit system.</p>