This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: C:\Python24\Lib\compileall.py returns False
Type: Stage:
Components: IDLE Versions: Python 2.4
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: kbk Nosy List: kbk, pieterb, rhettinger
Priority: normal Keywords:

Created on 2004-11-19 14:01 by pieterb, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg23215 - (view) Author: PieterB (pieterb) Date: 2004-11-19 14:01
I tried running compileall.py from IDLE with Python 2.4c1
(WinXP, SP1).

I get the following 'error':

....
Listing C:\WINDOWS\System32\python24.zip ...
Can't list C:\WINDOWS\System32\python24.zip
Listing C:\Python24 ...
Listing C:\Python24\DLLs ...
Listing C:\Python24\lib ...
Listing C:\Python24\lib\plat-win ...
Can't list C:\Python24\lib\plat-win
Listing C:\Python24\lib\lib-tk ...
Compiling C:\Python24\lib\lib-tk\Canvas.py ...
Compiling C:\Python24\lib\lib-tk\Dialog.py ...
Compiling C:\Python24\lib\lib-tk\FileDialog.py ...
Compiling C:\Python24\lib\lib-tk\ScrolledText.py ...
Compiling C:\Python24\lib\lib-tk\Tix.py ...
Compiling C:\Python24\lib\lib-tk\Tkdnd.py ...
Compiling C:\Python24\lib\lib-tk\turtle.py ...

Traceback (most recent call last):
  File "C:\Python24\Lib\compileall.py", line 157, in
-toplevel-
    sys.exit(exit_status)
SystemExit: False
>>> 

Shouldn't an integer value (e.g. 0) be returned by
sys.exit?
It's nice that you can see where the script has ended,
but I think it's good to be more elaborate that
everything went OK. I think some users might think it's
strange to get a Traceback when everything is ok.
msg23216 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-12-19 22:27
Logged In: YES 
user_id=80475

I think this is just a fact of life when using IDLE to run
scripts designed for command-line use.

The script is question is fine and represents good coding
style.  The only question is whether IDLE should handle
system exits differently.

Kurt, please pronounce and close.
msg23217 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2004-12-20 00:20
Logged In: YES 
user_id=149084

From compileall.py:155 :

if __name__ == '__main__':
    exit_status = not main()
    sys.exit(exit_status)

IDLE traps the sys.exit() because quitting IDLE is 
usually not what the user wants to do when it's
encountered in the user's program.  

compileall.py is exiting with a False status, equivalent
to the conventional UNIX success return of zero.  You
could take it up with the compileall.py maintainer, but
to me it's no biggie.  In any case, IDLE is working as
designed.

You can actually run this by 
$ idle -r compileall.py

It will end up in the IDLE shell when finished, just close
the shell  :-)

Works on Windows, too, but the pathnames are more
complicated because IDLE isn't currently installed
correctly.
History
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41195
2004-11-19 14:01:48pieterbcreate