Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7957717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:17:50+00:00 2026-06-04T04:17:50+00:00

Under Windows, executing the following Python script I get an ERRORLEVEL of 0 instead

  • 0

Under Windows, executing the following Python script I get an ERRORLEVEL of 0 instead of the expected 2.

import sys
import scipy.io

sys.exit(2)

If I remove the import scipy.io, I got the correct ERRORLEVEL of 2…

Any idea why importing scipy.io cause such an issue?

PS: windows 7, python 2.72, scipy 0.10.1

Calling help(sys.exit) just before the sys.exit call return the following (which seems to be good):

Help on built-in function exit in module sys: 

exit(...) 
    exit([status]) 

    Exit the interpreter by raising SystemExit(status). 
    If the status is omitted or None, it defaults to zero (i.e., success). 
    If the status is numeric, it will be used as the system exit status. 
    If it is another kind of object, it will be printed and the system 
    exit status will be one (i.e., failure).

If I call

sys.exit('Something wrong')

The string is printed but the system still return 0 as ERRORLEVEL instead of the 1 expected.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T04:17:51+00:00Added an answer on June 4, 2026 at 4:17 am

    This appears to be due to a bug in SciPy. Here are some relevant tickets (only the first one is still open):

    • http://projects.scipy.org/scipy/ticket/1314
    • http://projects.scipy.org/scipy/ticket/1521
    • http://projects.scipy.org/scipy/ticket/1485

    One curious observation there is that

    the bug disappears when importing weave.

    Perhaps try importing scipy.weave to see if this workaround helps?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can I get a threads suspend count under Windows CE, using C or Visual
The following code will give a hard fail when run under Windows 7 32bit:
The following shell script takes a list of arguments, turns Unix paths into WINE/Windows
I have two C++ processes (A and B), executing under Windows, where one launches
Let's say I have the following scenario: <form action=/something.php method=GET>Click me</div> <script type=text/javascript><!-- $('form').submit(function(e)
Under Windows, I have used a program called Dependency Walker to examine the libraries
Under windows, this F# code will extend a file from say 12 bytes out
I am creating screenshots under Windows and using the LockBits function from GDI+ to
I have IIS running under Windows XP. I have .html files with classic ASP
Trying to build Xuggler under Windows. Xuggler is core native code functions wrapped into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.