# cpython-fullhistory /

Filename Size Date modified Message
Demo
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Python
RISCOS
Tools
109 B
2.1 KB
12.0 KB
25.9 KB
14.1 KB
39.8 KB
7.5 KB
209.0 KB
53.9 KB
5.5 KB
19.6 KB
34.0 KB

## This is Python version 2.2

See the file "LICENSE" for information on the history of this software, terms & conditions for usage, and a DISCLAIMER OF ALL WARRANTIES.

This Python distribution contains no GNU General Public Licensed (GPLed) code so it may be used in proprietary projects just like prior Python distributions. There are interfaces to some GNU code but these are entirely optional.

All trademarks referenced herein are property of their respective holders.

### What's new in this release?

See the file "Misc/NEWS".

### If you don't read instructions

Congratulations on getting this far. :-)

To start building right away (on UNIX): type "./configure" in the current directory and when it finishes, type "make". The section Build Instructions' below is still recommended reading, especially the part on customizing Modules/Setup.

### What is Python anyway?

Python is an interpreted object-oriented programming language suitable (amongst other uses) for distributed application development, scripting, numeric computing and system testing. Python is often compared to Tcl, Perl, Java, JavaScript, Visual Basic or Scheme. To find out more about what Python can do for you, point your browser to http://www.python.org/.

### How do I learn Python?

The official tutorial is still a good place to start; see http://www.python.org/doc/ for online and downloadable versions, as well as a list of other introductions, and reference documentation.

There's a quickly growing set of books on Python. See http://www.python.org/psa/bookstore/ for a list.

### Documentation

All documentation is provided online in a variety of formats. In order of importance for new users: Tutorial, Library Reference, Language Reference, Extending & Embedding, and the Python/C API. The Library Reference is especially of immense value since much of Python's power is described there, including the built-in data types and functions!

All documentation is also available online at the Python web site (http://www.python.org/doc/, see below). It is available online for occasional reference, or can be downloaded in many formats for faster access. The documentation is available in HTML, PostScript, PDF, and LaTeX formats; the LaTeX version is primarily for documentation authors, translators, and people with special formatting requirements.

The best documentation for the new (in Python 2.2) type/class unification features is Guido's tutorial introduction, at

http://www.python.org/2.2/descrintro.html

### Web sites

New Python releases and related technologies are published at http://www.python.org/. Come visit us!

There's also a Python community web site at http://starship.python.net/.

### Newsgroups and Mailing Lists

Read comp.lang.python, a high-volume discussion newsgroup about Python, or comp.lang.python.announce, a low-volume moderated newsgroup for Python-related announcements. These are also accessible as mailing lists: see http://www.python.org/psa/MailingLists.html for an overview of the many Python-related mailing lists.

Archives are accessible via Deja.com Usenet News: see http://www.deja.com/usenet. The mailing lists are also archived, see http://www.python.org/psa/MailingLists.html for details.

### Bug reports

To report or search for bugs, please use the Python Bug Tracker at http://sourceforge.net/bugs/?group_id=5470.

### Patches and contributions

To submit a patch or other contribution, please use the Python Patch Manager at http://sourceforge.net/patch/?group_id=5470. Guidelines for patch submission may be found at http://www.python.org/patches/.

If you have a proposal to change Python, it's best to submit a Python Enhancement Proposal (PEP) first. All current PEPs, as well as guidelines for submitting a new PEP, are list at http://python.sourceforge.net/peps/.

### Questions

For help, if you can't find it in the manuals or on the web site, it's best to post to the comp.lang.python or the Python mailing list (see above). If you specifically don't want to involve the newsgroup or mailing list, send questions to help@python.org (a group of volunteers who answer questions as they can). The newsgroup is the most efficient way to ask public questions.

## Build instructions

Before you can build Python, you must first configure it. Fortunately, the configuration and build process has been streamlined for most Unix installations, so all you have to do is type a few commands, optionally edit one file, and sit back. There are some platforms where things are not quite as smooth; see the platform specific notes below. If you want to build for multiple platforms sharing the same source tree, see the section on VPATH below.

Start by running the script "./configure", which determines your system configuration and creates the Makefile. (It takes a minute or two -- please be patient!) You may want to pass options to the configure script or edit the Modules/Setup file after running configure -- see the section below on configuration options and variables. When it's done, you are ready to run make.

To build Python, you normally type "make" in the toplevel directory. If you have changed the configuration or have modified Modules/Setup, the Makefile may have to be rebuilt. In this case you may have to run make again to correctly build your desired target. The interpreter executable is built in the top level directory.

Once you have built a Python interpreter, see the subsections below on testing, configuring additional modules, and installation. If you run into trouble, see the next section. Editing the Modules/Setup file after running make is supported; just run "make" again after making the desired changes.

### Troubleshooting

If you run into other trouble, see section 3 of the FAQ (http://www.python.org/cgi-bin/faqw.py or http://www.python.org/doc/FAQ.html) for hints on what can go wrong, and how to fix it.

If you rerun the configure script with different options, remove all object files by running "make clean" before rebuilding. Believe it or not, "make clean" sometimes helps to clean up other inexplicable problems as well. Try it before sending in a bug report!

If the configure script fails or doesn't seem to find things that should be there, inspect the config.log file. When you fix a configure problem, be sure to remove config.cache!

If you get a warning for every file about the -Olimit option being no longer supported, you can ignore it. There's no foolproof way to know whether this option is needed; all we can do is test whether it is accepted without error. On some systems, e.g. older SGI compilers, it is essential for performance (specifically when compiling ceval.c, which has more basic blocks than the default limit of 1000). If the warning bothers you, edit the Makefile to remove "-Olimit 1500" from the OPT variable.

If you get failures in test_long, or sys.maxint gets set to -1, you are probably experiencing compiler bugs, usually related to optimization. This is a common problem with some versions of gcc and egcs, and some vendor-supplied compilers, which can sometimes be worked around by turning off optimization. Consider switching to stable versions (gcc 2.7.2.3, egcs 1.1.2, or contact your vendor.)

From Python 2.0 onward, all Python C code is ANSI C. Compiling using old K&R-C-only compilers is no longer possible. ANSI C compilers are available for all modern systems, either in the form of updated compilers from the vendor, or one of the free compilers (gcc, egcs).

### Platform specific notes

(Some of these may no longer apply. If you find you can build Python on these platforms without the special directions mentioned here, submit a documentation bug report to SourceForge (see Bug Reports above) so we can remove them!)

64-bit platforms: The modules audioop, imageop and rgbimg don't work.
Don't try to enable them in the Modules/Setup file. They contain code that is quite wordsize sensitive. (If you have a fix, let us know!)
Solaris: When using Sun's C compiler with threads, at least on Solaris
2.5.1, you need to add the "-mt" compiler option (the simplest way is probably to specify the compiler with this option as the "CC" environment variable when running the configure script).
Linux: A problem with threads and fork() was tracked down to a bug in

the pthreads code in glibc version 2.0.5; glibc version 2.0.7 solves the problem. This causes the popen2 test to fail; problem and solution reported by Pablo Bleyer.

Under Linux systems using GNU libc 2 (aka libc6), the crypt module now needs the -lcrypt option. Uncomment this flag in Modules/Setup, or comment out the crypt module in the same file. Most modern Linux systems use glibc2.

FreeBSD 3.x and probably platforms with NCurses that use libmytinfo or
similar: When using cursesmodule, the linking is not done in the correct order with the defaults. Remove "-ltermcap" from the readline entry in Setup, and use as curses entry: "curses cursesmodule.c -lmytinfo -lncurses -ltermcap" - "mytinfo" (so called on FreeBSD) should be the name of the auxiliary library required on your platform. Normally, it would be linked automatically, but not necessarily in the correct order.
BSDI: BSDI versions before 4.1 have known problems with threads,
which can cause strange errors in a number of modules (for instance, the 'test_signal' test script will hang forever.) Turning off threads (with --with-threads=no) or upgrading to BSDI 4.1 solves this problem.
DEC Unix: Run configure with --with-dec-threads, or with
--with-threads=no if no threads are desired (threads are on by default). When using GCC, it is possible to get an internal compiler error if optimization is used. This was reported for GCC 2.7.2.3 on selectmodule.c. Manually compile the affected file without optimization to solve the problem.
DEC Ultrix: compile with GCC to avoid bugs in the native compiler,
and pass SHELL=/bin/sh5 to Make when installing.
AIX: A complete overhaul of the shared library support is now in
place. See Misc/AIX-NOTES for some notes on how it's done. (The optimizer bug reported at this place in previous releases has been worked around by a minimal code change.) If you get errors about ptread_* functions, during compile or during testing, try setting CC to a thread-safe (reentrant) compiler, like "cc_r". For full C++ module support, set CC="xlC_r" (or CC="xlC" without thread support).
When using threading, you may have to add -D_REENTRANT to the OPT variable in the top-level Makefile; reported by Pat Knight, this seems to make a difference (at least for HP-UX 10.20) even though config.h defines it.

Minix: When using ack, use "CC=cc AR=aal RANLIB=: ./configure"!

SCO: The following apply to SCO 3 only; Python builds out of the box

on SCO 5 (or so we've heard).

1) Everything works much better if you add -U__STDC__ to the defs. This is because all the SCO header files are broken. Anything that isn't mentioned in the C standard is conditionally excluded when __STDC__ is defined.

2) Due to the U.S. export restrictions, SCO broke the crypt stuff out into a separate library, libcrypt_i.a so the LIBS needed be set to:

LIBS=' -lsocket -lcrypt_i'
UnixWare: There are known bugs in the math library of the system, as well as
problems in the handling of threads (calling fork in one thread may interrupt system calls in others). Therefore, test_math and tests involving threads will fail until those problems are fixed.
SunOS 4.x: When using the SunPro C compiler, you may want to use the
'-Xa' option instead of '-Xc', to enable some needed non-ANSI Sunisms.
want to revive it.
QNX: Chris Herborth (chrish@qnx.com) writes:

configure works best if you use GNU bash; a port is available on ftp.qnx.com in /usr/free. I used the following process to build, test and install Python 1.5.x under QNX:

1. CONFIG_SHELL=/usr/local/bin/bash CC=cc RANLIB=:

./configure --verbose --without-gcc --with-libm=""

2. edit Modules/Setup to activate everything that makes sense for your system... tested here at QNX with the following modules:

array, audioop, binascii, cPickle, cStringIO, cmath, crypt, curses, errno, fcntl, gdbm, grp, imageop, _locale, math, md5, new, operator, parser, pcre, posix, pwd, readline, regex, reop, rgbimg, rotor, select, signal, socket, soundex, strop, struct, syslog, termios, time, timing, zlib, audioop, imageop, rgbimg

3. make SHELL=/usr/local/bin/bash

or, if you feel the need for speed:

make SHELL=/usr/local/bin/bash OPT="-5 -Oil+nrt"

4. make SHELL=/usr/local/bin/bash test

Using GNU readline 2.2 seems to behave strangely, but I think that's a problem with my readline 2.2 port. :-

5. make SHELL=/usr/local/bin/bash install

If you get SIGSEGVs while running Python (I haven't yet, but I've only run small programs and the test cases), you're probably running out of stack; the default 32k could be a little tight. To increase the stack size, edit the Makefile to read: LDFLAGS = -N 48k

BeOS: Chris Herborth (chrish@qnx.com) writes:
See BeOS/README for notes about compiling/installing Python on BeOS R3 or later. Note that only the PowerPC platform is supported for R3; both PowerPC and x86 are supported for R4.
1. Don't use gcc. It compiles Python/graminit.c into something that the Cray assembler doesn't like. Cray's cc seems to work fine.
2. Comment out modules md5 (won't compile) and audioop (will crash the interpreter during the test suite).

If you run the test suite, two tests will fail (rotate and binascii), but these are not the modules you'd expect to need on a Cray.

SGI: SGI's standard "make" utility (/bin/make or /usr/bin/make)

does not check whether a command actually changed the file it is supposed to build. This means that whenever you say "make" it will redo the link step. The remedy is to use SGI's much smarter "smake" utility (/usr/sbin/smake), or GNU make. If you set the first line of the Makefile to #!/usr/sbin/smake smake will be invoked by make (likewise for GNU make).

WARNING: There are bugs in the optimizer of some versions of SGI's compilers that can cause bus errors or other strange behavior, especially on numerical operations. To avoid this, try building with "make OPT=".

OS/2: If you are running Warp3 or Warp4 and have IBM's VisualAge C/C++
compiler installed, just change into the pcos2vacpp directory and type NMAKE. Threading and sockets are supported by default in the resulting binaries of PYTHON15.DLL and PYTHON.EXE.
Monterey (64-bit AIX): The current Monterey C compiler (Visual Age)
uses the OBJECT_MODE={32|64} environment variable to set the compilation mode to either 32-bit or 64-bit (32-bit mode is the default). Presumably you want 64-bit compilation mode for this 64-bit OS. As a result you must first set OBJECT_MODE=64 in your environment before configuring (./configure) or building (make) Python on Monterey.
Reliant UNIX: The thread support does not compile on Reliant UNIX, and
there is a (minor) problem in the configure script for that platform as well. This should be resolved in time for a future release.
Mac OS X 10: One of the regular expression tests fails

with a SEGV due to the small stack size used by default, if you do "limit stacksize 2048" before "make test" it should work.

On naked Darwin you may want to add the configure option "--disable-toolbox-glue" to disable the glue code for the Carbon interface modules. The modules themselves are currently only built if you add the --enable-framework option, see below.

On a clean OSX /usr/local does not exist. Do a "sudo mkdir -m 775 /usr/local" before you do a make install. Alternatively, do "sudo make install" which installs everything as superuser.

You may want to try the configure option "--enable-framework" which installs Python as a framework. The location can be set as argument to the --enable-framework option (default /Library/Frameworks). You may also want to check out ./Mac/OSX for building a Python.app. You may also want to manually install a symlink in /usr/local/bin/python to the executable deep down in the framework.

Cygwin: With recent (relative to the time of writing, 2001-12-11)

Cygwin installations, Python builds and passes all tests on NT/2000 if the _socket module is linked statically. If the _socket module is linked dynamically (the default), then failures can occur under certain conditions related to fork(). This is a known Cygwin problem that may be resolved by rebasing the necessary DLLs to prevent base address conflicts.

Threads support should still be disable due to a known bug in Cygwin pthreads that causes test_threadedtempfile to hang.

To workaround the above, run "./configure --with-threads=no" and include any other options you need (--prefix, etc.). Then in Modules/Setup uncomment the lines: