Added Python (Thanks to Beholder) - it fails to build properly using my build system,

so there's a precompiled binary included, with a hack in Android.mk to make it work on NDK r4b
This commit is contained in:
pelya
2011-04-01 14:32:12 +03:00
parent a7cf867372
commit 9586a42a30
3953 changed files with 1480069 additions and 1 deletions

View File

@@ -0,0 +1,783 @@
Acknowledgements
----------------
This list is not complete and not in any useful order, but I would
like to thank everybody who contributed in any way, with code, hints,
bug reports, ideas, moral support, endorsement, or even complaints....
Without you, I would've stopped working on Python long ago!
--Guido
PS: In the standard Python distribution, this file is encoded in Latin-1.
David Abrahams
Jim Ahlstrom
Jyrki Alakuijala
Billy G. Allie
Kevin Altis
Mark Anacker
Anders Andersen
John Anderson
Erik Andersén
Oliver Andrich
Ross Andrus
Jason Asbahr
David Ascher
Chris AtLee
John Aycock
Jan-Hein B"uhrman
Donovan Baarda
Attila Babo
Alfonso Baciero
Dwayne Bailey
Stig Bakken
Greg Ball
Luigi Ballabio
Jeff Balogh
Michael J. Barber
Chris Barker
Quentin Barnes
Richard Barran
Cesar Eduardo Barros
Des Barry
Ulf Bartelt
Nick Bastin
Jeff Bauer
Michael R Bax
Anthony Baxter
Samuel L. Bayer
Donald Beaudry
David Beazley
Robin Becker
Neal Becker
Bill Bedford
Reimer Behrends
Ben Bell
Thomas Bellman
Alexander Belopolsky
Andrew Bennetts
Andy Bensky
Michel Van den Bergh
Eric Beser
Steven Bethard
Stephen Bevan
Ron Bickers
David Binger
Dominic Binks
Philippe Biondi
Stuart Bishop
Roy Bixler
Mike Bland
Martin Bless
Pablo Bleyer
Erik van Blokland
Eric Blossom
Finn Bock
Paul Boddie
Matthew Boedicker
David Bolen
Gregory Bond
Jurjen Bos
Peter Bosch
Eric Bouck
Thierry Bousch
Sebastian Boving
Monty Brandenberg
Georg Brandl
Terrence Brannon
Dave Brennan
Tom Bridgman
Richard Brodie
Daniel Brotsky
Jean Brouwers
Gary S. Brown
Oleg Broytmann
Dave Brueck
Stan Bubrouski
Erik de Bueger
Dick Bulterman
Bill Bumgarner
Jimmy Burgett
Tommy Burnette
Roger Burnham
Alastair Burt
Tarn Weisner Burton
Lee Busby
Ralph Butler
Jp Calderone
Daniel Calvelo
Tony Campbell
Brett Cannon
Mike Carlton
Terry Carroll
Donn Cave
Per Cederqvist
Octavian Cerna
Hye-Shik Chang
Jeffrey Chang
Mitch Chapman
Greg Chapman
Brad Chapman
David Chaum
Nicolas Chauvat
Michael Chermside
Albert Chin-A-Young
Adal Chiriliuc
Matt Chisholm
Tom Christiansen
Vadim Chugunov
David Cinege
Mike Clarkson
Brad Clements
Steve Clift
Nick Coghlan
Josh Cogliati
Dave Cole
Benjamin Collar
Jeffery Collins
Paul Colomiets
Matt Conway
David M. Cooke
Greg Copeland
Aldo Cortesi
David Costanzo
Scott Cotton
Greg Couch
Steve Cousins
Alex Coventry
Matthew Dixon Cowles
Christopher A. Craig
Laura Creighton
Simon Cross
Drew Csillag
John Cugini
Tom Culliton
Andrew Dalke
Lars Damerow
Eric Daniel
Scott David Daniels
Ben Darnell
Jonathan Dasteel
John DeGood
Vincent Delft
Arnaud Delobelle
Erik Demaine
Roger Dev
Raghuram Devarakonda
Toby Dickenson
Mark Dickinson
Yves Dionne
Daniel Dittmar
Jaromir Dolecek
Ismail Donmez
Dima Dorfman
Cesar Douady
Dean Draayer
John DuBois
Paul Dubois
Quinn Dunkan
Robin Dunn
Luke Dunstan
Andy Dustman
Gary Duzan
Eugene Dvurechenski
Josip Dzolonga
Maxim Dzumanenko
Walter Dörwald
Hans Eckardt
Grant Edwards
John Ehresman
Andrew Eland
Lance Ellinghaus
David Ely
Jeff Epler
Tom Epperly
Stoffel Erasmus
Jürgen A. Erhard
Michael Ernst
Ben Escoto
Andy Eskilsson
Stefan Esser
Stephen D Evans
Carey Evans
Tim Everett
Paul Everitt
David Everly
Greg Ewing
Martijn Faassen
Andreas Faerber
Bill Fancher
Mark Favas
Niels Ferguson
Sebastian Fernandez
Vincent Fiack
Tomer Filiba
Russell Finn
Nils Fischbeck
Frederik Fix
Matt Fleming
Hernán Martínez Foffani
Michael Foord
Amaury Forgeot d'Arc
Doug Fort
John Fouhy
Martin Franklin
Robin Friedrich
Ivan Frohne
Jim Fulton
Tadayoshi Funaba
Gyro Funch
Peter Funk
Geoff Furnish
Ulisses Furquim
Achim Gaedke
Lele Gaifax
Santiago Gala
Yitzchak Gale
Quentin Gallet-Gilles
Raymund Galvin
Nitin Ganatra
Fred Gansevles
Lars Marius Garshol
Dan Gass
Andrew Gaul
Stephen M. Gava
Harry Henry Gebel
Marius Gedminas
Thomas Gellekum
Christos Georgiou
Ben Gertzfield
Dinu Gherman
Jonathan Giddy
Johannes Gijsbers
Michael Gilfix
Tim Golden
Chris Gonnerman
David Goodger
Hans de Graaff
Eddy De Greef
Duncan Grisby
Dag Gruneau
Michael Guravage
Lars Gustäbel
Thomas Güttler
Barry Haddow
Paul ten Hagen
Rasmus Hahn
Peter Haight
Václav Haisman
Bob Halley
Jesse Hallio
Jun Hamano
Mark Hammond
Manus Hand
Milton L. Hankins
Stephen Hansen
Barry Hantman
Lynda Hardman
Derek Harland
Jason Harper
Larry Hastings
Shane Hathaway
Rycharde Hawkes
Jochen Hayek
Christian Heimes
Thomas Heller
Malte Helmert
Lance Finn Helsten
Jonathan Hendry
James Henstridge
Chris Herborth
Ivan Herman
Jürgen Hermann
Gary Herron
Thomas Herve
Bernhard Herzog
Magnus L. Hetland
Raymond Hettinger
Kevan Heydon
Jason Hildebrand
Richie Hindle
Konrad Hinsen
David Hobley
Tim Hochberg
Joerg-Cyril Hoehle
Gregor Hoffleit
Chris Hoffman
Albert Hofkamp
Jonathan Hogg
Gerrit Holl
Shane Holloway
Rune Holm
Philip Homburg
Naofumi Honda
Jeffrey Honig
Rob Hooft
Brian Hooper
Randall Hopper
Nadav Horesh
Ken Howard
Brad Howes
Chih-Hao Huang
Lawrence Hudson
Michael Hudson
Jim Hugunin
Greg Humphreys
Eric Huss
Jeremy Hylton
Gerhard Häring
Mihai Ibanescu
Lars Immisch
Tony Ingraldi
John Interrante
Bob Ippolito
Atsuo Ishimoto
Paul Jackson
Ben Jackson
David Jacobs
Kevin Jacobs
Kjetil Jacobsen
Geert Jansen
Jack Jansen
Bill Janssen
Drew Jenkins
Flemming Kjær Jensen
Jiba
Orjan Johansen
Gregory K. Johnson
Simon Johnston
Evan Jones
Jeremy Jones
Richard Jones
Irmen de Jong
Lucas de Jonge
John Jorgensen
Jens B. Jorgensen
Fred L. Drake, Jr.
Andreas Jung
Tattoo Mabonzo K.
Bob Kahn
Kurt B. Kaiser
Tamito Kajiyama
Peter van Kampen
Jacob Kaplan-Moss
Lou Kates
Sebastien Keim
Robert Kern
Randall Kern
Magnus Kessler
Lawrence Kesteloot
Vivek Khera
Mads Kiilerich
Taek Joo Kim
Paul Kippes
Steve Kirsch
Ron Klatchko
Bastian Kleineidam
Bob Kline
Matthias Klose
Kim Knapp
Lenny Kneler
Pat Knight
Greg Kochanski
Damon Kohler
Joseph Koshy
Bob Kras
Holger Krekel
Michael Kremer
Fabian Kreutz
Hannu Krosing
Andrew Kuchling
Vladimir Kushnir
Cameron Laird
Tino Lange
Andrew Langmead
Detlef Lannert
Soren Larsen
Piers Lauder
Ben Laurie
Simon Law
Chris Lawrence
Brian Leair
John J. Lee
Inyeol Lee
Thomas Lee
Christopher Lee
Luc Lefebvre
Kip Lehman
Joerg Lehmann
Luke Kenneth Casson Leighton
Marc-Andre Lemburg
John Lenton
Christopher Tur Lesniewski-Laas
Mark Levinson
William Lewis
Robert van Liere
Shawn Ligocki
Martin Ligr
Christopher Lindblad
Bjorn Lindqvist
Per Lindqvist
Eric Lindvall
Gregor Lingl
Nick Lockwood
Stephanie Lockwood
Anne Lord
Tom Loredo
Jason Lowe
Tony Lownds
Ray Loyzaga
Loren Luke
Fredrik Lundh
Mark Lutz
Jim Lynch
Mikael Lyngvig
Martin von Löwis
Andrew I MacIntyre
Tim MacKenzie
Nick Maclaren
Steve Majewski
Grzegorz Makarewicz
Ken Manheimer
Vladimir Marangozov
David Marek
Doug Marien
Alex Martelli
Anthony Martin
Sébastien Martini
Roger Masse
Nick Mathewson
Graham Matthews
Dieter Maurer
Arnaud Mazin
Chris McDonough
Greg McFarlane
Alan McIntyre
Michael McLay
Gordon McMillan
Caolan McNamara
Andrew McNamara
Craig McPheeters
Lambert Meertens
Bill van Melle
Luke Mewburn
Mike Meyer
Steven Miale
Trent Mick
Aristotelis Mikropoulos
Damien Miller
Chad Miller
Jay T. Miller
Roman Milner
Dustin J. Mitchell
Dom Mitchell
Doug Moen
The Dragon De Monsyne
Skip Montanaro
Paul Moore
James A Morrison
Sjoerd Mullender
Sape Mullender
Michael Muller
Piotr Meyer
John Nagle
Takahiro Nakayama
Travers Naran
Fredrik Nehr
Trent Nelson
Tony Nelson
Chad Netzer
Max Neunhöffer
George Neville-Neil
Johannes Nicolai
Samuel Nicolary
Gustavo Niemeyer
Oscar Nierstrasz
Hrvoje Niksic
Jesse Noller
Bill Noon
Stefan Norberg
Tim Northover
Joe Norton
Neal Norwitz
Nigel O'Brian
Kevin O'Connor
Tim O'Malley
Pascal Oberndoerfer
Jeffrey Ollie
Grant Olson
Piet van Oostrum
Jason Orendorff
Douglas Orr
Denis S. Otkidach
Michael Otteneder
R. M. Oudkerk
Russel Owen
Ondrej Palkovsky
Mike Pall
Todd R. Palmer
Juan David Ibáñez Palomar
Jan Palus
M. Papillon
Peter Parente
Alexandre Parenteau
Dan Parisien
Harri Pasanen
Randy Pausch
Samuele Pedroni
Marcel van der Peijl
Steven Pemberton
Mark Perrego
Trevor Perrin
Tim Peters
Benjamin Peterson
Chris Petrilli
Bjorn Pettersen
Geoff Philbrick
Gavrie Philipson
Adrian Phillips
Christopher J. Phoenix
Neale Pickett
Jim St. Pierre
Dan Pierson
Martijn Pieters
François Pinard
Zach Pincus
Michael Piotrowski
Antoine Pitrou
Jean-François Piéronne
Guilherme Polo
Michael Pomraning
Iustin Pop
John Popplewell
Amrit Prem
Paul Prescod
Donovan Preston
Steve Purcell
Fernando Pérez
Eduardo Pérez
Brian Quinlan
Anders Qvist
Burton Radons
Antti Rasinen
Eric Raymond
Edward K. Ream
Marc Recht
John Redford
Terry Reedy
Steve Reeves
Ofir Reichenberg
Sean Reifschneider
Michael P. Reilly
Bernhard Reiter
Steven Reiz
Roeland Rengelink
Tim Rice
Jan Pieter Riegel
Armin Rigo
Nicholas Riley
Jean-Claude Rimbault
Juan M. Bello Rivas
Anthony Roach
Mark Roberts
Jim Robinson
Andy Robinson
Kevin Rodgers
Giampaolo Rodola
Mike Romberg
Armin Ronacher
Case Roole
Timothy Roscoe
Jim Roskind
Just van Rossum
Hugo van Rossum
Saskia van Rossum
Donald Wallace Rouse II
Liam Routt
Craig Rowland
Paul Rubin
Sam Ruby
Audun S. Runde
Jeff Rush
Sam Rushing
Mark Russell
Nick Russo
Hajime Saitou
Rich Salz
Kevin Samborn
Ilya Sandler
Ty Sarna
Ben Sayer
Michael Scharf
Neil Schemenauer
David Scherer
Gregor Schmid
Ralf Schmitt
Michael Schneider
Peter Schneider-Kamp
Arvin Schnell
Chad J. Schroeder
Sam Schulenburg
Stefan Schwarzer
Dietmar Schwertberger
Federico Schwindt
Steven Scott
Barry Scott
Nick Seidenman
Žiga Seilnach
Fred Sells
Jiwon Seo
Jerry Seutter
Denis Severson
Ian Seyer
Ha Shao
Bruce Sherwood
Pete Shinners
Michael Shiplett
John W. Shipman
Joel Shprentz
Itamar Shtull-Trauring
Eric Siegerman
Paul Sijben
Kirill Simonov
Nathan Paul Simons
Janne Sinkkonen
George Sipe
J. Sipprell
Kragen Sitaker
Eric V. Smith
Christopher Smith
Gregory P. Smith
Rafal Smotrzyk
Dirk Soede
Paul Sokolovsky
Cody Somerville
Clay Spence
Per Spilling
Joshua Spoerri
Noah Spurrier
Nathan Srebro
RajGopal Srinivasan
Quentin Stafford-Fraser
Frank Stajano
Oliver Steele
Greg Stein
Chris Stern
Victor Stinner
Richard Stoakley
Peter Stoehr
Casper Stoel
Michael Stone
Ken Stox
Dan Stromberg
Daniel Stutzbach
Nathan Sullivan
Mark Summerfield
Hisao Suzuki
Andrew Svetlov
Kalle Svensson
Paul Swartz
Thenault Sylvain
Geoff Talvola
William Tanksley
Christian Tanzer
Steven Taschuk
Monty Taylor
Amy Taylor
Tobias Thelen
James Thomas
Robin Thomas
Eric Tiedemann
Tracy Tims
Oren Tirosh
Jason Tishler
Christian Tismer
Frank J. Tobin
R Lindsay Todd
Bennett Todd
Richard Townsend
Laurence Tratt
John Tromp
Jason Trowbridge
Anthony Tuininga
Stephen Turner
Bill Tutt
Doobee R. Tzeck
Eren Türkay
Lionel Ulmer
Roger Upole
Michael Urman
Hector Urtubia
Atul Varma
Dmitry Vasiliev
Alexandre Vassalotti
Frank Vercruesse
Mike Verdone
Jaap Vermeulen
Al Vezza
Jacques A. Vidrine
John Viega
Kannan Vijayan
Kurt Vile
Norman Vine
Frank Visser
Niki W. Waibel
Wojtek Walczak
Charles Waldman
Richard Walker
Larry Wall
Greg Ward
Barry Warsaw
Steve Waterbury
Bob Watson
Aaron Watters
Henrik Weber
Corran Webster
Stefan Wehr
Zack Weinberg
Edward Welbourne
Cliff Wells
Rickard Westman
Jeff Wheeler
Christopher White
Mats Wichmann
Truida Wiedijk
Felix Wiemann
Gerry Wiener
Bryce "Zooko" Wilcox-O'Hearn
John Williams
Sue Williams
Gerald S. Williams
Frank Willison
Greg V. Wilson
Jody Winston
Collin Winter
Dik Winter
Blake Winton
Jean-Claude Wippler
Lars Wirzenius
Chris Withers
Stefan Witzel
David Wolever
Klaus-Juergen Wolf
Dan Wolfe
Richard Wolff
Gordon Worley
Thomas Wouters
Heiko Wundram
Doug Wyatt
Ka-Ping Yee
Bob Yodlowski
Danny Yoo
George Yoshida
Masazumi Yoshikawa
Bernard Yue
Moshe Zadka
Milan Zamazal
Artur Zaprzala
Mike Zarnstorff
Siebren van der Zee
Uwe Zessin
Tarek ZiadŽ
Peter Åstrand
Jesse Noller

View File

@@ -0,0 +1,155 @@
Subject: AIX - Misc/AIX-NOTES
From: Vladimir Marangozov <Vladimir.Marangozov@imag.fr>
To: guido@CNRI.Reston.Va.US (Guido van Rossum)
Date: Wed, 6 Aug 1997 11:41:00 +0200 (EET)
==============================================================================
COMPILER INFORMATION
------------------------------------------------------------------------------
(1) A problem has been reported with "make test" failing because of "weird
indentation." Searching the comp.lang.python newsgroup reveals several
threads on this subject, and it seems to be a compiler bug in an old
version of the AIX CC compiler. However, the compiler/OS combination
which has this problem is not identified. In preparation for the 1.4
release, Vladimir Marangozov (Vladimir.Marangozov@imag.fr) and Manus Hand
(mhand@csn.net) reported no such troubles for the following compilers and
operating system versions:
AIX C compiler version 3.1.2 on AIX 4.1.3 and AIX 4.1.4
AIX C compiler version 1.3.0 on AIX 3.2.5
If you have this problem, please report the compiler/OS version.
(2) Stefan Esser (se@MI.Uni-Koeln.DE), in work done to compile Python
1.0.0 on AIX 3.2.4, reports that AIX compilers don't like the LANG
environment varaiable set to European locales. This makes the compiler
generate floating point constants using "," as the decimal seperator,
which the assembler doesn't understand (or perhaps it is the other way
around, with the assembler expecting, but not getting "," in float
numbers). "LANG=C; export LANG" solves the problem, as does
"LANG=C $(MAKE) ..." in the master Makefile.
(3) The cc (or xlc) compiler considers "Python/ceval.c" too complex to
optimize, except when invoked with "-qmaxmem=4000"
(4) Some problems (due to _AIX not being #defined) when python 1.0.0 was
compiled using 'gcc -ansi' were reported by Stefan Esser, but were not
investigated.
(5) The cc compiler has internal variables named "__abs" and "__div". These
names are reserved and may not be used as program variables in compiled
source. (As an anecdote in support of this, the implementation of
Python/operator.c had this problem in the 1.4 beta releases, and the
solution was to re#define some core-source variables having these names,
to give these python variables different names if the build is being done
on AIX.)
(6) As mentioned in the README, builds done immediately after previous builds
(without "make clean" or "make clobber") sometimes fail for mysterious
reasons. There are some unpredictable results when the configuration
is changed (that is, if you "configure" with different parameters) or if
intermediate changes are made to some files. Performing "make clean" or
"make clobber" resolves the problems.
==============================================================================
THREAD SUPPORT
------------------------------------------------------------------------------
As of AIX version 4, there are two (incompatible) types of pthreads on AIX:
a) AIX DCE pthreads (on AIX 3.2.5)
b) AIX 4 pthreads (on AIX 4.1 and up)
Support has been added to Python to handle the distinction.
The cc and gcc compilers do not initialize pthreads properly. The only
compilers that can initialize pthreads properly are IBM *_r* compilers,
which use the crt0_r.o module, and which invoke ld with the reentrant
version of libc (libc_r).
In order to enable thread support, follow these steps:
1. Uncomment the thread module in Modules/Setup
2. configure --without-gcc --with-thread ...
3. make CC="cc_r" OPT="-O -qmaxmem=4000"
For example, to make with both threads and readline, use:
./configure --without-gcc --with-thread --with-readline=/usr/local/lib
make CC=cc_r OPT="-O2 -qmaxmem=4000"
If the "make" which is used ignores the "CC=cc_r" directive, one could alias
the cc command to cc_r (for example, in C-shell, perform an "alias cc cc_r").
Vladimir Marangozov (Vladimir.Marangozov@imag.fr) provided this information,
and he reports that a cc_r build initializes threads properly and that all
demos on threads run okay with cc_r.
==============================================================================
SHARED LIBRARY SUPPORT
------------------------------------------------------------------------------
AIX shared library support was added to Python in the 1.4 release by Manus
Hand (mhand@csn.net) and Vladimir Marangozov (Vladimir.Marangozov@imag.fr).
Python modules may now be built as shared libraries on AIX using the normal
process of uncommenting the "*shared*" line in Modules/Setup before the
build.
AIX shared libraries require that an "export" and "import" file be provided
at compile time to list all extern symbols which may be shared between
modules. The "export" file (named python.exp) for the modules and the
libraries that belong to the Python core is created by the "makexp_aix"
script before performing the link of the python binary. It lists all global
symbols (exported during the link) of the modules and the libraries that
make up the python executable.
When shared library modules (.so files) are made, a second shell script
is invoked. This script is named "ld_so_aix" and is also provided with
the distribution in the Modules subdirectory. This script acts as an "ld"
wrapper which hides the explicit management of "export" and "import" files;
it adds the appropriate arguments (in the appropriate order) to the link
command that creates the shared module. Among other things, it specifies
that the "python.exp" file is an "import" file for the shared module.
At the time of this writing, neither the python.exp file nor the makexp_aix
or ld_so_aix scripts are installed by the make procedure, so you should
remember to keep these and/or copy them to a different location for
safekeeping if you wish to use them to add shared extension modules to
python. However, if the make process has been updated since this writing,
these files MAY have been installed for you during the make by the
LIBAINSTALL rule, in which case the need to make safe copies is obviated.
If you wish to add a shared extension module to the language, you would follow
the steps given in the example below (the example adds the shared extension
module "spam" to python):
1. Make sure that "ld_so_aix" and "makexp_aix" are in your path.
2. The "python.exp" file should be in the current directory.
3. Issue the following commands or include them in your Makefile:
cc -c spammodule.c
ld_so_aix cc spammodule.o -o spammodule.so
For more detailed information on the shared library support, examine the
contents of the "ld_so_aix" and "makexp_aix" scripts or refer to the AIX
documentation.
NOTE: If the extension module is written in C++ and contains templates,
an alternative to "ld_so_aix" is the /usr/lpp/xlC/bin/makeC++SharedLib
script. Chris Myers (myers@TC.Cornell.EDU) reports that ld_so_aix
works well for some C++ (including the C++ that is generated
automatically by the Python SWIG package [SWIG can be found at
http://www.cs.utah.edu/~beazley/SWIG/swig.html]). However, it is not
known whether makeC++SharedLib can be used as a complete substitute
for ld_so_aix.
According to Gary Hook from IBM, the format of the export file changed
in AIX 4.2. For AIX 4.2 and later, a period "." is required on the
first line after "#!". If python crashes while importing a shared
library, you can try modifying the LINKCC variable in the Makefile.
It probably looks like this:
LINKCC= $(srcdir)/Modules/makexp_aix Modules/python.exp \"\" $(LIBRARY); $(PURIFY) $(CXX)
You should modify the \"\" to be a period:
LINKCC= $(srcdir)/Modules/makexp_aix Modules/python.exp . $(LIBRARY); $(PURIFY) $(CXX)
Using a period fixed the problem in the snake farm. YMMV.
This fix has been incorporated into Python 2.3.
==============================================================================

View File

@@ -0,0 +1,43 @@
Python for BeOS R5
In Python-2.1, the standard version of the new setup.py program
will not build the full complement of modules on BeOS. Instead,
please replace it with the special BeOS version in Misc/BeOS-setup.py.
To build,
1) cp Misc/BeOS-setup.py setup.py
2) ./configure --prefix=/boot/home/config
3) make
The modules will all build, except termios which assumes some flags
we don't have. Put a libreadline.a in /boot/home/config/lib to get
a readline.so for your interactive editing convenience; NB, not
libreadline.so, you want to link a static readline library into the
dynamically loaded Python module.
Test:
make test
The BeOS is Not UNIX category:
- test_select crashed -- select.error : (-2147459072, 'Bad file descriptor')
- test_socket crashed -- exceptions.AttributeError : SOCK_RAW
- test_fcntl crashed -- exceptions.IOError: [Errno -2147483643] Invalid argument
This one is funny! BeOS does support large files, and that's why
we get this error: the file is too big for my filesystem!
- test_largefile crashed -- exceptions.IOError: [Errno -2147459065]
No space left on device
- test_pickle crashed. This is apparently a serious problem, "complex"
number objects reconstructed from a pickle don't compare equal to
their ancestors. But it happens on BeOS PPC only, not Intel.
Install:
make install
Maintainer: None (please volunteer if you would like to see this port continue
to exist!)

View File

@@ -0,0 +1,574 @@
# Autodetecting setup.py script for building the Python extensions
#
# Modified for BeOS build. Donn Cave, March 27 2001.
__version__ = "special BeOS after 1.37"
import sys, os
from distutils import sysconfig
from distutils import text_file
from distutils.errors import *
from distutils.core import Extension, setup
from distutils.command.build_ext import build_ext
# This global variable is used to hold the list of modules to be disabled.
disabled_module_list = ['dbm', 'mmap', 'resource', 'nis']
def find_file(filename, std_dirs, paths):
"""Searches for the directory where a given file is located,
and returns a possibly-empty list of additional directories, or None
if the file couldn't be found at all.
'filename' is the name of a file, such as readline.h or libcrypto.a.
'std_dirs' is the list of standard system directories; if the
file is found in one of them, no additional directives are needed.
'paths' is a list of additional locations to check; if the file is
found in one of them, the resulting list will contain the directory.
"""
# Check the standard locations
for dir in std_dirs:
f = os.path.join(dir, filename)
if os.path.exists(f): return []
# Check the additional directories
for dir in paths:
f = os.path.join(dir, filename)
if os.path.exists(f):
return [dir]
# Not found anywhere
return None
def find_library_file(compiler, libname, std_dirs, paths):
filename = compiler.library_filename(libname, lib_type='shared')
result = find_file(filename, std_dirs, paths)
if result is not None: return result
filename = compiler.library_filename(libname, lib_type='static')
result = find_file(filename, std_dirs, paths)
return result
def module_enabled(extlist, modname):
"""Returns whether the module 'modname' is present in the list
of extensions 'extlist'."""
extlist = [ext for ext in extlist if ext.name == modname]
return len(extlist)
class PyBuildExt(build_ext):
def build_extensions(self):
# Detect which modules should be compiled
self.detect_modules()
# Remove modules that are present on the disabled list
self.extensions = [ext for ext in self.extensions
if ext.name not in disabled_module_list]
# Fix up the autodetected modules, prefixing all the source files
# with Modules/ and adding Python's include directory to the path.
(srcdir,) = sysconfig.get_config_vars('srcdir')
# Figure out the location of the source code for extension modules
moddir = os.path.join(os.getcwd(), srcdir, 'Modules')
moddir = os.path.normpath(moddir)
srcdir, tail = os.path.split(moddir)
srcdir = os.path.normpath(srcdir)
moddir = os.path.normpath(moddir)
# Fix up the paths for scripts, too
self.distribution.scripts = [os.path.join(srcdir, filename)
for filename in self.distribution.scripts]
for ext in self.extensions[:]:
ext.sources = [ os.path.join(moddir, filename)
for filename in ext.sources ]
ext.include_dirs.append( '.' ) # to get config.h
ext.include_dirs.append( os.path.join(srcdir, './Include') )
# If a module has already been built statically,
# don't build it here
if ext.name in sys.builtin_module_names:
self.extensions.remove(ext)
# Parse Modules/Setup to figure out which modules are turned
# on in the file.
input = text_file.TextFile('Modules/Setup', join_lines=1)
remove_modules = []
while 1:
line = input.readline()
if not line: break
line = line.split()
remove_modules.append( line[0] )
input.close()
for ext in self.extensions[:]:
if ext.name in remove_modules:
self.extensions.remove(ext)
# When you run "make CC=altcc" or something similar, you really want
# those environment variables passed into the setup.py phase. Here's
# a small set of useful ones.
compiler = os.environ.get('CC')
linker_so = os.environ.get('LDSHARED')
args = {}
# unfortunately, distutils doesn't let us provide separate C and C++
# compilers
if compiler is not None:
args['compiler_so'] = compiler
if linker_so is not None:
args['linker_so'] = linker_so + ' -shared'
self.compiler.set_executables(**args)
build_ext.build_extensions(self)
def build_extension(self, ext):
try:
build_ext.build_extension(self, ext)
except (CCompilerError, DistutilsError), why:
self.announce('WARNING: building of extension "%s" failed: %s' %
(ext.name, sys.exc_info()[1]))
def get_platform (self):
# Get value of sys.platform
platform = sys.platform
if platform[:6] =='cygwin':
platform = 'cygwin'
elif platform[:4] =='beos':
platform = 'beos'
return platform
def detect_modules(self):
try:
belibs = os.environ['BELIBRARIES'].split(';')
except KeyError:
belibs = ['/boot/beos/system/lib']
belibs.append('/boot/home/config/lib')
self.compiler.library_dirs.append('/boot/home/config/lib')
try:
beincl = os.environ['BEINCLUDES'].split(';')
except KeyError:
beincl = []
beincl.append('/boot/home/config/include')
self.compiler.include_dirs.append('/boot/home/config/include')
# lib_dirs and inc_dirs are used to search for files;
# if a file is found in one of those directories, it can
# be assumed that no additional -I,-L directives are needed.
lib_dirs = belibs
inc_dirs = beincl
exts = []
platform = self.get_platform()
# Check for MacOS X, which doesn't need libm.a at all
math_libs = ['m']
if platform in ['Darwin1.2', 'beos']:
math_libs = []
# XXX Omitted modules: gl, pure, dl, SGI-specific modules
#
# The following modules are all pretty straightforward, and compile
# on pretty much any POSIXish platform.
#
# Some modules that are normally always on:
exts.append( Extension('_weakref', ['_weakref.c']) )
exts.append( Extension('_symtable', ['symtablemodule.c']) )
# array objects
exts.append( Extension('array', ['arraymodule.c']) )
# complex math library functions
exts.append( Extension('cmath', ['cmathmodule.c'],
libraries=math_libs) )
# math library functions, e.g. sin()
exts.append( Extension('math', ['mathmodule.c'],
libraries=math_libs) )
# fast string operations implemented in C
exts.append( Extension('strop', ['stropmodule.c']) )
# time operations and variables
exts.append( Extension('time', ['timemodule.c'],
libraries=math_libs) )
# operator.add() and similar goodies
exts.append( Extension('operator', ['operator.c']) )
# access to the builtin codecs and codec registry
exts.append( Extension('_codecs', ['_codecsmodule.c']) )
# Python C API test module
exts.append( Extension('_testcapi', ['_testcapimodule.c']) )
# static Unicode character database
exts.append( Extension('unicodedata', ['unicodedata.c']) )
# access to ISO C locale support
exts.append( Extension('_locale', ['_localemodule.c']) )
# Modules with some UNIX dependencies -- on by default:
# (If you have a really backward UNIX, select and socket may not be
# supported...)
# fcntl(2) and ioctl(2)
exts.append( Extension('fcntl', ['fcntlmodule.c']) )
# pwd(3)
exts.append( Extension('pwd', ['pwdmodule.c']) )
# grp(3)
exts.append( Extension('grp', ['grpmodule.c']) )
# posix (UNIX) errno values
exts.append( Extension('errno', ['errnomodule.c']) )
# select(2); not on ancient System V
exts.append( Extension('select', ['selectmodule.c']) )
# The md5 module implements the RSA Data Security, Inc. MD5
# Message-Digest Algorithm, described in RFC 1321. The necessary files
# md5c.c and md5.h are included here.
exts.append( Extension('md5', ['md5module.c', 'md5c.c']) )
# The sha module implements the SHA checksum algorithm.
# (NIST's Secure Hash Algorithm.)
exts.append( Extension('sha', ['shamodule.c']) )
# Helper module for various ascii-encoders
exts.append( Extension('binascii', ['binascii.c']) )
# Fred Drake's interface to the Python parser
exts.append( Extension('parser', ['parsermodule.c']) )
# cStringIO and cPickle
exts.append( Extension('cStringIO', ['cStringIO.c']) )
exts.append( Extension('cPickle', ['cPickle.c']) )
# Memory-mapped files (also works on Win32).
exts.append( Extension('mmap', ['mmapmodule.c']) )
# Lance Ellinghaus's syslog daemon interface
exts.append( Extension('syslog', ['syslogmodule.c']) )
# George Neville-Neil's timing module:
exts.append( Extension('timing', ['timingmodule.c']) )
#
# Here ends the simple stuff. From here on, modules need certain
# libraries, are platform-specific, or present other surprises.
#
# Multimedia modules
# These don't work for 64-bit platforms!!!
# These represent audio samples or images as strings:
# Disabled on 64-bit platforms
if sys.maxint != 9223372036854775807L:
# Operations on audio samples
exts.append( Extension('audioop', ['audioop.c']) )
# Operations on images
exts.append( Extension('imageop', ['imageop.c']) )
# Read SGI RGB image files (but coded portably)
exts.append( Extension('rgbimg', ['rgbimgmodule.c']) )
# readline
if self.compiler.find_library_file(lib_dirs, 'readline'):
readline_libs = ['readline']
if self.compiler.find_library_file(lib_dirs +
['/usr/lib/termcap'],
'termcap'):
readline_libs.append('termcap')
exts.append( Extension('readline', ['readline.c'],
library_dirs=['/usr/lib/termcap'],
libraries=readline_libs) )
# The crypt module is now disabled by default because it breaks builds
# on many systems (where -lcrypt is needed), e.g. Linux (I believe).
if self.compiler.find_library_file(lib_dirs, 'crypt'):
libs = ['crypt']
else:
libs = []
exts.append( Extension('crypt', ['cryptmodule.c'], libraries=libs) )
# socket(2)
# Detect SSL support for the socket module
ssl_incs = find_file('openssl/ssl.h', inc_dirs,
['/usr/local/ssl/include',
'/usr/contrib/ssl/include/'
]
)
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
['/usr/local/ssl/lib',
'/usr/contrib/ssl/lib/'
] )
if (ssl_incs is not None and
ssl_libs is not None):
exts.append( Extension('_socket', ['socketmodule.c'],
include_dirs = ssl_incs,
library_dirs = ssl_libs,
libraries = ['ssl', 'crypto'],
define_macros = [('USE_SSL',1)] ) )
else:
exts.append( Extension('_socket', ['socketmodule.c']) )
# Modules that provide persistent dictionary-like semantics. You will
# probably want to arrange for at least one of them to be available on
# your machine, though none are defined by default because of library
# dependencies. The Python module anydbm.py provides an
# implementation independent wrapper for these; dumbdbm.py provides
# similar functionality (but slower of course) implemented in Python.
# The standard Unix dbm module:
if platform not in ['cygwin']:
if (self.compiler.find_library_file(lib_dirs, 'ndbm')):
exts.append( Extension('dbm', ['dbmmodule.c'],
libraries = ['ndbm'] ) )
else:
exts.append( Extension('dbm', ['dbmmodule.c']) )
# Anthony Baxter's gdbm module. GNU dbm(3) will require -lgdbm:
if (self.compiler.find_library_file(lib_dirs, 'gdbm')):
exts.append( Extension('gdbm', ['gdbmmodule.c'],
libraries = ['gdbm'] ) )
# Berkeley DB interface.
#
# This requires the Berkeley DB code, see
# ftp://ftp.cs.berkeley.edu/pub/4bsd/db.1.85.tar.gz
#
# Edit the variables DB and DBPORT to point to the db top directory
# and the subdirectory of PORT where you built it.
#
# (See http://electricrain.com/greg/python/bsddb3/ for an interface to
# BSD DB 3.x.)
dblib = []
if self.compiler.find_library_file(lib_dirs, 'db'):
dblib = ['db']
db185_incs = find_file('db_185.h', inc_dirs,
['/usr/include/db3', '/usr/include/db2'])
db_inc = find_file('db.h', inc_dirs, ['/usr/include/db1'])
if db185_incs is not None:
exts.append( Extension('bsddb', ['bsddbmodule.c'],
include_dirs = db185_incs,
define_macros=[('HAVE_DB_185_H',1)],
libraries = dblib ) )
elif db_inc is not None:
exts.append( Extension('bsddb', ['bsddbmodule.c'],
include_dirs = db_inc,
libraries = dblib) )
# Unix-only modules
if platform not in ['mac', 'win32']:
# Steen Lumholt's termios module
exts.append( Extension('termios', ['termios.c']) )
# Jeremy Hylton's rlimit interface
if platform not in ['cygwin']:
exts.append( Extension('resource', ['resource.c']) )
# Generic dynamic loading module
#exts.append( Extension('dl', ['dlmodule.c']) )
# Sun yellow pages. Some systems have the functions in libc.
if platform not in ['cygwin']:
if (self.compiler.find_library_file(lib_dirs, 'nsl')):
libs = ['nsl']
else:
libs = []
exts.append( Extension('nis', ['nismodule.c'],
libraries = libs) )
# Curses support, requring the System V version of curses, often
# provided by the ncurses library.
if (self.compiler.find_library_file(lib_dirs, 'ncurses')):
curses_libs = ['ncurses']
exts.append( Extension('_curses', ['_cursesmodule.c'],
libraries = curses_libs) )
elif (self.compiler.find_library_file(lib_dirs, 'curses')):
if (self.compiler.find_library_file(lib_dirs, 'terminfo')):
curses_libs = ['curses', 'terminfo']
else:
curses_libs = ['curses', 'termcap']
exts.append( Extension('_curses', ['_cursesmodule.c'],
libraries = curses_libs) )
# If the curses module is enabled, check for the panel module
if (os.path.exists('Modules/_curses_panel.c') and
module_enabled(exts, '_curses') and
self.compiler.find_library_file(lib_dirs, 'panel')):
exts.append( Extension('_curses_panel', ['_curses_panel.c'],
libraries = ['panel'] + curses_libs) )
# Lee Busby's SIGFPE modules.
# The library to link fpectl with is platform specific.
# Choose *one* of the options below for fpectl:
if platform == 'irix5':
# For SGI IRIX (tested on 5.3):
exts.append( Extension('fpectl', ['fpectlmodule.c'],
libraries=['fpe']) )
elif 0: # XXX how to detect SunPro?
# For Solaris with SunPro compiler (tested on Solaris 2.5 with SunPro C 4.2):
# (Without the compiler you don't have -lsunmath.)
#fpectl fpectlmodule.c -R/opt/SUNWspro/lib -lsunmath -lm
pass
else:
# For other systems: see instructions in fpectlmodule.c.
#fpectl fpectlmodule.c ...
exts.append( Extension('fpectl', ['fpectlmodule.c']) )
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
if (self.compiler.find_library_file(lib_dirs, 'z')):
exts.append( Extension('zlib', ['zlibmodule.c'],
libraries = ['z']) )
# Interface to the Expat XML parser
#
# Expat is written by James Clark and must be downloaded separately
# (see below). The pyexpat module was written by Paul Prescod after a
# prototype by Jack Jansen.
#
# The Expat dist includes Windows .lib and .dll files. Home page is
# at http://www.jclark.com/xml/expat.html, the current production
# release is always ftp://ftp.jclark.com/pub/xml/expat.zip.
#
# EXPAT_DIR, below, should point to the expat/ directory created by
# unpacking the Expat source distribution.
#
# Note: the expat build process doesn't yet build a libexpat.a; you
# can do this manually while we try convince the author to add it. To
# do so, cd to EXPAT_DIR, run "make" if you have not done so, then
# run:
#
# ar cr libexpat.a xmltok/*.o xmlparse/*.o
#
expat_defs = []
expat_incs = find_file('expat.h', inc_dirs, [])
if expat_incs is not None:
# expat.h was found
expat_defs = [('HAVE_EXPAT_H', 1)]
else:
expat_incs = find_file('xmlparse.h', inc_dirs, [])
if (expat_incs is not None and
self.compiler.find_library_file(lib_dirs, 'expat')):
exts.append( Extension('pyexpat', ['pyexpat.c'],
define_macros = expat_defs,
libraries = ['expat']) )
# Platform-specific libraries
if platform == 'linux2':
# Linux-specific modules
exts.append( Extension('linuxaudiodev', ['linuxaudiodev.c']) )
if platform == 'sunos5':
# SunOS specific modules
exts.append( Extension('sunaudiodev', ['sunaudiodev.c']) )
self.extensions.extend(exts)
# Call the method for detecting whether _tkinter can be compiled
self.detect_tkinter(inc_dirs, lib_dirs)
def detect_tkinter(self, inc_dirs, lib_dirs):
# The _tkinter module.
# Assume we haven't found any of the libraries or include files
tcllib = tklib = tcl_includes = tk_includes = None
for version in ['8.4', '8.3', '8.2', '8.1', '8.0']:
tklib = self.compiler.find_library_file(lib_dirs,
'tk' + version )
tcllib = self.compiler.find_library_file(lib_dirs,
'tcl' + version )
if tklib and tcllib:
# Exit the loop when we've found the Tcl/Tk libraries
break
# Now check for the header files
if tklib and tcllib:
# Check for the include files on Debian, where
# they're put in /usr/include/{tcl,tk}X.Y
debian_tcl_include = [ '/usr/include/tcl' + version ]
debian_tk_include = [ '/usr/include/tk' + version ] + debian_tcl_include
tcl_includes = find_file('tcl.h', inc_dirs, debian_tcl_include)
tk_includes = find_file('tk.h', inc_dirs, debian_tk_include)
if (tcllib is None or tklib is None and
tcl_includes is None or tk_includes is None):
# Something's missing, so give up
return
# OK... everything seems to be present for Tcl/Tk.
include_dirs = [] ; libs = [] ; defs = [] ; added_lib_dirs = []
for dir in tcl_includes + tk_includes:
if dir not in include_dirs:
include_dirs.append(dir)
# Check for various platform-specific directories
platform = self.get_platform()
if platform == 'sunos5':
include_dirs.append('/usr/openwin/include')
added_lib_dirs.append('/usr/openwin/lib')
elif os.path.exists('/usr/X11R6/include'):
include_dirs.append('/usr/X11R6/include')
added_lib_dirs.append('/usr/X11R6/lib')
elif os.path.exists('/usr/X11R5/include'):
include_dirs.append('/usr/X11R5/include')
added_lib_dirs.append('/usr/X11R5/lib')
else:
# Assume default location for X11
include_dirs.append('/usr/X11/include')
added_lib_dirs.append('/usr/X11/lib')
# Check for BLT extension
if self.compiler.find_library_file(lib_dirs + added_lib_dirs, 'BLT8.0'):
defs.append( ('WITH_BLT', 1) )
libs.append('BLT8.0')
# Add the Tcl/Tk libraries
libs.append('tk'+version)
libs.append('tcl'+version)
if platform in ['aix3', 'aix4']:
libs.append('ld')
# Finally, link with the X11 libraries
libs.append('X11')
ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
define_macros=[('WITH_APPINIT', 1)] + defs,
include_dirs = include_dirs,
libraries = libs,
library_dirs = added_lib_dirs,
)
self.extensions.append(ext)
# XXX handle these, but how to detect?
# *** Uncomment and edit for PIL (TkImaging) extension only:
# -DWITH_PIL -I../Extensions/Imaging/libImaging tkImaging.c \
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment these for TOGL extension only:
# -lGL -lGLU -lXext -lXmu \
def main():
setup(name = 'Python standard library',
version = '%d.%d' % sys.version_info[:2],
cmdclass = {'build_ext':PyBuildExt},
# The struct module is defined here, because build_ext won't be
# called unless there's at least one extension module defined.
ext_modules=[Extension('struct', ['structmodule.c'])],
# Scripts to install
scripts = ['Tools/scripts/pydoc']
)
# --install-platlib
if __name__ == '__main__':
sysconfig.set_python_build()
main()

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,73 @@
-*- text -*-
If you edited Misc/NEWS before it was converted to ReST format skimming this
file should help make the transition a bit easier. For full details about
Docutils and ReST, go to the Docutils website:
http://docutils.sourceforge.net/
To process Misc/NEWS using Docutils, you'll need the latest docutils
snapshot:
http://docutils.sf.net/docutils-snapshot.tgz
Docutils works with Python 2.2 or newer.
To process NEWS into NEWS.html, first install Docutils, and then run
this command:
python .../docutils/tools/rst2html.py NEWS NEWS.html
Here ".../docutils" is the directory into which the above snapshot was
extracted. (I hope this recipe will change for the better.)
David Goodger made a change to the allowable structure of internal
references which greatly simplified initial conversion of the file.
The changes required fell into the following categories:
* The top-level "What's New" section headers changed to:
What's New in Python 2.3 alpha 1?
=================================
*Release date: DD-MMM-2002*
Note that the release date line is emphasized, with a "*" at each
end.
* Subsections are underlined with a single row of hyphens:
Type/class unification and new-style classes
--------------------------------------------
* Places where "balanced" single quotes were used were changed to use
apostrophes as both the opening and closing quote (`string' -> 'string').
* In a few places asterisks needed to be escaped which would otherwise have
been interpreted as beginning blocks of italic or bold text, e.g.:
- The type of tp_free has been changed from "``void (*)(PyObject *)``"
to "``void (*)(void *)``".
Note that only the asterisks preceded by whitespace needed to be escaped.
* One instance of a word ending with an underscore needed to be quoted
("PyCmp_" became "``PyCmp_``").
* One table was converted to ReST form (search Misc/NEWS for "New codecs"
for this example).
* A few places where chunks of code or indented text were displayed needed
to be properly introduced (preceding paragraph terminated by "::" and the
chunk of code or text indented w.r.t. the paragraph). For example:
- Note that PyLong_AsDouble can fail! This has always been true,
but no callers checked for it. It's more likely to fail now,
because overflow errors are properly detected now. The proper way
to check::
double x = PyLong_AsDouble(some_long_object);
if (x == -1.0 && PyErr_Occurred()) {
/* The conversion failed. */
}

View File

@@ -0,0 +1,97 @@
Purify (tm) and Quantify (tm) are commercial software quality
assurance tools available from IBM <http://www.ibm.com/software/rational/>.
Purify is essentially a memory access
verifier and leak detector; Quantify is a C level profiler. The rest
of this file assumes you generally know how to use Purify and
Quantify, and that you have installed valid licenses for these
products. If you haven't installed such licenses, you can ignore the
following since it won't help you a bit!
You can easily build a Purify or Quantify instrumented version of the
Python interpreter by passing the PURIFY variable to the make command
at the top of the Python tree:
make PURIFY=purify
This assumes that the `purify' program is on your $PATH. Note that
you cannot both Purify and Quantify the Python interpreter (or any
program for that matter) at the same time. If you want to build a
Quantify'd interpreter, do this:
make PURIFY=quantify
Starting with Python 2.3, pymalloc is enabled by default. This
will cause many supurious warnings. Modify Objects/obmalloc.c
and enable Py_USING_MEMORY_DEBUGGER by uncommenting it.
README.valgrind has more details about why this is necessary.
See below about setting up suppressions. Some tests may not
run well with Purify due to heavy memory or CPU usage. These
tests may include: test_largefile, test_import, and test_long.
Please report any findings (problems or no warnings) to python-dev@python.org.
It may be useful to submit a bug report for any problems.
When running the regression test (make test), I have found it useful
to set my PURIFYOPTIONS environment variable using the following
(bash) shell function. Check out the Purify documentation for
details:
p() {
chainlen='-chain-length=12'
ignoresigs='-ignore-signals="SIGHUP,SIGINT,SIGQUIT,SIGILL,SIGTRAP,SIGAVRT,SIGEMT,SIGFPE,SIGKILL,SIGBUS,SIGSEGV,SIGPIPE,SIGTERM,SIGUSR1,SIGUSR2,SIGPOLL,SIGXCPU,SIGXFSZ,SIGFREEZE,SIGTHAW,SIGRTMIN,SIGRTMAX"'
followchild='-follow-child-processes=yes'
threads='-max-threads=50'
export PURIFYOPTIONS="$chainlen $ignoresigs $followchild $threads"
echo $PURIFYOPTIONS
}
Note that you may want to crank -chain-length up even further. A
value of 20 should get you the entire stack up into the Python C code
in all situations.
With the regression test on a fatly configured interpreter
(i.e. including as many modules as possible in your Modules/Setup
file), you'll probably get a gabillion UMR errors, and a few MLK
errors. I think most of these can be safely suppressed by putting the
following in your .purify file:
suppress umr ...; "socketmodule.c"
suppress umr ...; time_strftime
suppress umr ...; "dbmmodule.c"
suppress umr ...; "gdbmmodule.c"
suppress umr ...; "grpmodule.c"
suppress umr ...; "nismodule.c"
suppress umr ...; "pwdmodule.c"
Note: this list is very old and may not be accurate any longer.
It's possible some of these no longer need to be suppressed.
You will also need to suppress warnings (at least umr)
from Py_ADDRESS_IN_RANGE.
This will still leave you with just a few UMR, mostly in the readline
library, which you can safely ignore. A lot of work has gone into
Python 1.5 to plug as many leaks as possible.
Using Purify or Quantify in this way will give you coarse grained
reports on the whole Python interpreter. You can actually get more
fine grained control over both by linking with the optional `pure'
module, which exports (most of) the Purify and Quantify C API's into
Python. To link in this module (it must be statically linked), edit
your Modules/Setup file for your site, and rebuild the interpreter.
You might want to check out the comments in the Modules/puremodule.c
file for some idiosyncrasies.
Using this module, you can actually profile or leak test a small
section of code, instead of the whole interpreter. Using this in
conjuction with pdb.py, dbx, or the profiler.py module really gives
you quite a bit of introspective power.
Naturally there are a couple of caveats. This has only been tested
with Purify 4.0.1 and Quantify 2.1-beta on Solaris 2.5. Purify 4.0.1
does not work with Solaris 2.6, but Purify 4.1 which reportedly will,
is currently in beta test. There are funky problems when Purify'ing a
Python interpreter build with threads. I've had a lot of problems
getting this to work, so I generally don't build with threads when I'm
Purify'ing. If you get this to work, let us know!
-Barry Warsaw <bwarsaw@cnri.reston.va.us>

View File

@@ -0,0 +1,42 @@
Q. I want to port Python to a new platform. How do I begin?
A. I guess the two things to start with is to familiarize yourself
with are the development system for your target platform and the
generic build process for Python. Make sure you can compile and run a
simple hello-world program on your target platform. Make sure you can
compile and run the Python interpreter on a platform to which it has
already been ported (preferably Unix, but Mac or Windows will do,
too).
I also would never start something like this without at least
medium-level understanding of your target platform (i.e. how it is
generally used, how to write platform specific apps etc.) and Python
(or else you'll never know how to test the results).
The build process for Python, in particular the Makefiles in the
source distribution, will give you a hint on which files to compile
for Python. Not all source files are relevant -- some are platform
specific, others are only used in emergencies (e.g. getopt.c). The
Makefiles tell the story.
You'll also need a pyconfig.h file tailored for your platform. You can
start with pyconfig.h.in, read the comments and turn on definitions that
apply to your platform.
And you'll need a config.c file, which lists the built-in modules you
support. Start with Modules/config.c.in.
Finally, you'll run into some things that aren't supported on your
target platform. Forget about the posix module for now -- simply take
it out of the config.c file.
Bang on it until you get a >>> prompt. (You may have to disable the
importing of "site.py" and "exceptions.py" by passing -X and -S
options.
Then bang on it until it executes very simple Python statements.
Now bang on it some more. At some point you'll want to use the os
module; this is the time to start thinking about what to to with the
posix module. It's okay to simply #ifdef out those functions that
cause problems; the remaining ones will be quite useful.

View File

@@ -0,0 +1,33 @@
Python Misc subdirectory
========================
This directory contains files that wouldn't fit in elsewhere. Some
documents are only of historic importance.
Files found here
----------------
ACKS Acknowledgements
AIX-NOTES Notes for building Python on AIX
BeOS-NOTES Notes for building on BeOS
BeOS-setup.py setup.py replacement for BeOS, see BeOS-NOTES
cheatsheet Quick summary of Python by Ken Manheimer
find_recursionlimit.py Script to find a value for sys.maxrecursionlimit
gdbinit Handy stuff to put in your .gdbinit file, if you use gdb
HISTORY News from previous releases -- oldest last
HPUX-NOTES Notes about dynamic loading under HP-UX
indent.pro GNU indent profile approximating my C style
NEWS News for this release (for some meaning of "this")
Porting Mini-FAQ on porting to new platforms
PURIFY.README Information for Purify users
pymemcompat.h Memory interface compatibility file.
python.man UNIX man page for the python interpreter
python-mode.el Emacs mode for editing Python programs
README The file you're reading now
README.valgrind Information for Valgrind users, see valgrind-python.supp
RFD Request For Discussion about a Python newsgroup
RPM (Old) tools to build RPMs
SpecialBuilds.txt Describes extra symbols you can set for debug builds
setuid-prog.c C helper program for set-uid Python scripts
vgrindefs Python configuration for vgrind (a generic pretty printer)
valgrind-python.supp Valgrind suppression file, see README.valgrind

View File

@@ -0,0 +1,38 @@
2005-01-08
If you are have a problem building on OpenBSD and see output like this
while running configure:
checking curses.h presence... yes
configure: WARNING: curses.h: present but cannot be compiled
configure: WARNING: curses.h: check for missing prerequisite headers?
configure: WARNING: curses.h: see the Autoconf documentation
configure: WARNING: curses.h: section "Present But Cannot Be Compiled"
configure: WARNING: curses.h: proceeding with the preprocessor's result
configure: WARNING: curses.h: in the future, the compiler will take precedence
there is likely a problem that will prevent building python.
If you see the messages above and are able to completely build python,
please tell python-dev@python.org indicating your version of OpenBSD
and any other relevant system configuration.
The build error that occurs while making may look something like this:
/usr/include/sys/event.h:53: error: syntax error before "u_int"
/usr/include/sys/event.h:55: error: syntax error before "u_short"
To fix this problem, you will probably need update Python's configure
script to disable certain options. Search for a line that looks like:
OpenBSD/2.* | OpenBSD/3.@<:@012345678@:>@)
If your version is not in that list, e.g., 3.9, add the version
number. In this case, you would just need to add a 9 after the 8.
If you modify configure.in, you will need to regenerate configure
with autoconf.
If your version is already in the list, this is not a known problem.
Please submit a bug report here:
http://sourceforge.net/tracker/?group_id=5470&atid=105470

View File

@@ -0,0 +1,22 @@
Coverity has a static analysis tool (Prevent) which is similar to Klocwork.
They run their tool on the Python source code (SVN head) on a daily basis.
The results are available at:
http://scan.coverity.com/
About 20 people have access to the analysis reports. Other
people can be added by request.
Prevent was first run on the Python 2.5 source code in March 2006.
There were originally about 100 defects reported. Some of these
were false positives. Over 70 issues were uncovered.
Each warning has a unique id and comments that can be made on it.
When checking in changes due to a warning, the unique id
as reported by the tool was added to the SVN commit message.
False positives were annotated so that the comments can
be reviewed and reversed if the analysis was incorrect.
Contact python-dev@python.org for more information.

View File

@@ -0,0 +1,30 @@
Klocwork has a static analysis tool (K7) which is similar to Coverity.
They will run their tool on the Python source code on demand.
The results are available at:
https://opensource.klocwork.com/
Currently, only Neal Norwitz has access to the analysis reports. Other
people can be added by request.
K7 was first run on the Python 2.5 source code in mid-July 2006.
This is after Coverity had been making their results available.
There were originally 175 defects reported. Most of these
were false positives. However, there were numerous real issues
also uncovered.
Each warning has a unique id and comments that can be made on it.
When checking in changes due to a K7 report, the unique id
as reported by the tool was added to the SVN commit message.
A comment was added to the K7 warning indicating the SVN revision
in addition to any analysis.
False positives were also annotated so that the comments can
be reviewed and reversed if the analysis was incorrect.
A second run was performed on 10-Aug-2006. The tool was tuned to remove
some false positives and perform some additional checks. ~150 new
warnings were produced, primarily related to dereferencing NULL pointers.
Contact python-dev@python.org for more information.

View File

@@ -0,0 +1,97 @@
This document describes some caveats about the use of Valgrind with
Python. Valgrind is used periodically by Python developers to try
to ensure there are no memory leaks or invalid memory reads/writes.
If you don't want to read about the details of using Valgrind, there
are still two things you must do to suppress the warnings. First,
you must use a suppressions file. One is supplied in
Misc/valgrind-python.supp. Second, you must do one of the following:
* Uncomment Py_USING_MEMORY_DEBUGGER in Objects/obmalloc.c,
then rebuild Python
* Uncomment the lines in Misc/valgrind-python.supp that
suppress the warnings for PyObject_Free and PyObject_Realloc
If you want to use Valgrind more effectively and catch even more
memory leaks, you will need to configure python --without-pymalloc.
PyMalloc allocates a few blocks in big chunks and most object
allocations don't call malloc, they use chunks doled about by PyMalloc
from the big blocks. This means Valgrind can't detect
many allocations (and frees), except for those that are forwarded
to the system malloc. Note: configuring python --without-pymalloc
makes Python run much slower, especially when running under Valgrind.
You may need to run the tests in batches under Valgrind to keep
the memory usage down to allow the tests to complete. It seems to take
about 5 times longer to run --without-pymalloc.
Apr 15, 2006:
test_ctypes causes Valgrind 3.1.1 to fail (crash).
test_socket_ssl should be skipped when running valgrind.
The reason is that it purposely uses uninitialized memory.
This causes many spurious warnings, so it's easier to just skip it.
Details:
--------
Python uses its own small-object allocation scheme on top of malloc,
called PyMalloc.
Valgrind may show some unexpected results when PyMalloc is used.
Starting with Python 2.3, PyMalloc is used by default. You can disable
PyMalloc when configuring python by adding the --without-pymalloc option.
If you disable PyMalloc, most of the information in this document and
the supplied suppressions file will not be useful. As discussed above,
disabling PyMalloc can catch more problems.
If you use valgrind on a default build of Python, you will see
many errors like:
==6399== Use of uninitialised value of size 4
==6399== at 0x4A9BDE7E: PyObject_Free (obmalloc.c:711)
==6399== by 0x4A9B8198: dictresize (dictobject.c:477)
These are expected and not a problem. Tim Peters explains
the situation:
PyMalloc needs to know whether an arbitrary address is one
that's managed by it, or is managed by the system malloc.
The current scheme allows this to be determined in constant
time, regardless of how many memory areas are under pymalloc's
control.
The memory pymalloc manages itself is in one or more "arenas",
each a large contiguous memory area obtained from malloc.
The base address of each arena is saved by pymalloc
in a vector. Each arena is carved into "pools", and a field at
the start of each pool contains the index of that pool's arena's
base address in that vector.
Given an arbitrary address, pymalloc computes the pool base
address corresponding to it, then looks at "the index" stored
near there. If the index read up is out of bounds for the
vector of arena base addresses pymalloc maintains, then
pymalloc knows for certain that this address is not under
pymalloc's control. Otherwise the index is in bounds, and
pymalloc compares
the arena base address stored at that index in the vector
to
the arbitrary address pymalloc is investigating
pymalloc controls this arbitrary address if and only if it lies
in the arena the address's pool's index claims it lies in.
It doesn't matter whether the memory pymalloc reads up ("the
index") is initialized. If it's not initialized, then
whatever trash gets read up will lead pymalloc to conclude
(correctly) that the address isn't controlled by it, either
because the index is out of bounds, or the index is in bounds
but the arena it represents doesn't contain the address.
This determination has to be made on every call to one of
pymalloc's free/realloc entry points, so its speed is critical
(Python allocates and frees dynamic memory at a ferocious rate
-- everything in Python, from integers to "stack frames",
lives in the heap).

View File

@@ -0,0 +1,114 @@
To: python-list
Subject: comp.lang.python RFD again
From: Guido.van.Rossum@cwi.nl
I've followed the recent discussion and trimmed the blurb RFD down a bit
(and added the word "object-oriented" to the blurb).
I don't think it's too early to *try* to create the newsgroup --
whether we will succeed may depend on how many Python supporters there
are outside the mailing list.
I'm personally not worried about moderation, and anyway I haven't
heard from any volunteers for moderation (and I won't volunteer
myself) so I suggest that we'll continue to ask for one unmoderated
newsgroup.
My next action will be to post an updated FAQ (which will hint at the
upcoming RFD) to comp.lang.misc; then finalize the 1.0.0 release and
put it on the ftp site. I'll also try to get it into
comp.sources.unix or .misc. And all this before the end of January!
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>
======================================================================
These are the steps required (in case you don't know about the
newsgroup creation process):
First, we need to draw up an RFD (Request For Discussion). This is a
document that tells what the purpose of the group is, and gives a case
for its creation. We post this to relevant groups (comp.lang.misc,
the mailing list, news.groups, etc.) Discussion is held on
news.groups.
Then, after a few weeks, we run the official CFV (Call For Votes).
The votes are then collected over a period of weeks. We need 100 more
yes votes than no votes, and a 2/3 majority, to get the group.
There are some restrictions on the vote taker: [s]he cannot actively
campaign for/against the group during the vote process. So the main
benefit to Steve instead of me running the vote is that I will be free
to campaign for its creation!
The following is our current draft for the RFD.
======================================================================
Request For Discussion: comp.lang.python
Purpose
-------
The newsgroup will be for discussion on the Python computer language.
Possible topics include requests for information, general programming,
development, and bug reports. The group will be unmoderated.
What is Python?
---------------
Python is a relatively new very-high-level language developed in
Amsterdam. Python is a simple, object-oriented procedural language,
with features taken from ABC, Icon, Modula-3, and C/C++.
Its central goal is to provide the best of both worlds: the dynamic
nature of scripting languages like Perl/TCL/REXX, but also support for
general programming found in the more traditional languages like Icon,
C, Modula,...
Python may be FTP'd from the following sites:
ftp.cwi.nl in directory /pub/python (its "home site", also has a FAQ)
ftp.uu.net in directory /languages/python
gatekeeper.dec.com in directory /pub/plan/python/cwi
Rationale
---------
Currently there is a mailing list with over 130 subscribers.
The activity of this list is high, and to make handling the
traffic more reasonable, a newsgroup is being proposed. We
also feel that comp.lang.misc would not be a suitable forum
for this volume of discussion on a particular language.
Charter
-------
Comp.lang.python is an unmoderated newsgroup which will serve
as a forum for discussing the Python computer language. The
group will serve both those who just program in Python and
those who work on developing the language. Topics that
may be discussed include:
- announcements of new versions of the language and
applications written in Python.
- discussion on the internals of the Python language.
- general information about the language.
- discussion on programming in Python.
Discussion
----------
Any objections to this RFD will be considered and, if determined
to be appropriate, will be incorporated. The discussion period
will be for a period of 21 days after which the first CFV will be
issued.

View File

@@ -0,0 +1,16 @@
This directory contains support file used to build RPM releases of
Python. Its contents are maintained by Sean Reifschneider
<jafo@tummy.com>.
It is recommended that RPM builders use the python*.src.rpm file
downloaded from the "ftp.python.org:/pub/python/<version>/rpms". These
may be more up to date than the files included in the base Python
release tar-file.
If you wish to build RPMs from the base Python release tar-file, note
that you will have to download the
"doc/<version>/html-<version>.tar.bz2"
file from python.org and place it into your "SOURCES" directory for
the build to complete. This is the same directory that you place the
Python-2.3.1 release tar-file in. You can then use the ".spec" file in
this directory to build RPMs.

View File

@@ -0,0 +1,387 @@
##########################
# User-modifiable configs
##########################
# Is the resulting package and the installed binary named "python" or
# "python2"?
#WARNING: Commenting out doesn't work. Last line is what's used.
%define config_binsuffix none
%define config_binsuffix 2.6
# Build tkinter? "auto" enables it if /usr/bin/wish exists.
#WARNING: Commenting out doesn't work. Last line is what's used.
%define config_tkinter no
%define config_tkinter yes
%define config_tkinter auto
# Use pymalloc? The last line (commented or not) determines wether
# pymalloc is used.
#WARNING: Commenting out doesn't work. Last line is what's used.
%define config_pymalloc no
%define config_pymalloc yes
# Enable IPV6?
#WARNING: Commenting out doesn't work. Last line is what's used.
%define config_ipv6 yes
%define config_ipv6 no
# Location of the HTML directory.
%define config_htmldir /var/www/html/python
#################################
# End of user-modifiable configs
#################################
%define name python
#--start constants--
%define version 2.6.2
%define libver 2.6
#--end constants--
%define release 1pydotorg
%define __prefix /usr
# kludge to get around rpm <percent>define weirdness
%define ipv6 %(if [ "%{config_ipv6}" = yes ]; then echo --enable-ipv6; else echo --disable-ipv6; fi)
%define pymalloc %(if [ "%{config_pymalloc}" = yes ]; then echo --with-pymalloc; else echo --without-pymalloc; fi)
%define binsuffix %(if [ "%{config_binsuffix}" = none ]; then echo ; else echo "%{config_binsuffix}"; fi)
%define include_tkinter %(if [ \\( "%{config_tkinter}" = auto -a -f /usr/bin/wish \\) -o "%{config_tkinter}" = yes ]; then echo 1; else echo 0; fi)
%define libdirname %(( uname -m | egrep -q '_64$' && [ -d /usr/lib64 ] && echo lib64 ) || echo lib)
# detect if documentation is available
%define include_docs %(if [ -f "%{_sourcedir}/html-%{version}.tar.bz2" ]; then echo 1; else echo 0; fi)
Summary: An interpreted, interactive, object-oriented programming language.
Name: %{name}%{binsuffix}
Version: %{version}
Release: %{release}
Copyright: Modified CNRI Open Source License
Group: Development/Languages
Source: Python-%{version}.tar.bz2
%if %{include_docs}
Source1: html-%{version}.tar.bz2
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildPrereq: expat-devel
BuildPrereq: db4-devel
BuildPrereq: gdbm-devel
BuildPrereq: sqlite-devel
Prefix: %{__prefix}
Packager: Sean Reifschneider <jafo-rpms@tummy.com>
%description
Python is an interpreted, interactive, object-oriented programming
language. It incorporates modules, exceptions, dynamic typing, very high
level dynamic data types, and classes. Python combines remarkable power
with very clear syntax. It has interfaces to many system calls and
libraries, as well as to various window systems, and is extensible in C or
C++. It is also usable as an extension language for applications that need
a programmable interface. Finally, Python is portable: it runs on many
brands of UNIX, on PCs under Windows, MS-DOS, and OS/2, and on the
Mac.
%package devel
Summary: The libraries and header files needed for Python extension development.
Prereq: python%{binsuffix} = %{PACKAGE_VERSION}
Group: Development/Libraries
%description devel
The Python programming language's interpreter can be extended with
dynamically loaded extensions and can be embedded in other programs.
This package contains the header files and libraries needed to do
these types of tasks.
Install python-devel if you want to develop Python extensions. The
python package will also need to be installed. You'll probably also
want to install the python-docs package, which contains Python
documentation.
%if %{include_tkinter}
%package tkinter
Summary: A graphical user interface for the Python scripting language.
Group: Development/Languages
Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release}
%description tkinter
The Tkinter (Tk interface) program is an graphical user interface for
the Python scripting language.
You should install the tkinter package if you'd like to use a graphical
user interface for Python programming.
%endif
%package tools
Summary: A collection of development tools included with Python.
Group: Development/Tools
Prereq: python%{binsuffix} = %{PACKAGE_VERSION}-%{release}
%description tools
The Python package includes several development tools that are used
to build python programs. This package contains a selection of those
tools, including the IDLE Python IDE.
Install python-tools if you want to use these tools to develop
Python programs. You will also need to install the python and
tkinter packages.
%if %{include_docs}
%package docs
Summary: Python-related documentation.
Group: Development/Documentation
%description docs
Documentation relating to the Python programming language in HTML and info
formats.
%endif
%changelog
* Mon Dec 20 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.4-2pydotorg]
- Changing the idle wrapper so that it passes arguments to idle.
* Tue Oct 19 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.4b1-1pydotorg]
- Updating to 2.4.
* Thu Jul 22 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.4-3pydotorg]
- Paul Tiemann fixes for %{prefix}.
- Adding permission changes for directory as suggested by reimeika.ca
- Adding code to detect when it should be using lib64.
- Adding a define for the location of /var/www/html for docs.
* Thu May 27 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.4-2pydotorg]
- Including changes from Ian Holsman to build under Red Hat 7.3.
- Fixing some problems with the /usr/local path change.
* Sat Mar 27 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.2-3pydotorg]
- Being more agressive about finding the paths to fix for
#!/usr/local/bin/python.
* Sat Feb 07 2004 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.3-2pydotorg]
- Adding code to remove "#!/usr/local/bin/python" from particular files and
causing the RPM build to terminate if there are any unexpected files
which have that line in them.
* Mon Oct 13 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.2-1pydotorg]
- Adding code to detect wether documentation is available to build.
* Fri Sep 19 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3.1-1pydotorg]
- Updating to the 2.3.1 release.
* Mon Feb 24 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3b1-1pydotorg]
- Updating to 2.3b1 release.
* Mon Feb 17 2003 Sean Reifschneider <jafo-rpms@tummy.com> [2.3a1-1]
- Updating to 2.3 release.
* Sun Dec 23 2001 Sean Reifschneider <jafo-rpms@tummy.com>
[Release 2.2-2]
- Added -docs package.
- Added "auto" config_tkinter setting which only enables tk if
/usr/bin/wish exists.
* Sat Dec 22 2001 Sean Reifschneider <jafo-rpms@tummy.com>
[Release 2.2-1]
- Updated to 2.2.
- Changed the extension to "2" from "2.2".
* Tue Nov 18 2001 Sean Reifschneider <jafo-rpms@tummy.com>
[Release 2.2c1-1]
- Updated to 2.2c1.
* Thu Nov 1 2001 Sean Reifschneider <jafo-rpms@tummy.com>
[Release 2.2b1-3]
- Changed the way the sed for fixing the #! in pydoc works.
* Wed Oct 24 2001 Sean Reifschneider <jafo-rpms@tummy.com>
[Release 2.2b1-2]
- Fixed missing "email" package, thanks to anonymous report on sourceforge.
- Fixed missing "compiler" package.
* Mon Oct 22 2001 Sean Reifschneider <jafo-rpms@tummy.com>
[Release 2.2b1-1]
- Updated to 2.2b1.
* Mon Oct 9 2001 Sean Reifschneider <jafo-rpms@tummy.com>
[Release 2.2a4-4]
- otto@balinor.mat.unimi.it mentioned that the license file is missing.
* Sun Sep 30 2001 Sean Reifschneider <jafo-rpms@tummy.com>
[Release 2.2a4-3]
- Ignacio Vazquez-Abrams pointed out that I had a spruious double-quote in
the spec files. Thanks.
* Wed Jul 25 2001 Sean Reifschneider <jafo-rpms@tummy.com>
[Release 2.2a1-1]
- Updated to 2.2a1 release.
- Changed idle and pydoc to use binsuffix macro
#######
# PREP
#######
%prep
%setup -n Python-%{version}
########
# BUILD
########
%build
./configure --enable-unicode=ucs4 %{ipv6} %{pymalloc} --prefix=%{__prefix}
make
##########
# INSTALL
##########
%install
# set the install path
echo '[install_scripts]' >setup.cfg
echo 'install_dir='"${RPM_BUILD_ROOT}%{__prefix}/bin" >>setup.cfg
[ -d "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{__prefix}/%{libdirname}/python%{libvers}/lib-dynload
make prefix=$RPM_BUILD_ROOT%{__prefix} install
# REPLACE PATH IN PYDOC
if [ ! -z "%{binsuffix}" ]
then
(
cd $RPM_BUILD_ROOT%{__prefix}/bin
mv pydoc pydoc.old
sed 's|#!.*|#!%{__prefix}/bin/env python'%{binsuffix}'|' \
pydoc.old >pydoc
chmod 755 pydoc
rm -f pydoc.old
)
fi
# add the binsuffix
if [ ! -z "%{binsuffix}" ]
then
( cd $RPM_BUILD_ROOT%{__prefix}/bin; rm -f python[0-9a-zA-Z]*;
mv -f python python"%{binsuffix}" )
( cd $RPM_BUILD_ROOT%{__prefix}/man/man1; mv python.1 python%{binsuffix}.1 )
( cd $RPM_BUILD_ROOT%{__prefix}/bin; mv -f pydoc pydoc"%{binsuffix}" )
( cd $RPM_BUILD_ROOT%{__prefix}/bin; mv -f idle idle"%{binsuffix}" )
fi
########
# Tools
echo '#!%{__prefix}/bin/env python%{binsuffix}' >${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
echo 'import os, sys' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
echo 'os.execvp("%{__prefix}/bin/python%{binsuffix}", ["%{__prefix}/bin/python%{binsuffix}", "%{__prefix}/lib/python%{libvers}/idlelib/idle.py"] + sys.argv[1:])' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
echo 'print "Failed to exec Idle"' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
echo 'sys.exit(1)' >>${RPM_BUILD_ROOT}%{__prefix}/bin/idle%{binsuffix}
chmod 755 $RPM_BUILD_ROOT%{__prefix}/bin/idle%{binsuffix}
cp -a Tools $RPM_BUILD_ROOT%{__prefix}/%{libdirname}/python%{libvers}
# MAKE FILE LISTS
rm -f mainpkg.files
find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/lib-dynload -type f |
sed "s|^${RPM_BUILD_ROOT}|/|" |
grep -v -e '_tkinter.so$' >mainpkg.files
find "$RPM_BUILD_ROOT""%{__prefix}"/bin -type f |
sed "s|^${RPM_BUILD_ROOT}|/|" |
grep -v -e '/bin/idle%{binsuffix}$' >>mainpkg.files
rm -f tools.files
find "$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/idlelib \
"$RPM_BUILD_ROOT""%{__prefix}"/%{libdirname}/python%{libvers}/Tools -type f |
sed "s|^${RPM_BUILD_ROOT}|/|" >tools.files
echo "%{__prefix}"/bin/idle%{binsuffix} >>tools.files
######
# Docs
%if %{include_docs}
mkdir -p "$RPM_BUILD_ROOT"%{config_htmldir}
(
cd "$RPM_BUILD_ROOT"%{config_htmldir}
bunzip2 < %{SOURCE1} | tar x
)
%endif
# fix the #! line in installed files
find "$RPM_BUILD_ROOT" -type f -print0 |
xargs -0 grep -l /usr/local/bin/python | while read file
do
FIXFILE="$file"
sed 's|^#!.*python|#!%{__prefix}/bin/env python'"%{binsuffix}"'|' \
"$FIXFILE" >/tmp/fix-python-path.$$
cat /tmp/fix-python-path.$$ >"$FIXFILE"
rm -f /tmp/fix-python-path.$$
done
# check to see if there are any straggling #! lines
find "$RPM_BUILD_ROOT" -type f | xargs egrep -n '^#! */usr/local/bin/python' \
| grep ':1:#!' >/tmp/python-rpm-files.$$ || true
if [ -s /tmp/python-rpm-files.$$ ]
then
echo '*****************************************************'
cat /tmp/python-rpm-files.$$
cat <<@EOF
*****************************************************
There are still files referencing /usr/local/bin/python in the
install directory. They are listed above. Please fix the .spec
file and try again. If you are an end-user, you probably want
to report this to jafo-rpms@tummy.com as well.
*****************************************************
@EOF
rm -f /tmp/python-rpm-files.$$
exit 1
fi
rm -f /tmp/python-rpm-files.$$
########
# CLEAN
########
%clean
[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf $RPM_BUILD_ROOT
rm -f mainpkg.files tools.files
########
# FILES
########
%files -f mainpkg.files
%defattr(-,root,root)
%doc Misc/README Misc/cheatsheet Misc/Porting
%doc LICENSE Misc/ACKS Misc/HISTORY Misc/NEWS
%{__prefix}/man/man1/python%{binsuffix}.1*
%attr(755,root,root) %dir %{__prefix}/include/python%{libvers}
%attr(755,root,root) %dir %{__prefix}/%{libdirname}/python%{libvers}/
%{__prefix}/%{libdirname}/python%{libvers}/*.txt
%{__prefix}/%{libdirname}/python%{libvers}/*.py*
%{__prefix}/%{libdirname}/python%{libvers}/pdb.doc
%{__prefix}/%{libdirname}/python%{libvers}/profile.doc
%{__prefix}/%{libdirname}/python%{libvers}/curses
%{__prefix}/%{libdirname}/python%{libvers}/distutils
%{__prefix}/%{libdirname}/python%{libvers}/encodings
%{__prefix}/%{libdirname}/python%{libvers}/plat-linux2
%{__prefix}/%{libdirname}/python%{libvers}/site-packages
%{__prefix}/%{libdirname}/python%{libvers}/test
%{__prefix}/%{libdirname}/python%{libvers}/xml
%{__prefix}/%{libdirname}/python%{libvers}/email
%{__prefix}/%{libdirname}/python%{libvers}/email/mime
%{__prefix}/%{libdirname}/python%{libvers}/sqlite3
%{__prefix}/%{libdirname}/python%{libvers}/compiler
%{__prefix}/%{libdirname}/python%{libvers}/bsddb
%{__prefix}/%{libdirname}/python%{libvers}/hotshot
%{__prefix}/%{libdirname}/python%{libvers}/logging
%{__prefix}/%{libdirname}/python%{libvers}/lib-old
%files devel
%defattr(-,root,root)
%{__prefix}/include/python%{libvers}/*.h
%{__prefix}/%{libdirname}/python%{libvers}/config
%files -f tools.files tools
%defattr(-,root,root)
%if %{include_tkinter}
%files tkinter
%defattr(-,root,root)
%{__prefix}/%{libdirname}/python%{libvers}/lib-tk
%{__prefix}/%{libdirname}/python%{libvers}/lib-dynload/_tkinter.so*
%endif
%if %{include_docs}
%files docs
%defattr(-,root,root)
%{config_htmldir}/*
%endif

View File

@@ -0,0 +1,261 @@
This file describes some special Python build types enabled via
compile-time preprocessor defines.
It is best to define these options in the EXTRA_CFLAGS make variable;
``make EXTRA_CFLAGS="-DPy_REF_DEBUG"``.
---------------------------------------------------------------------------
Py_REF_DEBUG introduced in 1.4
named REF_DEBUG before 1.4
Turn on aggregate reference counting. This arranges that extern
_Py_RefTotal hold a count of all references, the sum of ob_refcnt across
all objects. In a debug-mode build, this is where the "8288" comes from
in
>>> 23
23
[8288 refs]
>>>
Note that if this count increases when you're not storing away new objects,
there's probably a leak. Remember, though, that in interactive mode the
special name "_" holds a reference to the last result displayed!
Py_REF_DEBUG also checks after every decref to verify that the refcount
hasn't gone negative, and causes an immediate fatal error if it has.
Special gimmicks:
sys.gettotalrefcount()
Return current total of all refcounts.
Available under Py_REF_DEBUG in Python 2.3.
Before 2.3, Py_TRACE_REFS was required to enable this function.
---------------------------------------------------------------------------
Py_TRACE_REFS introduced in 1.4
named TRACE_REFS before 1.4
Turn on heavy reference debugging. This is major surgery. Every PyObject
grows two more pointers, to maintain a doubly-linked list of all live
heap-allocated objects. Most builtin type objects are not in this list,
as they're statically allocated. Starting in Python 2.3, if COUNT_ALLOCS
(see below) is also defined, a static type object T does appear in this
list if at least one object of type T has been created.
Note that because the fundamental PyObject layout changes, Python modules
compiled with Py_TRACE_REFS are incompatible with modules compiled without
it.
Py_TRACE_REFS implies Py_REF_DEBUG.
Special gimmicks:
sys.getobjects(max[, type])
Return list of the (no more than) max most-recently allocated objects,
most recently allocated first in the list, least-recently allocated
last in the list. max=0 means no limit on list length.
If an optional type object is passed, the list is also restricted to
objects of that type.
The return list itself, and some temp objects created just to call
sys.getobjects(), are excluded from the return list. Note that the
list returned is just another object, though, so may appear in the
return list the next time you call getobjects(); note that every
object in the list is kept alive too, simply by virtue of being in
the list.
envar PYTHONDUMPREFS
If this envar exists, Py_Finalize() arranges to print a list of
all still-live heap objects. This is printed twice, in different
formats, before and after Py_Finalize has cleaned up everything it
can clean up. The first output block produces the repr() of each
object so is more informative; however, a lot of stuff destined to
die is still alive then. The second output block is much harder
to work with (repr() can't be invoked anymore -- the interpreter
has been torn down too far), but doesn't list any objects that will
die. The tool script combinerefs.py can be run over this to combine
the info from both output blocks. The second output block, and
combinerefs.py, were new in Python 2.3b1.
---------------------------------------------------------------------------
PYMALLOC_DEBUG introduced in 2.3
When pymalloc is enabled (WITH_PYMALLOC is defined), calls to the PyObject_
memory routines are handled by Python's own small-object allocator, while
calls to the PyMem_ memory routines are directed to the system malloc/
realloc/free. If PYMALLOC_DEBUG is also defined, calls to both PyObject_
and PyMem_ memory routines are directed to a special debugging mode of
Python's small-object allocator.
This mode fills dynamically allocated memory blocks with special,
recognizable bit patterns, and adds debugging info on each end of
dynamically allocated memory blocks. The special bit patterns are:
#define CLEANBYTE 0xCB /* clean (newly allocated) memory */
#define DEADBYTE 0xDB /* dead (newly freed) memory */
#define FORBIDDENBYTE 0xFB /* forbidden -- untouchable bytes */
Strings of these bytes are unlikely to be valid addresses, floats, or 7-bit
ASCII strings.
Let S = sizeof(size_t). 2*S bytes are added at each end of each block of N
bytes requested. The memory layout is like so, where p represents the
address returned by a malloc-like or realloc-like function (p[i:j] means
the slice of bytes from *(p+i) inclusive up to *(p+j) exclusive; note that
the treatment of negative indices differs from a Python slice):
p[-2*S:-S]
Number of bytes originally asked for. This is a size_t, big-endian
(easier to read in a memory dump).
p[-S:0]
Copies of FORBIDDENBYTE. Used to catch under- writes and reads.
p[0:N]
The requested memory, filled with copies of CLEANBYTE, used to catch
reference to uninitialized memory.
When a realloc-like function is called requesting a larger memory
block, the new excess bytes are also filled with CLEANBYTE.
When a free-like function is called, these are overwritten with
DEADBYTE, to catch reference to freed memory. When a realloc-
like function is called requesting a smaller memory block, the excess
old bytes are also filled with DEADBYTE.
p[N:N+S]
Copies of FORBIDDENBYTE. Used to catch over- writes and reads.
p[N+S:N+2*S]
A serial number, incremented by 1 on each call to a malloc-like or
realloc-like function.
Big-endian size_t.
If "bad memory" is detected later, the serial number gives an
excellent way to set a breakpoint on the next run, to capture the
instant at which this block was passed out. The static function
bumpserialno() in obmalloc.c is the only place the serial number
is incremented, and exists so you can set such a breakpoint easily.
A realloc-like or free-like function first checks that the FORBIDDENBYTEs
at each end are intact. If they've been altered, diagnostic output is
written to stderr, and the program is aborted via Py_FatalError(). The
other main failure mode is provoking a memory error when a program
reads up one of the special bit patterns and tries to use it as an address.
If you get in a debugger then and look at the object, you're likely
to see that it's entirely filled with 0xDB (meaning freed memory is
getting used) or 0xCB (meaning uninitialized memory is getting used).
Note that PYMALLOC_DEBUG requires WITH_PYMALLOC.
Special gimmicks:
envar PYTHONMALLOCSTATS
If this envar exists, a report of pymalloc summary statistics is
printed to stderr whenever a new arena is allocated, and also
by Py_Finalize().
Changed in 2.5: The number of extra bytes allocated is 4*sizeof(size_t).
Before it was 16 on all boxes, reflecting that Python couldn't make use of
allocations >= 2**32 bytes even on 64-bit boxes before 2.5.
---------------------------------------------------------------------------
Py_DEBUG introduced in 1.5
named DEBUG before 1.5
This is what is generally meant by "a debug build" of Python.
Py_DEBUG implies LLTRACE, Py_REF_DEBUG, Py_TRACE_REFS, and
PYMALLOC_DEBUG (if WITH_PYMALLOC is enabled). In addition, C
assert()s are enabled (via the C way: by not defining NDEBUG), and
some routines do additional sanity checks inside "#ifdef Py_DEBUG"
blocks.
---------------------------------------------------------------------------
COUNT_ALLOCS introduced in 0.9.9
partly broken in 2.2 and 2.2.1
Each type object grows three new members:
/* Number of times an object of this type was allocated. */
int tp_allocs;
/* Number of times an object of this type was deallocated. */
int tp_frees;
/* Highwater mark: the maximum value of tp_allocs - tp_frees so
* far; or, IOW, the largest number of objects of this type alive at
* the same time.
*/
int tp_maxalloc;
Allocation and deallocation code keeps these counts up to date.
Py_Finalize() displays a summary of the info returned by sys.getcounts()
(see below), along with assorted other special allocation counts (like
the number of tuple allocations satisfied by a tuple free-list, the number
of 1-character strings allocated, etc).
Before Python 2.2, type objects were immortal, and the COUNT_ALLOCS
implementation relies on that. As of Python 2.2, heap-allocated type/
class objects can go away. COUNT_ALLOCS can blow up in 2.2 and 2.2.1
because of this; this was fixed in 2.2.2. Use of COUNT_ALLOCS makes
all heap-allocated type objects immortal, except for those for which no
object of that type is ever allocated.
Starting with Python 2.3, If Py_TRACE_REFS is also defined, COUNT_ALLOCS
arranges to ensure that the type object for each allocated object
appears in the doubly-linked list of all objects maintained by
Py_TRACE_REFS.
Special gimmicks:
sys.getcounts()
Return a list of 4-tuples, one entry for each type object for which
at least one object of that type was allocated. Each tuple is of
the form:
(tp_name, tp_allocs, tp_frees, tp_maxalloc)
Each distinct type object gets a distinct entry in this list, even
if two or more type objects have the same tp_name (in which case
there's no way to distinguish them by looking at this list). The
list is ordered by time of first object allocation: the type object
for which the first allocation of an object of that type occurred
most recently is at the front of the list.
---------------------------------------------------------------------------
LLTRACE introduced well before 1.0
Compile in support for Low Level TRACE-ing of the main interpreter loop.
When this preprocessor symbol is defined, before PyEval_EvalFrame
(eval_frame in 2.3 and 2.2, eval_code2 before that) executes a frame's code
it checks the frame's global namespace for a variable "__lltrace__". If
such a variable is found, mounds of information about what the interpreter
is doing are sprayed to stdout, such as every opcode and opcode argument
and values pushed onto and popped off the value stack.
Not useful very often, but very useful when needed.
---------------------------------------------------------------------------
CALL_PROFILE introduced for Python 2.3
Count the number of function calls executed.
When this symbol is defined, the ceval mainloop and helper functions
count the number of function calls made. It keeps detailed statistics
about what kind of object was called and whether the call hit any of
the special fast paths in the code.
---------------------------------------------------------------------------
WITH_TSC introduced for Python 2.4
Super-lowlevel profiling of the interpreter. When enabled, the sys
module grows a new function:
settscdump(bool)
If true, tell the Python interpreter to dump VM measurements to
stderr. If false, turn off dump. The measurements are based on the
processor's time-stamp counter.
This build option requires a small amount of platform specific code.
Currently this code is present for linux/x86 and any PowerPC platform
that uses GCC (i.e. OS X and linux/ppc).
On the PowerPC the rate at which the time base register is incremented
is not defined by the architecture specification, so you'll need to
find the manual for your specific processor. For the 750CX, 750CXe
and 750FX (all sold as the G3) we find:
The time base counter is clocked at a frequency that is
one-fourth that of the bus clock.
This build is enabled by the --with-tsc flag to configure.

View File

@@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/usr/bin/python
"""Generate code to warn about a module's removal in Python 3.0.
XXX Not supported:
- Module's in a package do not have their full name generated.
- Package's __init__ module; should detect and use the package's name instead.
"""
py_template = """from warnings import warnpy3k
warnpy3k("the ${1:%s} module has been removed in Python 3.0", stacklevel=2)
del warnpy3k$0"""
c_template = """
if (PyErr_WarnPy3k("the ${1:%s} module has been removed in "
"Python 3.0", 2) &lt; 0)
return;$0"""
import imp
import os
file_name = os.path.split(os.environ['TM_FILEPATH'])[1]
py_suffixes = reversed(sorted((suffix[0] for suffix in imp.get_suffixes() if suffix[2] == imp.PY_SOURCE), key=len))
c_suffixes = reversed(sorted((os.path.splitext(suffix[0])[0] + '.c'
for suffix in imp.get_suffixes() if suffix[2] == imp.C_EXTENSION), key=len))
pairings = ((py_suffixes, py_template), (c_suffixes, c_template))
def create_template(suffixes, template):
for suffix in suffixes:
if not file_name.endswith(suffix):
continue
module_name = file_name[:-len(suffix)]
return template % module_name
else:
return None
for template in (create_template(*pair) for pair in pairings):
if not template:
continue
print template,
break
else:
print 'XXX Could not generate code.'</string>
<key>input</key>
<string>none</string>
<key>name</key>
<string>2 to 3 - Module Deletion</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>tabTrigger</key>
<string>2to3moddel</string>
<key>uuid</key>
<string>9519C22B-6AB8-41A1-94F6-079E0B45C147</string>
</dict>
</plist>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string># XXX Leopard-specific unless have easy way to specific alternative Python executable.
cd $TM_PROJECT_DIRECTORY/Doc
make html 2&gt;&amp;1 | pre
rescan_project</string>
<key>input</key>
<string>none</string>
<key>name</key>
<string>Build Docs</string>
<key>output</key>
<string>showAsHTML</string>
<key>uuid</key>
<string>6EF151E5-7149-4F82-8796-0CC40FE589FA</string>
</dict>
</plist>

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string># XXX TODO
# - Highlight any compiler warnings for Python code.
# - Point out if compile failed.
cd $TM_PROJECT_DIRECTORY
make -s -j2 2&gt;&amp;1 | pre
rescan_project</string>
<key>input</key>
<string>none</string>
<key>name</key>
<string>Build Python</string>
<key>output</key>
<string>showAsHTML</string>
<key>uuid</key>
<string>B545BB1B-A8E1-426C-B50A-426E78B96D38</string>
</dict>
</plist>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>open "http://bugs.python.org/issue$(cat)"</string>
<key>fallbackInput</key>
<string>word</string>
<key>input</key>
<string>selection</string>
<key>name</key>
<string>Go to Issue</string>
<key>output</key>
<string>discard</string>
<key>uuid</key>
<string>FD25A8DC-22DC-4ED4-B222-B943C8A9117D</string>
</dict>
</plist>

View File

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string># Search order:
# - Current project.
# - TM_PYTHONDEV_DOCS.
# - Online docs in development.
html_index=$TM_PROJECT_DIRECTORY/Doc/build/html/index.html
if [[ -f $html_index ]]; then
open $html_index
elif [[ $TM_PYTHONDEV_DOCS ]]; then
open $TM_PYTHONDEV_DOCS
else
open http://docs.python.org/dev/
fi</string>
<key>input</key>
<string>none</string>
<key>keyEquivalent</key>
<string>@H</string>
<key>name</key>
<string>Open Docs</string>
<key>output</key>
<string>discard</string>
<key>uuid</key>
<string>BF336FFF-E14D-4BF1-A156-71CF768AC034</string>
</dict>
</plist>

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string># XXX Worth supporting using a local copy?
# Dumb luck that an unrecognized number leads to a 0 being used.
open `printf "http://www.python.org/dev/peps/pep-%04d" $(cat)`</string>
<key>fallbackInput</key>
<string>word</string>
<key>input</key>
<string>selection</string>
<key>name</key>
<string>Open PEP</string>
<key>output</key>
<string>discard</string>
<key>uuid</key>
<string>EDBB037F-AAE3-4512-863F-D9AA82C9E51E</string>
</dict>
</plist>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>content</key>
<string>.. deprecated:: 2.6
The :mod:\`${1}\` module has been deprecated for removal in Python 3.0.
${0}</string>
<key>name</key>
<string>2 to 3 - Module Deletion (docs)</string>
<key>tabTrigger</key>
<string>2to3docdel</string>
<key>uuid</key>
<string>0568410D-EAF1-4AF3-B6DE-8AF133A91821</string>
</dict>
</plist>

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>mainMenu</key>
<dict>
<key>items</key>
<array>
<string>9519C22B-6AB8-41A1-94F6-079E0B45C147</string>
<string>0568410D-EAF1-4AF3-B6DE-8AF133A91821</string>
<string>------------------------------------</string>
<string>B545BB1B-A8E1-426C-B50A-426E78B96D38</string>
<string>6EF151E5-7149-4F82-8796-0CC40FE589FA</string>
<string>------------------------------------</string>
<string>BF336FFF-E14D-4BF1-A156-71CF768AC034</string>
<string>FD25A8DC-22DC-4ED4-B222-B943C8A9117D</string>
<string>EDBB037F-AAE3-4512-863F-D9AA82C9E51E</string>
</array>
<key>submenus</key>
<dict/>
</dict>
<key>name</key>
<string>Python-Dev</string>
<key>ordering</key>
<array>
<string>9519C22B-6AB8-41A1-94F6-079E0B45C147</string>
<string>0568410D-EAF1-4AF3-B6DE-8AF133A91821</string>
<string>B545BB1B-A8E1-426C-B50A-426E78B96D38</string>
<string>6EF151E5-7149-4F82-8796-0CC40FE589FA</string>
<string>FD25A8DC-22DC-4ED4-B222-B943C8A9117D</string>
<string>BF336FFF-E14D-4BF1-A156-71CF768AC034</string>
<string>EDBB037F-AAE3-4512-863F-D9AA82C9E51E</string>
</array>
<key>uuid</key>
<string>A932ECD1-D43A-4F57-B7FB-A1CEC3B65D20</string>
</dict>
</plist>

View File

@@ -0,0 +1,148 @@
" Auto-generated Vim syntax file for Python (trunk: r60376M).
"
" To use: copy or symlink to ~/.vim/syntax/python.vim
if exists("b:current_syntax")
finish
endif
if exists("python_highlight_all")
let python_highlight_numbers = 1
let python_highlight_builtins = 1
let python_highlight_exceptions = 1
let python_highlight_space_errors = 1
endif
syn keyword pythonStatement as assert break continue del except exec finally
syn keyword pythonStatement global lambda pass print raise return try with
syn keyword pythonStatement yield
syn keyword pythonStatement def class nextgroup=pythonFunction skipwhite
syn match pythonFunction "[a-zA-Z_][a-zA-Z0-9_]*" contained
syn keyword pythonRepeat for while
syn keyword pythonConditional if elif else
syn keyword pythonOperator and in is not or
syn keyword pythonPreCondit import from
syn match pythonComment "#.*$" contains=pythonTodo
syn keyword pythonTodo TODO FIXME XXX contained
syn region pythonString matchgroup=Normal start=+[uU]\='+ end=+'+ skip=+\\\\\|\\'+ contains=pythonEscape
syn region pythonString matchgroup=Normal start=+[uU]\="+ end=+"+ skip=+\\\\\|\\"+ contains=pythonEscape
syn region pythonString matchgroup=Normal start=+[uU]\="""+ end=+"""+ contains=pythonEscape
syn region pythonString matchgroup=Normal start=+[uU]\='''+ end=+'''+ contains=pythonEscape
syn region pythonString matchgroup=Normal start=+[uU]\=[rR]'+ end=+'+ skip=+\\\\\|\\'+
syn region pythonString matchgroup=Normal start=+[uU]\=[rR]"+ end=+"+ skip=+\\\\\|\\"+
syn region pythonString matchgroup=Normal start=+[uU]\=[rR]"""+ end=+"""+
syn region pythonString matchgroup=Normal start=+[uU]\=[rR]'''+ end=+'''+
syn match pythonEscape +\\[abfnrtv\'"\\]+ contained
syn match pythonEscape "\\\o\{1,3}" contained
syn match pythonEscape "\\x\x\{2}" contained
syn match pythonEscape "\(\\u\x\{4}\|\\U\x\{8}\)" contained
syn match pythonEscape "\\$"
if exists("python_highlight_numbers")
syn match pythonNumber "\<0x\x\+[Ll]\=\>"
syn match pythonNumber "\<\d\+[LljJ]\=\>"
syn match pythonNumber "\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"
syn match pythonNumber "\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>"
syn match pythonNumber "\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"
endif
if exists("python_highlight_builtins")
syn keyword pythonBuiltin Ellipsis False None NotImplemented True __debug__
syn keyword pythonBuiltin __import__ abs all any apply basestring bool
syn keyword pythonBuiltin buffer bytes callable chr classmethod cmp coerce
syn keyword pythonBuiltin compile complex copyright credits delattr dict
syn keyword pythonBuiltin dir divmod enumerate eval execfile exit file
syn keyword pythonBuiltin filter float frozenset getattr globals hasattr
syn keyword pythonBuiltin hash help hex id input int intern isinstance
syn keyword pythonBuiltin issubclass iter len license list locals long map
syn keyword pythonBuiltin max min object oct open ord pow property quit
syn keyword pythonBuiltin range raw_input reduce reload repr reversed round
syn keyword pythonBuiltin set setattr slice sorted staticmethod str sum
syn keyword pythonBuiltin super trunc tuple type unichr unicode vars xrange
syn keyword pythonBuiltin zip
endif
if exists("python_highlight_exceptions")
syn keyword pythonException ArithmeticError AssertionError AttributeError
syn keyword pythonException BaseException DeprecationWarning EOFError
syn keyword pythonException EnvironmentError Exception FloatingPointError
syn keyword pythonException FutureWarning GeneratorExit IOError ImportError
syn keyword pythonException ImportWarning IndentationError IndexError
syn keyword pythonException KeyError KeyboardInterrupt LookupError
syn keyword pythonException MemoryError NameError NotImplementedError
syn keyword pythonException OSError OverflowError PendingDeprecationWarning
syn keyword pythonException ReferenceError RuntimeError RuntimeWarning
syn keyword pythonException StandardError StopIteration SyntaxError
syn keyword pythonException SyntaxWarning SystemError SystemExit TabError
syn keyword pythonException TypeError UnboundLocalError UnicodeDecodeError
syn keyword pythonException UnicodeEncodeError UnicodeError
syn keyword pythonException UnicodeTranslateError UnicodeWarning
syn keyword pythonException UserWarning ValueError Warning
syn keyword pythonException ZeroDivisionError
endif
if exists("python_highlight_space_errors")
syn match pythonSpaceError display excludenl "\S\s\+$"ms=s+1
syn match pythonSpaceError display " \+\t"
syn match pythonSpaceError display "\t\+ "
endif
hi def link pythonStatement Statement
hi def link pythonStatement Statement
hi def link pythonFunction Function
hi def link pythonRepeat Repeat
hi def link pythonConditional Conditional
hi def link pythonOperator Operator
hi def link pythonPreCondit PreCondit
hi def link pythonComment Comment
hi def link pythonTodo Todo
hi def link pythonString String
hi def link pythonEscape Special
hi def link pythonEscape Special
if exists("python_highlight_numbers")
hi def link pythonNumber Number
endif
if exists("python_highlight_builtins")
hi def link pythonBuiltin Function
endif
if exists("python_highlight_exceptions")
hi def link pythonException Exception
endif
if exists("python_highlight_space_errors")
hi def link pythonSpaceError Error
endif
" Uncomment the 'minlines' statement line and comment out the 'maxlines'
" statement line; changes behaviour to look at least 2000 lines previously for
" syntax matches instead of at most 200 lines
syn sync match pythonSync grouphere NONE "):$"
syn sync maxlines=200
"syn sync minlines=2000
let b:current_syntax = "python"

View File

@@ -0,0 +1,62 @@
"""Test file for syntax highlighting of editors.
Meant to cover a wide range of different types of statements and expressions.
Not necessarily sensical or comprehensive (assume that if one exception is
highlighted that all are, for instance).
Extraneous trailing whitespace can't be tested because of svn pre-commit hook
checks for such things.
"""
# Comment
# OPTIONAL: XXX catch your attention
# Statements
from __future__ import with_statement # Import
from sys import path as thing
assert True # keyword
def foo(): # function definition
return []
class Bar(object): # Class definition
def __enter__(self):
pass
def __exit__(self, *args):
pass
foo() # UNCOLOURED: function call
while False: # 'while'
continue
for x in foo(): # 'for'
break
with Bar() as stuff:
pass
if False: pass # 'if'
elif False: pass
else: pass
# Constants
'single-quote', u'unicode' # Strings of all kinds; prefixes not highlighted
"double-quote"
"""triple double-quote"""
'''triple single-quote'''
r'raw'
ur'unicode raw'
'escape\n'
'\04' # octal
'\xFF' # hex
'\u1111' # unicode character
1 # Integral
1L
1.0 # Float
.1
1+2j # Complex
# Expressions
1 and 2 or 3 # Boolean operators
2 < 3 # UNCOLOURED: comparison operators
spam = 42 # UNCOLOURED: assignment
2 + 3 # UNCOLOURED: number operators
[] # UNCOLOURED: list
{} # UNCOLOURED: dict
(1,) # UNCOLOURED: tuple
all # Built-in functions
GeneratorExit # Exceptions

View File

@@ -0,0 +1,227 @@
from __future__ import with_statement
import keyword
import exceptions
import __builtin__
from string import Template
from sys import subversion
comment_header = '''" Auto-generated Vim syntax file for Python (%s: r%s).
"
" To use: copy or symlink to ~/.vim/syntax/python.vim'''
statement_header = """
if exists("b:current_syntax")
finish
endif"""
statement_footer = '''
" Uncomment the 'minlines' statement line and comment out the 'maxlines'
" statement line; changes behaviour to look at least 2000 lines previously for
" syntax matches instead of at most 200 lines
syn sync match pythonSync grouphere NONE "):$"
syn sync maxlines=200
"syn sync minlines=2000
let b:current_syntax = "python"'''
looping = ('for', 'while')
conditionals = ('if', 'elif', 'else')
boolean_ops = ('and', 'in', 'is', 'not', 'or')
import_stmts = ('import', 'from')
object_defs = ('def', 'class')
exception_names = sorted(exc for exc in dir(exceptions)
if not exc.startswith('__'))
# Need to include functions that start with '__' (e.g., __import__), but
# nothing that comes with modules (e.g., __name__), so just exclude anything in
# the 'exceptions' module since we want to ignore exceptions *and* what any
# module would have
builtin_names = sorted(builtin for builtin in dir(__builtin__)
if builtin not in dir(exceptions))
escapes = (r'+\\[abfnrtv\'"\\]+', r'"\\\o\{1,3}"', r'"\\x\x\{2}"',
r'"\(\\u\x\{4}\|\\U\x\{8}\)"', r'"\\$"')
todos = ("TODO", "FIXME", "XXX")
# XXX codify?
numbers = (r'"\<0x\x\+[Ll]\=\>"', r'"\<\d\+[LljJ]\=\>"',
'"\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"',
'"\<\d\+\.\([eE][+-]\=\d\+\)\=[jJ]\=\>"',
'"\<\d\+\.\d\+\([eE][+-]\=\d\+\)\=[jJ]\=\>"')
contained = lambda x: "%s contained" % x
def str_regexes():
"""Generator to yield various combinations of strings regexes"""
regex_template = Template('matchgroup=Normal ' +
'start=+[uU]\=${raw}${sep}+ ' +
'end=+${sep}+ ' +
'${skip} ' +
'${contains}')
skip_regex = Template(r'skip=+\\\\\|\\${sep}+')
for raw in ('', '[rR]'):
for separator in ("'", '"', '"""', "'''"):
if len(separator) == 1:
skip = skip_regex.substitute(sep=separator)
else:
skip = ''
contains = 'contains=pythonEscape' if not raw else ''
yield regex_template.substitute(raw=raw, sep=separator, skip=skip,
contains = contains)
space_errors = (r'excludenl "\S\s\+$"ms=s+1', r'" \+\t"', r'"\t\+ "')
statements = (
('',
# XXX Might need to change pythonStatement since have
# specific Repeat, Conditional, Operator, etc. for 'while',
# etc.
[("Statement", "pythonStatement", "keyword",
(kw for kw in keyword.kwlist
if kw not in (looping + conditionals + boolean_ops +
import_stmts + object_defs))
),
("Statement", "pythonStatement", "keyword",
(' '.join(object_defs) +
' nextgroup=pythonFunction skipwhite')),
("Function","pythonFunction", "match",
contained('"[a-zA-Z_][a-zA-Z0-9_]*"')),
("Repeat", "pythonRepeat", "keyword", looping),
("Conditional", "pythonConditional", "keyword",
conditionals),
("Operator", "pythonOperator", "keyword", boolean_ops),
("PreCondit", "pythonPreCondit", "keyword", import_stmts),
("Comment", "pythonComment", "match",
'"#.*$" contains=pythonTodo'),
("Todo", "pythonTodo", "keyword",
contained(' '.join(todos))),
("String", "pythonString", "region", str_regexes()),
("Special", "pythonEscape", "match",
(contained(esc) for esc in escapes
if not '$' in esc)),
("Special", "pythonEscape", "match", r'"\\$"'),
]
),
("python_highlight_numbers",
[("Number", "pythonNumber", "match", numbers)]
),
("python_highlight_builtins",
[("Function", "pythonBuiltin", "keyword", builtin_names)]
),
("python_highlight_exceptions",
[("Exception", "pythonException", "keyword",
exception_names)]
),
("python_highlight_space_errors",
[("Error", "pythonSpaceError", "match",
("display " + err for err in space_errors))]
)
)
def syn_prefix(type_, kind):
return 'syn %s %s ' % (type_, kind)
def fill_stmt(iterable, fill_len):
"""Yield a string that fills at most fill_len characters with strings
returned by 'iterable' and separated by a space"""
# Deal with trailing char to handle ' '.join() calculation
fill_len += 1
overflow = None
it = iter(iterable)
while True:
buffer_ = []
total_len = 0
if overflow:
buffer_.append(overflow)
total_len += len(overflow) + 1
overflow = None
while total_len < fill_len:
try:
new_item = it.next()
buffer_.append(new_item)
total_len += len(new_item) + 1
except StopIteration:
if buffer_:
break
if overflow:
yield overflow
return
if total_len > fill_len:
overflow = buffer_.pop()
total_len -= len(overflow) - 1
ret = ' '.join(buffer_)
assert len(ret) <= fill_len
yield ret
FILL = 80
def main(file_path):
with open(file_path, 'w') as FILE:
# Comment for file
print>>FILE, comment_header % subversion[1:]
print>>FILE, ''
# Statements at start of file
print>>FILE, statement_header
print>>FILE, ''
# Generate case for python_highlight_all
print>>FILE, 'if exists("python_highlight_all")'
for statement_var, statement_parts in statements:
if statement_var:
print>>FILE, ' let %s = 1' % statement_var
else:
print>>FILE, 'endif'
print>>FILE, ''
# Generate Python groups
for statement_var, statement_parts in statements:
if statement_var:
print>>FILE, 'if exists("%s")' % statement_var
indent = ' '
else:
indent = ''
for colour_group, group, type_, arguments in statement_parts:
if not isinstance(arguments, basestring):
prefix = syn_prefix(type_, group)
if type_ == 'keyword':
stmt_iter = fill_stmt(arguments,
FILL - len(prefix) - len(indent))
try:
while True:
print>>FILE, indent + prefix + stmt_iter.next()
except StopIteration:
print>>FILE, ''
else:
for argument in arguments:
print>>FILE, indent + prefix + argument
else:
print>>FILE, ''
else:
print>>FILE, indent + syn_prefix(type_, group) + arguments
print>>FILE, ''
else:
if statement_var:
print>>FILE, 'endif'
print>>FILE, ''
print>>FILE, ''
# Associating Python group with Vim colour group
for statement_var, statement_parts in statements:
if statement_var:
print>>FILE, ' if exists("%s")' % statement_var
indent = ' '
else:
indent = ' '
for colour_group, group, type_, arguments in statement_parts:
print>>FILE, (indent + "hi def link %s %s" %
(group, colour_group))
else:
if statement_var:
print>>FILE, ' endif'
print>>FILE, ''
# Statements at the end of the file
print>>FILE, statement_footer
if __name__ == '__main__':
main("python.vim")

View File

@@ -0,0 +1,89 @@
" vimrc file for following the coding standards specified in PEP 7 & 8.
"
" To use this file, source it in your own personal .vimrc file (``source
" <filename>``) or, if you don't have a .vimrc file, you can just symlink to it
" (``ln -s <this file> ~/.vimrc``). All options are protected by autocmds
" (read below for an explanation of the command) so blind sourcing of this file
" is safe and will not affect your settings for non-Python or non-C files.
"
"
" All setting are protected by 'au' ('autocmd') statements. Only files ending
" in .py or .pyw will trigger the Python settings while files ending in *.c or
" *.h will trigger the C settings. This makes the file "safe" in terms of only
" adjusting settings for Python and C files.
"
" Only basic settings needed to enforce the style guidelines are set.
" Some suggested options are listed but commented out at the end of this file.
" Number of spaces to use for an indent.
" This will affect Ctrl-T and 'autoindent'.
" Python: 4 spaces
" C: 8 spaces (pre-existing files) or 4 spaces (new files)
au BufRead,BufNewFile *.py,*pyw set shiftwidth=4
au BufRead *.c,*.h set shiftwidth=8
au BufNewFile *.c,*.h set shiftwidth=4
" Number of spaces that a pre-existing tab is equal to.
" For the amount of space used for a new tab use shiftwidth.
" Python: 8
" C: 8
au BufRead,BufNewFile *py,*pyw,*.c,*.h set tabstop=8
" Replace tabs with the equivalent number of spaces.
" Also have an autocmd for Makefiles since they require hard tabs.
" Python: yes
" C: no
" Makefile: no
au BufRead,BufNewFile *.py,*.pyw set expandtab
au BufRead,BufNewFile *.c,*.h set noexpandtab
au BufRead,BufNewFile Makefile* set noexpandtab
" Use the below highlight group when displaying bad whitespace is desired
highlight BadWhitespace ctermbg=red guibg=red
" Display tabs at the beginning of a line in Python mode as bad.
au BufRead,BufNewFile *.py,*.pyw match BadWhitespace /^\t\+/
" Make trailing whitespace be flagged as bad.
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
" Wrap text after a certain number of characters
" Python: 79
" C: 79
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h set textwidth=79
" Turn off settings in 'formatoptions' relating to comment formatting.
" - c : do not automatically insert the comment leader when wrapping based on
" 'textwidth'
" - o : do not insert the comment leader when using 'o' or 'O' from command mode
" - r : do not insert the comment leader when hitting <Enter> in insert mode
" Python: not needed
" C: prevents insertion of '*' at the beginning of every line in a comment
au BufRead,BufNewFile *.c,*.h set formatoptions-=c formatoptions-=o formatoptions-=r
" Use UNIX (\n) line endings.
" Only used for new files so as to not force existing files to change their
" line endings.
" Python: yes
" C: yes
au BufNewFile *.py,*.pyw,*.c,*.h set fileformat=unix
" ----------------------------------------------------------------------------
" The following section contains suggested settings. While in no way required
" to meet coding standards, they are helpful.
" Set the default file encoding to UTF-8: ``set encoding=utf-8``
" Puts a marker at the beginning of the file to differentiate between UTF and
" UCS encoding (WARNING: can trick shells into thinking a text file is actually
" a binary file when executing the text file): ``set bomb``
" For full syntax highlighting:
"``let python_highlight_all=1``
"``syntax on``
" Automatically indent based on file type: ``filetype indent on``
" Keep indentation level from previous line: ``set autoindent``
" Folding based on indentation: ``set foldmethod=indent``

View File

@@ -0,0 +1,296 @@
#!/bin/sh
## Script to build and test the latest python from svn. It basically
## does this:
## svn up ; ./configure ; make ; make test ; make install ; cd Doc ; make
##
## Logs are kept and rsync'ed to the host. If there are test failure(s),
## information about the failure(s) is mailed.
##
## This script is run on the PSF's machine as user neal via crontab.
##
## Yes, this script would probably be easier in python, but then
## there's a bootstrap problem. What if Python doesn't build?
##
## This script should be fairly clean Bourne shell, ie not too many
## bash-isms. We should try to keep it portable to other Unixes.
## Even though it will probably only run on Linux. I'm sure there are
## several GNU-isms currently (date +%s and readlink).
##
## Perhaps this script should be broken up into 2 (or more) components.
## Building doc is orthogonal to the rest of the python build/test.
##
## FIXME: we should detect test hangs (eg, if they take more than 45 minutes)
## FIXME: we should run valgrind
## FIXME: we should run code coverage
## Utilities invoked in this script include:
## basename, date, dirname, expr, grep, readlink, uname
## cksum, make, mutt, rsync, svn
## remember where did we started from
DIR=`dirname $0`
if [ "$DIR" = "" ]; then
DIR="."
fi
## make directory absolute
DIR=`readlink -f $DIR`
FULLPATHNAME="$DIR/`basename $0`"
## we want Misc/..
DIR=`dirname $DIR`
## Configurable options
FAILURE_SUBJECT="Python Regression Test Failures"
#FAILURE_MAILTO="YOUR_ACCOUNT@gmail.com"
FAILURE_MAILTO="python-checkins@python.org"
#FAILURE_CC="optional--uncomment and set to desired address"
REMOTE_SYSTEM="neal@dinsdale.python.org"
REMOTE_DIR="/data/ftp.python.org/pub/www.python.org/doc/current"
REMOTE_DIR_DIST="/data/ftp.python.org/pub/python/doc/current"
RESULT_FILE="$DIR/build/index.html"
INSTALL_DIR="/tmp/python-test-2.6/local"
RSYNC_OPTS="-aC -e ssh"
# Always run the installed version of Python.
PYTHON=$INSTALL_DIR/bin/python
# Python options and regression test program that should always be run.
REGRTEST_ARGS="-E -tt $INSTALL_DIR/lib/python2.6/test/regrtest.py"
REFLOG="build/reflog.txt.out"
# These tests are not stable and falsely report leaks sometimes.
# The entire leak report will be mailed if any test not in this list leaks.
# Note: test_XXX (none currently) really leak, but are disabled
# so we don't send spam. Any test which really leaks should only
# be listed here if there are also test cases under Lib/test/leakers.
LEAKY_TESTS="test_(asynchat|cmd_line|docxmlrpc|dumbdbm|file|ftplib|httpservers|imaplib|popen2|socket|smtplib|sys|telnetlib|threadedtempfile|threading|threadsignals|urllib2_localnet|xmlrpc)"
# Skip these tests altogether when looking for leaks. These tests
# do not need to be stored above in LEAKY_TESTS too.
# test_compiler almost never finishes with the same number of refs
# since it depends on other modules, skip it.
# test_logging causes hangs, skip it.
LEAKY_SKIPS="-x test_compiler test_logging"
# Change this flag to "yes" for old releases to only update/build the docs.
BUILD_DISABLED="yes"
## utility functions
current_time() {
date +%s
}
update_status() {
now=`current_time`
time=`expr $now - $3`
echo "<li><a href=\"$2\">$1</a> <font size=\"-1\">($time seconds)</font></li>" >> $RESULT_FILE
}
place_summary_first() {
testf=$1
sed -n '/^[0-9][0-9]* tests OK\./,$p' < $testf \
| egrep -v '\[[0-9]+ refs\]' > $testf.tmp
echo "" >> $testf.tmp
cat $testf >> $testf.tmp
mv $testf.tmp $testf
}
count_failures () {
testf=$1
n=`grep -ic " failed:" $testf`
if [ $n -eq 1 ] ; then
n=`grep " failed:" $testf | sed -e 's/ .*//'`
fi
echo $n
}
mail_on_failure() {
if [ "$NUM_FAILURES" != "0" ]; then
dest=$FAILURE_MAILTO
# FAILURE_CC is optional.
if [ "$FAILURE_CC" != "" ]; then
dest="$dest -c $FAILURE_CC"
fi
if [ "x$3" != "x" ] ; then
(echo "More important issues:"
echo "----------------------"
egrep -v "$3" < $2
echo ""
echo "Less important issues:"
echo "----------------------"
egrep "$3" < $2)
else
cat $2
fi | mutt -s "$FAILURE_SUBJECT $1 ($NUM_FAILURES)" $dest
fi
}
## setup
cd $DIR
mkdir -p build
rm -f $RESULT_FILE build/*.out
rm -rf $INSTALL_DIR
## create results file
TITLE="Automated Python Build Results"
echo "<html>" >> $RESULT_FILE
echo " <head>" >> $RESULT_FILE
echo " <title>$TITLE</title>" >> $RESULT_FILE
echo " <meta http-equiv=\"refresh\" content=\"43200\">" >> $RESULT_FILE
echo " </head>" >> $RESULT_FILE
echo "<body>" >> $RESULT_FILE
echo "<h2>Automated Python Build Results</h2>" >> $RESULT_FILE
echo "<table>" >> $RESULT_FILE
echo " <tr>" >> $RESULT_FILE
echo " <td>Built on:</td><td>`date`</td>" >> $RESULT_FILE
echo " </tr><tr>" >> $RESULT_FILE
echo " <td>Hostname:</td><td>`uname -n`</td>" >> $RESULT_FILE
echo " </tr><tr>" >> $RESULT_FILE
echo " <td>Platform:</td><td>`uname -srmpo`</td>" >> $RESULT_FILE
echo " </tr>" >> $RESULT_FILE
echo "</table>" >> $RESULT_FILE
echo "<ul>" >> $RESULT_FILE
## update, build, and test
ORIG_CHECKSUM=`cksum $FULLPATHNAME`
F=svn-update.out
start=`current_time`
svn update >& build/$F
err=$?
update_status "Updating" "$F" $start
if [ $err = 0 -a "$BUILD_DISABLED" != "yes" ]; then
## FIXME: we should check if this file has changed.
## If it has changed, we should re-run the script to pick up changes.
if [ "$ORIG_CHECKSUM" != "$ORIG_CHECKSUM" ]; then
exec $FULLPATHNAME $@
fi
F=svn-stat.out
start=`current_time`
svn stat >& build/$F
## ignore some of the diffs
NUM_DIFFS=`egrep -vc '^. (@test|db_home|Lib/test/(regrtest\.py|db_home))$' build/$F`
update_status "svn stat ($NUM_DIFFS possibly important diffs)" "$F" $start
F=configure.out
start=`current_time`
./configure --prefix=$INSTALL_DIR --with-pydebug >& build/$F
err=$?
update_status "Configuring" "$F" $start
if [ $err = 0 ]; then
F=make.out
start=`current_time`
make >& build/$F
err=$?
warnings=`grep warning build/$F | egrep -vc "te?mpnam(_r|)' is dangerous,"`
update_status "Building ($warnings warnings)" "$F" $start
if [ $err = 0 ]; then
## make install
F=make-install.out
start=`current_time`
make install >& build/$F
update_status "Installing" "$F" $start
if [ ! -x $PYTHON ]; then
ln -s ${PYTHON}2.* $PYTHON
fi
## make and run basic tests
F=make-test.out
start=`current_time`
$PYTHON $REGRTEST_ARGS -u urlfetch >& build/$F
NUM_FAILURES=`count_failures build/$F`
place_summary_first build/$F
update_status "Testing basics ($NUM_FAILURES failures)" "$F" $start
mail_on_failure "basics" build/$F
F=make-test-opt.out
start=`current_time`
$PYTHON -O $REGRTEST_ARGS -u urlfetch >& build/$F
NUM_FAILURES=`count_failures build/$F`
place_summary_first build/$F
update_status "Testing opt ($NUM_FAILURES failures)" "$F" $start
mail_on_failure "opt" build/$F
## run the tests looking for leaks
F=make-test-refleak.out
start=`current_time`
## ensure that the reflog exists so the grep doesn't fail
touch $REFLOG
$PYTHON $REGRTEST_ARGS -R 4:3:$REFLOG -u network,urlfetch $LEAKY_SKIPS >& build/$F
LEAK_PAT="($LEAKY_TESTS|sum=0)"
NUM_FAILURES=`egrep -vc "$LEAK_PAT" $REFLOG`
place_summary_first build/$F
update_status "Testing refleaks ($NUM_FAILURES failures)" "$F" $start
mail_on_failure "refleak" $REFLOG "$LEAK_PAT"
## now try to run all the tests
F=make-testall.out
start=`current_time`
## skip curses when running from cron since there's no terminal
## skip sound since it's not setup on the PSF box (/dev/dsp)
$PYTHON $REGRTEST_ARGS -uall -x test_curses test_linuxaudiodev test_ossaudiodev >& build/$F
NUM_FAILURES=`count_failures build/$F`
place_summary_first build/$F
update_status "Testing all except curses and sound ($NUM_FAILURES failures)" "$F" $start
mail_on_failure "all" build/$F
fi
fi
fi
## make doc
cd $DIR/Doc
F="make-doc.out"
start=`current_time`
# XXX(nnorwitz): For now, keep the code that checks for a conflicted file until
# after the first release of 2.6a1 or 3.0a1. At that point, it will be clear
# if there will be a similar problem with the new doc system.
# Doc/commontex/boilerplate.tex is expected to always have an outstanding
# modification for the date. When a release is cut, a conflict occurs.
# This allows us to detect this problem and not try to build the docs
# which will definitely fail with a conflict.
#CONFLICTED_FILE=commontex/boilerplate.tex
#conflict_count=`grep -c "<<<" $CONFLICTED_FILE`
make clean
conflict_count=0
if [ $conflict_count != 0 ]; then
echo "Conflict detected in $CONFLICTED_FILE. Doc build skipped." > ../build/$F
err=1
else
make checkout update html >& ../build/$F
err=$?
fi
update_status "Making doc" "$F" $start
if [ $err != 0 ]; then
NUM_FAILURES=1
mail_on_failure "doc" ../build/$F
fi
F="make-doc-dist.out"
start=`current_time`
if [ $conflict_count == 0 ]; then
make dist >& ../build/$F
err=$?
fi
update_status "Making downloadable doc" "$F" $start
if [ $err != 0 ]; then
NUM_FAILURES=1
mail_on_failure "doc dist" ../build/$F
fi
echo "</ul>" >> $RESULT_FILE
echo "</body>" >> $RESULT_FILE
echo "</html>" >> $RESULT_FILE
## copy results
rsync $RSYNC_OPTS build/html/* $REMOTE_SYSTEM:$REMOTE_DIR
rsync $RSYNC_OPTS dist/* $REMOTE_SYSTEM:$REMOTE_DIR_DIST
cd ../build
rsync $RSYNC_OPTS index.html *.out $REMOTE_SYSTEM:$REMOTE_DIR/results/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,250 @@
Developer Log
=============
This file is a running log of developers given permissions on SourceForge.
The purpose is to provide some institutional memory of who was given access
and why.
The first entry starts in April 2005. In keeping with the style of
Misc/NEWS, newer entries should be added to the top. Any markup should
be in the form of ReST. Entries should include the initials of the
project admin who made the change or granted access. Feel free to revise
the format to accommodate documentation needs as they arise.
Permissions History
-------------------
- Tarek Ziadé as given SVN access on Decmeber 21 2008 by NCN,
for maintenance of distutils.
- Hirokazu Yamamoto was given SVN access on August 12 2008 by MvL,
for contributions to the Windows build.
- Antoine Pitrou was given SVN access on July 16 2008, by recommendation
from GvR, for general contributions to Python.
- Jesse Noller was given SVN access on 16 June 2008 by GFB,
for work on the multiprocessing module.
- Gregor Lingl was given SVN access on 10 June 2008 by MvL,
for work on the turtle module.
- Robert Schuppenies was given SVN access on 21 May 2008 by MvL,
for GSoC contributions.
- Rodrigo Bernardo Pimentel was given SVN access on 29 April 2008 by MvL,
for GSoC contributions.
- Heiko Weinen was given SVN access on 29 April 2008 by MvL,
for GSoC contributions.
- Jesus Cea was was given SVN access on 24 April 2008 by MvL,
for maintenance of bsddb.
- Guilherme Polo was given SVN access on 24 April 2008 by MvL,
for GSoC contributions.
- Thomas Lee was given SVN access on 21 April 2008 by NCN,
for work on branches (ast/optimizer related).
- Jeroen Ruigrok van der Werven was given SVN access on 12 April 2008
by GFB, for documentation work.
- Josiah Carlson was given SVN access on 26 March 2008 by GFB,
for work on asyncore/asynchat.
- Benjamin Peterson was given SVN access on 25 March 2008 by GFB,
for bug triage work.
- Jerry Seutter was given SVN access on 20 March 2008 by BAC, for
general contributions to Python.
- Jeff Rush was given SVN access on 18 March 2008 by AMK, for Distutils work.
- David Wolever was given SVN access on 17 March 2008 by MvL,
for 2to3 work.
- Trent Nelson was given SVN access on 17 March 2008 by MvL,
for general contributions to Python.
- Mark Dickinson was given SVN access on 6 January 2008 by Facundo
Batista for his work on mathemathics and number related issues.
- Amaury Forgeot d'Arc was given SVN access on 9 November 2007 by MvL,
for general contributions to Python.
- Christian Heimes was given SVN access on 31 October 2007 by MvL,
for general contributions to Python.
- Chris Monson was given SVN access on 20 October 2007 by NCN,
for his work on editing PEPs.
- Bill Janssen was given SVN access on 28 August 2007 by NCN,
for his work on the SSL module and other things related to (SSL) sockets.
- Jeffrey Yasskin was given SVN access on 9 August 2007 by NCN,
for his work on PEPs and other general patches.
- Senthil Kumaran was given SVN access on 16 June 2007 by MvL,
for his Summer-of-Code project, mentored by Skip Montanaro.
- Alexandre Vassalotti was given SVN access on 21 May 2007 by MvL,
for his Summer-of-Code project, mentored by Brett Cannon.
- Travis Oliphant was given SVN access on 17 Apr 2007 by MvL,
for implementing the extended buffer protocol.
- Ziga Seilnacht was given SVN access on 09 Mar 2007 by MvL,
for general maintenance.
- Pete Shinners was given SVN access on 04 Mar 2007 by NCN,
for PEP 3101 work in the sandbox.
- Pat Maupin and Eric V. Smith were given SVN access on 28 Feb 2007 by NCN,
for PEP 3101 work in the sandbox.
- Steven Bethard (SF name "bediviere") added to the SourceForge Python
project 26 Feb 2007, by NCN, as a tracker tech.
- Josiah Carlson (SF name "josiahcarlson") added to the SourceForge Python
project 06 Jan 2007, by NCN, as a tracker tech. He will maintain asyncore.
- Collin Winter was given SVN access on 05 Jan 2007 by NCN, for PEP
update access.
- Lars Gustaebel was given SVN access on 20 Dec 2006 by NCN, for tarfile.py
related work.
- 2006 Summer of Code entries: SoC developers are expected to work
primarily in nondist/sandbox or on a branch of their own, and will
have their work reviewed before changes are accepted into the trunk.
- Matt Fleming was added on 25 May 2006 by AMK; he'll be working on
enhancing the Python debugger.
- Jackilyn Hoxworth was added on 25 May 2006 by AMK; she'll be adding logging
to the standard library.
- Mateusz Rukowicz was added on 30 May 2006 by AMK; he'll be
translating the decimal module into C.
- SVN access granted to the "Need for Speed" Iceland sprint attendees,
between May 17 and 21, 2006, by Tim Peters. All work is to be done
in new sandbox projects or on new branches, with merging to the
trunk as approved:
Andrew Dalke
Christian Tismer
Jack Diederich
John Benediktsson
Kristján V. Jónsson
Martin Blais
Richard Emslie
Richard Jones
Runar Petursson
Steve Holden
Richard M. Tew
- Steven Bethard was given SVN access on 27 Apr 2006 by DJG, for PEP
update access.
- Talin was given SVN access on 27 Apr 2006 by DJG, for PEP update
access.
- George Yoshida (SF name "quiver") added to the SourceForge Python
project 14 Apr 2006, by Tim Peters, as a tracker admin. See
contemporaneous python-checkins thread with the unlikely Subject:
r45329 - python/trunk/Doc/whatsnew/whatsnew25.tex
- Ronald Oussoren was given SVN access on 3 Mar 2006 by NCN, for Mac
related work.
- Bob Ippolito was given SVN access on 2 Mar 2006 by NCN, for Mac
related work.
- Nick Coghlan requested CVS access so he could update his PEP directly.
Granted by GvR on 16 Oct 2005.
- Added two new developers for the Summer of Code project. 8 July 2005
by RDH. Andrew Kuchling will be mentoring Gregory K Johnson for a
project to enhance mailbox. Brett Cannon requested access for Flovis
Bruynooghe (sirolf) to work on pstats, profile, and hotshot. Both users
are expected to work primarily in nondist/sandbox and have their work
reviewed before making updates to active code.
- Georg Brandl was given SF tracker permissions on 28 May 2005
by RDH. Since the beginning of 2005, he has been active in discussions
on python-dev and has submitted a dozen patch reviews. The permissions
add the ability to change tracker status and to attach patches. On
3 June 2005, this was expanded by RDH to include checkin permissions.
- Terry Reedy was given SF tracker permissions on 7 Apr 2005 by RDH.
- Nick Coghlan was given SF tracker permissions on 5 Apr 2005 by RDH.
For several months, he has been active in reviewing and contributing
patches. The added permissions give him greater flexibility in
working with the tracker.
- Eric Price was made a developer on 2 May 2003 by TGP. This was
specifically to work on the new ``decimal`` package, which lived in
``nondist/sandbox/decimal/`` at the time.
- Eric S. Raymond was made a developer on 2 Jul 2000 by TGP, for general
library work. His request is archived here:
http://mail.python.org/pipermail/python-dev/2000-July/005314.html
Permissions Dropped on Request
------------------------------
- Roy Smith, Matt Fleming and Richard Emslie sent drop requests.
4 Aug 2008 GFB
- Per note from Andrew Kuchling, the permissions for Gregory K Johnson
and the Summer Of Code project are no longer needed. 4 Aug 2008 GFB
- Per note from Andrew Kuchling, the permissions for Gregory K Johnson
and the Summer Of Code project are no longer needed. AMK will make
any future checkins directly. 16 Oct 2005 RDH
- Johannes Gijsbers sent a drop request. 27 July 2005 RDH
- Flovis Bruynooghe sent a drop request. 14 July 2005 RDH
- Paul Prescod sent a drop request. 30 Apr 2005 RDH
- Finn Bock sent a drop request. 13 Apr 2005 RDH
- Eric Price sent a drop request. 10 Apr 2005 RDH
- Irmen de Jong requested dropping CVS access while keeping tracker
access. 10 Apr 2005 RDH
- Moshe Zadka and Ken Manheimer sent drop requests. 8 Apr 2005 by RDH
- Steve Holden, Gerhard Haring, and David Cole sent email stating that
they no longer use their access. 7 Apr 2005 RDH
Permissions Dropped after Loss of Contact
-----------------------------------------
- Several unsuccessful efforts were made to contact Charles G Waldman.
Removed on 8 Apr 2005 by RDH.
Initials of Project Admins
--------------------------
GvR: Guido van Rossum
NCN: Neal Norwitz
RDH: Raymond Hettinger
TGP: Tim Peters
DJG: David Goodger
MvL: Martin v. Loewis
GFB: Georg Brandl

View File

@@ -0,0 +1,117 @@
#! /usr/bin/env python
"""Find the maximum recursion limit that prevents interpreter termination.
This script finds the maximum safe recursion limit on a particular
platform. If you need to change the recursion limit on your system,
this script will tell you a safe upper bound. To use the new limit,
call sys.setrecursionlimit().
This module implements several ways to create infinite recursion in
Python. Different implementations end up pushing different numbers of
C stack frames, depending on how many calls through Python's abstract
C API occur.
After each round of tests, it prints a message:
"Limit of NNNN is fine".
The highest printed value of "NNNN" is therefore the highest potentially
safe limit for your system (which depends on the OS, architecture, but also
the compilation flags). Please note that it is practically impossible to
test all possible recursion paths in the interpreter, so the results of
this test should not be trusted blindly -- although they give a good hint
of which values are reasonable.
NOTE: When the C stack space allocated by your system is exceeded due
to excessive recursion, exact behaviour depends on the platform, although
the interpreter will always fail in a likely brutal way: either a
segmentation fault, a MemoryError, or just a silent abort.
NB: A program that does not use __methods__ can set a higher limit.
"""
import sys
import itertools
class RecursiveBlowup1:
def __init__(self):
self.__init__()
def test_init():
return RecursiveBlowup1()
class RecursiveBlowup2:
def __repr__(self):
return repr(self)
def test_repr():
return repr(RecursiveBlowup2())
class RecursiveBlowup4:
def __add__(self, x):
return x + self
def test_add():
return RecursiveBlowup4() + RecursiveBlowup4()
class RecursiveBlowup5:
def __getattr__(self, attr):
return getattr(self, attr)
def test_getattr():
return RecursiveBlowup5().attr
class RecursiveBlowup6:
def __getitem__(self, item):
return self[item - 2] + self[item - 1]
def test_getitem():
return RecursiveBlowup6()[5]
def test_recurse():
return test_recurse()
def test_cpickle(_cache={}):
try:
import cPickle
except ImportError:
print "cannot import cPickle, skipped!"
return
l = None
for n in itertools.count():
try:
l = _cache[n]
continue # Already tried and it works, let's save some time
except KeyError:
for i in range(100):
l = [l]
cPickle.dumps(l, protocol=-1)
_cache[n] = l
def check_limit(n, test_func_name):
sys.setrecursionlimit(n)
if test_func_name.startswith("test_"):
print test_func_name[5:]
else:
print test_func_name
test_func = globals()[test_func_name]
try:
test_func()
# AttributeError can be raised because of the way e.g. PyDict_GetItem()
# silences all exceptions and returns NULL, which is usually interpreted
# as "missing attribute".
except (RuntimeError, AttributeError):
pass
else:
print "Yikes!"
limit = 1000
while 1:
check_limit(limit, "test_recurse")
check_limit(limit, "test_add")
check_limit(limit, "test_repr")
check_limit(limit, "test_init")
check_limit(limit, "test_getattr")
check_limit(limit, "test_getitem")
check_limit(limit, "test_cpickle")
print "Limit of %d is fine" % limit
limit = limit + 100

View File

@@ -0,0 +1,153 @@
# -*- ksh -*-
#
# If you use the GNU debugger gdb to debug the Python C runtime, you
# might find some of the following commands useful. Copy this to your
# ~/.gdbinit file and it'll get loaded into gdb automatically when you
# start it up. Then, at the gdb prompt you can do things like:
#
# (gdb) pyo apyobjectptr
# <module 'foobar' (built-in)>
# refcounts: 1
# address : 84a7a2c
# $1 = void
# (gdb)
# Prints a representation of the object to stderr, along with the
# number of reference counts it current has and the hex address the
# object is allocated at. The argument must be a PyObject*
define pyo
print _PyObject_Dump($arg0)
end
# Prints a representation of the object to stderr, along with the
# number of reference counts it current has and the hex address the
# object is allocated at. The argument must be a PyGC_Head*
define pyg
print _PyGC_Dump($arg0)
end
# print the local variables of the current frame
define pylocals
set $_i = 0
while $_i < f->f_nlocals
if f->f_localsplus + $_i != 0
set $_names = co->co_varnames
set $_name = PyString_AsString(PyTuple_GetItem($_names, $_i))
printf "%s:\n", $_name
# side effect of calling _PyObject_Dump is to dump the object's
# info - assigning just prevents gdb from printing the
# NULL return value
set $_val = _PyObject_Dump(f->f_localsplus[$_i])
end
set $_i = $_i + 1
end
end
# A rewrite of the Python interpreter's line number calculator in GDB's
# command language
define lineno
set $__continue = 1
set $__co = f->f_code
set $__lasti = f->f_lasti
set $__sz = ((PyStringObject *)$__co->co_lnotab)->ob_size/2
set $__p = (unsigned char *)((PyStringObject *)$__co->co_lnotab)->ob_sval
set $__li = $__co->co_firstlineno
set $__ad = 0
while ($__sz-1 >= 0 && $__continue)
set $__sz = $__sz - 1
set $__ad = $__ad + *$__p
set $__p = $__p + 1
if ($__ad > $__lasti)
set $__continue = 0
end
set $__li = $__li + *$__p
set $__p = $__p + 1
end
printf "%d", $__li
end
# print the current frame - verbose
define pyframev
pyframe
pylocals
end
define pyframe
set $__fn = (char *)((PyStringObject *)co->co_filename)->ob_sval
set $__n = (char *)((PyStringObject *)co->co_name)->ob_sval
printf "%s (", $__fn
lineno
printf "): %s\n", $__n
### Uncomment these lines when using from within Emacs/XEmacs so it will
### automatically track/display the current Python source line
# printf "%c%c%s:", 032, 032, $__fn
# lineno
# printf ":1\n"
end
### Use these at your own risk. It appears that a bug in gdb causes it
### to crash in certain circumstances.
#define up
# up-silently 1
# printframe
#end
#define down
# down-silently 1
# printframe
#end
define printframe
if $pc > PyEval_EvalFrameEx && $pc < PyEval_EvalCodeEx
pyframe
else
frame
end
end
# Here's a somewhat fragile way to print the entire Python stack from gdb.
# It's fragile because the tests for the value of $pc depend on the layout
# of specific functions in the C source code.
# Explanation of while and if tests: We want to pop up the stack until we
# land in Py_Main (this is probably an incorrect assumption in an embedded
# interpreter, but the test can be extended by an interested party). If
# Py_Main <= $pc <= Py_GetArgcArv is true, $pc is in Py_Main(), so the while
# tests succeeds as long as it's not true. In a similar fashion the if
# statement tests to see if we are in PyEval_EvalFrame().
# print the entire Python call stack
define pystack
while $pc < Py_Main || $pc > Py_GetArgcArgv
if $pc > PyEval_EvalFrame && $pc < PyEval_EvalCodeEx
pyframe
end
up-silently 1
end
select-frame 0
end
# print the entire Python call stack - verbose mode
define pystackv
while $pc < Py_Main || $pc > Py_GetArgcArgv
if $pc > PyEval_EvalFrame && $pc < PyEval_EvalCodeEx
pyframev
end
up-silently 1
end
select-frame 0
end
# generally useful macro to print a Unicode string
def pu
set $uni = $arg0
set $i = 0
while (*$uni && $i++<100)
if (*$uni < 0x80)
print *(char*)$uni++
else
print /x *(short*)$uni++
end
end
end

View File

@@ -0,0 +1,15 @@
-sob
-nbad
-bap
-br
-nce
-ncs
-npcs
-i8
-ip8
-c25
-T PyObject

View File

@@ -0,0 +1,85 @@
/* The idea of this file is that you bundle it with your extension,
#include it, program to Python 2.3's memory API and have your
extension build with any version of Python from 1.5.2 through to
2.3 (and hopefully beyond). */
#ifndef Py_PYMEMCOMPAT_H
#define Py_PYMEMCOMPAT_H
#include "Python.h"
/* There are three "families" of memory API: the "raw memory", "object
memory" and "object" families. (This is ignoring the matter of the
cycle collector, about which more is said below).
Raw Memory:
PyMem_Malloc, PyMem_Realloc, PyMem_Free
Object Memory:
PyObject_Malloc, PyObject_Realloc, PyObject_Free
Object:
PyObject_New, PyObject_NewVar, PyObject_Del
The raw memory and object memory allocators both mimic the
malloc/realloc/free interface from ANSI C, but the object memory
allocator can (and, since 2.3, does by default) use a different
allocation strategy biased towards lots of "small" allocations.
The object family is used for allocating Python objects, and the
initializers take care of some basic initialization (setting the
refcount to 1 and filling out the ob_type field) as well as having
a somewhat different interface.
Do not mix the families! E.g. do not allocate memory with
PyMem_Malloc and free it with PyObject_Free. You may get away with
it quite a lot of the time, but there *are* scenarios where this
will break. You Have Been Warned.
Also, in many versions of Python there are an insane amount of
memory interfaces to choose from. Use the ones described above. */
#if PY_VERSION_HEX < 0x01060000
/* raw memory interface already present */
/* there is no object memory interface in 1.5.2 */
#define PyObject_Malloc PyMem_Malloc
#define PyObject_Realloc PyMem_Realloc
#define PyObject_Free PyMem_Free
/* the object interface is there, but the names have changed */
#define PyObject_New PyObject_NEW
#define PyObject_NewVar PyObject_NEW_VAR
#define PyObject_Del PyMem_Free
#endif
/* If your object is a container you probably want to support the
cycle collector, which was new in Python 2.0.
Unfortunately, the interface to the collector that was present in
Python 2.0 and 2.1 proved to be tricky to use, and so changed in
2.2 -- in a way that can't easily be papered over with macros.
This file contains macros that let you program to the 2.2 GC API.
Your module will compile against any Python since version 1.5.2,
but the type will only participate in the GC in versions 2.2 and
up. Some work is still necessary on your part to only fill out the
tp_traverse and tp_clear fields when they exist and set tp_flags
appropriately.
It is possible to support both the 2.0 and 2.2 GC APIs, but it's
not pretty and this comment block is too narrow to contain a
desciption of what's required... */
#if PY_VERSION_HEX < 0x020200B1
#define PyObject_GC_New PyObject_New
#define PyObject_GC_NewVar PyObject_NewVar
#define PyObject_GC_Del PyObject_Del
#define PyObject_GC_Track(op)
#define PyObject_GC_UnTrack(op)
#endif
#endif /* !Py_PYMEMCOMPAT_H */

View File

@@ -0,0 +1,53 @@
#!@EXENAME@
import sys
import os
import getopt
from distutils import sysconfig
valid_opts = ['prefix', 'exec-prefix', 'includes', 'libs', 'cflags',
'ldflags', 'help']
def exit_with_usage(code=1):
print >>sys.stderr, "Usage: %s [%s]" % (sys.argv[0],
'|'.join('--'+opt for opt in valid_opts))
sys.exit(code)
try:
opts, args = getopt.getopt(sys.argv[1:], '', valid_opts)
except getopt.error:
exit_with_usage()
if not opts:
exit_with_usage()
opt = opts[0][0]
pyver = sysconfig.get_config_var('VERSION')
getvar = sysconfig.get_config_var
if opt == '--help':
exit_with_usage(0)
elif opt == '--prefix':
print sysconfig.PREFIX
elif opt == '--exec-prefix':
print sysconfig.EXEC_PREFIX
elif opt in ('--includes', '--cflags'):
flags = ['-I' + sysconfig.get_python_inc(),
'-I' + sysconfig.get_python_inc(plat_specific=True)]
if opt == '--cflags':
flags.extend(getvar('CFLAGS').split())
print ' '.join(flags)
elif opt in ('--libs', '--ldflags'):
libs = getvar('LIBS').split() + getvar('SYSLIBS').split()
libs.append('-lpython'+pyver)
# add the prefix/lib/pythonX.Y/config dir, but only if there is no
# shared library in prefix/lib/.
if opt == '--ldflags' and not getvar('Py_ENABLE_SHARED'):
libs.insert(0, '-L' + getvar('LIBPL'))
print ' '.join(libs)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,403 @@
.TH PYTHON "1" "$Date: 2009-03-22 09:13:23 -0400 (Sun, 22 Mar 2009) $"
.\" To view this file while editing, run it through groff:
.\" groff -Tascii -man python.man | less
.SH NAME
python \- an interpreted, interactive, object-oriented programming language
.SH SYNOPSIS
.B python
[
.B \-d
]
[
.B \-E
]
[
.B \-h
]
[
.B \-i
]
[
.B \-m
.I module-name
]
[
.B \-O
]
.br
[
.B -Q
.I argument
]
[
.B \-S
]
[
.B \-t
]
[
.B \-u
]
.br
[
.B \-v
]
[
.B \-V
]
[
.B \-W
.I argument
]
[
.B \-x
]
[
.B \-3
]
.br
[
.B \-c
.I command
|
.I script
|
\-
]
[
.I arguments
]
.SH DESCRIPTION
Python is an interpreted, interactive, object-oriented programming
language that combines remarkable power with very clear syntax.
For an introduction to programming in Python you are referred to the
Python Tutorial.
The Python Library Reference documents built-in and standard types,
constants, functions and modules.
Finally, the Python Reference Manual describes the syntax and
semantics of the core language in (perhaps too) much detail.
(These documents may be located via the
.B "INTERNET RESOURCES"
below; they may be installed on your system as well.)
.PP
Python's basic power can be extended with your own modules written in
C or C++.
On most systems such modules may be dynamically loaded.
Python is also adaptable as an extension language for existing
applications.
See the internal documentation for hints.
.PP
Documentation for installed Python modules and packages can be
viewed by running the
.B pydoc
program.
.SH COMMAND LINE OPTIONS
.TP
.BI "\-c " command
Specify the command to execute (see next section).
This terminates the option list (following options are passed as
arguments to the command).
.TP
.B \-d
Turn on parser debugging output (for wizards only, depending on
compilation options).
.TP
.B \-E
Ignore environment variables like PYTHONPATH and PYTHONHOME that modify
the behavior of the interpreter.
.TP
.B \-h
Prints the usage for the interpreter executable and exits.
.TP
.B \-i
When a script is passed as first argument or the \fB\-c\fP option is
used, enter interactive mode after executing the script or the
command. It does not read the $PYTHONSTARTUP file. This can be
useful to inspect global variables or a stack trace when a script
raises an exception.
.TP
.BI "\-m " module-name
Searches
.I sys.path
for the named module and runs the corresponding
.I .py
file as a script.
.TP
.B \-O
Turn on basic optimizations. This changes the filename extension for
compiled (bytecode) files from
.I .pyc
to \fI.pyo\fP. Given twice, causes docstrings to be discarded.
.TP
.BI "\-Q " argument
Division control; see PEP 238. The argument must be one of "old" (the
default, int/int and long/long return an int or long), "new" (new
division semantics, i.e. int/int and long/long returns a float),
"warn" (old division semantics with a warning for int/int and
long/long), or "warnall" (old division semantics with a warning for
all use of the division operator). For a use of "warnall", see the
Tools/scripts/fixdiv.py script.
.TP
.B \-S
Disable the import of the module
.I site
and the site-dependent manipulations of
.I sys.path
that it entails.
.TP
.B \-t
Issue a warning when a source file mixes tabs and spaces for
indentation in a way that makes it depend on the worth of a tab
expressed in spaces. Issue an error when the option is given twice.
.TP
.B \-u
Force stdin, stdout and stderr to be totally unbuffered. On systems
where it matters, also put stdin, stdout and stderr in binary mode.
Note that there is internal buffering in xreadlines(), readlines() and
file-object iterators ("for line in sys.stdin") which is not
influenced by this option. To work around this, you will want to use
"sys.stdin.readline()" inside a "while 1:" loop.
.TP
.B \-v
Print a message each time a module is initialized, showing the place
(filename or built-in module) from which it is loaded. When given
twice, print a message for each file that is checked for when
searching for a module. Also provides information on module cleanup
at exit.
.TP
.B \-V
Prints the Python version number of the executable and exits.
.TP
.BI "\-W " argument
Warning control. Python sometimes prints warning message to
.IR sys.stderr .
A typical warning message has the following form:
.IB file ":" line ": " category ": " message.
By default, each warning is printed once for each source line where it
occurs. This option controls how often warnings are printed.
Multiple
.B \-W
options may be given; when a warning matches more than one
option, the action for the last matching option is performed.
Invalid
.B \-W
options are ignored (a warning message is printed about invalid
options when the first warning is issued). Warnings can also be
controlled from within a Python program using the
.I warnings
module.
The simplest form of
.I argument
is one of the following
.I action
strings (or a unique abbreviation):
.B ignore
to ignore all warnings;
.B default
to explicitly request the default behavior (printing each warning once
per source line);
.B all
to print a warning each time it occurs (this may generate many
messages if a warning is triggered repeatedly for the same source
line, such as inside a loop);
.B module
to print each warning only only the first time it occurs in each
module;
.B once
to print each warning only the first time it occurs in the program; or
.B error
to raise an exception instead of printing a warning message.
The full form of
.I argument
is
.IB action : message : category : module : line.
Here,
.I action
is as explained above but only applies to messages that match the
remaining fields. Empty fields match all values; trailing empty
fields may be omitted. The
.I message
field matches the start of the warning message printed; this match is
case-insensitive. The
.I category
field matches the warning category. This must be a class name; the
match test whether the actual warning category of the message is a
subclass of the specified warning category. The full class name must
be given. The
.I module
field matches the (fully-qualified) module name; this match is
case-sensitive. The
.I line
field matches the line number, where zero matches all line numbers and
is thus equivalent to an omitted line number.
.TP
.B \-x
Skip the first line of the source. This is intended for a DOS
specific hack only. Warning: the line numbers in error messages will
be off by one!
.TP
.B \-3
Warn about Python 3.x incompatibilities that 2to3 cannot trivially fix.
.SH INTERPRETER INTERFACE
The interpreter interface resembles that of the UNIX shell: when
called with standard input connected to a tty device, it prompts for
commands and executes them until an EOF is read; when called with a
file name argument or with a file as standard input, it reads and
executes a
.I script
from that file;
when called with
.B \-c
.I command,
it executes the Python statement(s) given as
.I command.
Here
.I command
may contain multiple statements separated by newlines.
Leading whitespace is significant in Python statements!
In non-interactive mode, the entire input is parsed before it is
executed.
.PP
If available, the script name and additional arguments thereafter are
passed to the script in the Python variable
.I sys.argv ,
which is a list of strings (you must first
.I import sys
to be able to access it).
If no script name is given,
.I sys.argv[0]
is an empty string; if
.B \-c
is used,
.I sys.argv[0]
contains the string
.I '-c'.
Note that options interpreted by the Python interpreter itself
are not placed in
.I sys.argv.
.PP
In interactive mode, the primary prompt is `>>>'; the second prompt
(which appears when a command is not complete) is `...'.
The prompts can be changed by assignment to
.I sys.ps1
or
.I sys.ps2.
The interpreter quits when it reads an EOF at a prompt.
When an unhandled exception occurs, a stack trace is printed and
control returns to the primary prompt; in non-interactive mode, the
interpreter exits after printing the stack trace.
The interrupt signal raises the
.I Keyboard\%Interrupt
exception; other UNIX signals are not caught (except that SIGPIPE is
sometimes ignored, in favor of the
.I IOError
exception). Error messages are written to stderr.
.SH FILES AND DIRECTORIES
These are subject to difference depending on local installation
conventions; ${prefix} and ${exec_prefix} are installation-dependent
and should be interpreted as for GNU software; they may be the same.
The default for both is \fI/usr/local\fP.
.IP \fI${exec_prefix}/bin/python\fP
Recommended location of the interpreter.
.PP
.I ${prefix}/lib/python<version>
.br
.I ${exec_prefix}/lib/python<version>
.RS
Recommended locations of the directories containing the standard
modules.
.RE
.PP
.I ${prefix}/include/python<version>
.br
.I ${exec_prefix}/include/python<version>
.RS
Recommended locations of the directories containing the include files
needed for developing Python extensions and embedding the
interpreter.
.RE
.IP \fI~/.pythonrc.py\fP
User-specific initialization file loaded by the \fIuser\fP module;
not used by default or by most applications.
.SH ENVIRONMENT VARIABLES
.IP PYTHONHOME
Change the location of the standard Python libraries. By default, the
libraries are searched in ${prefix}/lib/python<version> and
${exec_prefix}/lib/python<version>, where ${prefix} and ${exec_prefix}
are installation-dependent directories, both defaulting to
\fI/usr/local\fP. When $PYTHONHOME is set to a single directory, its value
replaces both ${prefix} and ${exec_prefix}. To specify different values
for these, set $PYTHONHOME to ${prefix}:${exec_prefix}.
.IP PYTHONPATH
Augments the default search path for module files.
The format is the same as the shell's $PATH: one or more directory
pathnames separated by colons.
Non-existent directories are silently ignored.
The default search path is installation dependent, but generally
begins with ${prefix}/lib/python<version> (see PYTHONHOME above).
The default search path is always appended to $PYTHONPATH.
If a script argument is given, the directory containing the script is
inserted in the path in front of $PYTHONPATH.
The search path can be manipulated from within a Python program as the
variable
.I sys.path .
.IP PYTHONSTARTUP
If this is the name of a readable file, the Python commands in that
file are executed before the first prompt is displayed in interactive
mode.
The file is executed in the same name space where interactive commands
are executed so that objects defined or imported in it can be used
without qualification in the interactive session.
You can also change the prompts
.I sys.ps1
and
.I sys.ps2
in this file.
.IP PYTHONY2K
Set this to a non-empty string to cause the \fItime\fP module to
require dates specified as strings to include 4-digit years, otherwise
2-digit years are converted based on rules described in the \fItime\fP
module documentation.
.IP PYTHONOPTIMIZE
If this is set to a non-empty string it is equivalent to specifying
the \fB\-O\fP option. If set to an integer, it is equivalent to
specifying \fB\-O\fP multiple times.
.IP PYTHONDEBUG
If this is set to a non-empty string it is equivalent to specifying
the \fB\-d\fP option. If set to an integer, it is equivalent to
specifying \fB\-d\fP multiple times.
.IP PYTHONINSPECT
If this is set to a non-empty string it is equivalent to specifying
the \fB\-i\fP option.
.IP PYTHONUNBUFFERED
If this is set to a non-empty string it is equivalent to specifying
the \fB\-u\fP option.
.IP PYTHONVERBOSE
If this is set to a non-empty string it is equivalent to specifying
the \fB\-v\fP option. If set to an integer, it is equivalent to
specifying \fB\-v\fP multiple times.
.SH AUTHOR
The Python Software Foundation: http://www.python.org/psf
.SH INTERNET RESOURCES
Main website: http://www.python.org/
.br
Documentation: http://docs.python.org/
.br
Community website: http://starship.python.net/
.br
Developer resources: http://www.python.org/dev/
.br
FTP: ftp://ftp.python.org/pub/python/
.br
Module repository: http://www.vex.net/parnassus/
.br
Newsgroups: comp.lang.python, comp.lang.python.announce
.SH LICENSING
Python is distributed under an Open Source license. See the file
"LICENSE" in the Python source distribution for information on terms &
conditions for accessing and otherwise using Python and for a
DISCLAIMER OF ALL WARRANTIES.

View File

@@ -0,0 +1,176 @@
/*
Template for a setuid program that calls a script.
The script should be in an unwritable directory and should itself
be unwritable. In fact all parent directories up to the root
should be unwritable. The script must not be setuid, that's what
this program is for.
This is a template program. You need to fill in the name of the
script that must be executed. This is done by changing the
definition of FULL_PATH below.
There are also some rules that should be adhered to when writing
the script itself.
The first and most important rule is to never, ever trust that the
user of the program will behave properly. Program defensively.
Check your arguments for reasonableness. If the user is allowed to
create files, check the names of the files. If the program depends
on argv[0] for the action it should perform, check it.
Assuming the script is a Bourne shell script, the first line of the
script should be
#!/bin/sh -
The - is important, don't omit it. If you're using esh, the first
line should be
#!/usr/local/bin/esh -f
and for ksh, the first line should be
#!/usr/local/bin/ksh -p
The script should then set the variable IFS to the string
consisting of <space>, <tab>, and <newline>. After this (*not*
before!), the PATH variable should be set to a reasonable value and
exported. Do not expect the PATH to have a reasonable value, so do
not trust the old value of PATH. You should then set the umask of
the program by calling
umask 077 # or 022 if you want the files to be readable
If you plan to change directories, you should either unset CDPATH
or set it to a good value. Setting CDPATH to just ``.'' (dot) is a
good idea.
If, for some reason, you want to use csh, the first line should be
#!/bin/csh -fb
You should then set the path variable to something reasonable,
without trusting the inherited path. Here too, you should set the
umask using the command
umask 077 # or 022 if you want the files to be readable
*/
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
/* CONFIGURATION SECTION */
#ifndef FULL_PATH /* so that this can be specified from the Makefile */
/* Uncomment the following line:
#define FULL_PATH "/full/path/of/script"
* Then comment out the #error line. */
#error "You must define FULL_PATH somewhere"
#endif
#ifndef UMASK
#define UMASK 077
#endif
/* END OF CONFIGURATION SECTION */
#if defined(__STDC__) && defined(__sgi)
#define environ _environ
#endif
/* don't change def_IFS */
char def_IFS[] = "IFS= \t\n";
/* you may want to change def_PATH, but you should really change it in */
/* your script */
#ifdef __sgi
char def_PATH[] = "PATH=/usr/bsd:/usr/bin:/bin:/usr/local/bin:/usr/sbin";
#else
char def_PATH[] = "PATH=/usr/ucb:/usr/bin:/bin:/usr/local/bin";
#endif
/* don't change def_CDPATH */
char def_CDPATH[] = "CDPATH=.";
/* don't change def_ENV */
char def_ENV[] = "ENV=:";
/*
This function changes all environment variables that start with LD_
into variables that start with XD_. This is important since we
don't want the script that is executed to use any funny shared
libraries.
The other changes to the environment are, strictly speaking, not
needed here. They can safely be done in the script. They are done
here because we don't trust the script writer (just like the script
writer shouldn't trust the user of the script).
If IFS is set in the environment, set it to space,tab,newline.
If CDPATH is set in the environment, set it to ``.''.
Set PATH to a reasonable default.
*/
void
clean_environ(void)
{
char **p;
extern char **environ;
for (p = environ; *p; p++) {
if (strncmp(*p, "LD_", 3) == 0)
**p = 'X';
else if (strncmp(*p, "_RLD", 4) == 0)
**p = 'X';
else if (strncmp(*p, "PYTHON", 6) == 0)
**p = 'X';
else if (strncmp(*p, "IFS=", 4) == 0)
*p = def_IFS;
else if (strncmp(*p, "CDPATH=", 7) == 0)
*p = def_CDPATH;
else if (strncmp(*p, "ENV=", 4) == 0)
*p = def_ENV;
}
putenv(def_PATH);
}
int
main(int argc, char **argv)
{
struct stat statb;
gid_t egid = getegid();
uid_t euid = geteuid();
/*
Sanity check #1.
This check should be made compile-time, but that's not possible.
If you're sure that you specified a full path name for FULL_PATH,
you can omit this check.
*/
if (FULL_PATH[0] != '/') {
fprintf(stderr, "%s: %s is not a full path name\n", argv[0],
FULL_PATH);
fprintf(stderr, "You can only use this wrapper if you\n");
fprintf(stderr, "compile it with an absolute path.\n");
exit(1);
}
/*
Sanity check #2.
Check that the owner of the script is equal to either the
effective uid or the super user.
*/
if (stat(FULL_PATH, &statb) < 0) {
perror("stat");
exit(1);
}
if (statb.st_uid != 0 && statb.st_uid != euid) {
fprintf(stderr, "%s: %s has the wrong owner\n", argv[0],
FULL_PATH);
fprintf(stderr, "The script should be owned by root,\n");
fprintf(stderr, "and shouldn't be writeable by anyone.\n");
exit(1);
}
if (setregid(egid, egid) < 0)
perror("setregid");
if (setreuid(euid, euid) < 0)
perror("setreuid");
clean_environ();
umask(UMASK);
while (**argv == '-') /* don't let argv[0] start with '-' */
(*argv)++;
execv(FULL_PATH, argv);
fprintf(stderr, "%s: could not execute the script\n", argv[0]);
exit(1);
}

View File

@@ -0,0 +1,391 @@
#
# This is a valgrind suppression file that should be used when using valgrind.
#
# Here's an example of running valgrind:
#
# cd python/dist/src
# valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \
# ./python -E -tt ./Lib/test/regrtest.py -u bsddb,network
#
# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER
# to use the preferred suppressions with Py_ADDRESS_IN_RANGE.
#
# If you do not want to recompile Python, you can uncomment
# suppressions for PyObject_Free and PyObject_Realloc.
#
# See Misc/README.valgrind for more information.
# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif
{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Addr4
fun:Py_ADDRESS_IN_RANGE
}
{
ADDRESS_IN_RANGE/Invalid read of size 4
Memcheck:Value4
fun:Py_ADDRESS_IN_RANGE
}
{
ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64)
Memcheck:Value8
fun:Py_ADDRESS_IN_RANGE
}
{
ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
Memcheck:Cond
fun:Py_ADDRESS_IN_RANGE
}
#
# Leaks (including possible leaks)
# Hmmm, I wonder if this masks some real leaks. I think it does.
# Will need to fix that.
#
{
Suppress leaking the GIL. Happens once per process, see comment in ceval.c.
Memcheck:Leak
fun:malloc
fun:PyThread_allocate_lock
fun:PyEval_InitThreads
}
{
Suppress leaking the GIL after a fork.
Memcheck:Leak
fun:malloc
fun:PyThread_allocate_lock
fun:PyEval_ReInitThreads
}
{
Suppress leaking the autoTLSkey. This looks like it shouldn't leak though.
Memcheck:Leak
fun:malloc
fun:PyThread_create_key
fun:_PyGILState_Init
fun:Py_InitializeEx
fun:Py_Main
}
{
Hmmm, is this a real leak or like the GIL?
Memcheck:Leak
fun:malloc
fun:PyThread_ReInitTLS
}
{
Handle PyMalloc confusing valgrind (possibly leaked)
Memcheck:Leak
fun:realloc
fun:_PyObject_GC_Resize
fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}
{
Handle PyMalloc confusing valgrind (possibly leaked)
Memcheck:Leak
fun:malloc
fun:_PyObject_GC_New
fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}
{
Handle PyMalloc confusing valgrind (possibly leaked)
Memcheck:Leak
fun:malloc
fun:_PyObject_GC_NewVar
fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}
#
# Non-python specific leaks
#
{
Handle pthread issue (possibly leaked)
Memcheck:Leak
fun:calloc
fun:allocate_dtv
fun:_dl_allocate_tls_storage
fun:_dl_allocate_tls
}
{
Handle pthread issue (possibly leaked)
Memcheck:Leak
fun:memalign
fun:_dl_allocate_tls_storage
fun:_dl_allocate_tls
}
###{
### ADDRESS_IN_RANGE/Invalid read of size 4
### Memcheck:Addr4
### fun:PyObject_Free
###}
###
###{
### ADDRESS_IN_RANGE/Invalid read of size 4
### Memcheck:Value4
### fun:PyObject_Free
###}
###
###{
### ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
### Memcheck:Cond
### fun:PyObject_Free
###}
###{
### ADDRESS_IN_RANGE/Invalid read of size 4
### Memcheck:Addr4
### fun:PyObject_Realloc
###}
###
###{
### ADDRESS_IN_RANGE/Invalid read of size 4
### Memcheck:Value4
### fun:PyObject_Realloc
###}
###
###{
### ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
### Memcheck:Cond
### fun:PyObject_Realloc
###}
###
### All the suppressions below are for errors that occur within libraries
### that Python uses. The problems to not appear to be related to Python's
### use of the libraries.
###
{
Generic ubuntu ld problems
Memcheck:Addr8
obj:/lib/ld-2.4.so
obj:/lib/ld-2.4.so
obj:/lib/ld-2.4.so
obj:/lib/ld-2.4.so
}
{
Generic gentoo ld problems
Memcheck:Cond
obj:/lib/ld-2.3.4.so
obj:/lib/ld-2.3.4.so
obj:/lib/ld-2.3.4.so
obj:/lib/ld-2.3.4.so
}
{
DBM problems, see test_dbm
Memcheck:Param
write(buf)
fun:write
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
fun:dbm_close
}
{
DBM problems, see test_dbm
Memcheck:Value8
fun:memmove
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
fun:dbm_store
fun:dbm_ass_sub
}
{
DBM problems, see test_dbm
Memcheck:Cond
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
fun:dbm_store
fun:dbm_ass_sub
}
{
DBM problems, see test_dbm
Memcheck:Cond
fun:memmove
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
obj:/usr/lib/libdb1.so.2
fun:dbm_store
fun:dbm_ass_sub
}
{
GDBM problems, see test_gdbm
Memcheck:Param
write(buf)
fun:write
fun:gdbm_open
}
{
ZLIB problems, see test_gzip
Memcheck:Cond
obj:/lib/libz.so.1.2.3
obj:/lib/libz.so.1.2.3
fun:deflate
}
{
Avoid problems w/readline doing a putenv and leaking on exit
Memcheck:Leak
fun:malloc
fun:xmalloc
fun:sh_set_lines_and_columns
fun:_rl_get_screen_size
fun:_rl_init_terminal_io
obj:/lib/libreadline.so.4.3
fun:rl_initialize
}
###
### These occur from somewhere within the SSL, when running
### test_socket_sll. They are too general to leave on by default.
###
###{
### somewhere in SSL stuff
### Memcheck:Cond
### fun:memset
###}
###{
### somewhere in SSL stuff
### Memcheck:Value4
### fun:memset
###}
###
###{
### somewhere in SSL stuff
### Memcheck:Cond
### fun:MD5_Update
###}
###
###{
### somewhere in SSL stuff
### Memcheck:Value4
### fun:MD5_Update
###}
#
# All of these problems come from using test_socket_ssl
#
{
from test_socket_ssl
Memcheck:Cond
fun:BN_bin2bn
}
{
from test_socket_ssl
Memcheck:Cond
fun:BN_num_bits_word
}
{
from test_socket_ssl
Memcheck:Value4
fun:BN_num_bits_word
}
{
from test_socket_ssl
Memcheck:Cond
fun:BN_mod_exp_mont_word
}
{
from test_socket_ssl
Memcheck:Cond
fun:BN_mod_exp_mont
}
{
from test_socket_ssl
Memcheck:Param
write(buf)
fun:write
obj:/usr/lib/libcrypto.so.0.9.7
}
{
from test_socket_ssl
Memcheck:Cond
fun:RSA_verify
}
{
from test_socket_ssl
Memcheck:Value4
fun:RSA_verify
}
{
from test_socket_ssl
Memcheck:Value4
fun:DES_set_key_unchecked
}
{
from test_socket_ssl
Memcheck:Value4
fun:DES_encrypt2
}
{
from test_socket_ssl
Memcheck:Cond
obj:/usr/lib/libssl.so.0.9.7
}
{
from test_socket_ssl
Memcheck:Value4
obj:/usr/lib/libssl.so.0.9.7
}
{
from test_socket_ssl
Memcheck:Cond
fun:BUF_MEM_grow_clean
}
{
from test_socket_ssl
Memcheck:Cond
fun:memcpy
fun:ssl3_read_bytes
}
{
from test_socket_ssl
Memcheck:Cond
fun:SHA1_Update
}
{
from test_socket_ssl
Memcheck:Value4
fun:SHA1_Update
}

View File

@@ -0,0 +1,10 @@
# vgrind is a pretty-printer that takes source code and outputs
# eye-pleasing postscript. The entry below should be added to your
# local vgrindefs file. Contributed by Neale Pickett <neale@lanl.gov>.
python|Python|py:\
:pb=^\d?(def|class)\d\p(\d|\\|\(|\:):\
:cb=#:ce=$:sb=":se=\e":lb=':le=\e':\
:kw=assert and break class continue def del elif else except\
exec finally for from global if import in is lambda not or\
pass print raise return try while yield: