[Python-Dev] -U option?

Barry A. Warsaw barry@digicool.com
Wed, 6 Jun 2001 15:37:26 -0400


>>>>> "TP" == Tim Peters <tim.one@home.com> writes:

    TP> Anyone understand -U?  Like, should it work, why is it there
    TP> if it doesn't and isn't expected to, and are there docs for it
    TP> beyond the "python -h" blurb?

Nope, except that /for me/ an installed Python 2.1 seems to start up
just fine with -U.  My uninstalled (i.e. run from the source tree)
2.2a0 fails when given -U:

@anthem[[~/projects/python:1068]]% ./python
Python 2.2a0 (#4, Jun  6 2001, 13:03:36) 
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> 
@anthem[[~/projects/python:1069]]% ./python -U
'import site' failed; use -v for traceback
Python 2.2a0 (#4, Jun  6 2001, 13:03:36) 
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> 
@anthem[[~/projects/python:1070]]% ./python -U -v
# ./Lib/site.pyc matches ./Lib/site.py
import site # precompiled from ./Lib/site.pyc
# ./Lib/os.pyc matches ./Lib/os.py
import os # precompiled from ./Lib/os.pyc
import posix # builtin
# ./Lib/posixpath.pyc matches ./Lib/posixpath.py
import posixpath # precompiled from ./Lib/posixpath.pyc
# ./Lib/stat.pyc matches ./Lib/stat.py
import stat # precompiled from ./Lib/stat.pyc
# ./Lib/UserDict.pyc matches ./Lib/UserDict.py
import UserDict # precompiled from ./Lib/UserDict.pyc
'import site' failed; traceback:
Traceback (most recent call last):
  File "./Lib/site.py", line 91, in ?
    from distutils.util import get_platform
ImportError: No module named distutils.util
Python 2.2a0 (#4, Jun  6 2001, 13:03:36) 
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "copyright", "credits" or "license" for more information.
>>> 
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] signal
# cleanup[1] site
# cleanup[1] posix
# cleanup[1] exceptions
# cleanup[2] stat
# cleanup[2] posixpath
# cleanup[2] UserDict
# cleanup[2] os
# cleanup sys
# cleanup __builtin__
# cleanup ints: 1 unfreed int in 1 out of 3 blocks
# cleanup floats

-Barry