From tim_one@users.sourceforge.net Fri Feb 1 00:52:31 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 31 Jan 2002 16:52:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.351,1.352 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv21290/python/Misc Modified Files: NEWS Log Message: New tempfile and os.open() gimmicks for Windows. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.351 retrieving revision 1.352 diff -C2 -d -r1.351 -r1.352 *** NEWS 2002/01/12 11:27:42 1.351 --- NEWS 2002/02/01 00:52:29 1.352 *************** *** 27,31 **** passed in. ! - gettext.translation has an optional fallback argument, and gettext.find an optional all argument. Translations will now fallback on a per-message basis. --- 27,31 ---- passed in. ! - gettext.translation has an optional fallback argument, and gettext.find an optional all argument. Translations will now fallback on a per-message basis. *************** *** 59,62 **** --- 59,85 ---- Windows + + - New tempfile.TemporaryFile implementation for Windows: this doesn't + need a TemproraryFileWrapper wrapper anymore, and should be immune + to a nasty problem: before 2.3, if you got a temp file on Windows, it + got wrapped in an object whose close() method first closed the + underlying file, then deleted the file. This usually worked fine. + However, the spawn family of functions on Windows create (at a low C + level) the same set of open files in the spawned process Q as were + open in the spawning process P. If a temp file f was among them, then + doing f.close() in P first closed P's C-level file handle on f, but Q's + C-level file handle on f remained open, so the attempt in P to delete f + blew up with a "Permission denied" error (Windows doesn't allow + deleting open files). This was surprising, subtle, and difficult to + work around. + + - The os module now exports all the symbolic constants usable with the + low-level os.open() on Windows: the new constants in 2.3 are + O_NOINHERIT, O_SHORT_LIVED, O_TEMPORARY, O_RANDOM and O_SEQUENTIAL. + The others were also available in 2.2: O_APPEND, O_BINARY, O_CREAT, + O_EXCL, O_RDONLY, O_RDWR, O_TEXT, O_TRUNC and O_WRONLY. Contrary + to Microsoft docs, O_SHORT_LIVED does not seem to imply O_TEMPORARY + (so specify both if you want both; note that neither is useful unless + specified with O_CREAT too). Mac From bwarsaw@users.sourceforge.net Fri Feb 1 05:59:16 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 31 Jan 2002 21:59:16 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0279.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv14252 Added Files: pep-0279.txt Log Message: PEP 279, Enhanced Generators, Raymond D. Hettinger. (Minor spell checking and formatting by BAW) --- NEW FILE: pep-0279.txt --- PEP: 279 Title: Enhanced Generators Version: $Revision: 1.1 $ Last-Modified: $Date: 2002/02/01 05:59:14 $ Author: othello@javanet.com (Raymond D. Hettinger) Status: Draft Type: Standards Track Created: 30-Jan-2002 Python-Version: 2.3 Post-History: Abstract This PEP introduces four orthogonal (not mutually exclusive) ideas for enhancing the generators as introduced in Python version 2.2 [1]. The goal is increase the convenience, utility, and power of generators. Rationale Starting with xrange() and xreadlines(), Python has been evolving toward a model that provides lazy evaluation as an alternative when complete evaluation is not desired because of memory restrictions or availability of data. Starting with Python 2.2, a second evolutionary direction came in the form of iterators and generators. The iter() factory function and generators were provided as convenient means of creating iterators. Deep changes were made to use iterators as a unifying theme throughout Python. The unification came in the form of establishing a common iterable interface for mappings, sequences, and file objects. In the case of mappings and file objects, lazy evaluation was made available. The next steps in the evolution of generators are: 1. Add built-in functions which provide lazy alternatives to their complete evaluation counterparts and one other convenience function which was made possible once iterators and generators became available. The new functions are xzip, xmap, xfilter, and indexed. 2. Provide a generator alternative to list comprehensions [3] making generator creation as convenient as list creation. 3. Extend the syntax of the 'yield' keyword to enable two way parameter passing. The resulting increase in power simplifies the creation of consumer streams which have a complex execution state and/or variable state. 4. Add a generator method to enable exceptions to be passed to a generator. Currently, there is no clean method for triggering exceptions from outside the generator. All of the suggestions are designed to take advantage of the existing implementation and require little additional effort to incorporate. Each is backward compatible and requires no new keywords. Specification for new built-ins: def xfilter( pred, gen ): ''' xfilter(...) xfilter(function, sequence) -> list Return an iterator containing those items of sequence for which function is true. If function is None, return a list of items that are true. ''' if pred is None: for i in gen: if i: yield i else: for i in gen: if pred(i): yield i def xmap( fun, *collections ): ''' xmap(...) xmap(function, sequence[, sequence, ...]) -> list Return an iterator applying the function to the items of the argument collection(s). If more than one collection is given, the function is called with an argument list consisting of the corresponding item of each collection, substituting None for missing values when not all collections have the same length. If the function is None, return a list of the items of the collection (or a list of tuples if more than one collection). ''' gens = map(iter, collections) values_left = [1] def values(): # Emulate map behaviour, i.e. shorter # sequences are padded with None when # they run out of values. values_left[0] = 0 for i in range(len(gens)): iterator = gens[i] if iterator is None: yield None else: try: yield iterator.next() values_left[0] = 1 except StopIteration: gens[i] = None yield None while 1: args = tuple(values()) if not values_left[0]: raise StopIteration yield func(*args) def xzip( *collections ): ''' xzip(...) xzip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)] Return a iterator of tuples, where each tuple contains the i-th element from each of the argument sequences or iterable. The returned iterator is truncated in length to the length of the shortest argument collection. ''' gens = map(iter, collections) while 1: yield tuple( [g.next() for g in gens] ) def indexed( collection, cnt=0, limit=None ): 'Generates an indexed series: (0,seqn[0]), (1,seqn[1]) ...' gen = iter(collection) while limit is None or cnt5] print g.next() print g.next() This would be implemented as if it had been written: def __temp_gen(): for line in file.readline(): if len(line) > 5: yield (len(line), line) g = __temp_gen() print g.next() print g.next() Note A: There is a difference in the above implementation as compared to list comprehensions. For a generator comprehension, the variables are created in a separate scope while list comprehensions use the enclosing scope. If this PEP is accepted, the parser should generate byte code that eliminates this difference by passing the line variable in the enclosing scope and using that same variable passed by reference inside the generator. This will make the behavior of generator comprehension identical to that of list comprehensions. Note B: There is some debate about whether the enclosing brackets should be part of the syntax for generator comprehensions. On the plus side, it neatly parallels list comprehensions and would be immediately recognizable as a similar form with similar internal syntax (taking maximum advantage of what people already know). More importantly, it sets off the generator comprehension from the rest of the function so as to not suggest that the enclosing function is a generator (currently the only cue that a function is really a generator is the presence of the yield keyword). On the minus side, the brackets may falsely suggest that the whole expression returns a list. All of the feedback received to date indicates that brackets do not make a false suggestion and are in fact helpful. Specification for two-way Generator Parameter Passing: 1. Allow 'yield' to assign a value as in: def mygen(): while 1: x = yield None print x 2. Let the .next() method take a value to pass to generator as in: g = mygen() g.next() # runs the generators until the first 'yield' g.next(1) # the '1' gets bound to 'x' in mygen() g.next(2) # the '2' gets bound to 'x' in mygen() Note A: An early question arose, when would you need this? The answer is that existing generators make it easy to write lazy producers which may have a complex execution state and/or complex variable state. This proposal makes it equally easy to write lazy consumers which may also have a complex execution or variable state. For instance, when writing an encoder for arithmetic compression, a series of fractional values are sent to a function which has periodic output and a complex state which depends on previous inputs. Also, that encoder requires a flush() function when no additional fractions are to be output. It is helpful to think of the following parallel with file output streams: ostream = file('mydest.txt','w') ostream.write(firstdat) ostream.write(seconddat) ostream.flush() With the proposed extensions, it could be written like this: def filelike(packagename, appendOrOverwrite): cum = [] if appendOrOverwrite == 'w+': cum.extend( packages[packagename] ) try: while 1: dat = yield None cum.append(dat) except FlushStream: packages[packagename] = cum ostream = filelike('mydest','w') ostream.next() ostream.next(firstdat) ostream.next(seconddat) ostream.throw( FlushStream ) # this feature discussed below Note C: Almost all of the machinery necessary to implement this extension is already in place. The parse syntax needs to be modified to accept the new x = yield None syntax and the .next() method needs to allow an argument. Note D: Some care must be used when writing a values to the generator because execution starts at the top of the generator not at the first yield. Consider the usual flow using .next() without an argument. g = mygen(p1) will bind p1 to a local variable and then return a generator to be bound to g and NOT run any code in mygen(). y = g.next() runs the generator from the first line until it encounters a yield when it suspends execution and a returns a value to be bound to y Since the same flow applies when you are submitting values, the first call to .next() should have no argument since there is no place to put it. g = mygen(p1) will bind p1 to a local variable and then return a generator to be bound to g and NOT run any code in mygen() g.next() will START execution in mygen() from the first line. Note, that there is nowhere to bind any potential arguments that might have been supplied to next(). Execution continues until the first yield is encountered and control is returned to the caller. g.next(val) resumes execution at the yield and binds val to the left hand side of the yield assignment and continues running until another yield is encountered. This makes sense because you submit values expecting them to be processed right away. Q. Two-way generator parameter passing seems awfully bold. To my mind, one of the great things about generators is that they meet the (very simple) definition of an iterator. With this, they no longer do. I like lazy consumers -- really I do -- but I'd rather be conservative about putting something like this in the language. A. If you don't use x = yield expr, then nothing changes and you haven't lost anything. So, it isn't really bold. It simply adds an option to pass in data as well as take it out. Other generator implementations (like the thread based generator.py) already have provisions for two-way parameter passing so that consumers are put on an equal footing with producers. Two-way is the norm, not the exception. Yield is not just a simple iterator creator. It does something else truly wonderful -- it suspends execution and saves state. It is good for a lot more than its original purpose. Dr. Mertz's article [5] shows how they can be used to create general purpose co-routines. Besides, 98% of the mechanism is already in place. Only the communication needs to be added. Remember GOSUB which neither took nor returned data. Routines which accepted parameters and returned values were a major step forward. When you first need to pass information into a generator, the existing alternative is clumsy. It involves setting a global variable, calling .next(), and assigning the local from the global. Q. Why not introduce another keyword 'accept' for lazy consumers? A. To avoid conflicts with 'yield', to avoid creating a new keyword, and to take advantage of the explicit clarity of the '=' operator. Q. How often does one need to write a lazy consumer or a co-routine? A. Not often. But, when you DO have to write one, this approach is the easiest to implement, read, and debug. It clearly beats using existing generators and passing data through global variables. It is much clearer and easier to debug than an equivalent approach using threading, mutexes, semaphores, and data queues. A class based approach competes well when there are no complex execution states or variable states. When the complexity increases, generators with two-way communication are much simpler because they automatically save state unlike classes which must explicitly store variable and execution state in instance variables. Q. Why does yield require an argument? Isn't yield None too wordy? A. It doesn't matter for the purposes of this PEP. For information purposes, here is the reasoning as I understand it. Though return allows an implicit None, some now consider this to be weak design. There is some spirit of "Explicit is better than Implicit". More importantly, in most uses of yield, a missing argument is more likely to be a bug than an intended yield None. Specification for Generator Exception Passing: Add a .throw(exception) method to the resulting generator as in: def mygen(): try: while 1: x = yield None print x except FlushStream: print 'Done' g = mygen() g.next(5) g.throw(FlushStream) There is no existing work around for triggering an exception inside a generator. This is a true deficiency. It is the only case in Python where active code cannot be excepted to or through. Even if .next(arg) is not adopted, we should add the .throw() method. Note A: The name of the throw method was selected for several reasons. Raise is a keyword and so cannot be used as a method name. Unlike raise which immediately raises an exception from the current execution point, throw will first return to the generator and then raise the exception. The word throw is suggestive of putting the exception in another location. The word throw is already associated with exceptions in other languages. References [1] PEP 255 Simple Generators http://python.sourceforge.net/peps/pep-0255.html [2] PEP 212 Loop Counter Iteration http://python.sourceforge.net/peps/pep-0212.html [3] PEP 202 List Comprehensions http://python.sourceforge.net/peps/pep-0202.html [4] There have been several discussion on comp.lang.python which helped tease out these proposals: Indexed Function http://groups.google.com/groups?hl=en&th=33f778d92dd5720a Xmap, Xfilter, Xzip and Two-way Generator Communication http://groups.google.com/groups?hl=en&th=b5e576b02894bb04&rnum=1 Two-way Generator Communication -- Revised Version http://groups.google.com/groups?hl=en&th=cb1d86e68850c592&rnum=1 Generator Comprehensions http://groups.google.com/groups?hl=en&th=215e6e5a7bfd526&rnum=2 http://groups.google.com/groups?hl=en&th=df8b5e7709957eb7 [5] Dr. David Mertz's draft column for Charming Python. href="http://gnosis.cx/publish/programming/charming_python_b5.txt Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil fill-column: 70 End: From bwarsaw@users.sourceforge.net Fri Feb 1 05:59:31 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 31 Jan 2002 21:59:31 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.152,1.153 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv14301 Modified Files: pep-0000.txt Log Message: PEP 279, Enhanced Generators, Raymond D. Hettinger. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** pep-0000.txt 2002/01/23 13:24:26 1.152 --- pep-0000.txt 2002/02/01 05:59:29 1.153 *************** *** 90,93 **** --- 90,94 ---- S 277 Unicode file name support for Windows NT Hodgson S 278 Universal Newline Support Jansen + S 279 Enhanced Generators Hettinger Finished PEPs (done, implemented in CVS) *************** *** 240,243 **** --- 241,245 ---- S 277 Unicode file name support for Windows NT Hodgson S 278 Universal Newline Support Jansen + S 279 Enhanced Generators Hettinger SR 666 Reject Foolish Indentation Creighton *************** *** 270,273 **** --- 272,276 ---- Goodger, David dgoodger@bigfoot.com Griffin, Grant g2@iowegian.com + Hettinger, Raymond D. othello@javanet.com Hodgson, Neil neilh@scintilla.org Hudson, Michael mwh@python.net From theller@users.sourceforge.net Fri Feb 1 09:44:11 2002 From: theller@users.sourceforge.net (Thomas Heller) Date: Fri, 01 Feb 2002 01:44:11 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils/command build_py.py,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv15304 Modified Files: build_py.py Log Message: package_dir must be converted from the distutils path conventions to local conventions before being used by build_py. Fixes SF bug #509288, probably a candidate for 2.2.1 Index: build_py.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_py.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** build_py.py 2001/12/06 20:59:17 1.34 --- build_py.py 2002/02/01 09:44:09 1.35 *************** *** 13,16 **** --- 13,17 ---- from distutils.core import Command from distutils.errors import * + from distutils.util import convert_path *************** *** 51,55 **** self.packages = self.distribution.packages self.py_modules = self.distribution.py_modules ! self.package_dir = self.distribution.package_dir # Ick, copied straight from install_lib.py (fancy_getopt needs a --- 52,59 ---- self.packages = self.distribution.packages self.py_modules = self.distribution.py_modules ! self.package_dir = {} ! if self.distribution.package_dir: ! for name, path in self.distribution.package_dir.items(): ! self.package_dir[name] = convert_path(path) # Ick, copied straight from install_lib.py (fancy_getopt needs a From tim_one@users.sourceforge.net Fri Feb 1 11:27:45 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 01 Feb 2002 03:27:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.352,1.353 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv3161/python/Misc Modified Files: NEWS Log Message: Implement os.waitpid() for Windows, in a way that's compatible with Linux where their capabilities intersect. Would be nice if people using non- MSVC compilers (Borland etc) took a whack at doing something similar for them (this code relies on the MS _cwait function). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.352 retrieving revision 1.353 diff -C2 -d -r1.352 -r1.353 *** NEWS 2002/02/01 00:52:29 1.352 --- NEWS 2002/02/01 11:27:43 1.353 *************** *** 60,63 **** --- 60,70 ---- Windows + - os.waitpid() is now implemented for Windows, and can be used to block + until a specified process exits. This is similar to, but not exactly + the same as, os.waitpid() on POSIX systems. If you're waiting for + a specific process whose pid was obtained from one of the spawn() + functions, the same Python os.waitpid() code works across platforms. + See the docs for details. + - New tempfile.TemporaryFile implementation for Windows: this doesn't need a TemproraryFileWrapper wrapper anymore, and should be immune From tim_one@users.sourceforge.net Fri Feb 1 11:27:45 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 01 Feb 2002 03:27:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libos.tex,1.76,1.77 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv3161/python/Doc/lib Modified Files: libos.tex Log Message: Implement os.waitpid() for Windows, in a way that's compatible with Linux where their capabilities intersect. Would be nice if people using non- MSVC compilers (Borland etc) took a whack at doing something similar for them (this code relies on the MS _cwait function). Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** libos.tex 2002/01/30 05:49:46 1.76 --- libos.tex 2002/02/01 11:27:43 1.77 *************** *** 97,101 **** If \function{putenv()} is not provided, this mapping may be passed to ! the appropriate process-creation functions to cause child processes to use a modified environment. \end{datadesc} --- 97,101 ---- If \function{putenv()} is not provided, this mapping may be passed to ! the appropriate process-creation functions to cause child processes to use a modified environment. \end{datadesc} *************** *** 185,189 **** translated into corresponding calls to \function{putenv()}; however, calls to \function{putenv()} don't update \code{os.environ}, so it is ! actually preferable to assign to items of \code{os.environ}. \end{funcdesc} --- 185,189 ---- translated into corresponding calls to \function{putenv()}; however, calls to \function{putenv()} don't update \code{os.environ}, so it is ! actually preferable to assign to items of \code{os.environ}. \end{funcdesc} *************** *** 414,418 **** \begin{funcdesc}{ftruncate}{fd, length} ! Truncate the file corresponding to file descriptor \var{fd}, so that it is at most \var{length} bytes in size. Availability: \UNIX. --- 414,418 ---- \begin{funcdesc}{ftruncate}{fd, length} ! Truncate the file corresponding to file descriptor \var{fd}, so that it is at most \var{length} bytes in size. Availability: \UNIX. *************** *** 910,914 **** \begin{funcdesc}{abort}{} Generate a \constant{SIGABRT} signal to the current process. On ! \UNIX, the default behavior is to produce a core dump; on Windows, the process immediately returns an exit code of \code{3}. Be aware that programs which use \function{signal.signal()} to register a handler --- 910,914 ---- \begin{funcdesc}{abort}{} Generate a \constant{SIGABRT} signal to the current process. On ! \UNIX, the default behavior is to produce a core dump; on Windows, the process immediately returns an exit code of \code{3}. Be aware that programs which use \function{signal.signal()} to register a handler *************** *** 1167,1170 **** --- 1167,1173 ---- \begin{funcdesc}{waitpid}{pid, options} + The details of this function differ on \UNIX and Windows. + + On \UNIX: Wait for completion of a child process given by process id \var{pid}, and return a tuple containing its process id and exit status *************** *** 1172,1176 **** call are affected by the value of the integer \var{options}, which should be \code{0} for normal operation. - Availability: \UNIX. If \var{pid} is greater than \code{0}, \function{waitpid()} requests --- 1175,1178 ---- *************** *** 1181,1184 **** --- 1183,1199 ---- than \code{-1}, status is requested for any process in the process group \code{-\var{pid}} (the absolute value of \var{pid}). + + On Windows: + Wait for completion of a process given by process id \var{pid}, + and return a tuple containing \var{pid}, + and its exit status shifted left by 8 bits (shifting makes cross-platform + use of the function easier). + A \var{pid} less than or equal to \code{0} has no special meaning on + Windows, and raises an exception. + The value of integer \var{options} has no effect. + \var{pid} can refer to any process whose id is known, not necessarily a + child process. + The \function{spawn()} functions called with \constant{P_NOWAIT} + return suitable process ids. \end{funcdesc} *************** *** 1212,1216 **** \begin{funcdesc}{WEXITSTATUS}{status} If \code{WIFEXITED(\var{status})} is true, return the integer ! parameter to the \manpage{exit}{2} system call. Otherwise, the return value is meaningless. Availability: \UNIX. --- 1227,1231 ---- \begin{funcdesc}{WEXITSTATUS}{status} If \code{WIFEXITED(\var{status})} is true, return the integer ! parameter to the \manpage{exit}{2} system call. Otherwise, the return value is meaningless. Availability: \UNIX. From tim_one@users.sourceforge.net Fri Feb 1 11:27:46 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 01 Feb 2002 03:27:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.219,2.220 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv3161/python/Modules Modified Files: posixmodule.c Log Message: Implement os.waitpid() for Windows, in a way that's compatible with Linux where their capabilities intersect. Would be nice if people using non- MSVC compilers (Borland etc) took a whack at doing something similar for them (this code relies on the MS _cwait function). Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.219 retrieving revision 2.220 diff -C2 -d -r2.219 -r2.220 *** posixmodule.c 2002/01/30 05:46:57 2.219 --- posixmodule.c 2002/02/01 11:27:43 2.220 *************** *** 79,82 **** --- 79,83 ---- #define HAVE_POPEN 1 #define HAVE_SYSTEM 1 + #define HAVE_CWAIT 1 #else /* 16-bit Windows */ #endif /* !MS_WIN32 */ *************** *** 3334,3339 **** return Py_BuildValue("ii", pid, status_i); } - #endif /* HAVE_WAITPID */ #ifdef HAVE_WAIT --- 3335,3365 ---- return Py_BuildValue("ii", pid, status_i); } + #elif defined(HAVE_CWAIT) + + /* MS C has a variant of waitpid() that's usable for most purposes. */ + static char posix_waitpid__doc__[] = + "waitpid(pid, options) -> (pid, status << 8)\n" + "Wait for completion of a given process. options is ignored on Windows."; + + static PyObject * + posix_waitpid(PyObject *self, PyObject *args) + { + int pid, options; + int status; + + if (!PyArg_ParseTuple(args, "ii:waitpid", &pid, &options)) + return NULL; + Py_BEGIN_ALLOW_THREADS + pid = _cwait(&status, pid, options); + Py_END_ALLOW_THREADS + if (pid == -1) + return posix_error(); + else + /* shift the status left a byte so this is more like the + POSIX waitpid */ + return Py_BuildValue("ii", pid, status << 8); + } + #endif /* HAVE_WAITPID || HAVE_CWAIT */ #ifdef HAVE_WAIT *************** *** 5679,5683 **** {"wait", posix_wait, METH_VARARGS, posix_wait__doc__}, #endif /* HAVE_WAIT */ ! #ifdef HAVE_WAITPID {"waitpid", posix_waitpid, METH_VARARGS, posix_waitpid__doc__}, #endif /* HAVE_WAITPID */ --- 5705,5709 ---- {"wait", posix_wait, METH_VARARGS, posix_wait__doc__}, #endif /* HAVE_WAIT */ ! #if defined(HAVE_WAITPID) || defined(HAVE_CWAIT) {"waitpid", posix_waitpid, METH_VARARGS, posix_waitpid__doc__}, #endif /* HAVE_WAITPID */ From mal@lemburg.com Fri Feb 1 11:47:38 2002 From: mal@lemburg.com (M.-A. Lemburg) Date: Fri, 01 Feb 2002 12:47:38 +0100 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.352,1.353 References: Message-ID: <3C5A805A.550C6003@lemburg.com> Tim Peters wrote: > > Update of /cvsroot/python/python/dist/src/Misc > In directory usw-pr-cvs1:/tmp/cvs-serv3161/python/Misc > > Modified Files: > NEWS > Log Message: > Implement os.waitpid() for Windows, in a way that's compatible with Linux > where their capabilities intersect. Would be nice if people using non- > MSVC compilers (Borland etc) took a whack at doing something similar for > them (this code relies on the MS _cwait function). Wouldn't it be better to use Win32 APIs for this ? That way, other compilers on Windows will have a chance to use the same code. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From tim@zope.com Fri Feb 1 12:10:05 2002 From: tim@zope.com (Tim Peters) Date: Fri, 1 Feb 2002 07:10:05 -0500 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.352,1.353 In-Reply-To: <3C5A805A.550C6003@lemburg.com> Message-ID: [MAL] > Wouldn't it be better to use Win32 APIs for this ? That way, > other compilers on Windows will have a chance to use the > same code. I have no reason to believe that other compilers on Windows don't follow MS in this respect; they usually seem to ape the same functions, sometimes with or without leading underscores, or other trivial name changes. If you want to wrestle with the Win32 API, be my guest . From bwarsaw@users.sourceforge.net Fri Feb 1 14:55:49 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 01 Feb 2002 06:55:49 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0279.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv14542 Modified Files: pep-0279.txt Log Message: Integrated Raymond Hettinger's latest update Index: pep-0279.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0279.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0279.txt 2002/02/01 05:59:14 1.1 --- pep-0279.txt 2002/02/01 14:55:46 1.2 *************** *** 15,20 **** This PEP introduces four orthogonal (not mutually exclusive) ideas for enhancing the generators as introduced in Python version 2.2 ! [1]. The goal is increase the convenience, utility, and power of ! generators. --- 15,20 ---- This PEP introduces four orthogonal (not mutually exclusive) ideas for enhancing the generators as introduced in Python version 2.2 ! [1]. The goal is to increase the convenience, utility, and power ! of generators. *************** *** 116,120 **** if not values_left[0]: raise StopIteration ! yield func(*args) def xzip( *collections ): --- 116,120 ---- if not values_left[0]: raise StopIteration ! yield fun(*args) def xzip( *collections ): *************** *** 136,140 **** gen = iter(collection) while limit is None or cnt Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv24734 Modified Files: intobject.c Log Message: Bugfix candidate. Fix SF bug #511603: Error calling str on subclass of int Explicitly fill in tp_str with the same pointer as tp_repr. Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.79 retrieving revision 2.80 diff -C2 -d -r2.79 -r2.80 *** intobject.c 2001/12/04 23:05:10 2.79 --- intobject.c 2002/02/01 15:34:10 2.80 *************** *** 894,898 **** (hashfunc)int_hash, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ --- 894,898 ---- (hashfunc)int_hash, /* tp_hash */ 0, /* tp_call */ ! (reprfunc)int_repr, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ From jackjansen@users.sourceforge.net Fri Feb 1 15:46:31 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 01 Feb 2002 07:46:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Include pyport.h,2.41,2.42 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv29045/Include Modified Files: pyport.h Log Message: Got rid of a few more NeXT ifdefs. The last, I think. Index: pyport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v retrieving revision 2.41 retrieving revision 2.42 diff -C2 -d -r2.41 -r2.42 *** pyport.h 2001/12/25 19:07:38 2.41 --- pyport.h 2002/02/01 15:46:29 2.42 *************** *** 454,459 **** */ #if (!defined(__GNUC__) || __GNUC__ < 2 || \ ! (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \ ! defined(NEXT) ) && \ !defined(RISCOS) #define __attribute__(__x) --- 454,458 ---- */ #if (!defined(__GNUC__) || __GNUC__ < 2 || \ ! (__GNUC__ == 2 && __GNUC_MINOR__ < 7) ) && \ !defined(RISCOS) #define __attribute__(__x) From jackjansen@users.sourceforge.net Fri Feb 1 15:46:31 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 01 Feb 2002 07:46:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules fpectlmodule.c,2.15,2.16 grpmodule.c,2.15,2.16 posixmodule.c,2.220,2.221 pwdmodule.c,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv29045/Modules Modified Files: fpectlmodule.c grpmodule.c posixmodule.c pwdmodule.c Log Message: Got rid of a few more NeXT ifdefs. The last, I think. Index: fpectlmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/fpectlmodule.c,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -d -r2.15 -r2.16 *** fpectlmodule.c 2002/01/17 23:15:58 2.15 --- fpectlmodule.c 2002/02/01 15:46:29 2.16 *************** *** 212,221 **** PyOS_setsig(SIGFPE, handler); - /*-- NeXT -----------------------------------------------------------------*/ - #elif defined(NeXT) && defined(m68k) && defined(__GNUC__) - /* NeXT needs explicit csr set to generate SIGFPE */ - asm("fmovel #0x1400,fpcr"); /* set OVFL and ZD bits */ - PyOS_setsig(SIGFPE, handler); - /*-- Microsoft Windows, NT ------------------------------------------------*/ #elif defined(_MSC_VER) --- 212,215 ---- Index: grpmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/grpmodule.c,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -d -r2.15 -r2.16 *** grpmodule.c 2001/03/11 03:03:07 2.15 --- grpmodule.c 2002/02/01 15:46:29 2.16 *************** *** 28,38 **** p->gr_name, p->gr_passwd, - #if defined(NeXT) && defined(_POSIX_SOURCE) && defined(__LITTLE_ENDIAN__) - /* Correct a bug present on Intel machines in NextStep 3.2 and 3.3; - for later versions you may have to remove this */ - (long)p->gr_short_pad, /* ugh-NeXT broke the padding */ - #else (long)p->gr_gid, - #endif w); Py_DECREF(w); --- 28,32 ---- Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.220 retrieving revision 2.221 diff -C2 -d -r2.220 -r2.221 *** posixmodule.c 2002/02/01 11:27:43 2.220 --- posixmodule.c 2002/02/01 15:46:29 2.221 *************** *** 119,131 **** #endif - #ifdef NeXT - /* NeXT's and aren't worth much */ - #undef HAVE_UNISTD_H - #undef HAVE_UTIME_H - #define HAVE_WAITPID - /* #undef HAVE_GETCWD */ - #define UNION_WAIT /* This should really be checked for by autoconf */ - #endif - #ifndef HAVE_UNISTD_H #if defined(PYCC_VACPP) --- 119,122 ---- *************** *** 3324,3332 **** return NULL; Py_BEGIN_ALLOW_THREADS - #ifdef NeXT - pid = wait4(pid, &status, options, NULL); - #else pid = waitpid(pid, &status, options); - #endif Py_END_ALLOW_THREADS if (pid == -1) --- 3315,3319 ---- *************** *** 3970,4052 **** } #endif - - #ifdef NeXT - #define HAVE_PUTENV - /* Steve Spicklemire got this putenv from NeXTAnswers */ - static int - putenv(char *newval) - { - extern char **environ; - - static int firstTime = 1; - char **ep; - char *cp; - int esiz; - char *np; - - if (!(np = strchr(newval, '='))) - return 1; - *np = '\0'; - - /* look it up */ - for (ep=environ ; *ep ; ep++) - { - /* this should always be true... */ - if (cp = strchr(*ep, '=')) - { - *cp = '\0'; - if (!strcmp(*ep, newval)) - { - /* got it! */ - *cp = '='; - break; - } - *cp = '='; - } - else - { - *np = '='; - return 1; - } - } - - *np = '='; - if (*ep) - { - /* the string was already there: - just replace it with the new one */ - *ep = newval; - return 0; - } - - /* expand environ by one */ - for (esiz=2, ep=environ ; *ep ; ep++) - esiz++; - if (firstTime) - { - char **epp; - char **newenv; - if (!(newenv = malloc(esiz * sizeof(char *)))) - return 1; - - for (ep=environ, epp=newenv ; *ep ;) - *epp++ = *ep++; - *epp++ = newval; - *epp = (char *) 0; - environ = newenv; - } - else - { - if (!(environ = realloc(environ, esiz * sizeof(char *)))) - return 1; - environ[esiz - 2] = newval; - environ[esiz - 1] = (char *) 0; - firstTime = 0; - } - - return 0; - } - #endif /* NeXT */ - #ifdef HAVE_PUTENV --- 3957,3960 ---- Index: pwdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pwdmodule.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** pwdmodule.c 2001/03/11 03:03:07 1.25 --- pwdmodule.c 2002/02/01 15:46:29 1.26 *************** *** 25,37 **** p->pw_name, p->pw_passwd, - #if defined(NeXT) && defined(_POSIX_SOURCE) && defined(__LITTLE_ENDIAN__) - /* Correct a bug present on Intel machines in NextStep 3.2 and 3.3; - for later versions you may have to remove this */ - (long)p->pw_short_pad1, /* ugh-NeXT broke the padding */ - (long)p->pw_short_pad2, - #else (long)p->pw_uid, (long)p->pw_gid, - #endif p->pw_gecos, p->pw_dir, --- 25,30 ---- From jackjansen@users.sourceforge.net Fri Feb 1 16:01:07 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 01 Feb 2002 08:01:07 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_next.c,2.10,2.11 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv399 Modified Files: dynload_next.c Log Message: A new dynload_next, which actually only works on OSX but isn't renamed yet. By default every module is imported in its own namespace, but this can be changed by defining USE_DYLD_GLOBAL_NAMESPACE. In a future version this define will be replaced by a runtime setting, but that needs a bit more thought. This code is largely based on code and feedback from Steven Majewski, Marcel Prastawa, Manoj Plakal and other on pythonmac-sig. Index: dynload_next.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_next.c,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -d -r2.10 -r2.11 *** dynload_next.c 2001/12/06 22:58:56 2.10 --- dynload_next.c 2002/02/01 16:01:05 2.11 *************** *** 1,36 **** ! /* Support for dynamic loading of extension modules */ #include "Python.h" #include "importdl.h" - - #ifdef WITH_DYLD - - #define USE_DYLD - #include - #else /* WITH_DYLD */ - - #define USE_RLD - /* Define this to 1 if you want be able to load ObjC modules as well: - it switches between two different way of loading modules on the NeXT, - one that directly interfaces with the dynamic loader (rld_load(), which - does not correctly load ObjC object files), and another that uses the - ObjC runtime (objc_loadModules()) to do the job. - You'll have to add ``-ObjC'' to the compiler flags if you set this to 1. - */ - #define HANDLE_OBJC_MODULES 1 - #if HANDLE_OBJC_MODULES - #include - #include - #endif - - #include - - #endif /* WITH_DYLD */ - - const struct filedescr _PyImport_DynLoadFiletab[] = { {".so", "rb", C_EXTENSION}, --- 1,12 ---- ! /* Support for dynamic loading of extension modules on Mac OS X ! ** All references to "NeXT" are for historical reasons. ! */ #include "Python.h" #include "importdl.h" #include const struct filedescr _PyImport_DynLoadFiletab[] = { {".so", "rb", C_EXTENSION}, *************** *** 39,44 **** }; dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, ! const char *pathname, FILE *fp) { dl_funcptr p = NULL; --- 15,37 ---- }; + /* + ** Python modules are Mach-O MH_BUNDLE files. The best way to load these + ** is each in a private namespace, so you can load, say, a module bar and a + ** module foo.bar. If we load everything in the global namespace the two + ** initbar() symbols will conflict. + ** However, it seems some extension packages depend upon being able to access + ** each others' global symbols. There seems to be no way to eat our cake and + ** have it, so the USE_DYLD_GLOBAL_NAMESPACE define determines which behaviour + ** you get. + */ + + #ifdef USE_DYLD_GLOBAL_NAMESPACE + #define LINKOPTIONS NSLINKMODULE_OPTION_BINDNOW|NSLINKMODULE_OPTION_RETURN_ON_ERROR + #else + #define LINKOPTIONS NSLINKMODULE_OPTION_BINDNOW| \ + NSLINKMODULE_OPTION_RETURN_ON_ERROR|NSLINKMODULE_OPTION_PRIVATE + #endif dl_funcptr _PyImport_GetDynLoadFunc(const char *fqname, const char *shortname, ! const char *pathname, FILE *fp) { dl_funcptr p = NULL; *************** *** 47,118 **** PyOS_snprintf(funcname, sizeof(funcname), "_init%.200s", shortname); - #ifdef USE_RLD - { - NXStream *errorStream; - struct mach_header *new_header; - const char *filenames[2]; - long ret; - unsigned long ptr; - - errorStream = NXOpenMemory(NULL, 0, NX_WRITEONLY); - filenames[0] = pathname; - filenames[1] = NULL; - - #if HANDLE_OBJC_MODULES - - /* The following very bogus line of code ensures that - objc_msgSend, etc are linked into the binary. Without - it, dynamic loading of a module that includes objective-c - method calls will fail with "undefined symbol _objc_msgSend()". - This remains true even in the presence of the -ObjC flag - to the compiler - */ - - [Object name]; - - /* objc_loadModules() dynamically loads the object files - indicated by the paths in filenames. If there are any - errors generated during loading -- typically due to the - inability to find particular symbols -- an error message - will be written to errorStream. - It returns 0 if the module is successfully loaded, 1 - otherwise. - */ - - ret = !objc_loadModules(filenames, errorStream, - NULL, &new_header, NULL); - - #else /* !HANDLE_OBJC_MODULES */ - - ret = rld_load(errorStream, &new_header, - filenames, NULL); - - #endif /* HANDLE_OBJC_MODULES */ - - /* extract the error messages for the exception */ - if(!ret) { - char *streamBuf; - int len, maxLen; - - NXPutc(errorStream, (char)0); - - NXGetMemoryBuffer(errorStream, - &streamBuf, &len, &maxLen); - PyErr_SetString(PyExc_ImportError, streamBuf); - } - - if(ret && rld_lookup(errorStream, funcname, &ptr)) - p = (dl_funcptr) ptr; - - NXCloseMemory(errorStream, NX_FREEBUFFER); - - if(!ret) - return NULL; - } - #endif /* USE_RLD */ - #ifdef USE_DYLD - /* This is also NeXT-specific. However, frameworks (the new style - of shared library) and rld() can't be used in the same program; - instead, you have to use dyld, which is mostly unimplemented. */ { NSObjectFileImageReturnCode rc; --- 40,43 ---- *************** *** 121,125 **** --- 46,52 ---- NSSymbol theSym; const char *errString; + char errBuf[512]; + #ifdef USE_DYLD_GLOBAL_NAMESPACE if (NSIsSymbolNameDefined(funcname)) { theSym = NSLookupAndBindSymbol(funcname); *************** *** 127,156 **** return p; } rc = NSCreateObjectFileImageFromFile(pathname, &image); switch(rc) { ! default: ! case NSObjectFileImageFailure: ! case NSObjectFileImageFormat: ! /* for these a message is printed on stderr by dyld */ errString = "Can't create object file image"; break; ! case NSObjectFileImageSuccess: errString = NULL; break; ! case NSObjectFileImageInappropriateFile: errString = "Inappropriate file type for dynamic loading"; break; ! case NSObjectFileImageArch: errString = "Wrong CPU type in object file"; break; ! case NSObjectFileImageAccess: errString = "Can't read object file (no access)"; break; } if (errString == NULL) { ! newModule = NSLinkModule(image, pathname, ! NSLINKMODULE_OPTION_BINDNOW|NSLINKMODULE_OPTION_RETURN_ON_ERROR); ! if (!newModule) ! errString = "Failure linking new module"; } if (errString != NULL) { --- 54,90 ---- return p; } + #endif rc = NSCreateObjectFileImageFromFile(pathname, &image); switch(rc) { ! default: ! case NSObjectFileImageFailure: ! case NSObjectFileImageFormat: ! /* for these a message is printed on stderr by dyld */ errString = "Can't create object file image"; break; ! case NSObjectFileImageSuccess: errString = NULL; break; ! case NSObjectFileImageInappropriateFile: errString = "Inappropriate file type for dynamic loading"; break; ! case NSObjectFileImageArch: errString = "Wrong CPU type in object file"; break; ! case NSObjectFileImageAccess: errString = "Can't read object file (no access)"; break; } if (errString == NULL) { ! newModule = NSLinkModule(image, pathname, LINKOPTIONS); ! if (newModule == NULL) { ! int errNo; ! char *fileName, *moreErrorStr; ! NSLinkEditErrors c; ! NSLinkEditError( &c, &errNo, &fileName, &moreErrorStr ); ! PyOS_snprintf(errBuf, 512, "Failure linking new module: %s: %s", ! fileName, moreErrorStr); ! errString = errBuf; ! } } if (errString != NULL) { *************** *** 158,173 **** return NULL; } if (!NSIsSymbolNameDefined(funcname)) { /* UnlinkModule() isn't implemented in current versions, but calling it does no harm */ NSUnLinkModule(newModule, FALSE); PyErr_Format(PyExc_ImportError, ! "Loaded module does not contain symbol %.200s", ! funcname); return NULL; } theSym = NSLookupAndBindSymbol(funcname); p = (dl_funcptr)NSAddressOfSymbol(theSym); ! } ! #endif /* USE_DYLD */ return p; --- 92,117 ---- return NULL; } + #ifdef USE_DYLD_GLOBAL_NAMESPACE if (!NSIsSymbolNameDefined(funcname)) { /* UnlinkModule() isn't implemented in current versions, but calling it does no harm */ NSUnLinkModule(newModule, FALSE); PyErr_Format(PyExc_ImportError, ! "Loaded module does not contain symbol %.200s", ! funcname); return NULL; } theSym = NSLookupAndBindSymbol(funcname); + #else + theSym = NSLookupSymbolInModule(newModule, funcname); + if ( theSym == NULL ) { + NSUnLinkModule(newModule, FALSE); + PyErr_Format(PyExc_ImportError, + "Loaded module does not contain symbol %.200s", + funcname); + return NULL; + } + #endif p = (dl_funcptr)NSAddressOfSymbol(theSym); ! } return p; From gvanrossum@users.sourceforge.net Fri Feb 1 16:28:01 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 01 Feb 2002 08:28:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib CGIHTTPServer.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv9084 Modified Files: CGIHTTPServer.py Log Message: Wesley Chun's SF patch 511380: add CGIHTTPServer error supt for Win32 This uses os.popen3 (if it exists) to ensure that errors from a non-Python CGI script are logged. Bugfix candidate. Index: CGIHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/CGIHTTPServer.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** CGIHTTPServer.py 2001/10/26 03:38:14 1.20 --- CGIHTTPServer.py 2002/02/01 16:27:59 1.21 *************** *** 42,45 **** --- 42,46 ---- have_fork = hasattr(os, 'fork') have_popen2 = hasattr(os, 'popen2') + have_popen3 = hasattr(os, 'popen3') # Make rfile unbuffered -- we need to read one line and then pass *************** *** 124,128 **** ispy = self.is_python(scriptname) if not ispy: ! if not (self.have_fork or self.have_popen2): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) --- 125,129 ---- ispy = self.is_python(scriptname) if not ispy: ! if not (self.have_fork or self.have_popen2 or self.have_popen3): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) *************** *** 215,221 **** os._exit(127) ! elif self.have_popen2: ! # Windows -- use popen2 to create a subprocess import shutil os.environ.update(env) cmdline = scriptfile --- 216,226 ---- os._exit(127) ! elif self.have_popen2 or self.have_popen3: ! # Windows -- use popen2 or popen3 to create a subprocess import shutil + if self.have_popen3: + popenx = os.popen3 + else: + popenx = os.popen2 os.environ.update(env) cmdline = scriptfile *************** *** 233,237 **** except: nbytes = 0 ! fi, fo = os.popen2(cmdline, 'b') if self.command.lower() == "post" and nbytes > 0: data = self.rfile.read(nbytes) --- 238,246 ---- except: nbytes = 0 ! files = popenx(cmdline, 'b') ! fi = files[0] ! fo = files[1] ! if self.have_popen3: ! fe = files[2] if self.command.lower() == "post" and nbytes > 0: data = self.rfile.read(nbytes) *************** *** 239,242 **** --- 248,256 ---- fi.close() shutil.copyfileobj(fo, self.wfile) + if self.have_popen3: + errors = fe.read() + fe.close() + if errors: + self.log_error('%s', errors) sts = fo.close() if sts: From akuchling@users.sourceforge.net Fri Feb 1 18:29:36 2002 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 01 Feb 2002 10:29:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils file_util.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv7455 Modified Files: file_util.py Log Message: [Bug #220993; may also fix bug #479469] Fix flakiness when old installations are present, by always unlinking the destination file before copying to it. Without the unlink(), the copied file remains owned by its previous UID, causing the subsequent chmod() to fail. Bugfix candidate, though it may cause changes on platforms where file ownership behaves differently. Index: file_util.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/file_util.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** file_util.py 2001/12/06 20:51:35 1.11 --- file_util.py 2002/02/01 18:29:34 1.12 *************** *** 37,40 **** --- 37,47 ---- "could not open '%s': %s" % (src, errstr) + if os.path.exists(dst): + try: + os.unlink(dst) + except os.error, (errno, errstr): + raise DistutilsFileError, \ + "could not delete '%s': %s" % (dst, errstr) + try: fdst = open(dst, 'wb') From jackjansen@users.sourceforge.net Fri Feb 1 22:24:58 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 01 Feb 2002 14:24:58 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_next.c,2.11,2.12 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv4181 Modified Files: dynload_next.c Log Message: Got rid of an extra level of {} and funny formatting that was still there because of the NeXT history. Index: dynload_next.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_next.c,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -d -r2.11 -r2.12 *** dynload_next.c 2002/02/01 16:01:05 2.11 --- dynload_next.c 2002/02/01 22:24:56 2.12 *************** *** 37,117 **** dl_funcptr p = NULL; char funcname[258]; PyOS_snprintf(funcname, sizeof(funcname), "_init%.200s", shortname); - { - NSObjectFileImageReturnCode rc; - NSObjectFileImage image; - NSModule newModule; - NSSymbol theSym; - const char *errString; - char errBuf[512]; - #ifdef USE_DYLD_GLOBAL_NAMESPACE ! if (NSIsSymbolNameDefined(funcname)) { ! theSym = NSLookupAndBindSymbol(funcname); ! p = (dl_funcptr)NSAddressOfSymbol(theSym); ! return p; ! } #endif ! rc = NSCreateObjectFileImageFromFile(pathname, &image); ! switch(rc) { ! default: ! case NSObjectFileImageFailure: ! case NSObjectFileImageFormat: /* for these a message is printed on stderr by dyld */ errString = "Can't create object file image"; ! break; ! case NSObjectFileImageSuccess: errString = NULL; break; ! case NSObjectFileImageInappropriateFile: errString = "Inappropriate file type for dynamic loading"; break; ! case NSObjectFileImageArch: errString = "Wrong CPU type in object file"; break; ! case NSObjectFileImageAccess: errString = "Can't read object file (no access)"; break; ! } ! if (errString == NULL) { ! newModule = NSLinkModule(image, pathname, LINKOPTIONS); ! if (newModule == NULL) { ! int errNo; ! char *fileName, *moreErrorStr; ! NSLinkEditErrors c; ! NSLinkEditError( &c, &errNo, &fileName, &moreErrorStr ); ! PyOS_snprintf(errBuf, 512, "Failure linking new module: %s: %s", ! fileName, moreErrorStr); ! errString = errBuf; ! } ! } ! if (errString != NULL) { ! PyErr_SetString(PyExc_ImportError, errString); ! return NULL; } #ifdef USE_DYLD_GLOBAL_NAMESPACE ! if (!NSIsSymbolNameDefined(funcname)) { ! /* UnlinkModule() isn't implemented in current versions, but calling it does no harm */ ! NSUnLinkModule(newModule, FALSE); ! PyErr_Format(PyExc_ImportError, ! "Loaded module does not contain symbol %.200s", ! funcname); ! return NULL; ! } ! theSym = NSLookupAndBindSymbol(funcname); #else ! theSym = NSLookupSymbolInModule(newModule, funcname); ! if ( theSym == NULL ) { ! NSUnLinkModule(newModule, FALSE); ! PyErr_Format(PyExc_ImportError, ! "Loaded module does not contain symbol %.200s", ! funcname); ! return NULL; ! } ! #endif ! p = (dl_funcptr)NSAddressOfSymbol(theSym); } return p; --- 37,115 ---- dl_funcptr p = NULL; char funcname[258]; + NSObjectFileImageReturnCode rc; + NSObjectFileImage image; + NSModule newModule; + NSSymbol theSym; + const char *errString; + char errBuf[512]; PyOS_snprintf(funcname, sizeof(funcname), "_init%.200s", shortname); #ifdef USE_DYLD_GLOBAL_NAMESPACE ! if (NSIsSymbolNameDefined(funcname)) { ! theSym = NSLookupAndBindSymbol(funcname); ! p = (dl_funcptr)NSAddressOfSymbol(theSym); ! return p; ! } #endif ! rc = NSCreateObjectFileImageFromFile(pathname, &image); ! switch(rc) { ! default: ! case NSObjectFileImageFailure: ! case NSObjectFileImageFormat: /* for these a message is printed on stderr by dyld */ errString = "Can't create object file image"; ! break; ! case NSObjectFileImageSuccess: errString = NULL; break; ! case NSObjectFileImageInappropriateFile: errString = "Inappropriate file type for dynamic loading"; break; ! case NSObjectFileImageArch: errString = "Wrong CPU type in object file"; break; ! case NSObjectFileImageAccess: errString = "Can't read object file (no access)"; break; ! } ! if (errString == NULL) { ! newModule = NSLinkModule(image, pathname, LINKOPTIONS); ! if (newModule == NULL) { ! int errNo; ! char *fileName, *moreErrorStr; ! NSLinkEditErrors c; ! NSLinkEditError( &c, &errNo, &fileName, &moreErrorStr ); ! PyOS_snprintf(errBuf, 512, "Failure linking new module: %s: %s", ! fileName, moreErrorStr); ! errString = errBuf; } + } + if (errString != NULL) { + PyErr_SetString(PyExc_ImportError, errString); + return NULL; + } #ifdef USE_DYLD_GLOBAL_NAMESPACE ! if (!NSIsSymbolNameDefined(funcname)) { ! /* UnlinkModule() isn't implemented in current versions, but calling it does no harm */ ! NSUnLinkModule(newModule, FALSE); ! PyErr_Format(PyExc_ImportError, ! "Loaded module does not contain symbol %.200s", ! funcname); ! return NULL; ! } ! theSym = NSLookupAndBindSymbol(funcname); #else ! theSym = NSLookupSymbolInModule(newModule, funcname); ! if ( theSym == NULL ) { ! NSUnLinkModule(newModule, FALSE); ! PyErr_Format(PyExc_ImportError, ! "Loaded module does not contain symbol %.200s", ! funcname); ! return NULL; } + #endif + p = (dl_funcptr)NSAddressOfSymbol(theSym); + } return p; From tim_one@users.sourceforge.net Sat Feb 2 00:08:17 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 01 Feb 2002 16:08:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Include patchlevel.h,2.61,2.62 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv32246/python/Include Modified Files: patchlevel.h Log Message: Change the version string from "2.2+" to "2.3a0". disutils peels off the first 3 characters of this string in several places, so for as long as they remain "2.2" it confuses the heck out of attempts to build 2.3 stuff using distutils. Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.61 retrieving revision 2.62 diff -C2 -d -r2.61 -r2.62 *** patchlevel.h 2001/12/21 20:05:33 2.61 --- patchlevel.h 2002/02/02 00:08:15 2.62 *************** *** 27,31 **** /* Version as a string */ ! #define PY_VERSION "2.2+" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 27,31 ---- /* Version as a string */ ! #define PY_VERSION "2.3a0" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From gvanrossum@users.sourceforge.net Mon Feb 4 01:59:25 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sun, 03 Feb 2002 17:59:25 -0800 Subject: [Python-checkins] CVS: python/dist/src README,1.137,1.138 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv32722 Modified Files: README Log Message: Quick build: clarify that you have to do "make install" as root; OS info: add info about Red Hat's python and python2. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** README 2002/01/04 15:59:57 1.137 --- README 2002/02/04 01:59:23 1.138 *************** *** 42,48 **** To start building right away (on UNIX): type "./configure" in the ! current directory and when it finishes, type "make". The section ! `Build Instructions' below is still recommended reading, especially ! the part on customizing Modules/Setup. --- 42,51 ---- To start building right away (on UNIX): type "./configure" in the ! current directory and when it finishes, type "make". This creates an ! executable "./python"; to install in /usr/local, first do "su root" ! and then "make install". ! ! The section `Build Instructions' below is still recommended reading, ! especially the part on customizing Modules/Setup. *************** *** 245,248 **** --- 248,258 ---- Modules/Setup, or comment out the crypt module in the same file. Most modern Linux systems use glibc2. + + Red Hat Linux: There's an executable /usr/bin/python which is Python + 1.5.2 on most Red Hat installations; several key Red Hat tools + require this version. Python 2.1.x may be installed as + /usr/bin/python2. The Makefile installs Python as + /usr/local/bin/python, which may or may not take precedence + over /usr/bin/python, depending on how you have set up $PATH. FreeBSD 3.x and probably platforms with NCurses that use libmytinfo or From jvr@users.sourceforge.net Mon Feb 4 11:53:55 2002 From: jvr@users.sourceforge.net (Just van Rossum) Date: Mon, 04 Feb 2002 03:53:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyConsole.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv21270 Modified Files: PyConsole.py Log Message: Flush screen buffer upon console.flush() and output.flush(). This fixes bug #511992. Index: PyConsole.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyConsole.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PyConsole.py 2002/01/21 23:00:52 1.10 --- PyConsole.py 2002/02/04 11:53:53 1.11 *************** *** 109,112 **** --- 109,114 ---- self.ted.WEClearUndo() self.updatescrollbars() + if Qd.QDIsPortBuffered(self._parentwindow.wid): + Qd.QDFlushPortBuffer(self._parentwindow.wid, None) def selection_ok(self): *************** *** 299,302 **** --- 301,306 ---- self.w.outputtext.updatescrollbars() self.w.outputtext.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 1) + if Qd.QDIsPortBuffered(self.w.wid): + Qd.QDFlushPortBuffer(self.w.wid, None) def show(self): From jvr@users.sourceforge.net Mon Feb 4 12:48:09 2002 From: jvr@users.sourceforge.net (Just van Rossum) Date: Mon, 04 Feb 2002 04:48:09 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PythonIDEMain.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv942 Modified Files: PythonIDEMain.py Log Message: Don't append quit menu when on OSX, it is special and automatic there. Index: PythonIDEMain.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDEMain.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PythonIDEMain.py 2002/01/21 23:00:52 1.15 --- PythonIDEMain.py 2002/02/04 12:48:06 1.16 *************** *** 15,18 **** --- 15,26 ---- ELIPSES = '\xc9' + def runningOnOSX(): + from gestalt import gestalt + gestaltMenuMgrAquaLayoutBit = 1 # menus have the Aqua 1.0 layout + gestaltMenuMgrAquaLayoutMask = (1L << gestaltMenuMgrAquaLayoutBit) + value = gestalt("menu") & gestaltMenuMgrAquaLayoutMask + return not not value + + class PythonIDE(Wapplication.Application): *************** *** 63,68 **** FrameWork.Separator(m) saveasappletitem = FrameWork.MenuItem(m, "Save as Applet"+ELIPSES, None, 'save_as_applet') ! FrameWork.Separator(m) ! quititem = FrameWork.MenuItem(m, "Quit", "Q", 'quit') m = Wapplication.Menu(self.menubar, "Edit") --- 71,79 ---- FrameWork.Separator(m) saveasappletitem = FrameWork.MenuItem(m, "Save as Applet"+ELIPSES, None, 'save_as_applet') ! if not runningOnOSX(): ! # On OSX there's a special "magic" quit menu, so we shouldn't add ! # it to the File menu. ! FrameWork.Separator(m) ! quititem = FrameWork.MenuItem(m, "Quit", "Q", 'quit') m = Wapplication.Menu(self.menubar, "Edit") From jvr@users.sourceforge.net Mon Feb 4 12:50:26 2002 From: jvr@users.sourceforge.net (Just van Rossum) Date: Mon, 04 Feb 2002 04:50:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wapplication.py,1.15,1.16 Wwindows.py,1.15,1.16 PyEdit.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv1441 Modified Files: Wapplication.py Wwindows.py PyEdit.py Log Message: Added minimal support for floating windows. Index: Wapplication.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wapplication.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Wapplication.py 2002/01/21 23:00:52 1.15 --- Wapplication.py 2002/02/04 12:50:24 1.16 *************** *** 7,13 **** import traceback from types import * - from Carbon import Menu; MenuToolbox = Menu; del Menu KILLUNKNOWNWINDOWS = 0 # Set to 0 for debugging. --- 7,18 ---- import traceback from types import * from Carbon import Menu; MenuToolbox = Menu; del Menu + if hasattr(Win, "FrontNonFloatingWindow"): + MyFrontWindow = Win.FrontNonFloatingWindow + else: + MyFrontWindow = Win.FrontWindow + + KILLUNKNOWNWINDOWS = 0 # Set to 0 for debugging. *************** *** 116,120 **** def do_frontWindowMethod(self, attr, *args): ! wid = Win.FrontWindow() if wid and self._windows.has_key(wid): window = self._windows[wid] --- 121,125 ---- def do_frontWindowMethod(self, attr, *args): ! wid = MyFrontWindow() if wid and self._windows.has_key(wid): window = self._windows[wid] *************** *** 147,151 **** ch = self.fkeymaps[keycode] modifiers = modifiers | FrameWork.cmdKey ! wid = Win.FrontWindow() if modifiers & FrameWork.cmdKey and not modifiers & FrameWork.shiftKey: if wid and self._windows.has_key(wid): --- 152,156 ---- ch = self.fkeymaps[keycode] modifiers = modifiers | FrameWork.cmdKey ! wid = MyFrontWindow() if modifiers & FrameWork.cmdKey and not modifiers & FrameWork.shiftKey: if wid and self._windows.has_key(wid): *************** *** 176,180 **** (what, message, when, where, modifiers) = event self.checkopenwindowsmenu() ! wid = Win.FrontWindow() if wid and self._windows.has_key(wid): self.checkmenus(self._windows[wid]) --- 181,185 ---- (what, message, when, where, modifiers) = event self.checkopenwindowsmenu() ! wid = MyFrontWindow() if wid and self._windows.has_key(wid): self.checkmenus(self._windows[wid]) *************** *** 210,214 **** if self._openwindowscheckmark: self.openwindowsmenu.menu.CheckMenuItem(self._openwindowscheckmark, 0) ! window = Win.FrontWindow() if window: for item, wid in self._openwindows.items(): --- 215,219 ---- if self._openwindowscheckmark: self.openwindowsmenu.menu.CheckMenuItem(self._openwindowscheckmark, 0) ! window = MyFrontWindow() if window: for item, wid in self._openwindows.items(): *************** *** 442,446 **** def _getmenuhandler(self, callback): menuhandler = None ! wid = Win.FrontWindow() if wid and self.bar.parent._windows.has_key(wid): window = self.bar.parent._windows[wid] --- 447,451 ---- def _getmenuhandler(self, callback): menuhandler = None ! wid = MyFrontWindow() if wid and self.bar.parent._windows.has_key(wid): window = self.bar.parent._windows[wid] Index: Wwindows.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wwindows.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Wwindows.py 2002/01/21 23:00:52 1.15 --- Wwindows.py 2002/02/04 12:50:24 1.16 *************** *** 8,12 **** --- 8,17 ---- from types import InstanceType, StringType + if hasattr(Win, "FrontNonFloatingWindow"): + MyFrontWindow = Win.FrontNonFloatingWindow + else: + MyFrontWindow = Win.FrontWindow + class Window(FrameWork.Window, Wbase.SelectableWidget): *************** *** 489,495 **** def do_key(self, event): (what, message, when, where, modifiers) = event ! w = Win.FrontWindow() ! if w <> self.wid: ! return c = chr(message & Events.charCodeMask) if modifiers & Events.cmdKey: --- 494,500 ---- def do_key(self, event): (what, message, when, where, modifiers) = event ! #w = Win.FrontWindow() ! #if w <> self.wid: ! # return c = chr(message & Events.charCodeMask) if modifiers & Events.cmdKey: *************** *** 553,557 **** import W app = W.getapplication() ! wid = Win.FrontWindow() if wid and app._windows.has_key(wid): window = app._windows[wid] --- 558,562 ---- import W app = W.getapplication() ! wid = MyFrontWindow() if wid and app._windows.has_key(wid): window = app._windows[wid] Index: PyEdit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyEdit.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** PyEdit.py 2002/01/21 23:00:52 1.27 --- PyEdit.py 2002/02/04 12:50:24 1.28 *************** *** 18,21 **** --- 18,27 ---- import re + if hasattr(Win, "FrontNonFloatingWindow"): + MyFrontWindow = Win.FrontNonFloatingWindow + else: + MyFrontWindow = Win.FrontWindow + + try: import Wthreading *************** *** 1190,1194 **** def findeditor(topwindow, fromtop = 0): ! wid = Win.FrontWindow() if not fromtop: if topwindow.w and wid == topwindow.w.wid: --- 1196,1200 ---- def findeditor(topwindow, fromtop = 0): ! wid = MyFrontWindow() if not fromtop: if topwindow.w and wid == topwindow.w.wid: From jvr@users.sourceforge.net Mon Feb 4 12:52:46 2002 From: jvr@users.sourceforge.net (Just van Rossum) Date: Mon, 04 Feb 2002 04:52:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib FrameWork.py,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv2080 Modified Files: FrameWork.py Log Message: Added minimal support for floating windows. Index: FrameWork.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/FrameWork.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** FrameWork.py 2002/01/21 23:01:24 1.48 --- FrameWork.py 2002/02/04 12:52:44 1.49 *************** *** 28,31 **** --- 28,36 ---- import EasyDialogs + try: + MyFrontWindow = FrontNonFloatingWindow + except NameError: + MyFrontWindow = FrontWindow + kHighLevelEvent = 23 # Don't know what header file this should come from SCROLLBARWIDTH = 16 # Again, not a clue... *************** *** 349,353 **** else: # See whether the front window wants it ! w = FrontWindow() if w and self._windows.has_key(w): window = self._windows[w] --- 354,358 ---- else: # See whether the front window wants it ! w = MyFrontWindow() if w and self._windows.has_key(w): window = self._windows[w] *************** *** 394,398 **** def do_suspendresume(self, event): (what, message, when, where, modifiers) = event ! wid = FrontWindow() if wid and self._windows.has_key(wid): window = self._windows[wid] --- 399,403 ---- def do_suspendresume(self, event): (what, message, when, where, modifiers) = event ! wid = MyFrontWindow() if wid and self._windows.has_key(wid): window = self._windows[wid] *************** *** 498,502 **** label, shortcut, callback, kind = menu.items[i] if type(callback) == types.StringType: ! wid = Win.FrontWindow() if wid and self.parent._windows.has_key(wid): window = self.parent._windows[wid] --- 503,507 ---- label, shortcut, callback, kind = menu.items[i] if type(callback) == types.StringType: ! wid = MyFrontWindow() if wid and self.parent._windows.has_key(wid): window = self.parent._windows[wid] *************** *** 590,594 **** else: # callback is string ! wid = Win.FrontWindow() if wid and self.bar.parent._windows.has_key(wid): window = self.bar.parent._windows[wid] --- 595,599 ---- else: # callback is string ! wid = MyFrontWindow() if wid and self.bar.parent._windows.has_key(wid): window = self.bar.parent._windows[wid] *************** *** 635,639 **** item = reply & 0xffff if not window: ! wid = Win.FrontWindow() try: window = self.bar.parent._windows[wid] --- 640,644 ---- item = reply & 0xffff if not window: ! wid = MyFrontWindow() try: window = self.bar.parent._windows[wid] *************** *** 798,802 **** # the activate event. # ! if FrontWindow() <> window: window.SelectWindow() return --- 803,807 ---- # the activate event. # ! if MyFrontWindow() <> window: window.SelectWindow() return *************** *** 847,851 **** def do_inContent(self, partcode, window, event): ! if FrontWindow() <> window: window.SelectWindow() return --- 852,856 ---- def do_inContent(self, partcode, window, event): ! if MyFrontWindow() <> window: window.SelectWindow() return From fdrake@users.sourceforge.net Mon Feb 4 19:48:27 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 04 Feb 2002 11:48:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs boilerplate.tex,1.71,1.72 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv19005/texinputs Modified Files: boilerplate.tex Log Message: Update version number to match Include/patchlevel.h. Index: boilerplate.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/boilerplate.tex,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** boilerplate.tex 2001/12/21 16:46:28 1.71 --- boilerplate.tex 2002/02/04 19:48:25 1.72 *************** *** 7,11 **** \date{\today} % XXX update before release! ! \release{2.2} % software release, not documentation ! \setreleaseinfo{+} % empty for final release ! \setshortversion{2.2} % major.minor only for software --- 7,11 ---- \date{\today} % XXX update before release! ! \release{2.3} % software release, not documentation ! \setreleaseinfo{a0} % empty for final release ! \setshortversion{2.3} % major.minor only for software From fdrake@users.sourceforge.net Mon Feb 4 19:49:31 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 04 Feb 2002 11:49:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc Makefile,1.236,1.237 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv19247 Modified Files: Makefile Log Message: Update version number to match Include/patchlevel.h. Make sure we clean up all the temp files craeted for the typeset formats. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.236 retrieving revision 1.237 diff -C2 -d -r1.236 -r1.237 *** Makefile 2001/12/21 16:46:26 1.236 --- Makefile 2002/02/04 19:49:29 1.237 *************** *** 67,71 **** # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2+ PYTHON= python --- 67,71 ---- # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.3a0 PYTHON= python *************** *** 612,615 **** --- 612,617 ---- rm -f $(DVIFILES) $(PSFILES) $(PDFFILES) cd $(INFODIR) && $(MAKE) clobber + rm -f paper-$(PAPER)/*.tex paper-$(PAPER)/*.ind paper-$(PAPER)/*.idx + rm -f paper-$(PAPER)/*.l2h paper-$(PAPER)/*.how paper-$(PAPER)/README rm -rf html/index.html html/modindex.html html/acks.html rm -rf html/api/ html/doc/ html/ext/ html/lib/ html/mac/ From bwarsaw@users.sourceforge.net Mon Feb 4 21:03:06 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 04 Feb 2002 13:03:06 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0279.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv9926 Modified Files: pep-0279.txt Log Message: Raymond Hettinger's latest updates. Index: pep-0279.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0279.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0279.txt 2002/02/01 14:55:46 1.2 --- pep-0279.txt 2002/02/04 21:03:03 1.3 *************** *** 8,12 **** Created: 30-Jan-2002 Python-Version: 2.3 ! Post-History: --- 8,12 ---- Created: 30-Jan-2002 Python-Version: 2.3 ! Post-History: *************** *** 46,50 **** making generator creation as convenient as list creation. ! 3. Extend the syntax of the 'yield' keyword to enable two way parameter passing. The resulting increase in power simplifies the creation of consumer streams which have a complex execution --- 46,50 ---- making generator creation as convenient as list creation. ! 3. Extend the syntax of the 'yield' keyword to enable generator parameter passing. The resulting increase in power simplifies the creation of consumer streams which have a complex execution *************** *** 58,62 **** existing implementation and require little additional effort to incorporate. Each is backward compatible and requires no new ! keywords. --- 58,63 ---- existing implementation and require little additional effort to incorporate. Each is backward compatible and requires no new ! keywords. These generator tools go into Python 2.3 when ! generators become final and are not imported from __future__. *************** *** 150,180 **** If a list comprehension starts with a 'yield' keyword, then ! express the remainder of the statement as generator. For example: ! g = [yield (len(line),line) for line in file.readline() if len(line)>5] ! print g.next() ! print g.next() This would be implemented as if it had been written: ! def __temp_gen(): ! for line in file.readline(): ! if len(line) > 5: ! yield (len(line), line) ! g = __temp_gen() ! print g.next() ! print g.next() ! ! Note A: There is a difference in the above implementation as ! compared to list comprehensions. For a generator comprehension, ! the variables are created in a separate scope while list ! comprehensions use the enclosing scope. If this PEP is accepted, ! the parser should generate byte code that eliminates this ! difference by passing the line variable in the enclosing scope and ! using that same variable passed by reference inside the generator. ! This will make the behavior of generator comprehension identical ! to that of list comprehensions. ! Note B: There is some debate about whether the enclosing brackets should be part of the syntax for generator comprehensions. On the plus side, it neatly parallels list comprehensions and would be --- 151,168 ---- If a list comprehension starts with a 'yield' keyword, then ! express the comprehension with a generator. For example: ! g = [yield (len(line),line) for line in file if len(line)>5] This would be implemented as if it had been written: ! class __Temp: ! def __iter__(self): ! for line in file: ! if len(line) > 5: ! yield (len(line), line) ! g = __Temp() ! Note A: There is some debate about whether the enclosing brackets should be part of the syntax for generator comprehensions. On the plus side, it neatly parallels list comprehensions and would be *************** *** 191,195 **** ! Specification for two-way Generator Parameter Passing: 1. Allow 'yield' to assign a value as in: --- 179,183 ---- ! Specification for Generator Parameter Passing: 1. Allow 'yield' to assign a value as in: *************** *** 210,214 **** is that a value can be sent into the generator. By analogy, consider the quality improvement from GOSUB (which had no argument ! passing mechanism) to modern procedure calls (which pass in arguments and return values). --- 198,202 ---- is that a value can be sent into the generator. By analogy, consider the quality improvement from GOSUB (which had no argument ! passing mechanism) to modern procedure calls (which can pass in arguments and return values). *************** *** 235,239 **** queues. A class-based approach competes well when there are no complex execution states or variable states. When the complexity ! increases, generators with two-way communication are much simpler because they automatically save state (unlike classes which must explicitly save the variable and execution state in instance --- 223,227 ---- queues. A class-based approach competes well when there are no complex execution states or variable states. When the complexity ! increases, generators with parameter passing are much simpler because they automatically save state (unlike classes which must explicitly save the variable and execution state in instance *************** *** 241,245 **** ! Example of a Complex Consumer The encoder for arithmetic compression sends a series of --- 229,233 ---- ! Example of a Complex Consumer The encoder for arithmetic compression sends a series of *************** *** 282,285 **** --- 270,282 ---- + Example of a Producer and Consumer Used Together in a Pipelike Fashion + + 'Analogy to: source | upper | sink' + sink = sinkgen() + sink.next() + for word in source(): + sink.next( word.upper() ) + + Specification for Generator Exception Passing: *************** *** 312,318 **** already associated with exceptions in other languages. References ! [1] PEP 255 Simple Generators http://python.sourceforge.net/peps/pep-0255.html --- 309,322 ---- already associated with exceptions in other languages. + Note B: The throw syntax should exactly match raise's syntax including: + raise string g.throw(string) + raise string, data g.throw(string,data) + raise class, instance g.throw(class,instance) + raise instance g.throw(instance) + raise g.throw() + References ! [1] PEP 255 Simple Generators http://python.sourceforge.net/peps/pep-0255.html *************** *** 321,325 **** http://python.sourceforge.net/peps/pep-0212.html ! [3] PEP 202 List Comprehensions http://python.sourceforge.net/peps/pep-0202.html --- 325,329 ---- http://python.sourceforge.net/peps/pep-0212.html ! [3] PEP 202 List Comprehensions http://python.sourceforge.net/peps/pep-0202.html *************** *** 327,331 **** tease out these proposals: ! Indexed Function http://groups.google.com/groups?hl=en&th=33f778d92dd5720a --- 331,335 ---- tease out these proposals: ! Indexed Function http://groups.google.com/groups?hl=en&th=33f778d92dd5720a *************** *** 340,347 **** Discussion Draft of this PEP ! http://groups.google.com/groups?hl=en&th=df8b5e7709957eb7 [5] Dr. David Mertz's draft column for Charming Python. ! href="http://gnosis.cx/publish/programming/charming_python_b5.txt --- 344,351 ---- Discussion Draft of this PEP ! http://groups.google.com/groups?hl=en&th=df8b5e7709957eb7 [5] Dr. David Mertz's draft column for Charming Python. ! http://gnosis.cx/publish/programming/charming_python_b5.txt *************** *** 357,358 **** --- 361,364 ---- fill-column: 70 End: + + From bwarsaw@users.sourceforge.net Mon Feb 4 21:09:12 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 04 Feb 2002 13:09:12 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0246.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv11873 Modified Files: pep-0246.txt Log Message: Spelling error. Index: pep-0246.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0246.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0246.txt 2001/07/05 19:20:16 1.3 --- pep-0246.txt 2002/02/04 21:09:10 1.4 *************** *** 18,22 **** This proposal provides a built-in "adapt" function that, for any object X and protocol Y, can be used to ask the Python environment ! for a version of X complaint with Y. Behind the scenes, the mechanism asks the object X: "Are you now, or do you know how to wrap yourself to provide, a supporter of protocol Y?". And, if --- 18,22 ---- This proposal provides a built-in "adapt" function that, for any object X and protocol Y, can be used to ask the Python environment ! for a version of X compliant with Y. Behind the scenes, the mechanism asks the object X: "Are you now, or do you know how to wrap yourself to provide, a supporter of protocol Y?". And, if From fdrake@users.sourceforge.net Mon Feb 4 21:15:44 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 04 Feb 2002 13:15:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools support.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv13834/tools Modified Files: support.py Log Message: When linking to an index page, explicitly name index.html instead of using "./". The later does not work nicely when browsing docs on a local disk (as in the installed docs on Windows). Index: support.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/support.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** support.py 2001/10/22 15:07:16 1.4 --- support.py 2002/02/04 21:15:42 1.5 *************** *** 26,30 **** columns = 1 letters = 0 ! uplink = "./" uptitle = "Python Documentation Index" --- 26,30 ---- columns = 1 letters = 0 ! uplink = "index.html" uptitle = "Python Documentation Index" From fdrake@users.sourceforge.net Mon Feb 4 21:15:44 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 04 Feb 2002 13:15:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/html about.html,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/html In directory usw-pr-cvs1:/tmp/cvs-serv13834/html Modified Files: about.html Log Message: When linking to an index page, explicitly name index.html instead of using "./". The later does not work nicely when browsing docs on a local disk (as in the installed docs on Windows). Index: about.html =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/html/about.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** about.html 2000/10/05 05:17:29 1.3 --- about.html 2002/02/04 21:15:42 1.4 *************** *** 14,18 **** ! up ! up Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv20884/texinputs Modified Files: reportingbugs.tex Log Message: Update the instructions on reporting bugs to reflect that anonymous reports are no longer accepted. Index: reportingbugs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/reportingbugs.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** reportingbugs.tex 2000/09/21 21:32:14 1.1 --- reportingbugs.tex 2002/02/04 21:43:08 1.2 *************** *** 6,9 **** --- 6,14 ---- or its documentation. + Before submitting a report, you will be required to log into SourceForge; + this will make it possible for the developers to contact you + for additional information if needed. It is not possible to submit a + bug report anonymously. + All bug reports should be submitted via the Python Bug Tracker on SourceForge (\url{http://sourceforge.net/bugs/?group_id=5470}). The *************** *** 11,22 **** entered and submitted to the developers. - Before submitting a report, please log into SourceForge if you are a - member; this will make it possible for the developers to contact you - for additional information if needed. If you are not a SourceForge - member but would not mind the developers contacting you, you may - include your email address in your bug description. In this case, - please realize that the information is publically available and cannot - be protected. - The first step in filing a report is to determine whether the problem has already been reported. The advantage in doing so, aside from --- 16,19 ---- *************** *** 47,52 **** Each bug report will be assigned to a developer who will determine ! what needs to be done to correct the problem. If you have a ! SourceForge account and logged in to report the problem, you will receive an update each time action is taken on the bug. --- 44,48 ---- Each bug report will be assigned to a developer who will determine ! what needs to be done to correct the problem. You will receive an update each time action is taken on the bug. From fdrake@users.sourceforge.net Mon Feb 4 21:43:46 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 04 Feb 2002 13:43:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs reportingbugs.tex,1.1,1.1.24.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv21045/texinputs Modified Files: Tag: release22-maint reportingbugs.tex Log Message: Update the instructions on reporting bugs to reflect that anonymous reports are no longer accepted. Index: reportingbugs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/reportingbugs.tex,v retrieving revision 1.1 retrieving revision 1.1.24.1 diff -C2 -d -r1.1 -r1.1.24.1 *** reportingbugs.tex 2000/09/21 21:32:14 1.1 --- reportingbugs.tex 2002/02/04 21:43:44 1.1.24.1 *************** *** 6,9 **** --- 6,14 ---- or its documentation. + Before submitting a report, you will be required to log into SourceForge; + this will make it possible for the developers to contact you + for additional information if needed. It is not possible to submit a + bug report anonymously. + All bug reports should be submitted via the Python Bug Tracker on SourceForge (\url{http://sourceforge.net/bugs/?group_id=5470}). The *************** *** 11,22 **** entered and submitted to the developers. - Before submitting a report, please log into SourceForge if you are a - member; this will make it possible for the developers to contact you - for additional information if needed. If you are not a SourceForge - member but would not mind the developers contacting you, you may - include your email address in your bug description. In this case, - please realize that the information is publically available and cannot - be protected. - The first step in filing a report is to determine whether the problem has already been reported. The advantage in doing so, aside from --- 16,19 ---- *************** *** 47,52 **** Each bug report will be assigned to a developer who will determine ! what needs to be done to correct the problem. If you have a ! SourceForge account and logged in to report the problem, you will receive an update each time action is taken on the bug. --- 44,48 ---- Each bug report will be assigned to a developer who will determine ! what needs to be done to correct the problem. You will receive an update each time action is taken on the bug. From fdrake@users.sourceforge.net Mon Feb 4 21:44:01 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 04 Feb 2002 13:44:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs reportingbugs.tex,1.1,1.1.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv21149/texinputs Modified Files: Tag: release21-maint reportingbugs.tex Log Message: Update the instructions on reporting bugs to reflect that anonymous reports are no longer accepted. Index: reportingbugs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/reportingbugs.tex,v retrieving revision 1.1 retrieving revision 1.1.6.1 diff -C2 -d -r1.1 -r1.1.6.1 *** reportingbugs.tex 2000/09/21 21:32:14 1.1 --- reportingbugs.tex 2002/02/04 21:43:58 1.1.6.1 *************** *** 6,9 **** --- 6,14 ---- or its documentation. + Before submitting a report, you will be required to log into SourceForge; + this will make it possible for the developers to contact you + for additional information if needed. It is not possible to submit a + bug report anonymously. + All bug reports should be submitted via the Python Bug Tracker on SourceForge (\url{http://sourceforge.net/bugs/?group_id=5470}). The *************** *** 11,22 **** entered and submitted to the developers. - Before submitting a report, please log into SourceForge if you are a - member; this will make it possible for the developers to contact you - for additional information if needed. If you are not a SourceForge - member but would not mind the developers contacting you, you may - include your email address in your bug description. In this case, - please realize that the information is publically available and cannot - be protected. - The first step in filing a report is to determine whether the problem has already been reported. The advantage in doing so, aside from --- 16,19 ---- *************** *** 47,52 **** Each bug report will be assigned to a developer who will determine ! what needs to be done to correct the problem. If you have a ! SourceForge account and logged in to report the problem, you will receive an update each time action is taken on the bug. --- 44,48 ---- Each bug report will be assigned to a developer who will determine ! what needs to be done to correct the problem. You will receive an update each time action is taken on the bug. From lemburg@users.sourceforge.net Mon Feb 4 22:38:30 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Mon, 04 Feb 2002 14:38:30 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep2html.py,1.29,1.30 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv8170 Modified Files: pep2html.py Log Message: Fixed a typo which caused help (-h) to fail. Index: pep2html.py =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** pep2html.py 2001/11/12 14:58:07 1.29 --- pep2html.py 2002/02/04 22:38:27 1.30 *************** *** 59,63 **** def usage(code, msg=''): ! print >> sys.stderr, __docs__ % globals() if msg: print >> sys.stderr, msg --- 59,63 ---- def usage(code, msg=''): ! print >> sys.stderr, __doc__ % globals() if msg: print >> sys.stderr, msg From lemburg@users.sourceforge.net Mon Feb 4 22:47:09 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Mon, 04 Feb 2002 14:47:09 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0249.txt,1.5,1.6 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv10599 Modified Files: pep-0249.txt Log Message: Added optional DB API 2.0 extensions as discussed on the DB SIG. Index: pep-0249.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0249.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0249.txt 2001/08/08 08:38:06 1.5 --- pep-0249.txt 2002/02/04 22:47:07 1.6 *************** *** 35,43 **** Guide at http://www.python.org/topics/database/. ! This document describes the Python Database API Specification ! 2.0. The previous version 1.0 version is still available as ! reference, in PEP 248. Package writers are encouraged to use ! this version of the specification as basis for new interfaces. ! Module Interface --- 35,43 ---- Guide at http://www.python.org/topics/database/. ! This document describes the Python Database API Specification 2.0 ! and a set of common optional extensions. The previous version 1.0 ! version is still available as reference, in PEP 248. Package ! writers are encouraged to use this version of the specification as ! basis for new interfaces. Module Interface *************** *** 193,197 **** Connection Objects should respond to the following methods: ! close() Close the connection now (rather than whenever __del__ is --- 193,197 ---- Connection Objects should respond to the following methods: ! .close() Close the connection now (rather than whenever __del__ is *************** *** 205,209 **** ! commit() Commit any pending transaction to the database. Note that --- 205,209 ---- ! .commit() Commit any pending transaction to the database. Note that *************** *** 215,219 **** implement this method with void functionality. ! rollback() This method is optional since not all databases provide --- 215,219 ---- implement this method with void functionality. ! .rollback() This method is optional since not all databases provide *************** *** 226,230 **** rollback to be performed. ! cursor() Return a new Cursor Object using the connection. If the --- 226,230 ---- rollback to be performed. ! .cursor() Return a new Cursor Object using the connection. If the *************** *** 248,252 **** attributes: ! description This read-only attribute is a sequence of 7-item --- 248,252 ---- attributes: ! .description This read-only attribute is a sequence of 7-item *************** *** 265,269 **** Type Objects specified in the section below. ! rowcount This read-only attribute specifies the number of rows that --- 265,269 ---- Type Objects specified in the section below. ! .rowcount This read-only attribute specifies the number of rows that *************** *** 275,280 **** performed on the cursor or the rowcount of the last operation is not determinable by the interface. [7] ! callproc(procname[,parameters]) (This method is optional since not all databases provide --- 275,284 ---- performed on the cursor or the rowcount of the last operation is not determinable by the interface. [7] + + Note: Future versions of the DB API specification could + redefine the latter case to have the object return None + instead of -1. ! .callproc(procname[,parameters]) (This method is optional since not all databases provide *************** *** 292,296 **** standard fetchXXX() methods. ! close() Close the cursor now (rather than whenever __del__ is --- 296,300 ---- standard fetchXXX() methods. ! .close() Close the cursor now (rather than whenever __del__ is *************** *** 299,303 **** if any operation is attempted with the cursor. ! execute(operation[,parameters]) Prepare and execute a database operation (query or --- 303,307 ---- if any operation is attempted with the cursor. ! .execute(operation[,parameters]) Prepare and execute a database operation (query or *************** *** 327,331 **** Return values are not defined. ! executemany(operation,seq_of_parameters) Prepare a database operation (query or command) and then --- 331,335 ---- Return values are not defined. ! .executemany(operation,seq_of_parameters) Prepare a database operation (query or command) and then *************** *** 349,353 **** Return values are not defined. ! fetchone() Fetch the next row of a query result set, returning a --- 353,357 ---- Return values are not defined. ! .fetchone() Fetch the next row of a query result set, returning a *************** *** 383,387 **** same value from one fetchmany() call to the next. ! fetchall() Fetch all (remaining) rows of a query result, returning --- 387,391 ---- same value from one fetchmany() call to the next. ! .fetchall() Fetch all (remaining) rows of a query result, returning *************** *** 394,398 **** call was issued yet. ! nextset() (This method is optional since not all databases support --- 398,402 ---- call was issued yet. ! .nextset() (This method is optional since not all databases support *************** *** 412,416 **** call was issued yet. ! arraysize This read/write attribute specifies the number of rows to --- 416,420 ---- call was issued yet. ! .arraysize This read/write attribute specifies the number of rows to *************** *** 423,427 **** the implementation of executemany(). ! setinputsizes(sizes) This can be used before a call to executeXXX() to --- 427,431 ---- the implementation of executemany(). ! .setinputsizes(sizes) This can be used before a call to executeXXX() to *************** *** 442,446 **** and users are free to not use it. ! setoutputsize(size[,column]) Set a column buffer size for fetches of large columns --- 446,450 ---- and users are free to not use it. ! .setoutputsize(size[,column]) Set a column buffer size for fetches of large columns *************** *** 554,558 **** troubles because of the limited date range they cover. ! Implementation Hints * The preferred object types for the date/time objects are those --- 558,563 ---- troubles because of the limited date range they cover. ! ! Implementation Hints for Module Authors * The preferred object types for the date/time objects are those *************** *** 640,643 **** --- 645,864 ---- + Optional DB API Extensions + + During the lifetime of DB API 2.0, module authors have often + extended their implementations beyond what is required by this DB + API specification. To enhance compatibility and to provide a clean + upgrade path to possible future versions of the specification, + this section defines a set of common extensions to the core DB API + 2.0 specification. + + As with all DB API optional features, the database module authors + are free to not implement these additional attributes and methods + (using them will then result in an AttributeError) or to raise a + NotSupportedError in case the availability can only be checked at + run-time. + + It has been proposed to make usage of these extensions optionally + visible to the programmer by issuing Python warnings through the + Python warning framework. To make this feature useful, the warning + messages must be standardized in order to be able to mask them. These + standard messages are referred to below as "Warning Message". + + Cursor Attribute .rownumber + + This read-only attribute should provide the current 0-based + index of the cursor in the result set or None if the index cannot + be determined. + + The index can be seen as index of the cursor in a sequence (the + result set). The next fetch operation will fetch the row + indexed by .rownumber in that sequence. + + Warning Message: "DB-API extension cursor.rownumber used" + + Connection Attributes .Error, .ProgrammingError, etc. + + All exception classes defined by the DB API standard should be + exposed on the Connection objects are attributes (in addition + to being available at module scope). + + These attributes simplify error handling in multi-connection + environments. + + Warning Message: "DB-API extension connection. used" + + Cursor Attributes .connection + + This read-only attribute return a reference to the Connection + object on which the cursor was created. + + The attribute simplifies writing polymorph code in + multi-connection environments. + + Warning Message: "DB-API extension cursor.connection used" + + Cursor Method .scroll(value[,mode='relative']) + + Scroll the cursor in the result set to a new position according + to mode. + + If mode is 'relative' (default), value is taken as offset to + the current position in the result set, if set to 'absolute', + value states an absolute target position. + + An IndexError should be raised in case a scroll operation would + leave the result set. In this case, the cursor position is left + undefined (ideal would be to not move the cursor at all). + + Note: This method should use native scrollable cursors, if + available , or revert to an emulation for forward-only + scrollable cursors. The method may raise NotSupportedErrors to + signal that a specific operation is not supported by the + database (e.g. backward scrolling). + + Warning Message: "DB-API extension cursor.scroll() used" + + Cursor Attribute .messages + + This is a Python list object to which the interface appends + tuples (exception class, exception value) for all messages + which the interfaces receives from the underlying database for + this cursor. + + The list is cleared by all standard cursor methods calls (prior + to executing the call) except for the .fetchXXX() calls + automatically to avoid excessive memory usage and can also be + cleared by executing "del cursor.messages[:]". + + All error and warning messages generated by the database are + placed into this list, so checking the list allows the user to + verify correct operation of the method calls. + + The aim of this attribute is to eliminate the need for a + Warning exception which often causes problems (some warnings + really only have informational character). + + Warning Message: "DB-API extension cursor.messages used" + + Connection Attribute .messages + + Same as cursor.messages except that the messages in the list + are connection oriented. + + The list is cleared automatically by all standard connection + methods calls (prior to executing the call) to avoid excessive + memory usage and can also be cleared by executing "del + connection.messages[:]". + + Warning Message: "DB-API extension connection.messages used" + + Cursor Method .next() + + Return the next row from the currently executing SQL statement + using the same semantics as .fetchone(). A StopIteration + exception is raised when the result set is exhausted for Python + versions 2.2 and later. Previous versions don't have the + StopIteration exception and so the method should raise an + IndexError instead. + + Warning Message: "DB-API extension cursor.next() used" + + Cursor Method .__iter__() + + Return self to make cursors compatible to the iteration protocol. + + Warning Message: "DB-API extension cursor.__iter__() used" + + Cursor Attribute .lastrowid + + This read-only attribute provides the rowid of the last + modified row (most databases return a rowid only when a single + INSERT operation is performed). If the operation does not set + a rowid or if the database does not support rowids, this + attribute should be set to None. + + The semantics of .lastrowid are undefined in case the last + executed statement modified more than one row, e.g. when + using INSERT with .executemany(). + + Warning Message: "DB-API extension cursor.lastrowid used" + + + Optional Error Handling Extension + + The core DB API specification only introduces a set of exceptions + which can be raised to report errors to the user. In some cases, + exceptions may be too disruptive for the flow of a program or even + render execution impossible. + + For these cases and in order to simplify error handling when + dealing with databases, database module authors may choose to + implement user defineable error handlers. This section describes a + standard way of defining these error handlers. + + Cursor/Connection Attribute .errorhandler + + Read/write attribute which references an error handler to call + in case an error condition is met. + + The handler must be a Python callable taking the following + arguments: errorhandler(connection, cursor, errorclass, + errorvalue) where connection is a reference to the connection + on which the cursor operates, cursor a reference to the cursor + (or None in case the error does not apply to a cursor), + errorclass is an error class which to instantiate using + errorvalue as construction argument. + + The standard error handler should add the error information to + the appropriate .messages attribute (connection.messages or + cursor.messages) and raise the exception defined by the given + errorclass and errorvalue parameters. + + If no errorhandler is set (the attribute is None), the standard + error handling scheme as outlined above, should be applied. + + Warning Message: "DB-API extension .errorhandler used" + + Cursors should inherit the .errorhandler setting from their + connection objects at cursor creation time. + + + Frequently Asked Questions + + The database SIG often sees reoccurring questions about the DB API + specification. This section covers some of the issues people + sometimes have with the specification. + + Question: + + How can I construct a dictionary out of the tuples returned by + .fetchxxx(): + + Answer: + + There are several existing tools available which provide + helpers for this task. Most of them use the approach of using + the column names defined in the cursor attribute .description + as basis for the keys in the row dictionary. + + Note that the reason for not extending the DB API specification + to also support dictionary return values for the .fetchxxx() + methods is that this approach has several drawbacks: + + * Some databases don't support case-sensitive column names or + auto-convert them to all lowercase or all uppercase + characters. + + * Columns in the result set which are generated by the query + (e.g. using SQL functions) don't map to table column names + and databases usually generate names for these columns in a + very database specific way. + + As a result, accessing the columns through dictionary keys + varies between databases and makes writing portable code + impossible. + + Major Changes from Version 1.0 to Version 2.0 *************** *** 678,687 **** subclassing the defined exception classes. Open Issues Although the version 2.0 specification clarifies a lot of questions that were left open in the 1.0 version, there are still ! some remaining issues: * Define a useful return value for .nextset() for the case where --- 899,914 ---- subclassing the defined exception classes. + Post-publishing additions to the DB API 2.0 specification: + + * Additional optional DB API extensions to the set of + core functionality were specified. + Open Issues Although the version 2.0 specification clarifies a lot of questions that were left open in the 1.0 version, there are still ! some remaining issues which should be addressed in future ! versions: * Define a useful return value for .nextset() for the case where From jackjansen@users.sourceforge.net Tue Feb 5 21:24:49 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 05 Feb 2002 13:24:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib aepack.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18852 Modified Files: aepack.py Log Message: Added support for unicode strings (utxt). Index: aepack.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/aepack.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** aepack.py 2001/08/25 12:00:49 1.2 --- aepack.py 2002/02/05 21:24:47 1.3 *************** *** 89,92 **** --- 89,97 ---- if t == StringType: return AE.AECreateDesc('TEXT', x) + if t == UnicodeType: + data = t.encode('utf16') + if data[:2] == '\xfe\xff': + data = data[2:] + return AE.AECreateDesc('utxt', data) if t == ListType: list = AE.AECreateList('', 0) *************** *** 133,136 **** --- 138,143 ---- if t == typeChar: return desc.data + if t == typeUnicodeText: + return unicode(desc.data, 'utf16') # typeColorTable coerced to typeAEList # typeComp coerced to extended From jackjansen@users.sourceforge.net Tue Feb 5 22:34:37 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 05 Feb 2002 14:34:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/snd _Sndmodule.c,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/snd In directory usw-pr-cvs1:/tmp/cvs-serv9014/Python/Mac/Modules/snd Modified Files: _Sndmodule.c Log Message: Added SndRecord and (classic only) SndRecordToFile. Index: _Sndmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/snd/_Sndmodule.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** _Sndmodule.c 2001/12/18 15:36:25 1.6 --- _Sndmodule.c 2002/02/05 22:34:35 1.7 *************** *** 962,965 **** --- 962,1011 ---- } + static PyObject *Snd_SndRecord(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + OSErr _err; + Point corner; + OSType quality; + SndListHandle sndHandle; + if (!PyArg_ParseTuple(_args, "O&O&", + PyMac_GetPoint, &corner, + PyMac_GetOSType, &quality)) + return NULL; + _err = SndRecord((ModalFilterUPP)0, + corner, + quality, + &sndHandle); + if (_err != noErr) return PyMac_Error(_err); + _res = Py_BuildValue("O&", + ResObj_New, sndHandle); + return _res; + } + + #if !TARGET_API_MAC_CARBON + + static PyObject *Snd_SndRecordToFile(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + OSErr _err; + Point corner; + OSType quality; + short fRefNum; + if (!PyArg_ParseTuple(_args, "O&O&h", + PyMac_GetPoint, &corner, + PyMac_GetOSType, &quality, + &fRefNum)) + return NULL; + _err = SndRecordToFile((ModalFilterUPP)0, + corner, + quality, + fRefNum); + if (_err != noErr) return PyMac_Error(_err); + Py_INCREF(Py_None); + _res = Py_None; + return _res; + } + #endif + static PyObject *Snd_SPBSignInDevice(PyObject *_self, PyObject *_args) { *************** *** 1310,1313 **** --- 1356,1366 ---- {"SPBVersion", (PyCFunction)Snd_SPBVersion, 1, "() -> (NumVersion _rv)"}, + {"SndRecord", (PyCFunction)Snd_SndRecord, 1, + "(Point corner, OSType quality) -> (SndListHandle sndHandle)"}, + + #if !TARGET_API_MAC_CARBON + {"SndRecordToFile", (PyCFunction)Snd_SndRecordToFile, 1, + "(Point corner, OSType quality, short fRefNum) -> None"}, + #endif {"SPBSignInDevice", (PyCFunction)Snd_SPBSignInDevice, 1, "(short deviceRefNum, Str255 deviceName) -> None"}, From jackjansen@users.sourceforge.net Tue Feb 5 22:35:33 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 05 Feb 2002 14:35:33 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/snd sndscan.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/snd In directory usw-pr-cvs1:/tmp/cvs-serv9246/Python/Mac/Modules/snd Modified Files: sndscan.py Log Message: Don't blacklist ModalFilterUPP but always pass it as NULL. This enables the record routines to be generated. Index: sndscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/snd/sndscan.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** sndscan.py 2000/12/12 22:10:20 1.15 --- sndscan.py 2002/02/05 22:35:31 1.16 *************** *** 65,68 **** --- 65,69 ---- 'SndStartFilePlay', 'SndPauseFilePlay', + 'SndRecordToFile', ])] *************** *** 79,83 **** "SoundComponentData_ptr", "SoundConverter", - "ModalFilterUPP", ] --- 80,83 ---- From jackjansen@users.sourceforge.net Tue Feb 5 22:35:38 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 05 Feb 2002 14:35:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/snd sndsupport.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/snd In directory usw-pr-cvs1:/tmp/cvs-serv9260/Python/Mac/Modules/snd Modified Files: sndsupport.py Log Message: Don't blacklist ModalFilterUPP but always pass it as NULL. This enables the record routines to be generated. Index: sndsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/snd/sndsupport.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** sndsupport.py 2001/09/05 10:28:53 1.18 --- sndsupport.py 2002/02/05 22:35:36 1.19 *************** *** 46,49 **** --- 46,50 ---- SndListHandle = OpaqueByValueType("SndListHandle", "ResObj") SPBPtr = OpaqueByValueType("SPBPtr", "SPBObj") + ModalFilterUPP = FakeType("(ModalFilterUPP)0") # From jackjansen@users.sourceforge.net Tue Feb 5 23:50:40 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 05 Feb 2002 15:50:40 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0278.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv29706 Modified Files: pep-0278.txt Log Message: Two small clarifications after comments by Detlef Lannart. Index: pep-0278.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0278.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0278.txt 2002/01/23 13:24:26 1.1 --- pep-0278.txt 2002/02/05 23:50:38 1.2 *************** *** 41,45 **** parameter can also be "t", meaning "open for input as a text file with universal newline interpretation". Mode "t" cannot be ! combined with other mode flags such as "+". There is no special support for output to file with a different --- 41,47 ---- parameter can also be "t", meaning "open for input as a text file with universal newline interpretation". Mode "t" cannot be ! combined with other mode flags such as "+". Any line ending in the ! input file will be seen as a '\n' in Python, so little other code has ! to change to handle universal newlines. There is no special support for output to file with a different *************** *** 78,82 **** with platform-local convention otherwise. The reason for this is that input is the difficult case, outputting different newlines to ! a file is already easy enough in Python. While universal newlines are automatically enabled for import they --- 80,85 ---- with platform-local convention otherwise. The reason for this is that input is the difficult case, outputting different newlines to ! a file is already easy enough in Python. It would also slow down ! all "normal" Python output, even if only a little. While universal newlines are automatically enabled for import they From mwh@users.sourceforge.net Wed Feb 6 17:06:05 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Wed, 06 Feb 2002 09:06:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.33,2.33.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv5536/Modules Modified Files: Tag: release22-maint gcmodule.c Log Message: Fix a bunch of typos found by nnorwitz. Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.33 retrieving revision 2.33.6.1 diff -C2 -d -r2.33 -r2.33.6.1 *** gcmodule.c 2001/12/02 18:31:02 2.33 --- gcmodule.c 2002/02/06 17:06:02 2.33.6.1 *************** *** 616,620 **** static char gc_set_thresh__doc__[] = ! "set_threshold(threshold0, [threhold1, threshold2]) -> None\n" "\n" "Sets the collection thresholds. Setting threshold0 to zero disables\n" --- 616,620 ---- static char gc_set_thresh__doc__[] = ! "set_threshold(threshold0, [threshold1, threshold2]) -> None\n" "\n" "Sets the collection thresholds. Setting threshold0 to zero disables\n" From mwh@users.sourceforge.net Wed Feb 6 17:06:05 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Wed, 06 Feb 2002 09:06:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects rangeobject.c,2.30,2.30.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv5536/Objects Modified Files: Tag: release22-maint rangeobject.c Log Message: Fix a bunch of typos found by nnorwitz. Index: rangeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/rangeobject.c,v retrieving revision 2.30 retrieving revision 2.30.6.1 diff -C2 -d -r2.30 -r2.30.6.1 *** rangeobject.c 2001/12/04 16:36:39 2.30 --- rangeobject.c 2002/02/06 17:06:02 2.30.6.1 *************** *** 191,195 **** if (PyErr_Warn(PyExc_DeprecationWarning, ! "xrange object comparision is deprecated; " "convert to list instead") < 0) return -1; --- 191,195 ---- if (PyErr_Warn(PyExc_DeprecationWarning, ! "xrange object comparison is deprecated; " "convert to list instead") < 0) return -1; From mwh@users.sourceforge.net Wed Feb 6 17:06:05 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Wed, 06 Feb 2002 09:06:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.234.4.1,2.234.4.2 sysmodule.c,2.98.6.1,2.98.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv5536/Python Modified Files: Tag: release22-maint compile.c sysmodule.c Log Message: Fix a bunch of typos found by nnorwitz. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.234.4.1 retrieving revision 2.234.4.2 diff -C2 -d -r2.234.4.1 -r2.234.4.2 *** compile.c 2002/01/28 16:06:11 2.234.4.1 --- compile.c 2002/02/06 17:06:02 2.234.4.2 *************** *** 62,66 **** #define LOCAL_GLOBAL \ ! "name '%.400s' is a function paramter and declared global" #define LATE_FUTURE \ --- 62,66 ---- #define LOCAL_GLOBAL \ ! "name '%.400s' is a function parameter and declared global" #define LATE_FUTURE \ *************** *** 4453,4457 **** #define ILLEGAL_EXEC_AND_IMPORT_STAR \ ! "function '%.100s' uses import * and bare exec, which are illegal" \ "because it %s" --- 4453,4457 ---- #define ILLEGAL_EXEC_AND_IMPORT_STAR \ ! "function '%.100s' uses import * and bare exec, which are illegal " \ "because it %s" Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.98.6.1 retrieving revision 2.98.6.2 diff -C2 -d -r2.98.6.1 -r2.98.6.2 *** sysmodule.c 2002/01/12 11:13:24 2.98.6.1 --- sysmodule.c 2002/02/06 17:06:03 2.98.6.2 *************** *** 411,417 **** \n\ Set the flags that will be used for dlopen() calls. Among other\n\ ! things, this will enable a lazy resolving of symbols when imporing\n\ a module, if called as sys.setdlopenflags(0)\n\ ! To share symols across extension modules, call as\n\ sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)"; --- 411,417 ---- \n\ Set the flags that will be used for dlopen() calls. Among other\n\ ! things, this will enable a lazy resolving of symbols when importing\n\ a module, if called as sys.setdlopenflags(0)\n\ ! To share symbols across extension modules, call as\n\ sys.setdlopenflags(dl.RTLD_NOW|dl.RTLD_GLOBAL)"; *************** *** 674,678 **** maxint -- the largest supported integer (the smallest is -maxint-1)\n\ maxunicode -- the largest supported character\n\ ! builtin_module_names -- tuple of module names built into this intepreter\n\ version -- the version of this interpreter as a string\n\ version_info -- version information as a tuple\n\ --- 674,678 ---- maxint -- the largest supported integer (the smallest is -maxint-1)\n\ maxunicode -- the largest supported character\n\ ! builtin_module_names -- tuple of module names built into this interpreter\n\ version -- the version of this interpreter as a string\n\ version_info -- version information as a tuple\n\ From mwh@users.sourceforge.net Wed Feb 6 17:09:20 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Wed, 06 Feb 2002 09:09:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils msvccompiler.py,1.43,1.43.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv6766/Lib/distutils Modified Files: Tag: release22-maint msvccompiler.py Log Message: Backport loewis' checkin of revision 1.44: Encode MSVC paths as mbcs. Fixes #509117. 2.2.1 candidate. (apparently 1.5.2 compatibility is still a goal for distutils, but I'll wait until that gets amended on the trunk...) Index: msvccompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/msvccompiler.py,v retrieving revision 1.43 retrieving revision 1.43.6.1 diff -C2 -d -r1.43 -r1.43.6.1 *** msvccompiler.py 2001/12/06 20:51:35 1.43 --- msvccompiler.py 2002/02/06 17:09:18 1.43.6.1 *************** *** 118,121 **** --- 118,125 ---- V = string.split(v,';') for v in V: + try: + v = v.encode("mbcs") + except UnicodeError: + pass if v == '' or v in L: continue L.append(v) From mwh@users.sourceforge.net Wed Feb 6 17:11:53 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Wed, 06 Feb 2002 09:11:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _cursesmodule.c,2.61,2.61.6.1 _curses_panel.c,1.8,1.8.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv8213/Modules Modified Files: Tag: release22-maint _cursesmodule.c _curses_panel.c Log Message: Backport my fixing up of PyObject_New/PyMem_Del mismatches. Index: _cursesmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v retrieving revision 2.61 retrieving revision 2.61.6.1 diff -C2 -d -r2.61 -r2.61.6.1 *** _cursesmodule.c 2001/12/08 18:02:54 2.61 --- _cursesmodule.c 2002/02/06 17:11:51 2.61.6.1 *************** *** 361,365 **** { if (wo->win != stdscr) delwin(wo->win); ! PyMem_DEL(wo); } --- 361,365 ---- { if (wo->win != stdscr) delwin(wo->win); ! PyObject_DEL(wo); } Index: _curses_panel.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_curses_panel.c,v retrieving revision 1.8 retrieving revision 1.8.6.1 diff -C2 -d -r1.8 -r1.8.6.1 *** _curses_panel.c 2001/12/08 18:02:54 1.8 --- _curses_panel.c 2002/02/06 17:11:51 1.8.6.1 *************** *** 194,198 **** Py_DECREF(po->wo); remove_lop(po); ! PyMem_DEL(po); } --- 194,198 ---- Py_DECREF(po->wo); remove_lop(po); ! PyObject_DEL(po); } From lemburg@users.sourceforge.net Wed Feb 6 18:09:04 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 06 Feb 2002 10:09:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_unicode.py,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv6841/Lib/test Modified Files: test_unicode.py Log Message: Fix for the UTF-8 memory allocation bug and the UTF-8 encoding bug related to lone high surrogates. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** test_unicode.py 2001/12/10 20:57:34 1.47 --- test_unicode.py 2002/02/06 18:09:02 1.48 *************** *** 496,512 **** # UTF-8 specific encoding tests: ! verify(u'\u20ac'.encode('utf-8') == \ ! ''.join((chr(0xe2), chr(0x82), chr(0xac))) ) ! verify(u'\ud800\udc02'.encode('utf-8') == \ ! ''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))) ) ! verify(u'\ud84d\udc56'.encode('utf-8') == \ ! ''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))) ) # UTF-8 specific decoding tests ! verify(unicode(''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))), ! 'utf-8') == u'\U00023456' ) ! verify(unicode(''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))), ! 'utf-8') == u'\U00010002' ) ! verify(unicode(''.join((chr(0xe2), chr(0x82), chr(0xac))), ! 'utf-8') == u'\u20ac' ) # Other possible utf-8 test cases: --- 496,511 ---- # UTF-8 specific encoding tests: ! verify(u'\u20ac'.encode('utf-8') == '\xe2\x82\xac') ! verify(u'\ud800\udc02'.encode('utf-8') == '\xf0\x90\x80\x82') ! verify(u'\ud84d\udc56'.encode('utf-8') == '\xf0\xa3\x91\x96') ! verify(u'\ud800'.encode('utf-8') == '\xed\xa0\x80') ! verify(u'\udc00'.encode('utf-8') == '\xed\xb0\x80') ! verify((u'\ud800\udc02'*1000).encode('utf-8') == ! '\xf0\x90\x80\x82'*1000) ! # UTF-8 specific decoding tests ! verify(unicode('\xf0\xa3\x91\x96', 'utf-8') == u'\U00023456' ) ! verify(unicode('\xf0\x90\x80\x82', 'utf-8') == u'\U00010002' ) ! verify(unicode('\xe2\x82\xac', 'utf-8') == u'\u20ac' ) # Other possible utf-8 test cases: From lemburg@users.sourceforge.net Wed Feb 6 18:09:04 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 06 Feb 2002 10:09:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.124,2.125 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv6841/Objects Modified Files: unicodeobject.c Log Message: Fix for the UTF-8 memory allocation bug and the UTF-8 encoding bug related to lone high surrogates. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.124 retrieving revision 2.125 diff -C2 -d -r2.124 -r2.125 *** unicodeobject.c 2001/12/06 20:03:56 2.124 --- unicodeobject.c 2002/02/06 18:09:02 2.125 *************** *** 1172,1182 **** PyObject *v; char *p; ! char *q; ! Py_UCS4 ch2; ! unsigned int cbAllocated = 3 * size; unsigned int cbWritten = 0; int i = 0; ! v = PyString_FromStringAndSize(NULL, cbAllocated); if (v == NULL) return NULL; --- 1172,1180 ---- PyObject *v; char *p; ! unsigned int cbAllocated = 2 * size; unsigned int cbWritten = 0; int i = 0; ! v = PyString_FromStringAndSize(NULL, cbAllocated + 4); if (v == NULL) return NULL; *************** *** 1184,1194 **** return v; ! p = q = PyString_AS_STRING(v); while (i < size) { Py_UCS4 ch = s[i++]; if (ch < 0x80) { *p++ = (char) ch; cbWritten++; } else if (ch < 0x0800) { *p++ = 0xc0 | (ch >> 6); --- 1182,1194 ---- return v; ! p = PyString_AS_STRING(v); while (i < size) { Py_UCS4 ch = s[i++]; + if (ch < 0x80) { *p++ = (char) ch; cbWritten++; } + else if (ch < 0x0800) { *p++ = 0xc0 | (ch >> 6); *************** *** 1196,1230 **** cbWritten += 2; } - else if (ch < 0x10000) { - /* Check for high surrogate */ - if (0xD800 <= ch && ch <= 0xDBFF) { - if (i != size) { - ch2 = s[i]; - if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { ! if (cbWritten >= (cbAllocated - 4)) { ! /* Provide enough room for some more ! surrogates */ ! cbAllocated += 4*10; ! if (_PyString_Resize(&v, cbAllocated)) goto onError; } ! /* combine the two values */ ch = ((ch - 0xD800)<<10 | (ch2-0xDC00))+0x10000; - *p++ = (char)((ch >> 18) | 0xf0); *p++ = (char)(0x80 | ((ch >> 12) & 0x3f)); i++; cbWritten += 4; } } - } - else { *p++ = (char)(0xe0 | (ch >> 12)); - cbWritten += 3; - } *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); } else { *p++ = 0xf0 | (ch>>18); --- 1196,1233 ---- cbWritten += 2; } ! else { ! ! /* Assure that we have enough room for high order Unicode ! ordinals */ ! if (cbWritten >= cbAllocated) { ! cbAllocated += 4 * 10; ! if (_PyString_Resize(&v, cbAllocated + 4)) goto onError; + p = PyString_AS_STRING(v) + cbWritten; } ! if (ch < 0x10000) { ! /* Check for high surrogate */ ! if (0xD800 <= ch && ch <= 0xDBFF && i != size) { ! Py_UCS4 ch2 = s[i]; ! /* Check for low surrogate */ ! if (0xDC00 <= ch2 && ch2 <= 0xDFFF) { ch = ((ch - 0xD800)<<10 | (ch2-0xDC00))+0x10000; *p++ = (char)((ch >> 18) | 0xf0); *p++ = (char)(0x80 | ((ch >> 12) & 0x3f)); + *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); + *p++ = (char)(0x80 | (ch & 0x3f)); i++; cbWritten += 4; + continue; } + /* Fall through: handles isolated high surrogates */ } *p++ = (char)(0xe0 | (ch >> 12)); *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); *p++ = (char)(0x80 | (ch & 0x3f)); + cbWritten += 3; + } else { *p++ = 0xf0 | (ch>>18); *************** *** 1235,1240 **** } } *p = '\0'; ! if (_PyString_Resize(&v, p - q)) goto onError; return v; --- 1238,1244 ---- } } + } *p = '\0'; ! if (_PyString_Resize(&v, cbWritten)) goto onError; return v; From lemburg@users.sourceforge.net Wed Feb 6 18:18:05 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 06 Feb 2002 10:18:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.125,2.126 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv11602/Objects Modified Files: unicodeobject.c Log Message: Whitespace fixes. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.125 retrieving revision 2.126 diff -C2 -d -r2.125 -r2.126 *** unicodeobject.c 2002/02/06 18:09:02 2.125 --- unicodeobject.c 2002/02/06 18:18:03 2.126 *************** *** 1204,1210 **** cbAllocated += 4 * 10; if (_PyString_Resize(&v, cbAllocated + 4)) ! goto onError; p = PyString_AS_STRING(v) + cbWritten; ! } if (ch < 0x10000) { --- 1204,1210 ---- cbAllocated += 4 * 10; if (_PyString_Resize(&v, cbAllocated + 4)) ! goto onError; p = PyString_AS_STRING(v) + cbWritten; ! } if (ch < 0x10000) { *************** *** 1226,1241 **** } *p++ = (char)(0xe0 | (ch >> 12)); ! *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); ! *p++ = (char)(0x80 | (ch & 0x3f)); cbWritten += 3; ! } else { ! *p++ = 0xf0 | (ch>>18); ! *p++ = 0x80 | ((ch>>12) & 0x3f); ! *p++ = 0x80 | ((ch>>6) & 0x3f); ! *p++ = 0x80 | (ch & 0x3f); ! cbWritten += 4; } - } } *p = '\0'; --- 1226,1241 ---- } *p++ = (char)(0xe0 | (ch >> 12)); ! *p++ = (char)(0x80 | ((ch >> 6) & 0x3f)); ! *p++ = (char)(0x80 | (ch & 0x3f)); cbWritten += 3; ! } else { ! *p++ = 0xf0 | (ch>>18); ! *p++ = 0x80 | ((ch>>12) & 0x3f); ! *p++ = 0x80 | ((ch>>6) & 0x3f); ! *p++ = 0x80 | (ch & 0x3f); ! cbWritten += 4; ! } } } *p = '\0'; From lemburg@users.sourceforge.net Wed Feb 6 18:20:21 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 06 Feb 2002 10:20:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.126,2.127 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13272/Objects Modified Files: unicodeobject.c Log Message: Cosmetics. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.126 retrieving revision 2.127 diff -C2 -d -r2.126 -r2.127 *** unicodeobject.c 2002/02/06 18:18:03 2.126 --- unicodeobject.c 2002/02/06 18:20:19 2.127 *************** *** 1192,1197 **** else if (ch < 0x0800) { ! *p++ = 0xc0 | (ch >> 6); ! *p++ = 0x80 | (ch & 0x3f); cbWritten += 2; } --- 1192,1197 ---- else if (ch < 0x0800) { ! *p++ = (char)(0xc0 | (ch >> 6)); ! *p++ = (char)(0x80 | (ch & 0x3f)); cbWritten += 2; } *************** *** 1231,1238 **** } else { ! *p++ = 0xf0 | (ch>>18); ! *p++ = 0x80 | ((ch>>12) & 0x3f); ! *p++ = 0x80 | ((ch>>6) & 0x3f); ! *p++ = 0x80 | (ch & 0x3f); cbWritten += 4; } --- 1231,1238 ---- } else { ! *p++ = (char)(0xf0 | (ch>>18)); ! *p++ = (char)(0x80 | ((ch>>12) & 0x3f)); ! *p++ = (char)(0x80 | ((ch>>6) & 0x3f)); ! *p++ = (char)(0x80 | (ch & 0x3f)); cbWritten += 4; } From lemburg@users.sourceforge.net Wed Feb 6 18:22:50 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 06 Feb 2002 10:22:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils emxccompiler.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv14331 Added Files: emxccompiler.py Log Message: Forgot to add the new emxccompiler.py from Andrew I. MacIntyre's distutils patch for OS/2. Here it is... --- NEW FILE: emxccompiler.py --- """distutils.emxccompiler Provides the EMXCCompiler class, a subclass of UnixCCompiler that handles the EMX port of the GNU C compiler to OS/2. """ # issues: # # * OS/2 insists that DLLs can have names no longer than 8 characters # We put export_symbols in a def-file, as though the DLL can have # an arbitrary length name, but truncate the output filename. # # * only use OMF objects and use LINK386 as the linker (-Zomf) # # * always build for multithreading (-Zmt) as the accompanying OS/2 port # of Python is only distributed with threads enabled. # # tested configurations: # # * EMX gcc 2.81/EMX 0.9d fix03 # created 2001/5/7, Andrew MacIntyre, from Rene Liebscher's cywinccompiler.py __revision__ = "$Id: emxccompiler.py,v 1.1 2002/02/06 18:22:48 lemburg Exp $" import os,sys,copy from distutils.ccompiler import gen_preprocess_options, gen_lib_options from distutils.unixccompiler import UnixCCompiler from distutils.file_util import write_file from distutils.errors import DistutilsExecError, CompileError, UnknownFileError class EMXCCompiler (UnixCCompiler): compiler_type = 'emx' obj_extension = ".obj" static_lib_extension = ".lib" shared_lib_extension = ".dll" static_lib_format = "%s%s" shared_lib_format = "%s%s" res_extension = ".res" # compiled resource file exe_extension = ".exe" def __init__ (self, verbose=0, dry_run=0, force=0): UnixCCompiler.__init__ (self, verbose, dry_run, force) (status, details) = check_config_h() self.debug_print("Python's GCC status: %s (details: %s)" % (status, details)) if status is not CONFIG_H_OK: self.warn( "Python's pyconfig.h doesn't seem to support your compiler. " + ("Reason: %s." % details) + "Compiling may fail because of undefined preprocessor macros.") (self.gcc_version, self.ld_version) = \ get_versions() self.debug_print(self.compiler_type + ": gcc %s, ld %s\n" % (self.gcc_version, self.ld_version) ) # Hard-code GCC because that's what this is all about. # XXX optimization, warnings etc. should be customizable. self.set_executables(compiler='gcc -Zomf -Zmt -O2 -Wall', compiler_so='gcc -Zomf -Zmt -O2 -Wall', linker_exe='gcc -Zomf -Zmt -Zcrtdll', linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll') # want the gcc library statically linked (so that we don't have # to distribute a version dependent on the compiler we have) self.dll_libraries=["gcc"] # __init__ () # not much different of the compile method in UnixCCompiler, # but we have to insert some lines in the middle of it, so # we put here a adapted version of it. # (If we would call compile() in the base class, it would do some # initializations a second time, this is why all is done here.) def compile (self, sources, output_dir=None, macros=None, include_dirs=None, debug=0, extra_preargs=None, extra_postargs=None): (output_dir, macros, include_dirs) = \ self._fix_compile_args (output_dir, macros, include_dirs) (objects, skip_sources) = self._prep_compile (sources, output_dir) # Figure out the options for the compiler command line. pp_opts = gen_preprocess_options (macros, include_dirs) cc_args = pp_opts + ['-c'] if debug: cc_args[:0] = ['-g'] if extra_preargs: cc_args[:0] = extra_preargs if extra_postargs is None: extra_postargs = [] # Compile all source files that weren't eliminated by # '_prep_compile()'. for i in range (len (sources)): src = sources[i] ; obj = objects[i] ext = (os.path.splitext (src))[1] if skip_sources[src]: self.announce ("skipping %s (%s up-to-date)" % (src, obj)) else: self.mkpath (os.path.dirname (obj)) if ext == '.rc': # gcc requires '.rc' compiled to binary ('.res') files !!! try: self.spawn (["rc","-r",src]) except DistutilsExecError, msg: raise CompileError, msg else: # for other files use the C-compiler try: self.spawn (self.compiler_so + cc_args + [src, '-o', obj] + extra_postargs) except DistutilsExecError, msg: raise CompileError, msg # Return *all* object filenames, not just the ones we just built. return objects # compile () def link (self, target_desc, objects, output_filename, output_dir=None, libraries=None, library_dirs=None, runtime_library_dirs=None, export_symbols=None, debug=0, extra_preargs=None, extra_postargs=None, build_temp=None): # use separate copies, so we can modify the lists extra_preargs = copy.copy(extra_preargs or []) libraries = copy.copy(libraries or []) objects = copy.copy(objects or []) # Additional libraries libraries.extend(self.dll_libraries) # handle export symbols by creating a def-file # with executables this only works with gcc/ld as linker if ((export_symbols is not None) and (target_desc != self.EXECUTABLE)): # (The linker doesn't do anything if output is up-to-date. # So it would probably better to check if we really need this, # but for this we had to insert some unchanged parts of # UnixCCompiler, and this is not what we want.) # we want to put some files in the same directory as the # object files are, build_temp doesn't help much # where are the object files temp_dir = os.path.dirname(objects[0]) # name of dll to give the helper files the same base name (dll_name, dll_extension) = os.path.splitext( os.path.basename(output_filename)) # generate the filenames for these files def_file = os.path.join(temp_dir, dll_name + ".def") lib_file = os.path.join(temp_dir, dll_name + ".lib") # Generate .def file contents = [ "LIBRARY %s INITINSTANCE TERMINSTANCE" % os.path.splitext(os.path.basename(output_filename))[0], "DATA MULTIPLE NONSHARED", "EXPORTS"] for sym in export_symbols: contents.append(' "%s"' % sym) self.execute(write_file, (def_file, contents), "writing %s" % def_file) # next add options for def-file and to creating import libraries # for gcc/ld the def-file is specified as any other object files objects.append(def_file) #end: if ((export_symbols is not None) and # (target_desc != self.EXECUTABLE or self.linker_dll == "gcc")): # who wants symbols and a many times larger output file # should explicitly switch the debug mode on # otherwise we let dllwrap/ld strip the output file # (On my machine: 10KB < stripped_file < ??100KB # unstripped_file = stripped_file + XXX KB # ( XXX=254 for a typical python extension)) if not debug: extra_preargs.append("-s") UnixCCompiler.link(self, target_desc, objects, output_filename, output_dir, libraries, library_dirs, runtime_library_dirs, None, # export_symbols, we do this in our def-file debug, extra_preargs, extra_postargs, build_temp) # link () # -- Miscellaneous methods ----------------------------------------- # overwrite the one from CCompiler to support rc and res-files def object_filenames (self, source_filenames, strip_dir=0, output_dir=''): if output_dir is None: output_dir = '' obj_names = [] for src_name in source_filenames: # use normcase to make sure '.rc' is really '.rc' and not '.RC' (base, ext) = os.path.splitext (os.path.normcase(src_name)) if ext not in (self.src_extensions + ['.rc']): raise UnknownFileError, \ "unknown file type '%s' (from '%s')" % \ (ext, src_name) if strip_dir: base = os.path.basename (base) if ext == '.rc': # these need to be compiled to object files obj_names.append (os.path.join (output_dir, base + self.res_extension)) else: obj_names.append (os.path.join (output_dir, base + self.obj_extension)) return obj_names # object_filenames () # class EMXCCompiler # Because these compilers aren't configured in Python's pyconfig.h file by # default, we should at least warn the user if he is using a unmodified # version. CONFIG_H_OK = "ok" CONFIG_H_NOTOK = "not ok" CONFIG_H_UNCERTAIN = "uncertain" def check_config_h(): """Check if the current Python installation (specifically, pyconfig.h) appears amenable to building extensions with GCC. Returns a tuple (status, details), where 'status' is one of the following constants: CONFIG_H_OK all is well, go ahead and compile CONFIG_H_NOTOK doesn't look good CONFIG_H_UNCERTAIN not sure -- unable to read pyconfig.h 'details' is a human-readable string explaining the situation. Note there are two ways to conclude "OK": either 'sys.version' contains the string "GCC" (implying that this Python was built with GCC), or the installed "pyconfig.h" contains the string "__GNUC__". """ # XXX since this function also checks sys.version, it's not strictly a # "pyconfig.h" check -- should probably be renamed... from distutils import sysconfig import string # if sys.version contains GCC then python was compiled with # GCC, and the pyconfig.h file should be OK if string.find(sys.version,"GCC") >= 0: return (CONFIG_H_OK, "sys.version mentions 'GCC'") fn = sysconfig.get_config_h_filename() try: # It would probably better to read single lines to search. # But we do this only once, and it is fast enough f = open(fn) s = f.read() f.close() except IOError, exc: # if we can't read this file, we cannot say it is wrong # the compiler will complain later about this file as missing return (CONFIG_H_UNCERTAIN, "couldn't read '%s': %s" % (fn, exc.strerror)) else: # "pyconfig.h" contains an "#ifdef __GNUC__" or something similar if string.find(s,"__GNUC__") >= 0: return (CONFIG_H_OK, "'%s' mentions '__GNUC__'" % fn) else: return (CONFIG_H_NOTOK, "'%s' does not mention '__GNUC__'" % fn) def get_versions(): """ Try to find out the versions of gcc and ld. If not possible it returns None for it. """ from distutils.version import StrictVersion from distutils.spawn import find_executable import re gcc_exe = find_executable('gcc') if gcc_exe: out = os.popen(gcc_exe + ' -dumpversion','r') out_string = out.read() out.close() result = re.search('(\d+\.\d+\.\d+)',out_string) if result: gcc_version = StrictVersion(result.group(1)) else: gcc_version = None else: gcc_version = None # EMX ld has no way of reporting version number, and we use GCC # anyway - so we can link OMF DLLs ld_version = None return (gcc_version, ld_version) From guido@python.org Wed Feb 6 18:32:12 2002 From: guido@python.org (Guido van Rossum) Date: Wed, 06 Feb 2002 13:32:12 -0500 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.124,2.125 In-Reply-To: Your message of "Wed, 06 Feb 2002 10:09:04 PST." References: Message-ID: <200202061832.g16IWCk21884@pcp742651pcs.reston01.va.comcast.net> > Modified Files: > unicodeobject.c > Log Message: > Fix for the UTF-8 memory allocation bug and the UTF-8 encoding > bug related to lone high surrogates. Isn't this a bugfix candidate? --Guido van Rossum (home page: http://www.python.org/~guido/) From mal@lemburg.com Wed Feb 6 18:36:04 2002 From: mal@lemburg.com (M.-A. Lemburg) Date: Wed, 06 Feb 2002 19:36:04 +0100 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.124,2.125 References: <200202061832.g16IWCk21884@pcp742651pcs.reston01.va.comcast.net> Message-ID: <3C617794.E7A92505@lemburg.com> Guido van Rossum wrote: > > > Modified Files: > > unicodeobject.c > > Log Message: > > Fix for the UTF-8 memory allocation bug and the UTF-8 encoding > > bug related to lone high surrogates. > > Isn't this a bugfix candidate? Yes. For 2.1.3 (if that should ever become reality) and 2.2.1. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From fredrik@pythonware.com Wed Feb 6 19:03:40 2002 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 6 Feb 2002 20:03:40 +0100 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.124,2.125 References: <200202061832.g16IWCk21884@pcp742651pcs.reston01.va.comcast.net> Message-ID: <013101c1af41$2f6c8260$ced241d5@hagrid> guido wrote: > > Fix for the UTF-8 memory allocation bug and the UTF-8 encoding > > bug related to lone high surrogates. > > Isn't this a bugfix candidate? Aren't you supposed to be at the Python conference? (not enough exciting talks, or what? ;-) From lemburg@users.sourceforge.net Thu Feb 7 11:33:51 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Thu, 07 Feb 2002 03:33:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_unicodedata,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv8617/Lib/test/output Modified Files: test_unicodedata Log Message: Fix to the UTF-8 encoder: it failed on 0-length input strings. Fix for the UTF-8 decoder: it will now accept isolated surrogates (previously it raised an exception which causes round-trips to fail). Added new tests for UTF-8 round-trip safety (we rely on UTF-8 for marshalling Unicode objects, so we better make sure it works for all Unicode code points, including isolated surrogates). Bumped the PYC magic in a non-standard way -- please review. This was needed because the old PYC format used illegal UTF-8 sequences for isolated high surrogates which now raise an exception. Index: test_unicodedata =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_unicodedata,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_unicodedata 3 Nov 2000 20:24:15 -0000 1.4 --- test_unicodedata 7 Feb 2002 11:33:49 -0000 1.5 *************** *** 1,5 **** test_unicodedata Testing Unicode Database... ! Methods: 6c7a7c02657b69d0fdd7a7d174f573194bba2e18 Functions: 41e1d4792185d6474a43c83ce4f593b1bdb01f8a API: ok --- 1,5 ---- test_unicodedata Testing Unicode Database... ! Methods: 84b72943b1d4320bc1e64a4888f7cdf62eea219a Functions: 41e1d4792185d6474a43c83ce4f593b1bdb01f8a API: ok From lemburg@users.sourceforge.net Thu Feb 7 11:33:51 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Thu, 07 Feb 2002 03:33:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python import.c,2.193,2.194 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv8617/Python Modified Files: import.c Log Message: Fix to the UTF-8 encoder: it failed on 0-length input strings. Fix for the UTF-8 decoder: it will now accept isolated surrogates (previously it raised an exception which causes round-trips to fail). Added new tests for UTF-8 round-trip safety (we rely on UTF-8 for marshalling Unicode objects, so we better make sure it works for all Unicode code points, including isolated surrogates). Bumped the PYC magic in a non-standard way -- please review. This was needed because the old PYC format used illegal UTF-8 sequences for isolated high surrogates which now raise an exception. Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.193 retrieving revision 2.194 diff -C2 -d -r2.193 -r2.194 *** import.c 12 Jan 2002 11:05:10 -0000 2.193 --- import.c 7 Feb 2002 11:33:49 -0000 2.194 *************** *** 42,47 **** (quite apart from that the -U option doesn't work so isn't used anyway). */ ! #define MAGIC (60717 | ((long)'\r'<<16) | ((long)'\n'<<24)) /* Magic word as global; note that _PyImport_Init() can change the --- 42,66 ---- (quite apart from that the -U option doesn't work so isn't used anyway). + + XXX MAL, 2002-02-07: I had to modify the MAGIC due to a fix of the + UTF-8 encoder (it previously produced invalid UTF-8 for unpaired + high surrogates), so I simply bumped the month value to 20 (invalid + month) and set the day to 1. This should be recognizable by any + algorithm relying on the above scheme. Perhaps we should simply + start counting in increments of 10 from now on ?! + + Known values: + Python 1.5: 20121 + Python 1.5.1: 20121 + Python 1.5.2: 20121 + Python 2.0: 50823 + Python 2.0.1: 50823 + Python 2.1: 60202 + Python 2.1.1: 60202 + Python 2.1.2: 60202 + Python 2.2: 60717 + Python 2.3a0: 62001 */ ! #define MAGIC (62001 | ((long)'\r'<<16) | ((long)'\n'<<24)) /* Magic word as global; note that _PyImport_Init() can change the From lemburg@users.sourceforge.net Thu Feb 7 11:33:51 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Thu, 07 Feb 2002 03:33:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_unicode.py,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv8617/Lib/test Modified Files: test_unicode.py Log Message: Fix to the UTF-8 encoder: it failed on 0-length input strings. Fix for the UTF-8 decoder: it will now accept isolated surrogates (previously it raised an exception which causes round-trips to fail). Added new tests for UTF-8 round-trip safety (we rely on UTF-8 for marshalling Unicode objects, so we better make sure it works for all Unicode code points, including isolated surrogates). Bumped the PYC magic in a non-standard way -- please review. This was needed because the old PYC format used illegal UTF-8 sequences for isolated high surrogates which now raise an exception. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** test_unicode.py 6 Feb 2002 18:09:02 -0000 1.48 --- test_unicode.py 7 Feb 2002 11:33:49 -0000 1.49 *************** *** 24,42 **** verify(repr(u"'") == '''u"'"''') verify(repr(u'"') == """u'"'""") ! verify(repr(u''.join(map(unichr, range(256)))) == ! "u'\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r" ! "\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a" ! "\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHI" ! "JKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\x7f" ! "\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d" ! "\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b" ! "\\x9c\\x9d\\x9e\\x9f\\xa0\\xa1\\xa2\\xa3\\xa4\\xa5\\xa6\\xa7\\xa8\\xa9" ! "\\xaa\\xab\\xac\\xad\\xae\\xaf\\xb0\\xb1\\xb2\\xb3\\xb4\\xb5\\xb6\\xb7" ! "\\xb8\\xb9\\xba\\xbb\\xbc\\xbd\\xbe\\xbf\\xc0\\xc1\\xc2\\xc3\\xc4\\xc5" ! "\\xc6\\xc7\\xc8\\xc9\\xca\\xcb\\xcc\\xcd\\xce\\xcf\\xd0\\xd1\\xd2\\xd3" ! "\\xd4\\xd5\\xd6\\xd7\\xd8\\xd9\\xda\\xdb\\xdc\\xdd\\xde\\xdf\\xe0\\xe1" ! "\\xe2\\xe3\\xe4\\xe5\\xe6\\xe7\\xe8\\xe9\\xea\\xeb\\xec\\xed\\xee\\xef" ! "\\xf0\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd" ! "\\xfe\\xff'") def test(method, input, output, *args): --- 24,44 ---- verify(repr(u"'") == '''u"'"''') verify(repr(u'"') == """u'"'""") ! latin1repr = ( ! "u'\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r" ! "\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a" ! "\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHI" ! "JKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\x7f" ! "\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d" ! "\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b" ! "\\x9c\\x9d\\x9e\\x9f\\xa0\\xa1\\xa2\\xa3\\xa4\\xa5\\xa6\\xa7\\xa8\\xa9" ! "\\xaa\\xab\\xac\\xad\\xae\\xaf\\xb0\\xb1\\xb2\\xb3\\xb4\\xb5\\xb6\\xb7" ! "\\xb8\\xb9\\xba\\xbb\\xbc\\xbd\\xbe\\xbf\\xc0\\xc1\\xc2\\xc3\\xc4\\xc5" ! "\\xc6\\xc7\\xc8\\xc9\\xca\\xcb\\xcc\\xcd\\xce\\xcf\\xd0\\xd1\\xd2\\xd3" ! "\\xd4\\xd5\\xd6\\xd7\\xd8\\xd9\\xda\\xdb\\xdc\\xdd\\xde\\xdf\\xe0\\xe1" ! "\\xe2\\xe3\\xe4\\xe5\\xe6\\xe7\\xe8\\xe9\\xea\\xeb\\xec\\xed\\xee\\xef" ! "\\xf0\\xf1\\xf2\\xf3\\xf4\\xf5\\xf6\\xf7\\xf8\\xf9\\xfa\\xfb\\xfc\\xfd" ! "\\xfe\\xff'") ! testrepr = repr(u''.join(map(unichr, range(256)))) ! verify(testrepr == latin1repr) def test(method, input, output, *args): *************** *** 496,499 **** --- 498,502 ---- # UTF-8 specific encoding tests: + verify(u''.encode('utf-8') == '') verify(u'\u20ac'.encode('utf-8') == '\xe2\x82\xac') verify(u'\ud800\udc02'.encode('utf-8') == '\xf0\x90\x80\x82') *************** *** 553,564 **** verify(unicode(u.encode(encoding),encoding) == u) ! # Roundtrip safety for non-BMP (just a few chars) ! u = u'\U00010001\U00020002\U00030003\U00040004\U00050005' ! for encoding in ('utf-8', ! 'utf-16', 'utf-16-le', 'utf-16-be', ! #'raw_unicode_escape', ! 'unicode_escape', 'unicode_internal'): ! verify(unicode(u.encode(encoding),encoding) == u) ! u = u''.join(map(unichr, range(256))) for encoding in ( --- 556,560 ---- verify(unicode(u.encode(encoding),encoding) == u) ! # Roundtrip safety for BMP (just the first 256 chars) u = u''.join(map(unichr, range(256))) for encoding in ( *************** *** 572,575 **** --- 568,572 ---- print '*** codec for "%s" failed: %s' % (encoding, why) + # Roundtrip safety for BMP (just the first 128 chars) u = u''.join(map(unichr, range(128))) for encoding in ( *************** *** 582,585 **** --- 579,595 ---- except ValueError,why: print '*** codec for "%s" failed: %s' % (encoding, why) + + # Roundtrip safety for non-BMP (just a few chars) + u = u'\U00010001\U00020002\U00030003\U00040004\U00050005' + for encoding in ('utf-8', + 'utf-16', 'utf-16-le', 'utf-16-be', + #'raw_unicode_escape', + 'unicode_escape', 'unicode_internal'): + verify(unicode(u.encode(encoding),encoding) == u) + + # UTF-8 must be roundtrip safe for all UCS-2 code points + u = u''.join(map(unichr, range(0x10000))) + for encoding in ('utf-8',): + verify(unicode(u.encode(encoding),encoding) == u) print 'done.' From lemburg@users.sourceforge.net Thu Feb 7 11:33:51 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Thu, 07 Feb 2002 03:33:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.127,2.128 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv8617/Objects Modified Files: unicodeobject.c Log Message: Fix to the UTF-8 encoder: it failed on 0-length input strings. Fix for the UTF-8 decoder: it will now accept isolated surrogates (previously it raised an exception which causes round-trips to fail). Added new tests for UTF-8 round-trip safety (we rely on UTF-8 for marshalling Unicode objects, so we better make sure it works for all Unicode code points, including isolated surrogates). Bumped the PYC magic in a non-standard way -- please review. This was needed because the old PYC format used illegal UTF-8 sequences for isolated high surrogates which now raise an exception. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.127 retrieving revision 2.128 diff -C2 -d -r2.127 -r2.128 *** unicodeobject.c 6 Feb 2002 18:20:19 -0000 2.127 --- unicodeobject.c 7 Feb 2002 11:33:49 -0000 2.128 *************** *** 1066,1075 **** } ch = ((s[0] & 0x0f) << 12) + ((s[1] & 0x3f) << 6) + (s[2] & 0x3f); ! if (ch < 0x800 || (ch >= 0xd800 && ch < 0xe000)) { errmsg = "illegal encoding"; goto utf8Error; } else ! *p++ = (Py_UNICODE)ch; break; --- 1066,1082 ---- } ch = ((s[0] & 0x0f) << 12) + ((s[1] & 0x3f) << 6) + (s[2] & 0x3f); ! if (ch < 0x0800) { ! /* Note: UTF-8 encodings of surrogates are considered ! legal UTF-8 sequences; ! ! XXX For wide builds (UCS-4) we should probably try ! to recombine the surrogates into a single code ! unit. ! */ errmsg = "illegal encoding"; goto utf8Error; } else ! *p++ = (Py_UNICODE)ch; break; *************** *** 1085,1091 **** /* validate and convert to UTF-16 */ if ((ch < 0x10000) /* minimum value allowed for 4 ! byte encoding */ || (ch > 0x10ffff)) /* maximum value allowed for ! UTF-16 */ { errmsg = "illegal encoding"; --- 1092,1098 ---- /* validate and convert to UTF-16 */ if ((ch < 0x10000) /* minimum value allowed for 4 ! byte encoding */ || (ch > 0x10ffff)) /* maximum value allowed for ! UTF-16 */ { errmsg = "illegal encoding"; *************** *** 1176,1184 **** int i = 0; v = PyString_FromStringAndSize(NULL, cbAllocated + 4); if (v == NULL) return NULL; - if (size == 0) - return v; p = PyString_AS_STRING(v); --- 1183,1195 ---- int i = 0; + /* Short-cut for emtpy strings */ + if (size == 0) + return PyString_FromStringAndSize(NULL, 0); + + /* We allocate 4 more bytes to have room for at least one full + UTF-8 sequence; saves a few cycles in the loop below */ v = PyString_FromStringAndSize(NULL, cbAllocated + 4); if (v == NULL) return NULL; p = PyString_AS_STRING(v); From mal@lemburg.com Thu Feb 7 11:38:16 2002 From: mal@lemburg.com (M.-A. Lemburg) Date: Thu, 07 Feb 2002 12:38:16 +0100 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.127,2.128 References: Message-ID: <3C626728.8FC62921@lemburg.com> "M.-A. Lemburg" wrote: > > Update of /cvsroot/python/python/dist/src/Objects > In directory usw-pr-cvs1:/tmp/cvs-serv8617/Objects > > Modified Files: > unicodeobject.c > Log Message: > Fix to the UTF-8 encoder: it failed on 0-length input strings. > > ... > > Index: unicodeobject.c > =================================================================== > RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v > retrieving revision 2.127 > retrieving revision 2.128 > diff -C2 -d -r2.127 -r2.128 > *** unicodeobject.c 6 Feb 2002 18:20:19 -0000 2.127 > --- unicodeobject.c 7 Feb 2002 11:33:49 -0000 2.128 > *************** > *************** > *** 1176,1184 **** > int i = 0; > > v = PyString_FromStringAndSize(NULL, cbAllocated + 4); > if (v == NULL) > return NULL; > - if (size == 0) > - return v; > > p = PyString_AS_STRING(v); > --- 1183,1195 ---- > int i = 0; > > + /* Short-cut for emtpy strings */ > + if (size == 0) > + return PyString_FromStringAndSize(NULL, 0); > + > + /* We allocate 4 more bytes to have room for at least one full > + UTF-8 sequence; saves a few cycles in the loop below */ > v = PyString_FromStringAndSize(NULL, cbAllocated + 4); > if (v == NULL) > return NULL; > > p = PyString_AS_STRING(v); This part of the patch should be considered a bug-fix candidate for 2.2.1. It fixes a problem introduced by yesterdays patch. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From bwarsaw@users.sourceforge.net Thu Feb 7 12:08:14 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 07 Feb 2002 04:08:14 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0279.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv21255 Modified Files: pep-0279.txt Log Message: Raymond Hettinger's latest update, slightly reformatted. Index: pep-0279.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0279.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0279.txt 4 Feb 2002 21:03:03 -0000 1.3 --- pep-0279.txt 7 Feb 2002 12:08:12 -0000 1.4 *************** *** 61,64 **** --- 61,69 ---- generators become final and are not imported from __future__. + SourceForge contains a working, pure Python simulation of every + feature proposed in this PEP [8]. SourceForge also has a separate + file with a simulation test suite and working source code for the + examples listed used in this PEP [9]. + Specification for new built-ins: *************** *** 119,123 **** yield fun(*args) ! def xzip( *collections ): ''' xzip(...) --- 124,128 ---- yield fun(*args) ! def xzip( *collections ): ### Code from Python Cookbook [6] ''' xzip(...) *************** *** 147,150 **** --- 152,161 ---- not include generators. + Note B: An alternate, simplified definition of indexed was proposed: + + def indexed( collection, cnt=0, limit=sys.maxint ): + 'Generates an indexed series: (0,seqn[0]), (1,seqn[1]) ...' + return xzip( xrange(cnt,limit), collection ) + Specification for Generator Comprehensions: *************** *** 178,181 **** --- 189,223 ---- in fact helpful. + Note B: An iterable instance is returned by the above code. The + purpose is to allow the object to be re-started and looped-over + multiple times. This accurately mimics the behavior of list + comprehensions. As a result, the following code (provided by Oren + Tirosh) works equally well with or without 'yield': + + letters = [yield chr(i) for i in xrange(ord('a'),ord('z')+1)] + digits = [yield str(i) for i in xrange(10)] + letdig = [yield l+d for l in letters for d in digits] + + Note C: List comprehensions expose their looping variable and + leave the variable in the enclosing scope. The code, [str(i) for + i in range(8)] leaves 'i' set to 7 in the scope where the + comprehension appears. This behavior is by design and reflects an + intent to duplicate the result of coding a for-loop instead of a + list comprehension. Further, the variable 'i' is in a defined and + potentially useful state on the line immediately following the + list comprehension. + + In contrast, generator comprehensions do not expose the looping + variable to the enclosing scope. The code, [yield str(i) for i in + range(8)] leaves 'i' untouched in the scope where the + comprehension appears. This is also by design and reflects an + intent to duplicate the result of coding a generator directly + instead of a generator comprehension. Further, the variable 'i' + is not in a defined state on the line immediately following the + list comprehension. It does not come into existence until + iteration starts. Since several generators may be running at + once, there are potentially multiple, unequal instances of 'i' at + any one time. + Specification for Generator Parameter Passing: *************** *** 260,271 **** Loop over the picture files in a directory, shrink them ! one-at-a-time to thumbnail size using PIL, and send them to a lazy ! consumer. That consumer is responsible for creating a large blank ! image, accepting thumbnails one-at-a-time and placing them in a ! 5x3 grid format onto the blank image. Whenever the grid is full, ! it writes-out the large image as an index print. A FlushStream ! exception indicates that no more thumbnails are available and that ! the partial index print should be written out if there are one or ! more thumbnails on it. --- 302,313 ---- Loop over the picture files in a directory, shrink them ! one-at-a-time to thumbnail size using PIL [7], and send them to a ! lazy consumer. That consumer is responsible for creating a large ! blank image, accepting thumbnails one-at-a-time and placing them ! in a 5x3 grid format onto the blank image. Whenever the grid is ! full, it writes-out the large image as an index print. A ! FlushStream exception indicates that no more thumbnails are ! available and that the partial index print should be written out ! if there are one or more thumbnails on it. *************** *** 349,352 **** --- 391,407 ---- http://gnosis.cx/publish/programming/charming_python_b5.txt + [6] The code fragment for xmap() was found at: + http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66448 + + [7] PIL, the Python Imaging Library can be found at: + http://www.pythonware.com/products/pil/ + + [8] A pure Python simulation of every feature in this PEP is at: + http://sourceforge.net/tracker/download.php?group_id=5470&atid=305470&file_id=17348&aid=513752 + + [9] The full, working source code for each of the examples in this PEP + along with other examples and tests is at: + http://sourceforge.net/tracker/download.php?group_id=5470&atid=305470&file_id=17412&aid=513756 + Copyright *************** *** 361,364 **** fill-column: 70 End: - - --- 416,417 ---- From mal@lemburg.com Thu Feb 7 12:57:25 2002 From: mal@lemburg.com (M.-A. Lemburg) Date: Thu, 07 Feb 2002 13:57:25 +0100 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.127,2.128 References: <3C626728.8FC62921@lemburg.com> Message-ID: <3C6279B5.AAFBDC74@lemburg.com> [UTF-8 codec changes] Thinking about this some more, I am not that confident anymore about making this a bug fix candidate. The fix of the encoder output affects PYC files as well as tests which encode Unicode strings containing unpaired high surrogates (e.g. ones which construct Unicode strings using range(0x10000)). About the PYC issue: Byte code from source files containing '\uD800' cannot be read back into the interpreter; as a result importing such modules fails if Python finds a valid PYC file for it. The fix would recover this error, but users would have to manually delete the PYC files since we cannot change the PYC magic in patch releases. About the UTF-8 encoding output: Prior to the fix, u'\uD800'.encode('utf-8') gave '\xa0\x80', now it returns '\xeo\xa0\x80' which is correct, but breaks any code relying on the old behaviour. OTOH, '\xa0\x80' cannot be decoded back into Unicode, so this may be a non-issue. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From theller@users.sourceforge.net Fri Feb 8 14:41:34 2002 From: theller@users.sourceforge.net (Thomas Heller) Date: Fri, 08 Feb 2002 06:41:34 -0800 Subject: [Python-checkins] CVS: distutils/distutils msvccompiler.py,1.44,1.45 Message-ID: Update of /cvsroot/python/distutils/distutils In directory usw-pr-cvs1:/tmp/cvs-serv26986 Modified Files: msvccompiler.py Log Message: Make it 1.5.2 compatible again. Index: msvccompiler.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/msvccompiler.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** msvccompiler.py 29 Jan 2002 10:23:42 -0000 1.44 --- msvccompiler.py 8 Feb 2002 14:41:31 -0000 1.45 *************** *** 118,125 **** V = string.split(v,';') for v in V: ! try: ! v = v.encode("mbcs") ! except UnicodeError: ! pass if v == '' or v in L: continue L.append(v) --- 118,126 ---- V = string.split(v,';') for v in V: ! if hasattr(v, "encode"): ! try: ! v = v.encode("mbcs") ! except UnicodeError: ! pass if v == '' or v in L: continue L.append(v) From gvanrossum@users.sourceforge.net Fri Feb 8 16:20:09 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 08 Feb 2002 08:20:09 -0800 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts google.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory usw-pr-cvs1:/tmp/cvs-serv26265 Modified Files: google.py Log Message: www.google.com is better than google.com. Index: google.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/google.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** google.py 4 Dec 2001 15:23:47 -0000 1.1 --- google.py 8 Feb 2002 16:20:07 -0000 1.2 *************** *** 17,21 **** list.append(arg) s = '+'.join(list) ! url = "http://google.com/search?q=%s" % s webbrowser.open(url) --- 17,21 ---- list.append(arg) s = '+'.join(list) ! url = "http://www.google.com/search?q=%s" % s webbrowser.open(url) From fdrake@users.sourceforge.net Fri Feb 8 20:13:49 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 08 Feb 2002 12:13:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv30098 Added Files: this.py Log Message: Python 10 was a success, commemorate it\! --- NEW FILE: this.py --- s = """Gur Mra bs Clguba, ol Gvz Crgref Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. Fvzcyr vf orggre guna pbzcyrk. Pbzcyrk vf orggre guna pbzcyvpngrq. Syng vf orggre guna arfgrq. Fcnefr vf orggre guna qrafr. Ernqnovyvgl pbhagf. Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. Nygubhtu cenpgvpnyvgl orngf chevgl. Reebef fubhyq arire cnff fvyragyl. Hayrff rkcyvpvgyl fvyraprq. Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff. Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg. Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu. Abj vf orggre guna arire. Nygubhtu arire vf bsgra orggre guna *evtug* abj. Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn. Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) print "".join([d.get(c, c) for c in s]) From nnorwitz@users.sourceforge.net Fri Feb 8 20:13:55 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Fri, 08 Feb 2002 12:13:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test regrtest.py,1.70,1.71 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv30131/Lib/test Modified Files: regrtest.py Log Message: Fix typo Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** regrtest.py 14 Dec 2001 21:28:53 -0000 1.70 --- regrtest.py 8 Feb 2002 20:13:53 -0000 1.71 *************** *** 26,30 **** -s means to run only a single test and exit. This is useful when doing memory ! analysis on the Python interpreter (which tend to consume to many resources to run the full regression test non-stop). The file /tmp/pynexttest is read to find the next test to run. If this file is missing, the first test_*.py file --- 26,30 ---- -s means to run only a single test and exit. This is useful when doing memory ! analysis on the Python interpreter (which tend to consume too many resources to run the full regression test non-stop). The file /tmp/pynexttest is read to find the next test to run. If this file is missing, the first test_*.py file From akuchlin@mems-exchange.org Fri Feb 8 20:31:04 2002 From: akuchlin@mems-exchange.org (Andrew Kuchling) Date: Fri, 8 Feb 2002 15:31:04 -0500 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.1 In-Reply-To: References: Message-ID: <20020208203104.GB3576@ute.mems-exchange.org> On Fri, Feb 08, 2002 at 12:13:49PM -0800, Fred L. Drake wrote: >d = {} >for c in (65, 97): > for i in range(26): > d[chr(i+c)] = chr((i+13) % 26 + c) > >print "".join([d.get(c, c) for c in s]) MAL's borrowed the time machine again. The above code could just be written as: print s.encode('rot-13') --amk (www.amk.ca) Ph-nglui mglw'nafh Cthulhu R'lyeh wgah'nagl fhtagn. -- H.P. Lovecraft, "The Call of Cthulhu" From fdrake@acm.org Fri Feb 8 20:33:23 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 8 Feb 2002 15:33:23 -0500 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.1 In-Reply-To: <20020208203104.GB3576@ute.mems-exchange.org> References: <20020208203104.GB3576@ute.mems-exchange.org> Message-ID: <15460.13843.125910.216232@grendel.zope.com> Andrew Kuchling writes: > MAL's borrowed the time machine again. The above code > could just be written as: I'll blame it on Barry, since he wrote the module. ;-) This should probably get added to the release22-maint branch as well, since the module was included in the Python 2.2 distributions. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From guido@python.org Fri Feb 8 20:40:28 2002 From: guido@python.org (Guido van Rossum) Date: Fri, 08 Feb 2002 15:40:28 -0500 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.1 In-Reply-To: Your message of "Fri, 08 Feb 2002 15:31:04 EST." <20020208203104.GB3576@ute.mems-exchange.org> References: <20020208203104.GB3576@ute.mems-exchange.org> Message-ID: <200202082040.g18KeS504346@pcp742651pcs.reston01.va.comcast.net> > MAL's borrowed the time machine again. The above code > could just be written as: > > print s.encode('rot-13') Yes, but that would be so obvious. It's much more fun to let people guess what it does. :-) --Guido van Rossum (home page: http://www.python.org/~guido/) From guido@python.org Fri Feb 8 20:42:35 2002 From: guido@python.org (Guido van Rossum) Date: Fri, 08 Feb 2002 15:42:35 -0500 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.1 In-Reply-To: Your message of "Fri, 08 Feb 2002 15:33:23 EST." <15460.13843.125910.216232@grendel.zope.com> References: <20020208203104.GB3576@ute.mems-exchange.org> <15460.13843.125910.216232@grendel.zope.com> Message-ID: <200202082042.g18KgZi04386@pcp742651pcs.reston01.va.comcast.net> > I'll blame it on Barry, since he wrote the module. ;-) Actually, I did this version. > This should probably get added to the release22-maint branch as well, > since the module was included in the Python 2.2 distributions. Sure. --Guido van Rossum (home page: http://www.python.org/~guido/) From gvanrossum@users.sourceforge.net Fri Feb 8 20:41:37 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 08 Feb 2002 12:41:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25050 Modified Files: this.py Log Message: Whitespace cleanup. Index: this.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/this.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** this.py 8 Feb 2002 20:13:47 -0000 1.1 --- this.py 8 Feb 2002 20:41:34 -0000 1.2 *************** *** 1,4 **** s = """Gur Mra bs Clguba, ol Gvz Crgref ! Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. --- 1,4 ---- s = """Gur Mra bs Clguba, ol Gvz Crgref ! Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. *************** *** 20,28 **** Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" ! d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) ! print "".join([d.get(c, c) for c in s]) --- 20,28 ---- Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" ! d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) ! print "".join([d.get(c, c) for c in s]) From barry@zope.com Fri Feb 8 20:46:02 2002 From: barry@zope.com (Barry A. Warsaw) Date: Fri, 8 Feb 2002 15:46:02 -0500 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.1 References: <20020208203104.GB3576@ute.mems-exchange.org> <15460.13843.125910.216232@grendel.zope.com> Message-ID: <15460.14602.451907.889109@anthem.wooz.org> >>>>> "Fred" == Fred L Drake, Jr writes: Fred> I'll blame it on Barry, since he wrote the module. ;-) Actually, Guido wrote that version. BTW, I'm surprised nobody mentioned the easter egg at the conference at all. It can't be that nobody noticed it -- I mean, Guido practically gave the whole thing away in his tutorial blurb, and the shirts were no subtle clue either. I guess the whole thing was just too boring to mention. ;) -Barry From fdrake@users.sourceforge.net Fri Feb 8 20:47:50 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 08 Feb 2002 12:47:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.2.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv1176 Added Files: Tag: release22-maint this.py Log Message: Python 10 was a success, commemorate it\! This includes Guido's whitespace cleanup. --- NEW FILE: this.py --- s = """Gur Mra bs Clguba, ol Gvz Crgref Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. Fvzcyr vf orggre guna pbzcyrk. Pbzcyrk vf orggre guna pbzcyvpngrq. Syng vf orggre guna arfgrq. Fcnefr vf orggre guna qrafr. Ernqnovyvgl pbhagf. Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. Nygubhtu cenpgvpnyvgl orngf chevgl. Reebef fubhyq arire cnff fvyragyl. Hayrff rkcyvpvgyl fvyraprq. Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff. Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg. Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu. Abj vf orggre guna arire. Nygubhtu arire vf bsgra orggre guna *evtug* abj. Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn. Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) print "".join([d.get(c, c) for c in s]) From fdrake@acm.org Fri Feb 8 20:46:06 2002 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 8 Feb 2002 15:46:06 -0500 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.1 In-Reply-To: <200202082042.g18KgZi04386@pcp742651pcs.reston01.va.comcast.net> References: <20020208203104.GB3576@ute.mems-exchange.org> <15460.13843.125910.216232@grendel.zope.com> <200202082042.g18KgZi04386@pcp742651pcs.reston01.va.comcast.net> Message-ID: <15460.14606.882190.427343@grendel.zope.com> Guido van Rossum writes: > Actually, I did this version. OK, I don't mind blaming you instead. ;-) I've committed the cleaned-up version to the release22-maint branch. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From tim.one@comcast.net Fri Feb 8 20:53:36 2002 From: tim.one@comcast.net (Tim Peters) Date: Fri, 08 Feb 2002 15:53:36 -0500 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.1 In-Reply-To: <200202082040.g18KeS504346@pcp742651pcs.reston01.va.comcast.net> Message-ID: [AMK] > MAL's borrowed the time machine again. The above code > could just be written as: > > print s.encode('rot-13') Wouldn't s.decode make more sense ? [GvR] > Yes, but that would be so obvious. It's much more fun to let people > guess what it does. :-) LOL! I understood what the original code did instantly. I had to scratch my head twice to figure out what that "s.encode('rot-13')" thing meant. So we should rot-13 encode the original code, and exec it after rot-13 decoding it . From tim.one@comcast.net Fri Feb 8 20:55:21 2002 From: tim.one@comcast.net (Tim Peters) Date: Fri, 08 Feb 2002 15:55:21 -0500 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.1 In-Reply-To: <15460.14602.451907.889109@anthem.wooz.org> Message-ID: [Barry] > BTW, I'm surprised nobody mentioned the easter egg at the conference > at all. It can't be that nobody noticed it -- I mean, Guido > practically gave the whole thing away in his tutorial blurb, and the > shirts were no subtle clue either. I guess the whole thing was just > too boring to mention. I asked a few (about 5) about it, and they were all aware of it already. Somebody was adamant that we should never take it out, because it so valuable to have the Pythonic Theses available at their fingertips. I'm starting to understand how Jesus felt . From barry@zope.com Fri Feb 8 20:58:33 2002 From: barry@zope.com (Barry A. Warsaw) Date: Fri, 8 Feb 2002 15:58:33 -0500 Subject: [Python-checkins] CVS: python/dist/src/Lib this.py,NONE,1.1 References: <15460.14602.451907.889109@anthem.wooz.org> Message-ID: <15460.15353.701913.946042@anthem.wooz.org> >>>>> "TP" == Tim Peters writes: TP> I asked a few (about 5) about it, and they were all aware of TP> it already. Somebody was adamant that we should never take it TP> out, because it so valuable to have the Pythonic Theses TP> available at their fingertips. I'm starting to understand how TP> Jesus felt . Were they all Japanese? Top Google hit for "this.py": http://www.python.jp/pipermail/python-ml-jp/2001-December/000895.html -Barry From gvanrossum@users.sourceforge.net Fri Feb 8 21:26:09 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 08 Feb 2002 13:26:09 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.53,2.54 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv24288 Modified Files: complexobject.c Log Message: Declare real and imag as read-only attributes. This fixes SF bug #514858 (Gregory Smith): complex not entirely immutable 2.2.1 Bugfix candidate! Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.53 retrieving revision 2.54 diff -C2 -d -r2.53 -r2.54 *** complexobject.c 13 Dec 2001 19:52:22 -0000 2.53 --- complexobject.c 8 Feb 2002 21:26:07 -0000 2.54 *************** *** 630,636 **** static PyMemberDef complex_members[] = { ! {"real", T_DOUBLE, offsetof(PyComplexObject, cval.real), 0, "the real part of a complex number"}, ! {"imag", T_DOUBLE, offsetof(PyComplexObject, cval.imag), 0, "the imaginary part of a complex number"}, {0}, --- 630,636 ---- static PyMemberDef complex_members[] = { ! {"real", T_DOUBLE, offsetof(PyComplexObject, cval.real), READONLY, "the real part of a complex number"}, ! {"imag", T_DOUBLE, offsetof(PyComplexObject, cval.imag), READONLY, "the imaginary part of a complex number"}, {0}, From fdrake@users.sourceforge.net Fri Feb 8 21:27:52 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 08 Feb 2002 13:27:52 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _hotshot.c,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv26767/Modules Modified Files: _hotshot.c Log Message: start() and stop() methods: return None where there is no exception; returning NULL causes the interpreter to raise a SystemError. Noted by Anthony Baxter at Python 10. Index: _hotshot.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_hotshot.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** _hotshot.c 12 Jan 2002 11:05:04 -0000 1.12 --- _hotshot.c 8 Feb 2002 21:27:50 -0000 1.13 *************** *** 1181,1186 **** if (PyArg_ParseTuple(args, ":start")) { ! if (is_available(self)) do_start(self); } return result; --- 1181,1189 ---- if (PyArg_ParseTuple(args, ":start")) { ! if (is_available(self)) { do_start(self); + result = Py_None; + Py_INCREF(result); + } } return result; *************** *** 1199,1204 **** if (!self->active) PyErr_SetString(ProfilerError, "profiler not active"); ! else do_stop(self); } return result; --- 1202,1210 ---- if (!self->active) PyErr_SetString(ProfilerError, "profiler not active"); ! else { do_stop(self); + result = Py_None; + Py_INCREF(result); + } } return result; From fdrake@users.sourceforge.net Fri Feb 8 21:29:24 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 08 Feb 2002 13:29:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_hotshot.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv29145/Lib/test Modified Files: test_hotshot.py Log Message: Added regression test for start()/stop() returning bogus NULL. Index: test_hotshot.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_hotshot.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_hotshot.py 29 Oct 2001 20:54:01 -0000 1.5 --- test_hotshot.py 8 Feb 2002 21:29:22 -0000 1.6 *************** *** 99,102 **** --- 99,112 ---- self.run_test(g, events, self.new_profiler(lineevents=1)) + def test_start_stop(self): + # Make sure we don't return NULL in the start() and stop() + # methods when there isn't an error. Bug in 2.2 noted by + # Anthony Baxter. + profiler = self.new_profiler() + profiler.start() + profiler.stop() + profiler.close() + os.unlink(self.logfn) + def test_main(): From fdrake@users.sourceforge.net Fri Feb 8 21:31:25 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 08 Feb 2002 13:31:25 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _hotshot.c,1.11.6.1,1.11.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv32179/Modules Modified Files: Tag: release22-maint _hotshot.c Log Message: start() and stop() methods: return None where there is no exception; returning NULL causes the interpreter to raise a SystemError. Noted by Anthony Baxter at Python 10. Index: _hotshot.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_hotshot.c,v retrieving revision 1.11.6.1 retrieving revision 1.11.6.2 diff -C2 -d -r1.11.6.1 -r1.11.6.2 *** _hotshot.c 12 Jan 2002 11:13:23 -0000 1.11.6.1 --- _hotshot.c 8 Feb 2002 21:31:23 -0000 1.11.6.2 *************** *** 1181,1186 **** if (PyArg_ParseTuple(args, ":start")) { ! if (is_available(self)) do_start(self); } return result; --- 1181,1189 ---- if (PyArg_ParseTuple(args, ":start")) { ! if (is_available(self)) { do_start(self); + result = Py_None; + Py_INCREF(result); + } } return result; *************** *** 1199,1204 **** if (!self->active) PyErr_SetString(ProfilerError, "profiler not active"); ! else do_stop(self); } return result; --- 1202,1210 ---- if (!self->active) PyErr_SetString(ProfilerError, "profiler not active"); ! else { do_stop(self); + result = Py_None; + Py_INCREF(result); + } } return result; From fdrake@users.sourceforge.net Fri Feb 8 21:31:49 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 08 Feb 2002 13:31:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_hotshot.py,1.5,1.5.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv353/Lib/test Modified Files: Tag: release22-maint test_hotshot.py Log Message: Added regression test for start()/stop() returning bogus NULL. Index: test_hotshot.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_hotshot.py,v retrieving revision 1.5 retrieving revision 1.5.8.1 diff -C2 -d -r1.5 -r1.5.8.1 *** test_hotshot.py 29 Oct 2001 20:54:01 -0000 1.5 --- test_hotshot.py 8 Feb 2002 21:31:47 -0000 1.5.8.1 *************** *** 99,102 **** --- 99,112 ---- self.run_test(g, events, self.new_profiler(lineevents=1)) + def test_start_stop(self): + # Make sure we don't return NULL in the start() and stop() + # methods when there isn't an error. Bug in 2.2 noted by + # Anthony Baxter. + profiler = self.new_profiler() + profiler.start() + profiler.stop() + profiler.close() + os.unlink(self.logfn) + def test_main(): From gvanrossum@users.sourceforge.net Fri Feb 8 21:32:44 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 08 Feb 2002 13:32:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _cursesmodule.c,2.51,2.51.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv1604 Modified Files: Tag: release21-maint _cursesmodule.c Log Message: In case there ever will be a 2.1.3, this fixes SF bug #514928 (Bastian Kleineidam): curses error in w.border(). For some reason, in 2.1.2 and before, PyCursesWindow_Border is declared as METH_VARARGS but calls PyArg_Parse(), which is wrong. (This is not relevant for 2.2, which does this completely different and makes all functions METH_VARARGS.) Index: _cursesmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v retrieving revision 2.51 retrieving revision 2.51.2.1 diff -C2 -d -r2.51 -r2.51.2.1 *** _cursesmodule.c 10 Apr 2001 19:53:37 -0000 2.51 --- _cursesmodule.c 8 Feb 2002 21:32:41 -0000 2.51.2.1 *************** *** 564,568 **** chtype ls, rs, ts, bs, tl, tr, bl, br; ls = rs = ts = bs = tl = tr = bl = br = 0; ! if (!PyArg_Parse(args,"|llllllll;ls,rs,ts,bs,tl,tr,bl,br", &ls, &rs, &ts, &bs, &tl, &tr, &bl, &br)) return NULL; --- 564,568 ---- chtype ls, rs, ts, bs, tl, tr, bl, br; ls = rs = ts = bs = tl = tr = bl = br = 0; ! if (!PyArg_ParseTuple(args,"|llllllll;ls,rs,ts,bs,tl,tr,bl,br", &ls, &rs, &ts, &bs, &tl, &tr, &bl, &br)) return NULL; From gvanrossum@users.sourceforge.net Fri Feb 8 22:22:37 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Fri, 08 Feb 2002 14:22:37 -0800 Subject: [Python-checkins] CVS: python/dist/src README,1.138,1.139 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv3578 Modified Files: README Log Message: Updates related to Modules/Setup and setup.py. This addresses SF bug #512871 (Jon Ribbens): Installation instructions are wrong. Bugfix candidate. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** README 4 Feb 2002 01:59:23 -0000 1.138 --- README 8 Feb 2002 22:22:35 -0000 1.139 *************** *** 46,50 **** and then "make install". ! The section `Build Instructions' below is still recommended reading, especially the part on customizing Modules/Setup. --- 46,50 ---- and then "make install". ! The section `Build instructions' below is still recommended reading, especially the part on customizing Modules/Setup. *************** *** 152,181 **** ================== ! Before you can build Python, you must first configure it. Fortunately, ! the configuration and build process has been streamlined for most Unix ! installations, so all you have to do is type a few commands, ! optionally edit one file, and sit back. There are some platforms ! where things are not quite as smooth; see the platform specific notes ! below. If you want to build for multiple platforms sharing the same ! source tree, see the section on VPATH below. ! Start by running the script "./configure", which determines your system ! configuration and creates the Makefile. (It takes a minute or two -- ! please be patient!) You may want to pass options to the configure ! script or edit the Modules/Setup file after running configure -- see the ! section below on configuration options and variables. When it's done, ! you are ready to run make. ! To build Python, you normally type "make" in the toplevel directory. If ! you have changed the configuration or have modified Modules/Setup, the ! Makefile may have to be rebuilt. In this case you may have to run make ! again to correctly build your desired target. The interpreter ! executable is built in the top level directory. Once you have built a Python interpreter, see the subsections below on ! testing, configuring additional modules, and installation. If you run ! into trouble, see the next section. Editing the Modules/Setup file ! after running make is supported; just run "make" again after making ! the desired changes. --- 152,185 ---- ================== ! Before you can build Python, you must first configure it. ! Fortunately, the configuration and build process has been automated ! for Unix and Linux installations, so all you usually have to do is ! type a few commands and sit back. There are some platforms where ! things are not quite as smooth; see the platform specific notes below. ! If you want to build for multiple platforms sharing the same source ! tree, see the section on VPATH below. ! Start by running the script "./configure", which determines your ! system configuration and creates the Makefile. (It takes a minute or ! two -- please be patient!) You may want to pass options to the ! configure script -- see the section below on configuration options and ! variables. When it's done, you are ready to run make. ! To build Python, you normally type "make" in the toplevel directory. ! If you have changed the configuration, the Makefile may have to be ! rebuilt. In this case you may have to run make again to correctly ! build your desired target. The interpreter executable is built in the ! top level directory. Once you have built a Python interpreter, see the subsections below on ! testing and installation. If you run into trouble, see the next ! section. ! ! Previous versions of Python used a manual configuration process that ! involved editing the file Modules/Setup. While this file still exists ! and manual configuration is still supported, it is rarely needed any ! more: almost all modules are automatically built as appropriate under ! guidance of the setup.py script, which is run by Make after the ! interpreter has been built. *************** *** 229,232 **** --- 233,237 ---- 64-bit platforms: The modules audioop, imageop and rgbimg don't work. + The setup.py script disables them on 64-bit installations. Don't try to enable them in the Modules/Setup file. They contain code that is quite wordsize sensitive. (If you have a *************** *** 245,251 **** Under Linux systems using GNU libc 2 (aka libc6), the crypt ! module now needs the -lcrypt option. Uncomment this flag in ! Modules/Setup, or comment out the crypt module in the same ! file. Most modern Linux systems use glibc2. Red Hat Linux: There's an executable /usr/bin/python which is Python --- 250,255 ---- Under Linux systems using GNU libc 2 (aka libc6), the crypt ! module now needs the -lcrypt option. The setup.py script ! takes care of this automatically. Red Hat Linux: There's an executable /usr/bin/python which is Python *************** *** 561,565 **** distribution attempts to detect which modules can be built and automatically compiles them. Autodetection doesn't always work, so ! you can customize the configuration by editing the Modules/Setup file. This file is initially copied from Setup.dist by the configure script; if it does not exist yet, create it by copying Modules/Setup.dist --- 565,574 ---- distribution attempts to detect which modules can be built and automatically compiles them. Autodetection doesn't always work, so ! you can still customize the configuration by editing the Modules/Setup ! file; but this should be considered a last resort. The rest of this ! section only applies if you decide to edit the Modules/Setup file. ! You also need this to enable static linking of certain modules (which ! is needed to enable profiling on some systems). ! This file is initially copied from Setup.dist by the configure script; if it does not exist yet, create it by copying Modules/Setup.dist *************** *** 629,634 **** the compiled files left by the previous test run). The test set produces some output. You can generally ignore the messages about ! skipped tests due to optional features which can't be imported. (If ! you want to test those modules, edit Modules/Setup to configure them.) If a message is printed about a failed test or a traceback or core dump is produced, something is wrong. On some Linux systems (those --- 638,642 ---- the compiled files left by the previous test run). The test set produces some output. You can generally ignore the messages about ! skipped tests due to optional features which can't be imported. If a message is printed about a failed test or a traceback or core dump is produced, something is wrong. On some Linux systems (those *************** *** 733,738 **** about the install prefix. ! --with-readline: This option is no longer supported. To use GNU ! readline, enable module "readline" in the Modules/Setup file. --with-threads: On most Unix systems, you can now use multiple --- 741,746 ---- about the install prefix. ! --with-readline: This option is no longer supported. GNU ! readline is automatically enabled by setup.py when present. --with-threads: On most Unix systems, you can now use multiple *************** *** 889,912 **** ! The Tk interface ! ---------------- ! Tk (the user interface component of John Ousterhout's Tcl language) is ! also usable from Python. Since this requires that you first build and ! install Tcl/Tk, the Tk interface is not enabled by default when ! building Python from source. Python supports Tcl/Tk version 8.0 and higher. - See http://dev.ajubasolutions.com/ for more info on Tcl/Tk, including - the on-line manual pages. - - - To enable the Python/Tk interface, once you've built and installed - Tcl/Tk, load the file Modules/Setup into your favorite text editor and - search for the string "_tkinter". Then follow the instructions found - there. If you have installed Tcl/Tk or X11 in unusual places, you - will have to edit the first line to fix or add the -I and -L options. - (Also see the general instructions at the top of that file.) - For more Tkinter information, see the Tkinter Resource page: http://www.python.org/topics/tkinter/ --- 897,907 ---- ! Tkinter ! ------- ! The setup.py script automatically configures this when it detects a ! usable Tcl/Tk installation. This requires Tcl/Tk version 8.0 or higher. For more Tkinter information, see the Tkinter Resource page: http://www.python.org/topics/tkinter/ *************** *** 920,932 **** (lower case t and leading underscore) which lives in Modules/_tkinter.c. Demos and normal Tk applications import only the ! Python Tkinter module -- the latter uses the C _tkinter module ! directly. In order to find the C _tkinter module, it must be compiled ! and linked into the Python interpreter -- the _tkinter line in the ! Setup file does this. In order to find the Python Tkinter module, ! sys.path must be set correctly -- the TKPATH assignment in the Setup ! file takes care of this, but only if you install Python properly ! ("make install libinstall"). (You can also use dynamic loading for ! the C _tkinter module, in which case you must manually fix up sys.path ! or set $PYTHONPATH for the Python Tkinter module.) --- 915,923 ---- (lower case t and leading underscore) which lives in Modules/_tkinter.c. Demos and normal Tk applications import only the ! Python Tkinter module -- only the latter imports the C _tkinter ! module. In order to find the C _tkinter module, it must be compiled ! and linked into the Python interpreter -- the setup.py script does ! this. In order to find the Python Tkinter module, sys.path must be ! set correctly -- normal installation takes care of this. From bwarsaw@users.sourceforge.net Fri Feb 8 23:25:48 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 08 Feb 2002 15:25:48 -0800 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts fixnotice.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory usw-pr-cvs1:/tmp/cvs-serv19328 Modified Files: fixnotice.py Log Message: Added a module docstring, which doubles as the --help text. Added a bunch of command line options to make the script more generic. Index: fixnotice.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/fixnotice.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** fixnotice.py 17 Jan 2001 09:13:33 -0000 1.5 --- fixnotice.py 8 Feb 2002 23:25:46 -0000 1.6 *************** *** 1,4 **** --- 1,34 ---- #! /usr/bin/env python + """(Ostensibly) fix copyright notices in files. + + Actually, this sript will simply replace a block of text in a file from one + string to another. It will only do this once though, i.e. not globally + throughout the file. It writes a backup file and then does an os.rename() + dance for atomicity. + + Usage: fixnotices.py [options] [filenames] + Options: + -h / --help + Print this message and exit + + --oldnotice=file + Use the notice in the file as the old (to be replaced) string, instead + of the hard coded value in the script. + + --newnotice=file + Use the notice in the file as the new (replacement) string, instead of + the hard coded value in the script. + + --dry-run + Don't actually make the changes, but print out the list of files that + would change. When used with -v, a status will be printed for every + file. + + -v / --verbose + Print a message for every file looked at, indicating whether the file + is changed or not. + """ + OLD_NOTICE = """/*********************************************************** Copyright (c) 2000, BeOpen.com. *************** *** 11,47 **** ******************************************************************/ """ NEW_NOTICE = "" - # " <-- Help Emacs ! import os, sys, string def main(): ! args = sys.argv[1:] ! if not args: ! print "No arguments." for arg in args: process(arg) ! def process(arg): ! f = open(arg) data = f.read() f.close() ! i = string.find(data, OLD_NOTICE) if i < 0: ! ## print "No old notice in", arg return data = data[:i] + NEW_NOTICE + data[i+len(OLD_NOTICE):] ! new = arg + ".new" ! backup = arg + ".bak" ! print "Replacing notice in", arg, "...", ! sys.stdout.flush() f = open(new, "w") f.write(data) f.close() ! os.rename(arg, backup) ! os.rename(new, arg) ! print "done" if __name__ == '__main__': --- 41,112 ---- ******************************************************************/ """ + import os + import sys + import getopt NEW_NOTICE = "" + DRYRUN = 0 + VERBOSE = 0 ! def usage(code, msg=''): ! print __doc__ % globals() ! if msg: ! print msg ! sys.exit(code) ! def main(): ! global DRYRUN, OLD_NOTICE, NEW_NOTICE, VERBOSE ! try: ! opts, args = getopt.getopt(sys.argv[1:], 'hv', ! ['help', 'oldnotice=', 'newnotice=', ! 'dry-run', 'verbose']) ! except getopt.error, msg: ! usage(1, msg) ! ! for opt, arg in opts: ! if opt in ('-h', '--help'): ! usage(0) ! elif opt in ('-v', '--verbose'): ! VERBOSE = 1 ! elif opt == '--dry-run': ! DRYRUN = 1 ! elif opt == '--oldnotice': ! fp = open(arg) ! OLD_NOTICE = fp.read() ! fp.close() ! elif opt == '--newnotice': ! fp = open(arg) ! NEW_NOTICE = fp.read() ! fp.close() ! for arg in args: process(arg) ! ! def process(file): ! f = open(file) data = f.read() f.close() ! i = data.find(OLD_NOTICE) if i < 0: ! if VERBOSE: ! print 'no change:', file ! return ! elif DRYRUN or VERBOSE: ! print ' change:', file ! if DRYRUN: ! # Don't actually change the file return data = data[:i] + NEW_NOTICE + data[i+len(OLD_NOTICE):] ! new = file + ".new" ! backup = file + ".bak" f = open(new, "w") f.write(data) f.close() ! os.rename(file, backup) ! os.rename(new, file) ! if __name__ == '__main__': From lemburg@users.sourceforge.net Sat Feb 9 11:28:45 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Sat, 09 Feb 2002 03:28:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.353,1.354 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv28168 Modified Files: NEWS Log Message: Add news about PYC magic and changes to UTF-8 codec. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.353 retrieving revision 1.354 diff -C2 -d -r1.353 -r1.354 *** NEWS 1 Feb 2002 11:27:43 -0000 1.353 --- NEWS 9 Feb 2002 11:28:43 -0000 1.354 *************** *** 7,10 **** --- 7,13 ---- Core and builtins + - The UTF-8 codec will now encode and decode Unicode surrogates + correctly and without raising exceptions for unpaired ones. + - file.xreadlines() now raises a ValueError if the file is closed: Previously, an xreadlines object was returned which would raise *************** *** 51,54 **** --- 54,60 ---- - Because Python's magic number scheme broke on January 1st, we decided to stop Python development. Thanks for all the fish! + + - Some of us don't like fish, so we changed Python's magic number + scheme to a new one. See Python/import.c for details. New platforms From lemburg@users.sourceforge.net Sun Feb 10 21:36:22 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Sun, 10 Feb 2002 13:36:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/encodings __init__.py,1.6,1.7 aliases.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv16639/Lib/encodings Modified Files: __init__.py aliases.py Log Message: Add IANA character set aliases to the encodings alias dictionary and make alias lookup lazy. Note that only those IANA character set aliases were added for which we actually have codecs in the encodings package. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/__init__.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** __init__.py 19 Sep 2001 11:52:07 -0000 1.6 --- __init__.py 10 Feb 2002 21:36:20 -0000 1.7 *************** *** 5,10 **** Codec modules must have names corresponding to standard lower-case ! encoding names with hyphens mapped to underscores, e.g. 'utf-8' is ! implemented by the module 'utf_8.py'. Each codec module must export the following interface: --- 5,10 ---- Codec modules must have names corresponding to standard lower-case ! encoding names with hyphens and periods mapped to underscores, ! e.g. 'utf-8' is implemented by the module 'utf_8.py'. Each codec module must export the following interface: *************** *** 29,36 **** """#" ! import codecs,aliases,exceptions _cache = {} _unknown = '--unknown--' class CodecRegistryError(exceptions.LookupError, --- 29,37 ---- """#" ! import codecs,exceptions _cache = {} _unknown = '--unknown--' + _import_tail = ['*'] class CodecRegistryError(exceptions.LookupError, *************** *** 41,57 **** # Cache lookup ! entry = _cache.get(encoding,_unknown) if entry is not _unknown: return entry ! # Import the module modname = encoding.replace('-', '_') ! modname = aliases.aliases.get(modname,modname) try: ! mod = __import__(modname,globals(),locals(),'*') except ImportError,why: # cache misses _cache[encoding] = None return None # Now ask the module for the registry entry --- 42,76 ---- # Cache lookup ! entry = _cache.get(encoding, _unknown) if entry is not _unknown: return entry ! # Import the module: ! # ! # First look in the encodings package, then try to lookup the ! # encoding in the aliases mapping and retry the import using the ! # default import module lookup scheme with the alias name. ! # modname = encoding.replace('-', '_') ! modname = modname.replace('.', '_') try: ! mod = __import__('encodings.' + modname, ! globals(), locals(), _import_tail) except ImportError,why: + import aliases + modname = aliases.aliases.get(modname, _unknown) + if modname is not _unknown: + try: + mod = __import__(modname, + globals(), locals(), _import_tail) + except ImportError,why: + mod = None + else: + mod = None + if mod is None: # cache misses _cache[encoding] = None return None + # Now ask the module for the registry entry *************** *** 80,83 **** --- 99,103 ---- pass else: + import aliases for alias in codecaliases: if not aliases.aliases.has_key(alias): Index: aliases.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/aliases.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** aliases.py 2 Dec 2001 12:24:19 -0000 1.11 --- aliases.py 10 Feb 2002 21:36:20 -0000 1.12 *************** *** 5,111 **** Note that the search function converts the encoding names to lower ! case and replaces hyphens with underscores *before* performing the ! lookup. """ aliases = { ! # Latin-1 ! 'latin': 'latin_1', ! 'latin1': 'latin_1', ! ! # UTF-7 ! 'utf7': 'utf_7', ! 'u7': 'utf_7', ! ! # UTF-8 ! 'utf': 'utf_8', ! 'utf8': 'utf_8', ! 'u8': 'utf_8', ! 'utf8@ucs2': 'utf_8', ! 'utf8@ucs4': 'utf_8', ! ! # UTF-16 ! 'utf16': 'utf_16', ! 'u16': 'utf_16', ! 'utf_16be': 'utf_16_be', ! 'utf_16le': 'utf_16_le', ! 'unicodebigunmarked': 'utf_16_be', ! 'unicodelittleunmarked': 'utf_16_le', ! # ASCII ! 'us_ascii': 'ascii', ! 'ansi_x3.4_1968': 'ascii', # used on Linux ! '646': 'ascii', # used on Solaris ! # EBCDIC ! 'ebcdic_cp_us': 'cp037', ! 'ibm039': 'cp037', ! 'ibm1140': 'cp1140', ! ! # ISO ! '8859': 'latin_1', ! 'iso8859': 'latin_1', ! 'iso8859_1': 'latin_1', ! 'iso_8859_1': 'latin_1', ! 'iso_8859_10': 'iso8859_10', ! 'iso_8859_13': 'iso8859_13', ! 'iso_8859_14': 'iso8859_14', ! 'iso_8859_15': 'iso8859_15', ! 'iso_8859_2': 'iso8859_2', ! 'iso_8859_3': 'iso8859_3', ! 'iso_8859_4': 'iso8859_4', ! 'iso_8859_5': 'iso8859_5', ! 'iso_8859_6': 'iso8859_6', ! 'iso_8859_7': 'iso8859_7', ! 'iso_8859_8': 'iso8859_8', ! 'iso_8859_9': 'iso8859_9', ! # Mac ! 'maclatin2': 'mac_latin2', ! 'maccentraleurope': 'mac_latin2', ! 'maccyrillic': 'mac_cyrillic', ! 'macgreek': 'mac_greek', ! 'maciceland': 'mac_iceland', ! 'macroman': 'mac_roman', ! 'macturkish': 'mac_turkish', ! # Windows ! 'windows_1251': 'cp1251', ! 'windows_1252': 'cp1252', ! 'windows_1254': 'cp1254', ! 'windows_1255': 'cp1255', ! # MBCS ! 'dbcs': 'mbcs', ! # Code pages ! '437': 'cp437', ! # CJK ! # ! # The codecs for these encodings are not distributed with the ! # Python core, but are included here for reference, since the ! # locale module relies on having these aliases available. ! # ! 'jis_7': 'jis_7', ! 'iso_2022_jp': 'jis_7', ! 'ujis': 'euc_jp', ! 'ajec': 'euc_jp', ! 'eucjp': 'euc_jp', ! 'tis260': 'tactis', ! 'sjis': 'shift_jis', ! # Content transfer/compression encodings ! 'rot13': 'rot_13', ! 'base64': 'base64_codec', ! 'base_64': 'base64_codec', ! 'zlib': 'zlib_codec', ! 'zip': 'zlib_codec', ! 'hex': 'hex_codec', ! 'uu': 'uu_codec', ! 'quopri': 'quopri_codec', ! 'quotedprintable': 'quopri_codec', ! 'quoted_printable': 'quopri_codec', } --- 5,340 ---- Note that the search function converts the encoding names to lower ! case and replaces hyphens and periods with underscores *before* ! performing the lookup. ! ! Contents: ! ! The following aliases dictionary contains mappings of all IANA ! character set names for which the Python core library provides ! codecs. In addition to these, a few Python specific codec ! aliases have also been added. ! ! About the CJK codec aliases: ! ! The codecs for these encodings are not distributed with the ! Python core, but are included here for reference, since the ! locale module relies on having these aliases available. """ aliases = { ! # ascii codec ! '646' : 'ascii', ! 'ansi_x3_4_1968' : 'ascii', ! 'ansi_x3_4_1986' : 'ascii', ! 'cp367' : 'ascii', ! 'csascii' : 'ascii', ! 'ibm367' : 'ascii', ! 'iso646_us' : 'ascii', ! 'iso_646_irv:1991' : 'ascii', ! 'iso_ir_6' : 'ascii', ! 'us' : 'ascii', ! 'us_ascii' : 'ascii', ! # base64_codec codec ! 'base64' : 'base64_codec', ! 'base_64' : 'base64_codec', ! # cp037 codec ! 'csibm037' : 'cp037', ! 'ebcdic_cp_ca' : 'cp037', ! 'ebcdic_cp_nl' : 'cp037', ! 'ebcdic_cp_us' : 'cp037', ! 'ebcdic_cp_wt' : 'cp037', ! 'ibm037' : 'cp037', ! 'ibm039' : 'cp037', ! # cp1026 codec ! 'csibm1026' : 'cp1026', ! 'ibm1026' : 'cp1026', ! # cp1140 codec ! 'ibm1140' : 'cp1140', ! # cp1250 codec ! 'windows_1250' : 'cp1250', ! # cp1251 codec ! 'windows_1251' : 'cp1251', ! # cp1252 codec ! 'windows_1252' : 'cp1252', ! # cp1253 codec ! 'windows_1253' : 'cp1253', ! ! # cp1254 codec ! 'windows_1254' : 'cp1254', ! ! # cp1255 codec ! 'windows_1255' : 'cp1255', ! ! # cp1256 codec ! 'windows_1256' : 'cp1256', ! ! # cp1257 codec ! 'windows_1257' : 'cp1257', ! ! # cp1258 codec ! 'windows_1258' : 'cp1258', ! ! # cp424 codec ! 'csibm424' : 'cp424', ! 'ebcdic_cp_he' : 'cp424', ! 'ibm424' : 'cp424', ! ! # cp437 codec ! '437' : 'cp437', ! 'cspc8codepage437' : 'cp437', ! 'ibm437' : 'cp437', ! ! # cp500 codec ! 'csibm500' : 'cp500', ! 'ebcdic_cp_be' : 'cp500', ! 'ebcdic_cp_ch' : 'cp500', ! 'ibm500' : 'cp500', ! ! # cp775 codec ! 'cspc775baltic' : 'cp775', ! 'ibm775' : 'cp775', ! ! # cp850 codec ! '850' : 'cp850', ! 'cspc850multilingual' : 'cp850', ! 'ibm850' : 'cp850', ! ! # cp852 codec ! '852' : 'cp852', ! 'cspcp852' : 'cp852', ! 'ibm852' : 'cp852', ! ! # cp855 codec ! '855' : 'cp855', ! 'csibm855' : 'cp855', ! 'ibm855' : 'cp855', ! ! # cp857 codec ! '857' : 'cp857', ! 'csibm857' : 'cp857', ! 'ibm857' : 'cp857', ! ! # cp860 codec ! '860' : 'cp860', ! 'csibm860' : 'cp860', ! 'ibm860' : 'cp860', ! ! # cp861 codec ! '861' : 'cp861', ! 'cp_is' : 'cp861', ! 'csibm861' : 'cp861', ! 'ibm861' : 'cp861', ! ! # cp862 codec ! '862' : 'cp862', ! 'cspc862latinhebrew' : 'cp862', ! 'ibm862' : 'cp862', ! ! # cp863 codec ! '863' : 'cp863', ! 'csibm863' : 'cp863', ! 'ibm863' : 'cp863', ! ! # cp864 codec ! 'csibm864' : 'cp864', ! 'ibm864' : 'cp864', ! ! # cp865 codec ! '865' : 'cp865', ! 'csibm865' : 'cp865', ! 'ibm865' : 'cp865', ! ! # cp866 codec ! '866' : 'cp866', ! 'csibm866' : 'cp866', ! 'ibm866' : 'cp866', ! ! # cp869 codec ! '869' : 'cp869', ! 'cp_gr' : 'cp869', ! 'csibm869' : 'cp869', ! 'ibm869' : 'cp869', ! ! # hex_codec codec ! 'hex' : 'hex_codec', ! ! # iso8859_10 codec ! 'csisolatin6' : 'iso8859_10', ! 'iso_8859_10' : 'iso8859_10', ! 'iso_8859_10:1992' : 'iso8859_10', ! 'iso_ir_157' : 'iso8859_10', ! 'l6' : 'iso8859_10', ! 'latin6' : 'iso8859_10', ! ! # iso8859_13 codec ! 'iso_8859_13' : 'iso8859_13', ! ! # iso8859_14 codec ! 'iso_8859_14' : 'iso8859_14', ! 'iso_8859_14:1998' : 'iso8859_14', ! 'iso_celtic' : 'iso8859_14', ! 'iso_ir_199' : 'iso8859_14', ! 'l8' : 'iso8859_14', ! 'latin8' : 'iso8859_14', ! ! # iso8859_15 codec ! 'iso_8859_15' : 'iso8859_15', ! ! # iso8859_2 codec ! 'csisolatin2' : 'iso8859_2', ! 'iso_8859_2' : 'iso8859_2', ! 'iso_8859_2:1987' : 'iso8859_2', ! 'iso_ir_101' : 'iso8859_2', ! 'l2' : 'iso8859_2', ! 'latin2' : 'iso8859_2', ! ! # iso8859_3 codec ! 'csisolatin3' : 'iso8859_3', ! 'iso_8859_3' : 'iso8859_3', ! 'iso_8859_3:1988' : 'iso8859_3', ! 'iso_ir_109' : 'iso8859_3', ! 'l3' : 'iso8859_3', ! 'latin3' : 'iso8859_3', ! ! # iso8859_4 codec ! 'csisolatin4' : 'iso8859_4', ! 'iso_8859_4' : 'iso8859_4', ! 'iso_8859_4:1988' : 'iso8859_4', ! 'iso_ir_110' : 'iso8859_4', ! 'l4' : 'iso8859_4', ! 'latin4' : 'iso8859_4', ! ! # iso8859_5 codec ! 'csisolatincyrillic' : 'iso8859_5', ! 'cyrillic' : 'iso8859_5', ! 'iso_8859_5' : 'iso8859_5', ! 'iso_8859_5:1988' : 'iso8859_5', ! 'iso_ir_144' : 'iso8859_5', ! ! # iso8859_6 codec ! 'arabic' : 'iso8859_6', ! 'asmo_708' : 'iso8859_6', ! 'csisolatinarabic' : 'iso8859_6', ! 'ecma_114' : 'iso8859_6', ! 'iso_8859_6' : 'iso8859_6', ! 'iso_8859_6:1987' : 'iso8859_6', ! 'iso_ir_127' : 'iso8859_6', ! ! # iso8859_7 codec ! 'csisolatingreek' : 'iso8859_7', ! 'ecma_118' : 'iso8859_7', ! 'elot_928' : 'iso8859_7', ! 'greek' : 'iso8859_7', ! 'greek8' : 'iso8859_7', ! 'iso_8859_7' : 'iso8859_7', ! 'iso_8859_7:1987' : 'iso8859_7', ! 'iso_ir_126' : 'iso8859_7', ! ! # iso8859_8 codec ! 'csisolatinhebrew' : 'iso8859_8', ! 'hebrew' : 'iso8859_8', ! 'iso_8859_8' : 'iso8859_8', ! 'iso_8859_8:1988' : 'iso8859_8', ! 'iso_ir_138' : 'iso8859_8', ! ! # iso8859_9 codec ! 'csisolatin5' : 'iso8859_9', ! 'iso_8859_9' : 'iso8859_9', ! 'iso_8859_9:1989' : 'iso8859_9', ! 'iso_ir_148' : 'iso8859_9', ! 'l5' : 'iso8859_9', ! 'latin5' : 'iso8859_9', ! ! # jis_7 codec ! 'csiso2022jp' : 'jis_7', ! 'iso_2022_jp' : 'jis_7', ! ! # koi8_r codec ! 'cskoi8r' : 'koi8_r', ! ! # latin_1 codec ! '8859' : 'latin_1', ! 'cp819' : 'latin_1', ! 'csisolatin1' : 'latin_1', ! 'ibm819' : 'latin_1', ! 'iso8859' : 'latin_1', ! 'iso_8859_1' : 'latin_1', ! 'iso_8859_1:1987' : 'latin_1', ! 'iso_ir_100' : 'latin_1', ! 'l1' : 'latin_1', ! 'latin' : 'latin_1', ! 'latin1' : 'latin_1', ! ! # mac_cyrillic codec ! 'maccyrillic' : 'mac_cyrillic', ! ! # mac_greek codec ! 'macgreek' : 'mac_greek', ! ! # mac_iceland codec ! 'maciceland' : 'mac_iceland', ! ! # mac_latin2 codec ! 'maccentraleurope' : 'mac_latin2', ! 'maclatin2' : 'mac_latin2', ! ! # mac_roman codec ! 'macroman' : 'mac_roman', ! ! # mac_turkish codec ! 'macturkish' : 'mac_turkish', ! ! # mbcs codec ! 'dbcs' : 'mbcs', ! ! # quopri_codec codec ! 'quopri' : 'quopri_codec', ! 'quoted_printable' : 'quopri_codec', ! 'quotedprintable' : 'quopri_codec', ! ! # rot_13 codec ! 'rot13' : 'rot_13', ! ! # tactis codec ! 'tis260' : 'tactis', ! ! # utf_16 codec ! 'u16' : 'utf_16', ! 'utf16' : 'utf_16', ! ! # utf_16_be codec ! 'unicodebigunmarked' : 'utf_16_be', ! 'utf_16be' : 'utf_16_be', ! ! # utf_16_le codec ! 'unicodelittleunmarked' : 'utf_16_le', ! 'utf_16le' : 'utf_16_le', ! ! # utf_7 codec ! 'u7' : 'utf_7', ! 'utf7' : 'utf_7', ! ! # utf_8 codec ! 'u8' : 'utf_8', ! 'utf' : 'utf_8', ! 'utf8' : 'utf_8', ! 'utf8@ucs2' : 'utf_8', ! 'utf8@ucs4' : 'utf_8', ! ! # uu_codec codec ! 'uu' : 'uu_codec', ! ! # zlib_codec codec ! 'zip' : 'zlib_codec', ! 'zlib' : 'zlib_codec', } From lemburg@users.sourceforge.net Sun Feb 10 21:42:50 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Sun, 10 Feb 2002 13:42:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.354,1.355 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv18352/Misc Modified Files: NEWS Log Message: News about the new alias support. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.354 retrieving revision 1.355 diff -C2 -d -r1.354 -r1.355 *** NEWS 9 Feb 2002 11:28:43 -0000 1.354 --- NEWS 10 Feb 2002 21:42:47 -0000 1.355 *************** *** 22,25 **** --- 22,28 ---- Library + - encodings package: added aliases for all supported IANA character + sets + - ftplib: to safeguard the user's privacy, anonymous login will use "anonymous@" as default password, rather than the real user and host From gvanrossum@users.sourceforge.net Mon Feb 11 01:18:27 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sun, 10 Feb 2002 17:18:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc README,1.16,1.17 unicode.txt,3.11,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv29430 Modified Files: README Removed Files: unicode.txt Log Message: Remove stub for unicode.txt. Resort README in dictionary order. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/README,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** README 26 Oct 2001 15:01:16 -0000 1.16 --- README 11 Feb 2002 01:18:25 -0000 1.17 *************** *** 12,30 **** BeOS-NOTES Notes for building on BeOS BeOS-setup.py setup.py replacement for BeOS, see BeOS-NOTES HISTORY News from previous releases -- oldest last HPUX-NOTES Notes about dynamic loading under HP-UX ! NEWS News for this release ! PURIFY.README Information for Purify users Porting Mini-FAQ on porting to new platforms README The file you're reading now RFD Request For Discussion about a Python newsgroup RPM (Old) tools to build RPMs - 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 - indent.pro GNU indent profile approximating my C style - python-mode.el Emacs mode for editing Python programs - python.man UNIX man page for the python interpreter setuid-prog.c C helper program for set-uid Python scripts - unicode.txt Marc-Andre Lemburg's specification of the Unicode API vgrindefs Python configuration for vgrind (a generic pretty printer) --- 12,29 ---- 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 + 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 RFD Request For Discussion about a Python newsgroup RPM (Old) tools to build RPMs setuid-prog.c C helper program for set-uid Python scripts vgrindefs Python configuration for vgrind (a generic pretty printer) --- unicode.txt DELETED --- From gvanrossum@users.sourceforge.net Mon Feb 11 01:33:53 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sun, 10 Feb 2002 17:33:53 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,NONE,1.1 pep-0000.txt,1.153,1.154 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv32229 Modified Files: pep-0000.txt Added Files: pep-0280.txt Log Message: Add PEP 280, optimizing access to globals. --- NEW FILE: pep-0280.txt --- PEP: 280 Title: Optimizing access to globals Version: $Revision: 1.1 $ Last-Modified: $Date: 2002/02/11 01:33:51 $ Author: skip@pobox.com, jeremy@alum.mit.edu, guido@python.org, tim.one@comcast.net, Status: Draft Type: Standards Track Created: 10-Feb-2002 Python-Version: 2.3 Post-History: Abstract This PEP attempts to summarize various approaches for avoiding the dictionary lookup for accessing globals and built-ins in most cases. There are several competing approaches, which originated in historical order by authors Montanaro, Hylton, and Van Rossum. The fourth author is added for his valuable feedback during all stages. The expectation is that eventually one approach will be picked and implemented; possibly multiple approaches will be prototyped first. Montanaro's approach: tracking globals XXX (Skip, please check in a description!). Hylton's approach: using a dlict XXX (Jerely, please check in a description!) Van Rossum's approach: using a celldict XXX (Guido, please check in a description!) Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.153 retrieving revision 1.154 diff -C2 -d -r1.153 -r1.154 *** pep-0000.txt 1 Feb 2002 05:59:29 -0000 1.153 --- pep-0000.txt 11 Feb 2002 01:33:51 -0000 1.154 *************** *** 91,94 **** --- 91,95 ---- S 278 Universal Newline Support Jansen S 279 Enhanced Generators Hettinger + S 280 Optimizing access to globals Montanaro, Hylton, van Rossum, Peters Finished PEPs (done, implemented in CVS) *************** *** 242,245 **** --- 243,247 ---- S 278 Universal Newline Support Jansen S 279 Enhanced Generators Hettinger + S 280 Optimizing access to globals Montanaro, Hylton, van Rossum, Peters SR 666 Reject Foolish Indentation Creighton From gvanrossum@users.sourceforge.net Mon Feb 11 02:09:42 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sun, 10 Feb 2002 18:09:42 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv6732 Modified Files: pep-0280.txt Log Message: Add detailed description of my approach. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0280.txt 11 Feb 2002 01:33:51 -0000 1.1 --- pep-0280.txt 11 Feb 2002 02:09:40 -0000 1.2 *************** *** 34,39 **** XXX (Jerely, please check in a description!) Van Rossum's approach: using a celldict ! XXX (Guido, please check in a description!) --- 34,229 ---- XXX (Jerely, please check in a description!) + See Jeremy's Python10 DevDay slides at + http://www.python.org/~jeremy/talks/spam10/PEP-267-1.html + and his Wiki at + http://www.zope.org/Members/jeremy/CurrentAndFutureProjects/FastGlobals + Van Rossum's approach: using a celldict ! (Note: Jason Orendorff writes: """I implemented this once, long ! ago, for Python 1.5-ish, I believe. I got it to the point where ! it was only 15% slower than ordinary Python, then abandoned it. ! ;) In my implementation, "cells" were real first-class objects, ! and "celldict" was a copy-and-hack version of dictionary. I ! forget how the rest worked.""" Reference: ! http://mail.python.org/pipermail/python-dev/2002-February/019876.html) ! ! Let a cell be a really simple Python object, containing a pointer ! to a Python object and a pointer to a cell. Both pointers may be ! NULL. A Python implementation could be: ! ! class cell(object): ! ! def __init__(self): ! self.objptr = NULL ! self.cellptr = NULL ! ! The cellptr attribute is used for chaining cells together for ! searching built-ins; this will be explained later. ! ! Let a celldict be a mapping from strings (the names of a module's ! globals) to objects (the values of those globals), implemented ! using a dict of cells. A Python implementation could be: ! ! class celldict(object): ! ! def __init__(self): ! self.__dict = {} # dict of cells ! ! def getcell(self, key): ! c = self.__dict.get(key) ! if c is None: ! c = cell() ! self.__dict[key] = c ! return c ! ! def cellkeys(self): ! return self.__dict.keys() ! ! def __getitem__(self, key): ! c = self.__dict.get(key) ! if c is None: ! raise KeyError, key ! value = c.objptr ! if value is NULL: ! raise KeyError, key ! else: ! return value ! ! def __setitem__(self, key, value): ! c = self.__dict.get(key) ! if c is None: ! c = cell() ! self.__dict[key] = c ! c.objptr = value ! ! def __delitem__(self, key): ! c = self.__dict.get(key) ! if c is None or c.objptr is NULL: ! raise KeyError, key ! c.objptr = NULL ! ! def keys(self): ! return [k for k, c in self.__dict.iteritems() ! if c.objptr is not NULL] ! ! def items(self): ! return [k, c.objptr for k, c in self.__dict.iteritems() ! if c.objptr is not NULL] ! ! def values(self): ! preturn [c.objptr for c in self.__dict.itervalues() ! if c.objptr is not NULL] ! ! def clear(self): ! for c in self.__dict.values(): ! c.objptr = NULL ! ! # Etc. ! ! It is possible that a cell exists corresponding to a given key, ! but the cell's objptr is NULL; let's call such a cell empty. When ! the celldict is used as a mapping, it is as if empty cells don't ! exist. However, once added, a cell is never deleted from a ! celldict, and it is possible to get at empty cells using the ! getcell() method. ! ! The celldict implementation never uses the cellptr attribute of ! cells. ! ! We change the module implementation to use a celldict for its ! __dict__. The module's getattr, setattr and delattr operations ! now map to getitem, setitem and delitem on the celldict. The type ! of .__dict__ and globals() is probably the only backwards ! incompatibility. ! ! When a module is initialized, its __builtins__ is initialized from ! the __builtin__ module's __dict__, which is itself a celldict. ! For each cell in __builtins__, the new module's __dict__ adds a ! cell with a NULL objptr, whose cellptr points to the corresponding ! cell of __builtins__. Python pseudo-code (ignoring rexec): ! ! import __builtin__ ! ! class module(object): ! ! def __init__(self): ! self.__dict__ = d = celldict() ! d['__builtins__'] = bd = __builtin__.__dict__ ! for k in bd.cellkeys(): ! c = self.__dict__.getcell(k) ! c.cellptr = bd.getcell(k) ! ! def __getattr__(self, k): ! try: ! return self.__dict__[k] ! except KeyError: ! raise IndexError, k ! ! def __setattr__(self, k, v): ! self.__dict__[k] = v ! ! def __delattr__(self, k): ! del self.__dict__[k] ! ! The compiler generates LOAD_GLOBAL_CELL (and STORE_GLOBAL_CELL ! etc.) opcodes for references to globals, where is a small ! index with meaning only within one code object like the const ! index in LOAD_CONST. The code object has a new tuple, co_globals, ! giving the names of the globals referenced by the code indexed by ! . No new analysis is required to be able to do this. ! ! When a function object is created from a code object and a celldict, ! the function object creates an array of cell pointers by asking the ! celldict for cells corresponding to the names in the code object's ! co_globals. If the celldict doesn't already have a cell for a ! particular name, it creates and an empty one. This array of cell ! pointers is stored on the function object as func_cells. When a ! function object is created from a regular dict instead of a ! celldict, func_cells is a NULL pointer. ! ! When the VM executes a LOAD_GLOBAL_CELL instruction, it gets ! cell number from func_cells. It then looks in the cell's ! PyObject pointer, and if not NULL, that's the global value. If it ! is NULL, it follows the cell's cell pointer to the next cell, if it ! is not NULL, and looks in the PyObject pointer in that cell. If ! that's also NULL, or if there is no second cell, NameError is ! raised. (It could follow the chain of cell pointers until a NULL ! cell pointer is found; but I have no use for this.) Similar for ! STORE_GLOBAL_CELL , except it doesn't follow the cell pointer ! chain -- it always stores in the first cell. ! ! There are fallbacks in the VM for the case where the function's ! globals aren't a celldict, and hence func_cells is NULL. In that ! case, the code object's co_globals is indexed with to find the ! name of the corresponding global and this name is used to index the ! function's globals dict. ! ! Additional ideas: ! ! - Never make func_cell a NULL pointer; instead, make up an array ! of empty cells, so that LOAD_GLOBAL_CELL can index func_cells ! without a NULL check. ! ! - Make c.cellptr equal to c when a cell is created, so that ! LOAD_GLOBAL_CELL can always dereference c.cellptr without a NULL ! check. ! ! With these two additional ideas added, here's Python pseudo-code ! for LOAD_GLOBAL_CELL: ! ! def LOAD_GLOBAL_CELL(self, i): ! # self is the frame ! c = self.func_cells[i] ! obj = c.objptr ! if obj is not NULL: ! return obj # Existing global ! return c.cellptr.objptr # Built-in or NULL ! ! XXX Incorporate Tim's most recent posts. (Tim, can you do this?) ! ! ! Comparison ! ! XXX Here, a comparison of the three approaches should be added. From gvanrossum@users.sourceforge.net Mon Feb 11 02:13:57 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sun, 10 Feb 2002 18:13:57 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.154,1.155 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv7394 Modified Files: pep-0000.txt Log Message: PEP 280 is my own; Jeremy and Skip already have PEPs describing their approaches. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -d -r1.154 -r1.155 *** pep-0000.txt 11 Feb 2002 01:33:51 -0000 1.154 --- pep-0000.txt 11 Feb 2002 02:13:54 -0000 1.155 *************** *** 91,95 **** S 278 Universal Newline Support Jansen S 279 Enhanced Generators Hettinger ! S 280 Optimizing access to globals Montanaro, Hylton, van Rossum, Peters Finished PEPs (done, implemented in CVS) --- 91,95 ---- S 278 Universal Newline Support Jansen S 279 Enhanced Generators Hettinger ! S 280 Optimizing access to globals van Rossum Finished PEPs (done, implemented in CVS) *************** *** 243,247 **** S 278 Universal Newline Support Jansen S 279 Enhanced Generators Hettinger ! S 280 Optimizing access to globals Montanaro, Hylton, van Rossum, Peters SR 666 Reject Foolish Indentation Creighton --- 243,247 ---- S 278 Universal Newline Support Jansen S 279 Enhanced Generators Hettinger ! S 280 Optimizing access to globals van Rossum SR 666 Reject Foolish Indentation Creighton From gvanrossum@users.sourceforge.net Mon Feb 11 02:16:50 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sun, 10 Feb 2002 18:16:50 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv7795 Modified Files: pep-0280.txt Log Message: Oops, Skip's and Jeremy's approach already have their own PEP. Reference those instead of trying to incorporate them. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0280.txt 11 Feb 2002 02:09:40 -0000 1.2 --- pep-0280.txt 11 Feb 2002 02:16:47 -0000 1.3 *************** *** 3,7 **** Version: $Revision$ Last-Modified: $Date$ ! Author: skip@pobox.com, jeremy@alum.mit.edu, guido@python.org, tim.one@comcast.net, Status: Draft Type: Standards Track --- 3,7 ---- Version: $Revision$ Last-Modified: $Date$ ! Author: guido@python.org (Guido van Rossum) Status: Draft Type: Standards Track *************** *** 13,22 **** Abstract ! This PEP attempts to summarize various approaches for avoiding the ! dictionary lookup for accessing globals and built-ins in most ! cases. There are several competing approaches, which originated ! in historical order by authors Montanaro, Hylton, and Van Rossum. ! The fourth author is added for his valuable feedback during all ! stages. The expectation is that eventually one approach will be picked and --- 13,20 ---- Abstract ! This PEP describes yet another approach to optimizing access to ! module globals, providing an alternative to PEP 266 (Optimizing ! Global Variable/Attribute Access by Skip Montanaro) and PEP 267 ! (Optimized Access to Module Namespaces by Jeremy Hylton). The expectation is that eventually one approach will be picked and *************** *** 25,44 **** ! Montanaro's approach: tracking globals ! ! XXX (Skip, please check in a description!). ! ! ! Hylton's approach: using a dlict ! ! XXX (Jerely, please check in a description!) ! ! See Jeremy's Python10 DevDay slides at ! http://www.python.org/~jeremy/talks/spam10/PEP-267-1.html ! and his Wiki at ! http://www.zope.org/Members/jeremy/CurrentAndFutureProjects/FastGlobals ! ! ! Van Rossum's approach: using a celldict (Note: Jason Orendorff writes: """I implemented this once, long --- 23,27 ---- ! Description (Note: Jason Orendorff writes: """I implemented this once, long *************** *** 227,229 **** Comparison ! XXX Here, a comparison of the three approaches should be added. --- 210,212 ---- Comparison ! XXX Here, a comparison of the three approaches could be added. From gvanrossum@users.sourceforge.net Mon Feb 11 02:22:52 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sun, 10 Feb 2002 18:22:52 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv8610 Modified Files: pep-0280.txt Log Message: Add Copyright and Emacs crud. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0280.txt 11 Feb 2002 02:16:47 -0000 1.3 --- pep-0280.txt 11 Feb 2002 02:22:50 -0000 1.4 *************** *** 211,212 **** --- 211,224 ---- XXX Here, a comparison of the three approaches could be added. + + + Copyright + + This document has been placed in the public domain. + + + + Local Variables: + mode: indented-text + indent-tabs-mode: nil + End: From tim_one@users.sourceforge.net Mon Feb 11 05:10:12 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 10 Feb 2002 21:10:12 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv3888 Modified Files: pep-0280.txt Log Message: Nuke hard tabs. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pep-0280.txt 11 Feb 2002 02:22:50 -0000 1.4 --- pep-0280.txt 11 Feb 2002 05:10:10 -0000 1.5 *************** *** 197,207 **** for LOAD_GLOBAL_CELL: ! def LOAD_GLOBAL_CELL(self, i): ! # self is the frame ! c = self.func_cells[i] ! obj = c.objptr ! if obj is not NULL: ! return obj # Existing global ! return c.cellptr.objptr # Built-in or NULL XXX Incorporate Tim's most recent posts. (Tim, can you do this?) --- 197,207 ---- for LOAD_GLOBAL_CELL: ! def LOAD_GLOBAL_CELL(self, i): ! # self is the frame ! c = self.func_cells[i] ! obj = c.objptr ! if obj is not NULL: ! return obj # Existing global ! return c.cellptr.objptr # Built-in or NULL XXX Incorporate Tim's most recent posts. (Tim, can you do this?) From tim_one@users.sourceforge.net Mon Feb 11 07:05:03 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 10 Feb 2002 23:05:03 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.5,1.6 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv22472 Modified Files: pep-0280.txt Log Message: Flesh out a more aggressive builtin-caching variation. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0280.txt 11 Feb 2002 05:10:10 -0000 1.5 --- pep-0280.txt 11 Feb 2002 07:05:01 -0000 1.6 *************** *** 184,188 **** function's globals dict. ! Additional ideas: - Never make func_cell a NULL pointer; instead, make up an array --- 184,189 ---- function's globals dict. ! ! Additional Ideas - Never make func_cell a NULL pointer; instead, make up an array *************** *** 205,209 **** return c.cellptr.objptr # Built-in or NULL ! XXX Incorporate Tim's most recent posts. (Tim, can you do this?) --- 206,396 ---- return c.cellptr.objptr # Built-in or NULL ! - Be more aggressive: put the actual values of builtins into module ! dicts, not just pointers to cells containing the actual values. ! ! There are two points to this: (1) Simplify and speed access, which ! is the most common operation. (2) Support faithful emulation of ! extreme existing corner cases. ! ! WRT #2, the set of builtins in the scheme above is captured at the ! time a module dict is first created. Mutations to the set of builtin ! names following that don't get reflected in the module dicts. Example: ! consider files main.py and cheater.py: ! ! [main.py] ! import cheater ! def f(): ! cheater.cheat() ! return pachinko() ! print f() ! ! [cheater.py] ! def cheat(): ! import __builtin__ ! __builtin__.pachinko = lambda: 666 ! ! If main.py is run under Python 2.2 (or before), 666 is printed. But ! under the proposal, __builtin__.pachinko doesn't exist at the time ! main's __dict__ is initialized. When the function object for ! f is created, main.__dict__ grows a pachinko cell mapping to two ! NULLs. When cheat() is called, __builtin__.__dict__ grows a pachinko ! cell too, but main.__dict__ doesn't know-- and will never know --about ! that. When f's return stmt references pachinko, in will still find ! the double-NULLs in main.__dict__'s pachinko cell, and so raise ! NameError. ! ! A similar (in cause) break in compatibility can occur if a module ! global foo is del'ed, but a builtin foo was created prior to that ! but after the module dict was first created. Then the builtin foo ! becomes visible in the module under 2.2 and before, but remains ! invisible under the proposal. ! ! Mutating builtins is extremely rare (most programs never mutate the ! builtins, and it's hard to imagine a plausible use for frequent ! mutation of the builtins -- I've never seen or heard of one), so it ! doesn't matter how expensive mutating the builtins becomes. OTOH, ! referencing globals and builtins is very common. Combining those ! observations suggests a more aggressive caching of builtins in module ! globals, speeding access at the expense of making mutations of the ! builtins (potentially much) more expensive to keep the caches in ! synch. ! ! Much of the scheme above remains the same, and most of the rest is ! just a little different. A cell changes to: ! ! class cell(object): ! def __init__(self, obj=NULL, builtin=0): ! self.objptr = obj ! self.buitinflag = builtin ! ! and a celldict maps strings to this version of cells. builtinflag ! is true when and only when objptr contains a value obtained from ! the builtins; in other words, it's true when and only when a cell ! is acting as a cached value. When builtinflag is false, objptr is ! the value of a module global (possibly NULL). celldict changes to: ! ! class celldict(object): ! ! def __init__(self, builtindict=()): ! self.basedict = builtindict ! self.__dict = d = {} ! for k, v in builtindict.items(): ! d[k] = cell(v, 1) ! ! def __getitem__(self, key): ! c = self.__dict.get(key) ! if c is None or c.objptr is NULL or c.builtinflag: ! raise KeyError, key ! return c.objptr ! ! def __setitem__(self, key, value): ! c = self.__dict.get(key) ! if c is None: ! c = cell() ! self.__dict[key] = c ! c.objptr = value ! c.builtinflag = 0 ! ! def __delitem__(self, key): ! c = self.__dict.get(key) ! if c is None or c.objptr is NULL or c.builtinflag: ! raise KeyError, key ! c.objptr = NULL ! # We may have unmasked a builtin. Note that because ! # we're checking the builtin dict for that *now*, this ! # still works if the builtin first came into existence ! # after we were constructed. Note too that del on ! # namespace dicts is rare, so the expensse of this check ! # shouldn't matter. ! if key in self.basedict: ! c.objptr = self.basedict[key] ! assert c.objptr is not NULL # else "in" lied ! c.buitinflag = 1 ! else: ! # There is no builtin with the same name. ! assert not c.buitinflag ! ! def keys(self): ! return [k for k, c in self.__dict.iteritems() ! if c.objptr is not NULL and not c.buitinflag] ! ! def items(self): ! return [k, c.objptr for k, c in self.__dict.iteritems() ! if c.objptr is not NULL and not c.buitinflag] ! ! def values(self): ! preturn [c.objptr for c in self.__dict.itervalues() ! if c.objptr is not NULL and not c.buitinflag] ! ! def clear(self): ! for c in self.__dict.values(): ! if not c.buitinflag: ! c.objptr = NULL ! ! # Etc. ! ! The speed benefit comes from simplifying LOAD_GLOBAL_CELL, which ! I expect is executed more frequently than all other namespace ! operations combined: ! ! def LOAD_GLOBAL_CELL(self, i): ! # self is the frame ! c = self.func_cells[i] ! return c.objptr # may be NULL (also true before) ! ! That is, accessing builtins and accessing module globals are equally ! fast. For module globals, a NULL-pointer test+branch is saved. For ! builtins, an additional pointer chase is also saved. ! ! The other part needed to make this fly is expensive, propagating ! mutations of builtins into the module dicts that were initialized ! from the builtins. This is much like, in 2.2, propagating changes ! in new-style base classes to their descendants: the builtins need to ! maintain a list of weakrefs to the modules (or module dicts) ! initialized from the builtin's dict. Given a mutation to the builtin ! dict (adding a new key, changing the value associated with an ! existing key, or deleting a key), traverse the list of module dicts ! and make corresponding mutations to them. This is straightforward; ! for example, if a key is deleted from builtins, execute ! reflect_bltin_del in each module: ! ! def reflect_bltin_del(self, key): ! c = self.__dict.get(key) ! assert c is not None # else we were already out of synch ! if c.buitinflag: ! # Put us back in synch. ! c.objptr = NULL ! c.buitinflag = 0 ! # Else we're shadowing the builtin, so don't care that ! # the builtin went away. ! ! Note that c.buitinflag protects from us erroneously deleting a ! module global of the same name. Adding a new (key, value) builtin ! pair is similar: ! ! def reflect_bltin_new(self, key, value): ! c = self.__dict.get(key) ! if c is None: ! # Never heard of it before: cache the builtin value. ! self.__dict[key] = cell(value, 1) ! elif c.objptr is NULL: ! # This used to exist in the module or the builtins, ! # but doesn't anymore; rehabilitate it. ! assert not c.builtinflag ! c.objptr = value ! c.buitinflag = 1 ! else: ! # We're shadowing it already. ! assert not c.buitinflag ! ! Changing the value of an existing builtin can be viewed as deleting ! the name, then adding it again. Indeed, since mutating builtins is ! so rare, that's probably the right way to implement it too (speed ! doesn't matter here): ! ! def reflect_bltin_change(self, key, newvalue): ! assert key in self.__dict ! self.reflect_bltin_del(key) ! self.reflect_bltin_new(key, newvalue) From tim_one@users.sourceforge.net Mon Feb 11 07:14:07 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 10 Feb 2002 23:14:07 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.6,1.7 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv23732 Modified Files: pep-0280.txt Log Message: Fix a typo, unfortunately propagated by word-completion. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pep-0280.txt 11 Feb 2002 07:05:01 -0000 1.6 --- pep-0280.txt 11 Feb 2002 07:14:05 -0000 1.7 *************** *** 262,266 **** def __init__(self, obj=NULL, builtin=0): self.objptr = obj ! self.buitinflag = builtin and a celldict maps strings to this version of cells. builtinflag --- 262,266 ---- def __init__(self, obj=NULL, builtin=0): self.objptr = obj ! self.builtinflag = builtin and a celldict maps strings to this version of cells. builtinflag *************** *** 306,329 **** c.objptr = self.basedict[key] assert c.objptr is not NULL # else "in" lied ! c.buitinflag = 1 else: # There is no builtin with the same name. ! assert not c.buitinflag def keys(self): return [k for k, c in self.__dict.iteritems() ! if c.objptr is not NULL and not c.buitinflag] def items(self): return [k, c.objptr for k, c in self.__dict.iteritems() ! if c.objptr is not NULL and not c.buitinflag] def values(self): preturn [c.objptr for c in self.__dict.itervalues() ! if c.objptr is not NULL and not c.buitinflag] def clear(self): for c in self.__dict.values(): ! if not c.buitinflag: c.objptr = NULL --- 306,329 ---- c.objptr = self.basedict[key] assert c.objptr is not NULL # else "in" lied ! c.builtinflag = 1 else: # There is no builtin with the same name. ! assert not c.builtinflag def keys(self): return [k for k, c in self.__dict.iteritems() ! if c.objptr is not NULL and not c.builtinflag] def items(self): return [k, c.objptr for k, c in self.__dict.iteritems() ! if c.objptr is not NULL and not c.builtinflag] def values(self): preturn [c.objptr for c in self.__dict.itervalues() ! if c.objptr is not NULL and not c.builtinflag] def clear(self): for c in self.__dict.values(): ! if not c.builtinflag: c.objptr = NULL *************** *** 358,369 **** c = self.__dict.get(key) assert c is not None # else we were already out of synch ! if c.buitinflag: # Put us back in synch. c.objptr = NULL ! c.buitinflag = 0 # Else we're shadowing the builtin, so don't care that # the builtin went away. ! Note that c.buitinflag protects from us erroneously deleting a module global of the same name. Adding a new (key, value) builtin pair is similar: --- 358,369 ---- c = self.__dict.get(key) assert c is not None # else we were already out of synch ! if c.builtinflag: # Put us back in synch. c.objptr = NULL ! c.builtinflag = 0 # Else we're shadowing the builtin, so don't care that # the builtin went away. ! Note that c.builtinflag protects from us erroneously deleting a module global of the same name. Adding a new (key, value) builtin pair is similar: *************** *** 379,386 **** assert not c.builtinflag c.objptr = value ! c.buitinflag = 1 else: # We're shadowing it already. ! assert not c.buitinflag Changing the value of an existing builtin can be viewed as deleting --- 379,386 ---- assert not c.builtinflag c.objptr = value ! c.builtinflag = 1 else: # We're shadowing it already. ! assert not c.builtinflag Changing the value of an existing builtin can be viewed as deleting From gvanrossum@users.sourceforge.net Mon Feb 11 14:36:53 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 11 Feb 2002 06:36:53 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.7,1.8 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv1656 Modified Files: pep-0280.txt Log Message: Answer questions by MAL; add drawing by Ping. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pep-0280.txt 11 Feb 2002 07:14:05 -0000 1.7 --- pep-0280.txt 11 Feb 2002 14:36:51 -0000 1.8 *************** *** 395,398 **** --- 395,438 ---- + FAQs + + Q. Will it still be possible to: + a) install new builtins in the __builtin__ namespace and have + them available in all already loaded modules right away ? + b) override builtins (e.g. open()) with my own copies + (e.g. to increase security) in a way that makes these new + copies override the previous ones in all modules ? + + A. Yes, this is the whole point of this design. In the original + approach, when LOAD_GLOBAL_CELL finds a NULL in the second + cell, it should go back to see if the __builtins__ dict has + been modified (the pseudo code doesn't have this yet). Tim's + alternative also takes care of this. + + Q. How does the new scheme get along with the restricted execution + model? + + A. It is intended to support that fully. + + + Graphics + + Ka-Ping Yee supplied a drawing of the state of things after + "import spam", where spam.py contains: + + import eggs + + i = -2 + max = 3 + + def foo(n): + y = abs(i) + max + return eggs.ham(y + n) + + The drawing is at http://web.lfw.org/repo/cells.gif; a larger + version is at http://lfw.org/repo/cells-big.gif; the source is at + http://lfw.org/repo/cells.ai. + + Comparison From gvanrossum@users.sourceforge.net Mon Feb 11 15:00:05 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 11 Feb 2002 07:00:05 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.8,1.9 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv11989 Modified Files: pep-0280.txt Log Message: More FAQs. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pep-0280.txt 11 Feb 2002 14:36:51 -0000 1.8 --- pep-0280.txt 11 Feb 2002 15:00:03 -0000 1.9 *************** *** 415,418 **** --- 415,445 ---- A. It is intended to support that fully. + Q. What happens when a global is deleted? + + A. The module's celldict would have a cell with a NULL objptr for + that key. + + Q. What would the C code for LOAD_GLOBAL_CELL look like? + + A. case LOAD_GLOBAL_CELL: + cell = func_cells[oparg]; + x = cell->objptr; + if (x == NULL) { + x = cell->cellptr->objptr; + if (x == NULL) { + ... error recovery ... + break; + } + } + Py_INCREF(x); + continue; + + Q. What happens in the module's top-level code where there is + presumably no func_cells array? + + A. We could do some code analysis and create a func_cells array, + or we could use LOAD_NAME which should use PyMapping_GetItem on + the globals dict. + Graphics From jvr@users.sourceforge.net Mon Feb 11 15:31:52 2002 From: jvr@users.sourceforge.net (Just van Rossum) Date: Mon, 11 Feb 2002 07:31:52 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils unixccompiler.py,1.38,1.39 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv20928/Lib/distutils Modified Files: unixccompiler.py Log Message: on MacOSX/Darwin, use ranlib when building static libs. Index: unixccompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/unixccompiler.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** unixccompiler.py 11 Dec 2001 05:04:24 -0000 1.38 --- unixccompiler.py 11 Feb 2002 15:31:50 -0000 1.39 *************** *** 18,22 **** __revision__ = "$Id$" ! import string, re, os from types import * from copy import copy --- 18,22 ---- __revision__ = "$Id$" ! import string, re, os, sys from types import * from copy import copy *************** *** 62,65 **** --- 62,68 ---- 'ranlib' : None, } + + if sys.platform[:6] == "darwin": + executables['ranlib'] = ["ranlib"] # Needed for the filename generation methods provided by the base From gvanrossum@users.sourceforge.net Mon Feb 11 15:48:53 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 11 Feb 2002 07:48:53 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.9,1.10 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv26219 Modified Files: pep-0280.txt Log Message: Also show C pseudo-code of Tim's version. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pep-0280.txt 11 Feb 2002 15:00:03 -0000 1.9 --- pep-0280.txt 11 Feb 2002 15:48:50 -0000 1.10 *************** *** 408,412 **** cell, it should go back to see if the __builtins__ dict has been modified (the pseudo code doesn't have this yet). Tim's ! alternative also takes care of this. Q. How does the new scheme get along with the restricted execution --- 408,412 ---- cell, it should go back to see if the __builtins__ dict has been modified (the pseudo code doesn't have this yet). Tim's ! "more aggressive" alternative also takes care of this. Q. How does the new scheme get along with the restricted execution *************** *** 422,426 **** Q. What would the C code for LOAD_GLOBAL_CELL look like? ! A. case LOAD_GLOBAL_CELL: cell = func_cells[oparg]; x = cell->objptr; --- 422,429 ---- Q. What would the C code for LOAD_GLOBAL_CELL look like? ! A. The first version, with the first two bullets under "Additional ! ideas" incorporated, could look like this: ! ! case LOAD_GLOBAL_CELL: cell = func_cells[oparg]; x = cell->objptr; *************** *** 431,434 **** --- 434,450 ---- break; } + } + Py_INCREF(x); + continue; + + With Tim's "more aggressive" alternative added, it could look + like this: + + case LOAD_GLOBAL_CELL: + cell = func_cells[oparg]; + x = cell->objptr; + if (x == NULL) { + ... error recovery ... + break; } Py_INCREF(x); From bwarsaw@users.sourceforge.net Mon Feb 11 16:09:28 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 11 Feb 2002 08:09:28 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0241.txt,1.10,1.11 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv32547 Modified Files: pep-0241.txt Log Message: After discussions w/ Andrew, we've decided to mark this PEP as Final. Index: pep-0241.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0241.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pep-0241.txt 10 Aug 2001 18:34:43 -0000 1.10 --- pep-0241.txt 11 Feb 2002 16:09:26 -0000 1.11 *************** *** 5,9 **** Type: Standards Track Created: 12-Mar-2001 ! Status: Draft Post-History: 19-Mar-2001 --- 5,9 ---- Type: Standards Track Created: 12-Mar-2001 ! Status: Final Post-History: 19-Mar-2001 From bwarsaw@users.sourceforge.net Mon Feb 11 16:11:34 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 11 Feb 2002 08:11:34 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.155,1.156 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv766 Modified Files: pep-0000.txt Log Message: PEPs 211, 212, 213, 218, 219, 225, all of which were marked `D' have been moved to the Deferred section. PEP 241 is marked Final and moved to the Finished section. PEP 222 is marked Deferred and moved to the Deferred section. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.155 retrieving revision 1.156 diff -C2 -d -r1.155 -r1.156 *** pep-0000.txt 11 Feb 2002 02:13:54 -0000 1.155 --- pep-0000.txt 11 Feb 2002 16:11:31 -0000 1.156 *************** *** 54,71 **** I 206 2.0 Batteries Included Zadka S 209 Adding Multidimensional Arrays Barrett, Oliphant - SD 211 Adding A New Outer Product Operator Wilson - SD 212 Loop Counter Iteration Schneider-Kamp - SD 213 Attribute Access Handlers Prescod S 215 String Interpolation Yee I 216 Docstring Format Zadka - SD 218 Adding a Built-In Set Object Type Wilson - SD 219 Stackless Python McMillan - S 222 Web Library Enhancements Kuchling - SD 225 Elementwise/Objectwise Operators Zhu, Lielens S 228 Reworking Python's Numeric Model Zadka, van Rossum S 237 Unifying Long Integers and Integers Zadka, van Rossum S 239 Adding a Rational Type to Python Zadka S 240 Adding a Rational Literal to Python Zadka - S 241 Metadata for Python Software Packages Kuchling S 242 Numeric Kinds Dubois S 243 Module Repository Upload Mechanism Reifschneider --- 54,63 ---- *************** *** 117,120 **** --- 109,113 ---- SF 236 Back to the __future__ Peters SF 238 Changing the Division Operator Zadka, van Rossum + SF 241 Metadata for Python Software Packages Kuchling SF 250 Using site-packages on Windows Moore IF 251 Python 2.2 Release Schedule Warsaw, van Rossum *************** *** 133,137 **** --- 126,137 ---- SR 204 Range Literals Wouters + SD 211 Adding A New Outer Product Operator Wilson + SD 212 Loop Counter Iteration Schneider-Kamp + SD 213 Attribute Access Handlers Prescod + SD 218 Adding a Built-In Set Object Type Wilson + SD 219 Stackless Python McMillan + SD 222 Web Library Enhancements Kuchling SR 224 Attribute Docstrings Lemburg + SD 225 Elementwise/Objectwise Operators Zhu, Lielens SR 231 __findattr__() Warsaw SD 233 Python Online Help Prescod *************** *** 185,189 **** ID 220 Coroutines, Generators, Continuations McMillan SF 221 Import As Wouters ! S 222 Web Library Enhancements Kuchling SF 223 Change the Meaning of \x Escapes Peters SR 224 Attribute Docstrings Lemburg --- 185,189 ---- ID 220 Coroutines, Generators, Continuations McMillan SF 221 Import As Wouters ! SD 222 Web Library Enhancements Kuchling SF 223 Change the Meaning of \x Escapes Peters SR 224 Attribute Docstrings Lemburg *************** *** 204,208 **** S 239 Adding a Rational Type to Python Zadka S 240 Adding a Rational Literal to Python Zadka ! S 241 Metadata for Python Software Packages Kuchling S 242 Numeric Kinds Dubois S 243 Module Repository Upload Mechanism Reifschneider --- 204,208 ---- S 239 Adding a Rational Type to Python Zadka S 240 Adding a Rational Literal to Python Zadka ! SF 241 Metadata for Python Software Packages Kuchling S 242 Numeric Kinds Dubois S 243 Module Repository Upload Mechanism Reifschneider From jackjansen@users.sourceforge.net Mon Feb 11 16:21:02 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 11 Feb 2002 08:21:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_next.c,2.12,2.13 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv4119 Modified Files: dynload_next.c Log Message: Removed a spurious }. (How did it get there in the first place??) Index: dynload_next.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_next.c,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -d -r2.12 -r2.13 *** dynload_next.c 1 Feb 2002 22:24:56 -0000 2.12 --- dynload_next.c 11 Feb 2002 16:21:00 -0000 2.13 *************** *** 111,116 **** #endif p = (dl_funcptr)NSAddressOfSymbol(theSym); - } - return p; } --- 111,114 ---- From gvanrossum@users.sourceforge.net Mon Feb 11 16:24:12 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 11 Feb 2002 08:24:12 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.10,1.11 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv5403 Modified Files: pep-0280.txt Log Message: Add Ping's "always doubly-indirect" idea. Remove mistaken pseudo-C for Tim's ideal. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** pep-0280.txt 11 Feb 2002 15:48:50 -0000 1.10 --- pep-0280.txt 11 Feb 2002 16:24:10 -0000 1.11 *************** *** 438,453 **** continue; ! With Tim's "more aggressive" alternative added, it could look ! like this: case LOAD_GLOBAL_CELL: cell = func_cells[oparg]; ! x = cell->objptr; ! if (x == NULL) { ! ... error recovery ... ! break; } ! Py_INCREF(x); ! continue; Q. What happens in the module's top-level code where there is --- 438,458 ---- continue; ! We could even write it like this (idea courtesy of Ka-Ping Yee): case LOAD_GLOBAL_CELL: cell = func_cells[oparg]; ! x = cell->cellptr->objptr; ! if (x != NULL) { ! Py_INCREF(x); ! continue; } ! ... error recovery ... ! break; ! ! In modern CPU architectures, this reduces the number of ! branches taken for built-ins, which might be a really good ! thing, while any decent memory cache should realize that ! cell->cellptr is the same as cell for regular globals and hence ! this should be very fast in that case too. Q. What happens in the module's top-level code where there is From akuchling@users.sourceforge.net Mon Feb 11 16:30:56 2002 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 11 Feb 2002 08:30:56 -0800 Subject: [Python-checkins] CVS: python/dist/src configure.in,1.289,1.290 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv8383 Modified Files: configure.in Log Message: Bump version number to 2.3 Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.289 retrieving revision 1.290 diff -C2 -d -r1.289 -r1.290 *** configure.in 1 Jan 2002 18:41:32 -0000 1.289 --- configure.in 11 Feb 2002 16:30:54 -0000 1.290 *************** *** 7,11 **** # Set VERSION so we only need to edit in one place (i.e., here) AC_SUBST(VERSION) ! VERSION=2.2 # Arguments passed to configure. --- 7,11 ---- # Set VERSION so we only need to edit in one place (i.e., here) AC_SUBST(VERSION) ! VERSION=2.3 # Arguments passed to configure. From akuchling@users.sourceforge.net Mon Feb 11 16:31:13 2002 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 11 Feb 2002 08:31:13 -0800 Subject: [Python-checkins] CVS: python/dist/src configure,1.280,1.281 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv8545 Modified Files: configure Log Message: Regenerate configure script Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.280 retrieving revision 1.281 diff -C2 -d -r1.280 -r1.281 *** configure 1 Jan 2002 18:41:32 -0000 1.280 --- configure 11 Feb 2002 16:31:10 -0000 1.281 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.288 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.289 [...3955 lines suppressed...] if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7594,7598 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7597: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7605,7609 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7608: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then From bwarsaw@users.sourceforge.net Mon Feb 11 16:43:18 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 11 Feb 2002 08:43:18 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0281.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv12940 Added Files: pep-0281.txt Log Message: PEP 281, Loop Counter Iteration with range and xrange, Magnus Lie Hetland --- NEW FILE: pep-0281.txt --- PEP: 281 Title: Loop Counter Iteration with range and xrange Version: $Revision: 1.1 $ Last-Modified: $Date: 2002/02/11 16:43:16 $ Author: magnus@hetland.org (Magnus Lie Hetland) Status: Draft Type: Standards Track Created: 11-Feb-2002 Python-Version: 2.3 Abstract This PEP describes yet another way of exposing the loop counter in for-loops. It basically proposes that the functionality of the function indices() from PEP 212 [1] be included in the existing functions range() and xrange(). Motivation It is often desirable to loop over the indices of a sequence. PEP 212 describes several ways of doing this, including adding a built-in function called indices, conceptually defined as def indices(sequence): return range(len(sequence)) On the assumption that adding functionality to an existing built-in function may be less intrusive than adding a new built-in function, this PEP proposes adding this functionality to the existing functions range() and xrange(). Specification It is proposed that all three arguments to the built-in functions range() and xrange() are allowed to be objects with a length (i.e. objects implementing the __len__ method). If an argument cannot be interpreted as an integer (i.e. it has no __int__ method), its length will be used instead. Examples: >>> range(range(10)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> range(range(5), range(10)) [5, 6, 7, 8, 9] >>> range(range(5), range(10), range(2)) [5, 7, 9] >>> list(xrange(range(10))) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] >>> list(xrange(xrange(10))) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] # Number the lines of a file: lines = file.readlines() for num in range(lines): print num, lines[num] Alternatives A natural alternative to the above specification is allowing xrange() to access its arguments in a lazy manner. Thus, instead of using their length explicitly, xrange can return one index for each element of the stop argument until the end is reached. A similar lazy treatment makes little sense for the start and step arguments since their length must be calculated before iteration can begin. (Actually, the length of the step argument isn't needed until the second element is returned.) A pseudo-implementation (using only the stop argument, and assuming that it is iterable) is: def xrange(stop): i = 0 for x in stop: yield i i += 1 Testing whether to use int() or lazy iteration could be done by checking for an __iter__ attribute. (This example assumes the presence of generators, but could easily have been implemented as a plain iterator object.) It may be questionable whether this feature is truly useful, since one would not be able to access the elements of the iterable object inside the for loop through indexing. Example: # Printing the numbers of the lines of a file: for num in range(file): print num # The line itself is not accessible A more controversial alternative (to deal with this) would be to let range() behave like the function irange() of PEP 212 when supplied with a sequence. Example: >>> range(5) [0, 1, 2, 3, 4] >>> range('abcde') [(0, 'a'), (1, 'b'), (2, 'c'), (3, 'd'), (4, 'e')] Backwards Compatibility The proposal could cause backwards incompatibilities if arguments are used which implement both __int__ and __len__ (or __iter__ in the case of lazy iteration with xrange). The author does not believe that this is a significant problem. References and Footnotes [1] PEP 212, Loop Counter Iteration http://www.python.org/peps/pep-0212.html Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil fill-column: 70 End: From bwarsaw@users.sourceforge.net Mon Feb 11 16:43:42 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 11 Feb 2002 08:43:42 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.156,1.157 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv13047 Modified Files: pep-0000.txt Log Message: Added PEP 281, Loop Counter Iteration with range and xrange, Magnus Lie Hetland Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.156 retrieving revision 1.157 diff -C2 -d -r1.156 -r1.157 *** pep-0000.txt 11 Feb 2002 16:11:31 -0000 1.156 --- pep-0000.txt 11 Feb 2002 16:43:40 -0000 1.157 *************** *** 84,87 **** --- 84,88 ---- S 279 Enhanced Generators Hettinger S 280 Optimizing access to globals van Rossum + S 281 Loop Counter Iteration with range and xrange Hetland Finished PEPs (done, implemented in CVS) *************** *** 244,247 **** --- 245,249 ---- S 279 Enhanced Generators Hettinger S 280 Optimizing access to globals van Rossum + S 281 Loop Counter Iteration with range and xrange Hetland SR 666 Reject Foolish Indentation Creighton *************** *** 274,277 **** --- 276,280 ---- Goodger, David dgoodger@bigfoot.com Griffin, Grant g2@iowegian.com + Hetland, Magnus Lie magnus@hetland.org Hettinger, Raymond D. othello@javanet.com Hodgson, Neil neilh@scintilla.org From lemburg@users.sourceforge.net Mon Feb 11 17:43:49 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Mon, 11 Feb 2002 09:43:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/encodings __init__.py,1.7,1.8 aliases.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory usw-pr-cvs1:/tmp/cvs-serv349/Lib/encodings Modified Files: __init__.py aliases.py Log Message: Corrected import behaviour for codecs which live outside the encodings package. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/__init__.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** __init__.py 10 Feb 2002 21:36:20 -0000 1.7 --- __init__.py 11 Feb 2002 17:43:46 -0000 1.8 *************** *** 5,10 **** Codec modules must have names corresponding to standard lower-case ! encoding names with hyphens and periods mapped to underscores, ! e.g. 'utf-8' is implemented by the module 'utf_8.py'. Each codec module must export the following interface: --- 5,10 ---- Codec modules must have names corresponding to standard lower-case ! encoding names with hyphens mapped to underscores, e.g. 'utf-8' is ! implemented by the module 'utf_8.py'. Each codec module must export the following interface: *************** *** 53,57 **** # modname = encoding.replace('-', '_') - modname = modname.replace('.', '_') try: mod = __import__('encodings.' + modname, --- 53,56 ---- *************** *** 59,73 **** except ImportError,why: import aliases ! modname = aliases.aliases.get(modname, _unknown) ! if modname is not _unknown: ! try: ! mod = __import__(modname, ! globals(), locals(), _import_tail) ! except ImportError,why: ! mod = None ! else: mod = None if mod is None: ! # cache misses _cache[encoding] = None return None --- 58,68 ---- except ImportError,why: import aliases ! modname = aliases.aliases.get(modname, modname) ! try: ! mod = __import__(modname, globals(), locals(), _import_tail) ! except ImportError,why: mod = None if mod is None: ! # Cache misses _cache[encoding] = None return None Index: aliases.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/aliases.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** aliases.py 10 Feb 2002 21:36:20 -0000 1.12 --- aliases.py 11 Feb 2002 17:43:46 -0000 1.13 *************** *** 5,10 **** Note that the search function converts the encoding names to lower ! case and replaces hyphens and periods with underscores *before* ! performing the lookup. Contents: --- 5,10 ---- Note that the search function converts the encoding names to lower ! case and replaces hyphens with underscores *before* performing the ! lookup. Contents: *************** *** 26,36 **** # ascii codec '646' : 'ascii', ! 'ansi_x3_4_1968' : 'ascii', ! 'ansi_x3_4_1986' : 'ascii', 'cp367' : 'ascii', 'csascii' : 'ascii', 'ibm367' : 'ascii', 'iso646_us' : 'ascii', ! 'iso_646_irv:1991' : 'ascii', 'iso_ir_6' : 'ascii', 'us' : 'ascii', --- 26,36 ---- # ascii codec '646' : 'ascii', ! 'ansi_x3.4_1968' : 'ascii', ! 'ansi_x3.4_1986' : 'ascii', 'cp367' : 'ascii', 'csascii' : 'ascii', 'ibm367' : 'ascii', 'iso646_us' : 'ascii', ! 'iso_646.irv:1991' : 'ascii', 'iso_ir_6' : 'ascii', 'us' : 'ascii', From nnorwitz@users.sourceforge.net Mon Feb 11 17:52:20 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 09:52:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib StringIO.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3171 Modified Files: StringIO.py Log Message: SF #515000, print result of f.tell() in test() instead of ignoring Index: StringIO.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/StringIO.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** StringIO.py 6 Jan 2002 17:15:05 -0000 1.20 --- StringIO.py 11 Feb 2002 17:52:18 -0000 1.21 *************** *** 194,198 **** f.seek(0) print 'First line =', `f.readline()` ! here = f.tell() line = f.readline() print 'Second line =', `line` --- 194,198 ---- f.seek(0) print 'First line =', `f.readline()` ! print 'Position =', f.tell() line = f.readline() print 'Second line =', `line` From nnorwitz@users.sourceforge.net Mon Feb 11 17:56:29 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 09:56:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib aifc.py,1.40,1.41 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv4155 Modified Files: aifc.py Log Message: SF #515004 cleanup - remove unnecessary imports - rename dum -> dummy Index: aifc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/aifc.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** aifc.py 20 Jan 2001 19:54:20 -0000 1.40 --- aifc.py 11 Feb 2002 17:56:27 -0000 1.41 *************** *** 179,183 **** def _read_float(f): # 10 bytes - import math expon = _read_short(f) # 2 bytes sign = 1 --- 179,182 ---- *************** *** 747,752 **** def _comp_data(self, data): import cl ! dum = self._comp.SetParam(cl.FRAME_BUFFER_SIZE, len(data)) ! dum = self._comp.SetParam(cl.COMPRESSED_BUFFER_SIZE, len(data)) return self._comp.Compress(self._nframes, data) --- 746,751 ---- def _comp_data(self, data): import cl ! dummy = self._comp.SetParam(cl.FRAME_BUFFER_SIZE, len(data)) ! dummy = self._comp.SetParam(cl.COMPRESSED_BUFFER_SIZE, len(data)) return self._comp.Compress(self._nframes, data) *************** *** 785,789 **** def _init_compression(self): if self._comptype == 'G722': - import audioop self._convert = self._lin2adpcm return --- 784,787 ---- From nnorwitz@users.sourceforge.net Mon Feb 11 17:57:57 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 09:57:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib cgi.py,1.68,1.69 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv5171 Modified Files: cgi.py Log Message: SF #515006, remove unnecessary import Index: cgi.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/cgi.py,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** cgi.py 13 Oct 2001 18:38:53 -0000 1.68 --- cgi.py 11 Feb 2002 17:57:55 -0000 1.69 *************** *** 878,882 **** """ - import traceback print "Content-type: text/html" print --- 878,881 ---- From nnorwitz@users.sourceforge.net Mon Feb 11 17:59:53 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 09:59:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib httplib.py,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv5974 Modified Files: httplib.py Log Message: SF #515011, cleanup: remove "or 0" condition Index: httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** httplib.py 11 Oct 2001 18:15:51 -0000 1.42 --- httplib.py 11 Feb 2002 17:59:51 -0000 1.43 *************** *** 608,613 **** except socket.sslerror, err: if (err[0] == socket.SSL_ERROR_WANT_READ ! or err[0] == socket.SSL_ERROR_WANT_WRITE ! or 0): continue if err[0] == socket.SSL_ERROR_ZERO_RETURN: --- 608,612 ---- except socket.sslerror, err: if (err[0] == socket.SSL_ERROR_WANT_READ ! or err[0] == socket.SSL_ERROR_WANT_WRITE): continue if err[0] == socket.SSL_ERROR_ZERO_RETURN: From nnorwitz@users.sourceforge.net Mon Feb 11 18:01:35 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 10:01:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib imputil.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv6682 Modified Files: imputil.py Log Message: SF #515012, cleanup: remove unused variable Index: imputil.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/imputil.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** imputil.py 4 Sep 2001 18:39:45 -0000 1.22 --- imputil.py 11 Feb 2002 18:01:32 -0000 1.23 *************** *** 456,460 **** if a == '': return b - path = s if ':' not in a: a = ':' + a --- 456,459 ---- From nnorwitz@users.sourceforge.net Mon Feb 11 18:06:23 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 10:06:23 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib urllib.py,1.135,1.136 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv8247 Modified Files: urllib.py Log Message: SF #515024 remove unused variable Index: urllib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib.py,v retrieving revision 1.135 retrieving revision 1.136 diff -C2 -d -r1.135 -r1.136 *** urllib.py 8 Dec 2001 17:09:07 -0000 1.135 --- urllib.py 11 Feb 2002 18:06:21 -0000 1.136 *************** *** 1159,1163 **** try: # non-sequence items should not work with len() - x = len(query) # non-empty strings will fail this if len(query) and type(query[0]) != types.TupleType: --- 1159,1162 ---- From nnorwitz@users.sourceforge.net Mon Feb 11 18:05:08 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 10:05:08 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib smtpd.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv7431 Modified Files: smtpd.py Log Message: SF #515021, print the refused list to the DEBUGSTREAM, so the parameter is used Note: There is a TBD (aka FIXME) for how best to handle the refused addresses Index: smtpd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtpd.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** smtpd.py 4 Nov 2001 03:04:25 -0000 1.11 --- smtpd.py 11 Feb 2002 18:05:05 -0000 1.12 *************** *** 349,353 **** refused = self._deliver(mailfrom, rcpttos, data) # TBD: what to do with refused addresses? ! print >> DEBUGSTREAM, 'we got some refusals' def _deliver(self, mailfrom, rcpttos, data): --- 349,353 ---- refused = self._deliver(mailfrom, rcpttos, data) # TBD: what to do with refused addresses? ! print >> DEBUGSTREAM, 'we got some refusals:', refused def _deliver(self, mailfrom, rcpttos, data): *************** *** 418,422 **** refused = self._deliver(mailfrom, rcpttos, data) # TBD: what to do with refused addresses? ! print >> DEBUGSTREAM, 'we got refusals' # Now deliver directly to the list commands mlists = {} --- 418,422 ---- refused = self._deliver(mailfrom, rcpttos, data) # TBD: what to do with refused addresses? ! print >> DEBUGSTREAM, 'we got refusals:', refused # Now deliver directly to the list commands mlists = {} From nnorwitz@users.sourceforge.net Mon Feb 11 18:11:11 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 10:11:11 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib webbrowser.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv9447 Modified Files: webbrowser.py Log Message: SF #515026, delete global variable that was apparently used only in a for loop. Index: webbrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** webbrowser.py 7 Jan 2002 15:29:01 -0000 1.27 --- webbrowser.py 11 Feb 2002 18:11:09 -0000 1.28 *************** *** 323,326 **** --- 323,327 ---- register(cmd.lower(), None, GenericBrowser( "%s '%%s'" % cmd.lower())) + del cmd _tryorder = filter(lambda x: _browsers.has_key(x.lower()) From nnorwitz@users.sourceforge.net Mon Feb 11 18:12:08 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 10:12:08 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib pickle.py,1.56,1.57 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10077 Modified Files: pickle.py Log Message: SF #515018, delete global variable that was apparently used only in a list comprehension. Index: pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** pickle.py 19 Dec 2001 16:55:02 -0000 1.56 --- pickle.py 11 Feb 2002 18:12:06 -0000 1.57 *************** *** 104,107 **** --- 104,108 ---- __all__.extend([x for x in dir() if re.match("[A-Z][A-Z0-9_]+$",x)]) + del x class Pickler: From nnorwitz@users.sourceforge.net Mon Feb 11 18:14:24 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 10:14:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib dis.py,1.37,1.38 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv10637 Modified Files: dis.py Log Message: SF #515009, delete global variable that was apparently used only in a for loop. Index: dis.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dis.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** dis.py 29 Aug 2001 18:02:21 -0000 1.37 --- dis.py 11 Feb 2002 18:14:22 -0000 1.38 *************** *** 136,139 **** --- 136,140 ---- opname = [''] * 256 for op in range(256): opname[op] = '<' + `op` + '>' + del op def def_op(name, op): From nnorwitz@users.sourceforge.net Mon Feb 11 18:18:31 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 10:18:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib sre_parse.py,1.51,1.52 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv12281 Modified Files: sre_parse.py Log Message: SF #515022 remove unused variable Index: sre_parse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** sre_parse.py 9 Dec 2001 16:13:15 -0000 1.51 --- sre_parse.py 11 Feb 2002 18:18:29 -0000 1.52 *************** *** 290,294 **** elif escape[1:2] in DIGITS: # octal escape *or* decimal group reference (sigh) - here = source.tell() if source.next in DIGITS: escape = escape + source.get() --- 290,293 ---- From nnorwitz@users.sourceforge.net Mon Feb 11 18:26:04 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 10:26:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib bdb.py,1.33,1.34 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14129 Modified Files: bdb.py Log Message: SF #515005, change "1 + ''" (which pychecker warns about being invalid) into "raise Exception". Index: bdb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bdb.py,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** bdb.py 29 Nov 2001 02:50:15 -0000 1.33 --- bdb.py 11 Feb 2002 18:26:02 -0000 1.34 *************** *** 169,173 **** """Start debugging from here.""" try: ! 1 + '' except: frame = sys.exc_info()[2].tb_frame.f_back --- 169,173 ---- """Start debugging from here.""" try: ! raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back *************** *** 189,193 **** sys.settrace(None) try: ! 1 + '' # raise an exception except: frame = sys.exc_info()[2].tb_frame.f_back --- 189,193 ---- sys.settrace(None) try: ! raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back From nnorwitz@users.sourceforge.net Mon Feb 11 18:34:43 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 11 Feb 2002 10:34:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib site.py,1.39,1.40 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv15988 Modified Files: site.py Log Message: SF #515020, delete global variables which are used only for temporary values in for loops (dircase, prefix, sitedir). Index: site.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** site.py 17 Dec 2001 16:07:06 -0000 1.39 --- site.py 11 Feb 2002 18:34:41 -0000 1.40 *************** *** 89,93 **** _dirs_in_sys_path[dircase] = 1 sys.path[:] = L ! del dir, L # Append ./build/lib. in case we're running in the build dir --- 89,93 ---- _dirs_in_sys_path[dircase] = 1 sys.path[:] = L ! del dir, dircase, L # Append ./build/lib. in case we're running in the build dir *************** *** 176,179 **** --- 176,180 ---- if os.path.isdir(sitedir): addsitedir(sitedir) + del prefix, sitedir _dirs_in_sys_path = None From lemburg@users.sourceforge.net Mon Feb 11 18:46:49 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Mon, 11 Feb 2002 10:46:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules main.c,1.62,1.63 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv19879/Modules Modified Files: main.c Log Message: Remove mentioning of -U option in "python -h" output. Index: main.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** main.c 12 Jan 2002 11:05:06 -0000 1.62 --- main.c 11 Feb 2002 18:46:47 -0000 1.63 *************** *** 61,65 **** "; static char *usage_3 = "\ - -U : Unicode literals: treats '...' literals like u'...'\n\ -v : verbose (trace import statements) (also PYTHONVERBOSE=x)\n\ -V : print the Python version number and exit\n\ --- 61,64 ---- From gward@users.sourceforge.net Mon Feb 11 20:46:12 2002 From: gward@users.sourceforge.net (Greg Ward) Date: Mon, 11 Feb 2002 12:46:12 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib urllib2.py,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv24426 Modified Files: urllib2.py Log Message: Fix bug #511786 (2.2.1 candidate): ensure that custom-supplied headers are preserved for redirected requests. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** urllib2.py 9 Nov 2001 16:46:51 -0000 1.24 --- urllib2.py 11 Feb 2002 20:46:10 -0000 1.25 *************** *** 417,421 **** # request, although that might interact poorly with other # handlers that also use handler-specific request attributes ! new = Request(newurl, req.get_data()) new.error_302_dict = {} if hasattr(req, 'error_302_dict'): --- 417,421 ---- # request, although that might interact poorly with other # handlers that also use handler-specific request attributes ! new = Request(newurl, req.get_data(), req.headers) new.error_302_dict = {} if hasattr(req, 'error_302_dict'): From loewis@users.sourceforge.net Mon Feb 11 23:08:42 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Mon, 11 Feb 2002 15:08:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules/expat - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Modules/expat In directory usw-pr-cvs1:/tmp/cvs-serv6496/expat Log Message: Directory /cvsroot/python/python/dist/src/Modules/expat added to the repository From loewis@users.sourceforge.net Mon Feb 11 23:13:10 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Mon, 11 Feb 2002 15:13:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules/expat - Imported sources Message-ID: Update of /cvsroot/python/python/dist/src/Modules/expat In directory usw-pr-cvs1:/tmp/cvs-serv7991 Log Message: Import Expat 1.95.2 lib/. Status: Vendor Tag: SourceForge Release Tags: r1_95_2 N python/dist/src/Modules/expat/Makefile.in N python/dist/src/Modules/expat/ascii.h N python/dist/src/Modules/expat/asciitab.h N python/dist/src/Modules/expat/expat.h.in N python/dist/src/Modules/expat/iasciitab.h N python/dist/src/Modules/expat/latin1tab.h N python/dist/src/Modules/expat/nametab.h N python/dist/src/Modules/expat/utf8tab.h N python/dist/src/Modules/expat/xmlparse.c N python/dist/src/Modules/expat/xmlrole.c N python/dist/src/Modules/expat/xmlrole.h N python/dist/src/Modules/expat/xmltok.c N python/dist/src/Modules/expat/xmltok.h N python/dist/src/Modules/expat/xmltok_impl.c N python/dist/src/Modules/expat/xmltok_impl.h N python/dist/src/Modules/expat/xmltok_ns.c N python/dist/src/Modules/expat/winconfig.h No conflicts created by this import ***** Bogus filespec: - Imported sources From loewis@users.sourceforge.net Mon Feb 11 23:16:34 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Mon, 11 Feb 2002 15:16:34 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules/expat xmlparse.c,1.1.1.1,1.2 xmlrole.c,1.1.1.1,1.2 xmltok.c,1.1.1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules/expat In directory usw-pr-cvs1:/tmp/cvs-serv9012 Modified Files: xmlparse.c xmlrole.c xmltok.c Log Message: Disable usage of Expat's config.h. Index: xmlparse.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlparse.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** xmlparse.c 11 Feb 2002 23:13:06 -0000 1.1.1.1 --- xmlparse.c 11 Feb 2002 23:16:32 -0000 1.2 *************** *** 10,14 **** --- 10,16 ---- # undef XMLPARSEAPI #else + #ifdef HAVE_CONFIG_H #include + #endif #ifdef __declspec Index: xmlrole.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlrole.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** xmlrole.c 11 Feb 2002 23:13:07 -0000 1.1.1.1 --- xmlrole.c 11 Feb 2002 23:16:32 -0000 1.2 *************** *** 10,14 **** --- 10,16 ---- # include "winconfig.h" #else + #ifdef HAVE_CONFIG_H # include + #endif #endif /* ndef COMPILED_FROM_DSP */ Index: xmltok.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** xmltok.c 11 Feb 2002 23:13:07 -0000 1.1.1.1 --- xmltok.c 11 Feb 2002 23:16:32 -0000 1.2 *************** *** 7,11 **** --- 7,13 ---- # include "winconfig.h" #else + #ifdef HAVE_CONFIG_H # include + #endif #endif /* ndef COMPILED_FROM_DSP */ From loewis@users.sourceforge.net Mon Feb 11 23:27:47 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Mon, 11 Feb 2002 15:27:47 -0800 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.78,1.79 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv12582 Modified Files: setup.py Log Message: Use included Expat library. Drop support for older expat versions. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** setup.py 23 Jan 2002 15:07:46 -0000 1.78 --- setup.py 11 Feb 2002 23:27:45 -0000 1.79 *************** *** 551,583 **** # 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']) ) # Dynamic loading module --- 551,579 ---- # 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. Source of Expat 1.95.2 is included ! # in Modules/expat. Usage of a system shared libexpat.so/expat.dll ! # is only advised if that has the same or newer version and was ! # build using the same defines. ! if sys.byteorder == "little": ! xmlbo = "12" else: ! xmlbo = "21" ! exts.append(Extension('pyexpat', ! sources = [ ! 'pyexpat.c', ! 'expat/xmlparse.c', ! 'expat/xmlrole.c', ! 'expat/xmltok.c', ! ], ! define_macros = [ ! ('HAVE_EXPAT_H',None), ! ('VERSION', '"1.95.2"'), ! ('XML_NS', '1'), ! ('XML_DTD', '1'), ! ('XML_BYTE_ORDER', xmlbo), ! ('XML_CONTEXT_BYTES','1024'), ! ], ! include_dirs = ['Modules/expat'] ! )) # Dynamic loading module From loewis@users.sourceforge.net Mon Feb 11 23:27:47 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Mon, 11 Feb 2002 15:27:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules pyexpat.c,2.57,2.58 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12582/Modules Modified Files: pyexpat.c Log Message: Use included Expat library. Drop support for older expat versions. Index: pyexpat.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v retrieving revision 2.57 retrieving revision 2.58 diff -C2 -d -r2.57 -r2.58 *** pyexpat.c 8 Dec 2001 18:02:57 -0000 2.57 --- pyexpat.c 11 Feb 2002 23:27:45 -0000 2.58 *************** *** 7,27 **** #include "compile.h" #include "frameobject.h" - #ifdef HAVE_EXPAT_H #include "expat.h" - #ifdef XML_MAJOR_VERSION - #define EXPAT_VERSION (0x10000 * XML_MAJOR_VERSION \ - + 0x100 * XML_MINOR_VERSION \ - + XML_MICRO_VERSION) - #else - /* Assume the oldest Expat that used expat.h and did not have version info */ - #define EXPAT_VERSION 0x015f00 - #endif - #else /* !defined(HAVE_EXPAT_H) */ - #include "xmlparse.h" - /* Assume Expat 1.1 unless told otherwise */ - #ifndef EXPAT_VERSION - #define EXPAT_VERSION 0x010100 - #endif - #endif /* !defined(HAVE_EXPAT_H) */ #ifndef PyGC_HEAD_SIZE --- 7,11 ---- *************** *** 53,70 **** NotStandalone, ExternalEntityRef, - #if EXPAT_VERSION >= 0x010200 StartDoctypeDecl, EndDoctypeDecl, - #endif - #if EXPAT_VERSION == 0x010200 - ExternalParsedEntityDecl, - InternalParsedEntityDecl, - #endif - #if EXPAT_VERSION >= 0x015f00 EntityDecl, XmlDecl, ElementDecl, AttlistDecl, - #endif _DummyDecl }; --- 37,46 ---- *************** *** 143,234 **** - #if EXPAT_VERSION == 0x010200 - /* Convert an array of attributes and their values into a Python dict */ - - static PyObject * - conv_atts_using_string(XML_Char **atts) - { - PyObject *attrs_obj = NULL; - XML_Char **attrs_p, **attrs_k = NULL; - int attrs_len; - PyObject *rv; - - if ((attrs_obj = PyDict_New()) == NULL) - goto finally; - for (attrs_len = 0, attrs_p = atts; - *attrs_p; - attrs_p++, attrs_len++) { - if (attrs_len % 2) { - rv = PyString_FromString(*attrs_p); - if (!rv) { - Py_DECREF(attrs_obj); - attrs_obj = NULL; - goto finally; - } - if (PyDict_SetItemString(attrs_obj, - (char*)*attrs_k, rv) < 0) { - Py_DECREF(attrs_obj); - attrs_obj = NULL; - goto finally; - } - Py_DECREF(rv); - } - else - attrs_k = attrs_p; - } - finally: - return attrs_obj; - } - #endif - #ifdef Py_USING_UNICODE - #if EXPAT_VERSION == 0x010200 - static PyObject * - conv_atts_using_unicode(XML_Char **atts) - { - PyObject *attrs_obj; - XML_Char **attrs_p, **attrs_k = NULL; - int attrs_len; - - if ((attrs_obj = PyDict_New()) == NULL) - goto finally; - for (attrs_len = 0, attrs_p = atts; - *attrs_p; - attrs_p++, attrs_len++) { - if (attrs_len % 2) { - PyObject *attr_str, *value_str; - const char *p = (const char *) (*attrs_k); - attr_str = PyUnicode_DecodeUTF8(p, strlen(p), "strict"); - if (!attr_str) { - Py_DECREF(attrs_obj); - attrs_obj = NULL; - goto finally; - } - p = (const char *) *attrs_p; - value_str = PyUnicode_DecodeUTF8(p, strlen(p), "strict"); - if (!value_str) { - Py_DECREF(attrs_obj); - Py_DECREF(attr_str); - attrs_obj = NULL; - goto finally; - } - if (PyDict_SetItem(attrs_obj, attr_str, value_str) < 0) { - Py_DECREF(attrs_obj); - Py_DECREF(attr_str); - Py_DECREF(value_str); - attrs_obj = NULL; - goto finally; - } - Py_DECREF(attr_str); - Py_DECREF(value_str); - } - else - attrs_k = attrs_p; - } - finally: - return attrs_obj; - } - #endif - /* Convert a string of XML_Chars into a Unicode string. Returns None if str is a null pointer. */ --- 119,123 ---- *************** *** 538,542 **** STRING_CONV_FUNC,notationName)) - #if EXPAT_VERSION >= 0x015f00 #ifndef Py_USING_UNICODE VOID_HANDLER(EntityDecl, --- 427,430 ---- *************** *** 651,655 **** STRING_CONV_FUNC,att_type, STRING_CONV_FUNC,dflt, isrequired)) - #endif VOID_HANDLER(NotationDecl, --- 539,542 ---- *************** *** 727,736 **** /* XXX UnknownEncodingHandler */ - #if EXPAT_VERSION == 0x010200 - VOID_HANDLER(StartDoctypeDecl, - (void *userData, const XML_Char *doctypeName), - ("(O&OOi)", STRING_CONV_FUNC,doctypeName, - Py_None, Py_None, -1)) - #elif EXPAT_VERSION >= 0x015f00 VOID_HANDLER(StartDoctypeDecl, (void *userData, const XML_Char *doctypeName, --- 614,617 ---- *************** *** 740,765 **** STRING_CONV_FUNC,sysid, STRING_CONV_FUNC,pubid, has_internal_subset)) - #endif - #if EXPAT_VERSION >= 0x010200 VOID_HANDLER(EndDoctypeDecl, (void *userData), ("()")) - #endif - - #if EXPAT_VERSION == 0x010200 - VOID_HANDLER(ExternalParsedEntityDecl, - (void *userData, const XML_Char *entityName, - const XML_Char *base, const XML_Char *systemId, - const XML_Char *publicId), - ("(O&O&O&O&)", STRING_CONV_FUNC, entityName, - STRING_CONV_FUNC, base, STRING_CONV_FUNC, systemId, - STRING_CONV_FUNC, publicId)) - - VOID_HANDLER(InternalParsedEntityDecl, - (void *userData, const XML_Char *entityName, - const XML_Char *replacementText, int replacementTextLength), - ("(O&O&i)", STRING_CONV_FUNC, entityName, - STRING_CONV_FUNC, replacementText, replacementTextLength)) - - #endif /* Expat version 1.2 & better */ /* ---------------------------------------------------------------- */ --- 621,626 ---- *************** *** 925,929 **** } - #if EXPAT_VERSION >= 0x015f00 static char xmlparse_GetInputContext__doc__[] = "GetInputContext() -> string\n\ --- 786,789 ---- *************** *** 957,961 **** return result; } - #endif static char xmlparse_ExternalEntityParserCreate__doc__[] = --- 817,820 ---- *************** *** 1034,1039 **** } - #if EXPAT_VERSION >= 0x010200 - static char xmlparse_SetParamEntityParsing__doc__[] = "SetParamEntityParsing(flag) -> success\n\ --- 893,896 ---- *************** *** 1054,1059 **** } - #endif /* Expat version 1.2 or better */ - static struct PyMethodDef xmlparse_methods[] = { {"Parse", (PyCFunction)xmlparse_Parse, --- 911,914 ---- *************** *** 1067,1078 **** {"ExternalEntityParserCreate", (PyCFunction)xmlparse_ExternalEntityParserCreate, METH_VARARGS, xmlparse_ExternalEntityParserCreate__doc__}, - #if EXPAT_VERSION >= 0x010200 {"SetParamEntityParsing", (PyCFunction)xmlparse_SetParamEntityParsing, METH_VARARGS, xmlparse_SetParamEntityParsing__doc__}, - #endif - #if EXPAT_VERSION >= 0x015f00 {"GetInputContext", (PyCFunction)xmlparse_GetInputContext, METH_VARARGS, xmlparse_GetInputContext__doc__}, - #endif {NULL, NULL} /* sentinel */ }; --- 922,929 ---- *************** *** 1573,1577 **** PyModule_AddObject(m, "__version__", get_version_string()); - #if EXPAT_VERSION >= 0x015f02 PyModule_AddStringConstant(m, "EXPAT_VERSION", (char *) XML_ExpatVersion()); --- 1424,1427 ---- *************** *** 1582,1586 **** info.minor, info.micro)); } - #endif #ifdef Py_USING_UNICODE init_template_buffer(); --- 1432,1435 ---- *************** *** 1650,1654 **** #undef MYCONST - #if EXPAT_VERSION >= 0x010200 #define MYCONST(c) PyModule_AddIntConstant(m, #c, c) MYCONST(XML_PARAM_ENTITY_PARSING_NEVER); --- 1499,1502 ---- *************** *** 1656,1662 **** MYCONST(XML_PARAM_ENTITY_PARSING_ALWAYS); #undef MYCONST - #endif - #if EXPAT_VERSION >= 0x015f00 #define MYCONST(c) PyModule_AddIntConstant(model_module, #c, c) PyModule_AddStringConstant(model_module, "__doc__", --- 1504,1508 ---- *************** *** 1675,1679 **** MYCONST(XML_CQUANT_PLUS); #undef MYCONST - #endif } --- 1521,1524 ---- *************** *** 1766,1771 **** } - #if EXPAT_VERSION >= 0x010200 - static void pyxml_SetStartDoctypeDeclHandler(XML_Parser *parser, void *junk) --- 1611,1614 ---- *************** *** 1784,1789 **** } - #endif - statichere struct HandlerInfo handler_info[] = { {"StartElementHandler", --- 1627,1630 ---- *************** *** 1832,1836 **** (xmlhandlersetter)XML_SetExternalEntityRefHandler, (xmlhandler)my_ExternalEntityRefHandler }, - #if EXPAT_VERSION >= 0x010200 {"StartDoctypeDeclHandler", pyxml_SetStartDoctypeDeclHandler, --- 1673,1676 ---- *************** *** 1839,1852 **** pyxml_SetEndDoctypeDeclHandler, (xmlhandler)my_EndDoctypeDeclHandler}, - #endif - #if EXPAT_VERSION == 0x010200 - {"ExternalParsedEntityDeclHandler", - (xmlhandlersetter)XML_SetExternalParsedEntityDeclHandler, - (xmlhandler)my_ExternalParsedEntityDeclHandler}, - {"InternalParsedEntityDeclHandler", - (xmlhandlersetter)XML_SetInternalParsedEntityDeclHandler, - (xmlhandler)my_InternalParsedEntityDeclHandler}, - #endif - #if EXPAT_VERSION >= 0x015f00 {"EntityDeclHandler", (xmlhandlersetter)XML_SetEntityDeclHandler, --- 1679,1682 ---- *************** *** 1861,1865 **** (xmlhandlersetter)XML_SetAttlistDeclHandler, (xmlhandler)my_AttlistDeclHandler}, - #endif /* Expat version 1.95 or better */ {NULL, NULL, NULL} /* sentinel */ --- 1691,1694 ---- From tim_one@users.sourceforge.net Tue Feb 12 00:01:37 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 11 Feb 2002 16:01:37 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.11,1.12 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv25638 Modified Files: pep-0280.txt Log Message: Minor updates. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pep-0280.txt 11 Feb 2002 16:24:10 -0000 1.11 --- pep-0280.txt 12 Feb 2002 00:01:35 -0000 1.12 *************** *** 384,396 **** assert not c.builtinflag ! Changing the value of an existing builtin can be viewed as deleting ! the name, then adding it again. Indeed, since mutating builtins is ! so rare, that's probably the right way to implement it too (speed ! doesn't matter here): def reflect_bltin_change(self, key, newvalue): ! assert key in self.__dict ! self.reflect_bltin_del(key) ! self.reflect_bltin_new(key, newvalue) --- 384,397 ---- assert not c.builtinflag ! Changing the value of an existing builtin: def reflect_bltin_change(self, key, newvalue): ! c = self.__dict.get(key) ! assert c is not None # else we were already out of synch ! if c.builtinflag: ! # Put us back in synch. ! c.objptr = newvalue ! # Else we're shadowing the builtin, so don't care that ! # the builtin changed. *************** *** 400,404 **** a) install new builtins in the __builtin__ namespace and have them available in all already loaded modules right away ? ! b) override builtins (e.g. open()) with my own copies (e.g. to increase security) in a way that makes these new copies override the previous ones in all modules ? --- 401,405 ---- a) install new builtins in the __builtin__ namespace and have them available in all already loaded modules right away ? ! b) override builtins (e.g. open()) with my own copies (e.g. to increase security) in a way that makes these new copies override the previous ones in all modules ? *************** *** 418,422 **** A. The module's celldict would have a cell with a NULL objptr for ! that key. Q. What would the C code for LOAD_GLOBAL_CELL look like? --- 419,427 ---- A. The module's celldict would have a cell with a NULL objptr for ! that key. This is true in both variations, but the "aggressive" ! variation goes on to see whether this unmasks a builtin of the ! same name, and if so copies its value (just a pointer-copy of the ! ultimate PyObject*) into the cell's objptr and sets the cell's ! builtinflag to true. Q. What would the C code for LOAD_GLOBAL_CELL look like? *************** *** 455,458 **** --- 460,475 ---- cell->cellptr is the same as cell for regular globals and hence this should be very fast in that case too. + + For the aggressive variant: + + case LOAD_GLOBAL_CELL: + cell = func_cells[oparg]; + x = cell->objptr; + if (x != NULL) { + Py_INCREF(x); + continue; + } + ... error recovery ... + break; Q. What happens in the module's top-level code where there is From loewis@users.sourceforge.net Tue Feb 12 00:05:51 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Mon, 11 Feb 2002 16:05:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/PCbuild pyexpat.dsp,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv27425 Modified Files: pyexpat.dsp Log Message: Build using included Expat. Index: pyexpat.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pyexpat.dsp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pyexpat.dsp 28 Jul 2001 07:56:38 -0000 1.6 --- pyexpat.dsp 12 Feb 2002 00:05:49 -0000 1.7 *************** *** 1,5 **** # Microsoft Developer Studio Project File - Name="pyexpat" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 ! # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 --- 1,5 ---- # Microsoft Developer Studio Project File - Name="pyexpat" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 ! # ** NICHT BEARBEITEN ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 *************** *** 7,26 **** CFG=pyexpat - Win32 Alpha Debug ! !MESSAGE This is not a valid makefile. To build this project using NMAKE, ! !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "pyexpat.mak". !MESSAGE ! !MESSAGE You can specify a configuration when running NMAKE ! !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "pyexpat.mak" CFG="pyexpat - Win32 Alpha Debug" !MESSAGE ! !MESSAGE Possible choices for configuration are: !MESSAGE ! !MESSAGE "pyexpat - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") ! !MESSAGE "pyexpat - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") ! !MESSAGE "pyexpat - Win32 Alpha Debug" (based on "Win32 (ALPHA) Dynamic-Link Library") ! !MESSAGE "pyexpat - Win32 Alpha Release" (based on "Win32 (ALPHA) Dynamic-Link Library") !MESSAGE --- 7,26 ---- CFG=pyexpat - Win32 Alpha Debug ! !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE ! !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl !MESSAGE !MESSAGE NMAKE /f "pyexpat.mak". !MESSAGE ! !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben ! !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel: !MESSAGE !MESSAGE NMAKE /f "pyexpat.mak" CFG="pyexpat - Win32 Alpha Debug" !MESSAGE ! !MESSAGE Für die Konfiguration stehen zur Auswahl: !MESSAGE ! !MESSAGE "pyexpat - Win32 Release" (basierend auf "Win32 (x86) Dynamic-Link Library") ! !MESSAGE "pyexpat - Win32 Debug" (basierend auf "Win32 (x86) Dynamic-Link Library") ! !MESSAGE "pyexpat - Win32 Alpha Debug" (basierend auf "Win32 (ALPHA) Dynamic-Link Library") ! !MESSAGE "pyexpat - Win32 Alpha Release" (basierend auf "Win32 (ALPHA) Dynamic-Link Library") !MESSAGE *************** *** 46,50 **** CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /I "..\..\expat\Source\lib" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_EXPAT_H" /YX /FD /c MTL=midl.exe # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 46,50 ---- CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /I "..\Modules\expat" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_EXPAT_H" /D "XML_NS" /D "XML_DTD" /D XML_BYTE_ORDER=12 /D XML_CONTEXT_BYTES=1024 /D VERSION=\"1.95.2\" /YX /FD /c MTL=midl.exe # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 77,81 **** CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /I "..\..\expat\Source\lib" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_EXPAT_H" /YX /FD /c MTL=midl.exe # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 77,81 ---- CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /I "..\Modules\expat" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_EXPAT_H" /D "XML_NS" /D "XML_DTD" /D XML_BYTE_ORDER=12 /D XML_CONTEXT_BYTES=1024 /D VERSION="1.95.2" /YX /FD /c MTL=midl.exe # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 181,185 **** # Begin Source File ! SOURCE=..\..\expat\Libs\expat.lib # End Source File # End Target --- 181,226 ---- # Begin Source File ! SOURCE=..\Modules\expat\xmlparse.c ! ! !IF "$(CFG)" == "pyexpat - Win32 Release" ! ! !ELSEIF "$(CFG)" == "pyexpat - Win32 Debug" ! ! !ELSEIF "$(CFG)" == "pyexpat - Win32 Alpha Debug" ! ! !ELSEIF "$(CFG)" == "pyexpat - Win32 Alpha Release" ! ! !ENDIF ! ! # End Source File ! # Begin Source File ! ! SOURCE=..\Modules\expat\xmlrole.c ! ! !IF "$(CFG)" == "pyexpat - Win32 Release" ! ! !ELSEIF "$(CFG)" == "pyexpat - Win32 Debug" ! ! !ELSEIF "$(CFG)" == "pyexpat - Win32 Alpha Debug" ! ! !ELSEIF "$(CFG)" == "pyexpat - Win32 Alpha Release" ! ! !ENDIF ! ! # End Source File ! # Begin Source File ! ! SOURCE=..\Modules\expat\xmltok.c ! ! !IF "$(CFG)" == "pyexpat - Win32 Release" ! ! !ELSEIF "$(CFG)" == "pyexpat - Win32 Debug" ! ! !ELSEIF "$(CFG)" == "pyexpat - Win32 Alpha Debug" ! ! !ELSEIF "$(CFG)" == "pyexpat - Win32 Alpha Release" ! ! !ENDIF ! # End Source File # End Target From mhammond@users.sourceforge.net Tue Feb 12 04:02:35 2002 From: mhammond@users.sourceforge.net (Mark Hammond) Date: Mon, 11 Feb 2002 20:02:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _hotshot.c,1.13,1.14 timemodule.c,2.120,2.121 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv18534 Modified Files: _hotshot.c timemodule.c Log Message: Ensure we also build on VC7. Involves replacing largeint.h helper functions with msvc's native 64 bit integers. Index: _hotshot.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_hotshot.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** _hotshot.c 8 Feb 2002 21:27:50 -0000 1.13 --- _hotshot.c 12 Feb 2002 04:02:33 -0000 1.14 *************** *** 15,19 **** #ifdef MS_WIN32 #include - #include #include /* for getcwd() */ typedef __int64 hs_time; --- 15,18 ---- Index: timemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/timemodule.c,v retrieving revision 2.120 retrieving revision 2.121 diff -C2 -d -r2.120 -r2.121 *** timemodule.c 16 Jan 2002 11:04:06 -0000 2.120 --- timemodule.c 12 Feb 2002 04:02:33 -0000 2.121 *************** *** 52,56 **** /* Win32 has better clock replacement XXX Win64 does not yet, but might when the platform matures. */ - #include #undef HAVE_CLOCK /* We have our own version down below */ #endif /* MS_WIN32 && !MS_WIN64 */ --- 52,55 ---- *************** *** 145,178 **** #if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(__BORLANDC__) ! /* Due to Mark Hammond */ static PyObject * time_clock(PyObject *self, PyObject *args) { ! static LARGE_INTEGER ctrStart; ! static LARGE_INTEGER divisor = {0,0}; ! LARGE_INTEGER now, diff, rem; if (!PyArg_ParseTuple(args, ":clock")) return NULL; ! if (LargeIntegerEqualToZero(divisor)) { ! QueryPerformanceCounter(&ctrStart); ! if (!QueryPerformanceFrequency(&divisor) || ! LargeIntegerEqualToZero(divisor)) { ! /* Unlikely to happen - ! this works on all intel machines at least! ! Revert to clock() */ return PyFloat_FromDouble(clock()); } } ! QueryPerformanceCounter(&now); ! diff = LargeIntegerSubtract(now, ctrStart); ! diff = LargeIntegerDivide(diff, divisor, &rem); ! /* XXX - we assume both divide results fit in 32 bits. This is ! true on Intels. First person who can afford a machine that ! doesnt deserves to fix it :-) ! */ ! return PyFloat_FromDouble((double)diff.LowPart + ! ((double)rem.LowPart / (double)divisor.LowPart)); } --- 144,174 ---- #if defined(MS_WIN32) && !defined(MS_WIN64) && !defined(__BORLANDC__) ! /* Due to Mark Hammond and Tim Peters */ static PyObject * time_clock(PyObject *self, PyObject *args) { ! static LONG_LONG ctrStart; ! static double divisor = 0.0; ! LONG_LONG now; ! double diff; + assert(sizeof(LONG_LONG) == sizeof(LARGE_INTEGER)); if (!PyArg_ParseTuple(args, ":clock")) return NULL; ! if (divisor == 0.0) { ! LONG_LONG freq; ! QueryPerformanceCounter((LARGE_INTEGER*)&ctrStart); ! if (!QueryPerformanceFrequency((LARGE_INTEGER*)&freq) || ! freq == 0) { ! /* Unlikely to happen - this works on all intel ! machines at least! Revert to clock() */ return PyFloat_FromDouble(clock()); } + divisor = (double)freq; } ! QueryPerformanceCounter((LARGE_INTEGER*)&now); ! diff = (double)(now - ctrStart); ! return PyFloat_FromDouble(diff / divisor); } From tim_one@users.sourceforge.net Tue Feb 12 04:31:23 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 11 Feb 2002 20:31:23 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.303,2.304 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv22340/python/python Modified Files: ceval.c Log Message: LOAD_FAST: rearrange branches to favor the expected case, and get rid of a redundant NULL-pointer check in the expected case. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.303 retrieving revision 2.304 diff -C2 -d -r2.303 -r2.304 *** ceval.c 1 Jan 2002 19:59:11 -0000 2.303 --- ceval.c 12 Feb 2002 04:31:21 -0000 2.304 *************** *** 1667,1681 **** case LOAD_FAST: x = GETLOCAL(oparg); ! if (x == NULL) { ! format_exc_check_arg( ! PyExc_UnboundLocalError, ! UNBOUNDLOCAL_ERROR_MSG, ! PyTuple_GetItem(co->co_varnames, oparg) ! ); ! break; } ! Py_INCREF(x); ! PUSH(x); ! if (x != NULL) continue; break; --- 1667,1678 ---- case LOAD_FAST: x = GETLOCAL(oparg); ! if (x != NULL) { ! Py_INCREF(x); ! PUSH(x); ! continue; } ! format_exc_check_arg(PyExc_UnboundLocalError, ! UNBOUNDLOCAL_ERROR_MSG, ! PyTuple_GetItem(co->co_varnames, oparg)); break; From gvanrossum@users.sourceforge.net Tue Feb 12 05:04:32 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Mon, 11 Feb 2002 21:04:32 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0280.txt,1.12,1.13 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv28154 Modified Files: pep-0280.txt Log Message: Add missing PUSH(x) statements to the C code. Index: pep-0280.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0280.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** pep-0280.txt 12 Feb 2002 00:01:35 -0000 1.12 --- pep-0280.txt 12 Feb 2002 05:04:30 -0000 1.13 *************** *** 441,444 **** --- 441,445 ---- } Py_INCREF(x); + PUSH(x); continue; *************** *** 450,453 **** --- 451,455 ---- if (x != NULL) { Py_INCREF(x); + PUSH(x); continue; } *************** *** 468,471 **** --- 470,474 ---- if (x != NULL) { Py_INCREF(x); + PUSH(x); continue; } From loewis@users.sourceforge.net Tue Feb 12 09:52:24 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Tue, 12 Feb 2002 01:52:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules/expat expat.h,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules/expat In directory usw-pr-cvs1:/tmp/cvs-serv19013 Added Files: expat.h Log Message: "Generate" from expat.h.in, for 1.95.2. --- NEW FILE: expat.h --- /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd See the file COPYING for copying permission. */ #ifndef XmlParse_INCLUDED #define XmlParse_INCLUDED 1 #include #ifndef XMLPARSEAPI # if defined(__declspec) && !defined(__BEOS__) # define XMLPARSEAPI(type) __declspec(dllimport) type __cdecl # else # define XMLPARSEAPI(type) type # endif #endif /* not defined XMLPARSEAPI */ #ifdef __cplusplus extern "C" { #endif typedef void *XML_Parser; /* Information is UTF-8 encoded. */ typedef char XML_Char; typedef char XML_LChar; enum XML_Content_Type { XML_CTYPE_EMPTY = 1, XML_CTYPE_ANY, XML_CTYPE_MIXED, XML_CTYPE_NAME, XML_CTYPE_CHOICE, XML_CTYPE_SEQ }; enum XML_Content_Quant { XML_CQUANT_NONE, XML_CQUANT_OPT, XML_CQUANT_REP, XML_CQUANT_PLUS }; /* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be XML_CQUANT_NONE, and the other fields will be zero or NULL. If type == XML_CTYPE_MIXED, then quant will be NONE or REP and numchildren will contain number of elements that may be mixed in and children point to an array of XML_Content cells that will be all of XML_CTYPE_NAME type with no quantification. If type == XML_CTYPE_NAME, then the name points to the name, and the numchildren field will be zero and children will be NULL. The quant fields indicates any quantifiers placed on the name. CHOICE and SEQ will have name NULL, the number of children in numchildren and children will point, recursively, to an array of XML_Content cells. The EMPTY, ANY, and MIXED types will only occur at top level. */ typedef struct XML_cp XML_Content; struct XML_cp { enum XML_Content_Type type; enum XML_Content_Quant quant; XML_Char * name; unsigned int numchildren; XML_Content * children; }; /* This is called for an element declaration. See above for description of the model argument. It's the caller's responsibility to free model when finished with it. */ typedef void (*XML_ElementDeclHandler) (void *userData, const XML_Char *name, XML_Content *model); XMLPARSEAPI(void) XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl); /* The Attlist declaration handler is called for *each* attribute. So a single Attlist declaration with multiple attributes declared will generate multiple calls to this handler. The "default" parameter may be NULL in the case of the "#IMPLIED" or "#REQUIRED" keyword. The "isrequired" parameter will be true and the default value will be NULL in the case of "#REQUIRED". If "isrequired" is true and default is non-NULL, then this is a "#FIXED" default. */ typedef void (*XML_AttlistDeclHandler) (void *userData, const XML_Char *elname, const XML_Char *attname, const XML_Char *att_type, const XML_Char *dflt, int isrequired); XMLPARSEAPI(void) XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl); /* The XML declaration handler is called for *both* XML declarations and text declarations. The way to distinguish is that the version parameter will be null for text declarations. The encoding parameter may be null for XML declarations. The standalone parameter will be -1, 0, or 1 indicating respectively that there was no standalone parameter in the declaration, that it was given as no, or that it was given as yes. */ typedef void (*XML_XmlDeclHandler) (void *userData, const XML_Char *version, const XML_Char *encoding, int standalone); XMLPARSEAPI(void) XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler xmldecl); typedef struct { void *(*malloc_fcn)(size_t size); void *(*realloc_fcn)(void *ptr, size_t size); void (*free_fcn)(void *ptr); } XML_Memory_Handling_Suite; /* Constructs a new parser; encoding is the encoding specified by the external protocol or null if there is none specified. */ XMLPARSEAPI(XML_Parser) XML_ParserCreate(const XML_Char *encoding); /* Constructs a new parser and namespace processor. Element type names and attribute names that belong to a namespace will be expanded; unprefixed attribute names are never expanded; unprefixed element type names are expanded only if there is a default namespace. The expanded name is the concatenation of the namespace URI, the namespace separator character, and the local part of the name. If the namespace separator is '\0' then the namespace URI and the local part will be concatenated without any separator. When a namespace is not declared, the name and prefix will be passed through without expansion. */ XMLPARSEAPI(XML_Parser) XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator); /* Constructs a new parser using the memory management suit referred to by memsuite. If memsuite is NULL, then use the standard library memory suite. If namespaceSeparator is non-NULL it creates a parser with namespace processing as described above. The character pointed at will serve as the namespace separator. All further memory operations used for the created parser will come from the given suite. */ XMLPARSEAPI(XML_Parser) XML_ParserCreate_MM(const XML_Char *encoding, const XML_Memory_Handling_Suite *memsuite, const XML_Char *namespaceSeparator); /* atts is array of name/value pairs, terminated by 0; names and values are 0 terminated. */ typedef void (*XML_StartElementHandler)(void *userData, const XML_Char *name, const XML_Char **atts); typedef void (*XML_EndElementHandler)(void *userData, const XML_Char *name); /* s is not 0 terminated. */ typedef void (*XML_CharacterDataHandler)(void *userData, const XML_Char *s, int len); /* target and data are 0 terminated */ typedef void (*XML_ProcessingInstructionHandler)(void *userData, const XML_Char *target, const XML_Char *data); /* data is 0 terminated */ typedef void (*XML_CommentHandler)(void *userData, const XML_Char *data); typedef void (*XML_StartCdataSectionHandler)(void *userData); typedef void (*XML_EndCdataSectionHandler)(void *userData); /* This is called for any characters in the XML document for which there is no applicable handler. This includes both characters that are part of markup which is of a kind that is not reported (comments, markup declarations), or characters that are part of a construct which could be reported but for which no handler has been supplied. The characters are passed exactly as they were in the XML document except that they will be encoded in UTF-8. Line boundaries are not normalized. Note that a byte order mark character is not passed to the default handler. There are no guarantees about how characters are divided between calls to the default handler: for example, a comment might be split between multiple calls. */ typedef void (*XML_DefaultHandler)(void *userData, const XML_Char *s, int len); /* This is called for the start of the DOCTYPE declaration, before any DTD or internal subset is parsed. */ typedef void (*XML_StartDoctypeDeclHandler)(void *userData, const XML_Char *doctypeName, const XML_Char *sysid, const XML_Char *pubid, int has_internal_subset); /* This is called for the start of the DOCTYPE declaration when the closing > is encountered, but after processing any external subset. */ typedef void (*XML_EndDoctypeDeclHandler)(void *userData); /* This is called for entity declarations. The is_parameter_entity argument will be non-zero if the entity is a parameter entity, zero otherwise. For internal entities (), value will be non-null and systemId, publicID, and notationName will be null. The value string is NOT null terminated; the length is provided in the value_length argument. Since it is legal to have zero-length values, do not use this argument to test for internal entities. For external entities, value will be null and systemId will be non-null. The publicId argument will be null unless a public identifier was provided. The notationName argument will have a non-null value only for unparsed entity declarations. */ typedef void (*XML_EntityDeclHandler) (void *userData, const XML_Char *entityName, int is_parameter_entity, const XML_Char *value, int value_length, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); XMLPARSEAPI(void) XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler); /* OBSOLETE -- OBSOLETE -- OBSOLETE This handler has been superceded by the EntityDeclHandler above. It is provided here for backward compatibility. This is called for a declaration of an unparsed (NDATA) entity. The base argument is whatever was set by XML_SetBase. The entityName, systemId and notationName arguments will never be null. The other arguments may be. */ typedef void (*XML_UnparsedEntityDeclHandler)(void *userData, const XML_Char *entityName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId, const XML_Char *notationName); /* This is called for a declaration of notation. The base argument is whatever was set by XML_SetBase. The notationName will never be null. The other arguments can be. */ typedef void (*XML_NotationDeclHandler)(void *userData, const XML_Char *notationName, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); /* When namespace processing is enabled, these are called once for each namespace declaration. The call to the start and end element handlers occur between the calls to the start and end namespace declaration handlers. For an xmlns attribute, prefix will be null. For an xmlns="" attribute, uri will be null. */ typedef void (*XML_StartNamespaceDeclHandler)(void *userData, const XML_Char *prefix, const XML_Char *uri); typedef void (*XML_EndNamespaceDeclHandler)(void *userData, const XML_Char *prefix); /* This is called if the document is not standalone (it has an external subset or a reference to a parameter entity, but does not have standalone="yes"). If this handler returns 0, then processing will not continue, and the parser will return a XML_ERROR_NOT_STANDALONE error. */ typedef int (*XML_NotStandaloneHandler)(void *userData); /* This is called for a reference to an external parsed general entity. The referenced entity is not automatically parsed. The application can parse it immediately or later using XML_ExternalEntityParserCreate. The parser argument is the parser parsing the entity containing the reference; it can be passed as the parser argument to XML_ExternalEntityParserCreate. The systemId argument is the system identifier as specified in the entity declaration; it will not be null. The base argument is the system identifier that should be used as the base for resolving systemId if systemId was relative; this is set by XML_SetBase; it may be null. The publicId argument is the public identifier as specified in the entity declaration, or null if none was specified; the whitespace in the public identifier will have been normalized as required by the XML spec. The context argument specifies the parsing context in the format expected by the context argument to XML_ExternalEntityParserCreate; context is valid only until the handler returns, so if the referenced entity is to be parsed later, it must be copied. The handler should return 0 if processing should not continue because of a fatal error in the handling of the external entity. In this case the calling parser will return an XML_ERROR_EXTERNAL_ENTITY_HANDLING error. Note that unlike other handlers the first argument is the parser, not userData. */ typedef int (*XML_ExternalEntityRefHandler)(XML_Parser parser, const XML_Char *context, const XML_Char *base, const XML_Char *systemId, const XML_Char *publicId); /* This structure is filled in by the XML_UnknownEncodingHandler to provide information to the parser about encodings that are unknown to the parser. The map[b] member gives information about byte sequences whose first byte is b. If map[b] is c where c is >= 0, then b by itself encodes the Unicode scalar value c. If map[b] is -1, then the byte sequence is malformed. If map[b] is -n, where n >= 2, then b is the first byte of an n-byte sequence that encodes a single Unicode scalar value. The data member will be passed as the first argument to the convert function. The convert function is used to convert multibyte sequences; s will point to a n-byte sequence where map[(unsigned char)*s] == -n. The convert function must return the Unicode scalar value represented by this byte sequence or -1 if the byte sequence is malformed. The convert function may be null if the encoding is a single-byte encoding, that is if map[b] >= -1 for all bytes b. When the parser is finished with the encoding, then if release is not null, it will call release passing it the data member; once release has been called, the convert function will not be called again. Expat places certain restrictions on the encodings that are supported using this mechanism. 1. Every ASCII character that can appear in a well-formed XML document, other than the characters $@\^`{}~ must be represented by a single byte, and that byte must be the same byte that represents that character in ASCII. 2. No character may require more than 4 bytes to encode. 3. All characters encoded must have Unicode scalar values <= 0xFFFF, (i.e., characters that would be encoded by surrogates in UTF-16 are not allowed). Note that this restriction doesn't apply to the built-in support for UTF-8 and UTF-16. 4. No Unicode character may be encoded by more than one distinct sequence of bytes. */ typedef struct { int map[256]; void *data; int (*convert)(void *data, const char *s); void (*release)(void *data); } XML_Encoding; /* This is called for an encoding that is unknown to the parser. The encodingHandlerData argument is that which was passed as the second argument to XML_SetUnknownEncodingHandler. The name argument gives the name of the encoding as specified in the encoding declaration. If the callback can provide information about the encoding, it must fill in the XML_Encoding structure, and return 1. Otherwise it must return 0. If info does not describe a suitable encoding, then the parser will return an XML_UNKNOWN_ENCODING error. */ typedef int (*XML_UnknownEncodingHandler)(void *encodingHandlerData, const XML_Char *name, XML_Encoding *info); XMLPARSEAPI(void) XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start, XML_EndElementHandler end); XMLPARSEAPI(void) XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler); XMLPARSEAPI(void) XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler); XMLPARSEAPI(void) XML_SetCharacterDataHandler(XML_Parser parser, XML_CharacterDataHandler handler); XMLPARSEAPI(void) XML_SetProcessingInstructionHandler(XML_Parser parser, XML_ProcessingInstructionHandler handler); XMLPARSEAPI(void) XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler); XMLPARSEAPI(void) XML_SetCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start, XML_EndCdataSectionHandler end); XMLPARSEAPI(void) XML_SetStartCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start); XMLPARSEAPI(void) XML_SetEndCdataSectionHandler(XML_Parser parser, XML_EndCdataSectionHandler end); /* This sets the default handler and also inhibits expansion of internal entities. The entity reference will be passed to the default handler. */ XMLPARSEAPI(void) XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler); /* This sets the default handler but does not inhibit expansion of internal entities. The entity reference will not be passed to the default handler. */ XMLPARSEAPI(void) XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler); XMLPARSEAPI(void) XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start, XML_EndDoctypeDeclHandler end); XMLPARSEAPI(void) XML_SetStartDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start); XMLPARSEAPI(void) XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end); XMLPARSEAPI(void) XML_SetUnparsedEntityDeclHandler(XML_Parser parser, XML_UnparsedEntityDeclHandler handler); XMLPARSEAPI(void) XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler); XMLPARSEAPI(void) XML_SetNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start, XML_EndNamespaceDeclHandler end); XMLPARSEAPI(void) XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start); XMLPARSEAPI(void) XML_SetEndNamespaceDeclHandler(XML_Parser parser, XML_EndNamespaceDeclHandler end); XMLPARSEAPI(void) XML_SetNotStandaloneHandler(XML_Parser parser, XML_NotStandaloneHandler handler); XMLPARSEAPI(void) XML_SetExternalEntityRefHandler(XML_Parser parser, XML_ExternalEntityRefHandler handler); /* If a non-null value for arg is specified here, then it will be passed as the first argument to the external entity ref handler instead of the parser object. */ XMLPARSEAPI(void) XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg); XMLPARSEAPI(void) XML_SetUnknownEncodingHandler(XML_Parser parser, XML_UnknownEncodingHandler handler, void *encodingHandlerData); /* This can be called within a handler for a start element, end element, processing instruction or character data. It causes the corresponding markup to be passed to the default handler. */ XMLPARSEAPI(void) XML_DefaultCurrent(XML_Parser parser); /* If do_nst is non-zero, and namespace processing is in effect, and a name has a prefix (i.e. an explicit namespace qualifier) then that name is returned as a triplet in a single string separated by the separator character specified when the parser was created: URI + sep + local_name + sep + prefix. If do_nst is zero, then namespace information is returned in the default manner (URI + sep + local_name) whether or not the names has a prefix. */ XMLPARSEAPI(void) XML_SetReturnNSTriplet(XML_Parser parser, int do_nst); /* This value is passed as the userData argument to callbacks. */ XMLPARSEAPI(void) XML_SetUserData(XML_Parser parser, void *userData); /* Returns the last value set by XML_SetUserData or null. */ #define XML_GetUserData(parser) (*(void **)(parser)) /* This is equivalent to supplying an encoding argument to XML_ParserCreate. It must not be called after XML_Parse or XML_ParseBuffer. */ XMLPARSEAPI(int) XML_SetEncoding(XML_Parser parser, const XML_Char *encoding); /* If this function is called, then the parser will be passed as the first argument to callbacks instead of userData. The userData will still be accessible using XML_GetUserData. */ XMLPARSEAPI(void) XML_UseParserAsHandlerArg(XML_Parser parser); /* Sets the base to be used for resolving relative URIs in system identifiers in declarations. Resolving relative identifiers is left to the application: this value will be passed through as the base argument to the XML_ExternalEntityRefHandler, XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base argument will be copied. Returns zero if out of memory, non-zero otherwise. */ XMLPARSEAPI(int) XML_SetBase(XML_Parser parser, const XML_Char *base); XMLPARSEAPI(const XML_Char *) XML_GetBase(XML_Parser parser); /* Returns the number of the attribute/value pairs passed in last call to the XML_StartElementHandler that were specified in the start-tag rather than defaulted. Each attribute/value pair counts as 2; thus this correspondds to an index into the atts array passed to the XML_StartElementHandler. */ XMLPARSEAPI(int) XML_GetSpecifiedAttributeCount(XML_Parser parser); /* Returns the index of the ID attribute passed in the last call to XML_StartElementHandler, or -1 if there is no ID attribute. Each attribute/value pair counts as 2; thus this correspondds to an index into the atts array passed to the XML_StartElementHandler. */ XMLPARSEAPI(int) XML_GetIdAttributeIndex(XML_Parser parser); /* Parses some input. Returns 0 if a fatal error is detected. The last call to XML_Parse must have isFinal true; len may be zero for this call (or any other). */ XMLPARSEAPI(int) XML_Parse(XML_Parser parser, const char *s, int len, int isFinal); XMLPARSEAPI(void *) XML_GetBuffer(XML_Parser parser, int len); XMLPARSEAPI(int) XML_ParseBuffer(XML_Parser parser, int len, int isFinal); /* Creates an XML_Parser object that can parse an external general entity; context is a '\0'-terminated string specifying the parse context; encoding is a '\0'-terminated string giving the name of the externally specified encoding, or null if there is no externally specified encoding. The context string consists of a sequence of tokens separated by formfeeds (\f); a token consisting of a name specifies that the general entity of the name is open; a token of the form prefix=uri specifies the namespace for a particular prefix; a token of the form =uri specifies the default namespace. This can be called at any point after the first call to an ExternalEntityRefHandler so longer as the parser has not yet been freed. The new parser is completely independent and may safely be used in a separate thread. The handlers and userData are initialized from the parser argument. Returns 0 if out of memory. Otherwise returns a new XML_Parser object. */ XMLPARSEAPI(XML_Parser) XML_ExternalEntityParserCreate(XML_Parser parser, const XML_Char *context, const XML_Char *encoding); enum XML_ParamEntityParsing { XML_PARAM_ENTITY_PARSING_NEVER, XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE, XML_PARAM_ENTITY_PARSING_ALWAYS }; /* Controls parsing of parameter entities (including the external DTD subset). If parsing of parameter entities is enabled, then references to external parameter entities (including the external DTD subset) will be passed to the handler set with XML_SetExternalEntityRefHandler. The context passed will be 0. Unlike external general entities, external parameter entities can only be parsed synchronously. If the external parameter entity is to be parsed, it must be parsed during the call to the external entity ref handler: the complete sequence of XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and XML_ParserFree calls must be made during this call. After XML_ExternalEntityParserCreate has been called to create the parser for the external parameter entity (context must be 0 for this call), it is illegal to make any calls on the old parser until XML_ParserFree has been called on the newly created parser. If the library has been compiled without support for parameter entity parsing (ie without XML_DTD being defined), then XML_SetParamEntityParsing will return 0 if parsing of parameter entities is requested; otherwise it will return non-zero. */ XMLPARSEAPI(int) XML_SetParamEntityParsing(XML_Parser parser, enum XML_ParamEntityParsing parsing); enum XML_Error { XML_ERROR_NONE, XML_ERROR_NO_MEMORY, XML_ERROR_SYNTAX, XML_ERROR_NO_ELEMENTS, XML_ERROR_INVALID_TOKEN, XML_ERROR_UNCLOSED_TOKEN, XML_ERROR_PARTIAL_CHAR, XML_ERROR_TAG_MISMATCH, XML_ERROR_DUPLICATE_ATTRIBUTE, XML_ERROR_JUNK_AFTER_DOC_ELEMENT, XML_ERROR_PARAM_ENTITY_REF, XML_ERROR_UNDEFINED_ENTITY, XML_ERROR_RECURSIVE_ENTITY_REF, XML_ERROR_ASYNC_ENTITY, XML_ERROR_BAD_CHAR_REF, XML_ERROR_BINARY_ENTITY_REF, XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF, XML_ERROR_MISPLACED_XML_PI, XML_ERROR_UNKNOWN_ENCODING, XML_ERROR_INCORRECT_ENCODING, XML_ERROR_UNCLOSED_CDATA_SECTION, XML_ERROR_EXTERNAL_ENTITY_HANDLING, XML_ERROR_NOT_STANDALONE, XML_ERROR_UNEXPECTED_STATE }; /* If XML_Parse or XML_ParseBuffer have returned 0, then XML_GetErrorCode returns information about the error. */ XMLPARSEAPI(enum XML_Error) XML_GetErrorCode(XML_Parser parser); /* These functions return information about the current parse location. They may be called when XML_Parse or XML_ParseBuffer return 0; in this case the location is the location of the character at which the error was detected. They may also be called from any other callback called to report some parse event; in this the location is the location of the first of the sequence of characters that generated the event. */ XMLPARSEAPI(int) XML_GetCurrentLineNumber(XML_Parser parser); XMLPARSEAPI(int) XML_GetCurrentColumnNumber(XML_Parser parser); XMLPARSEAPI(long) XML_GetCurrentByteIndex(XML_Parser parser); /* Return the number of bytes in the current event. Returns 0 if the event is in an internal entity. */ XMLPARSEAPI(int) XML_GetCurrentByteCount(XML_Parser parser); /* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets the integer pointed to by offset to the offset within this buffer of the current parse position, and sets the integer pointed to by size to the size of this buffer (the number of input bytes). Otherwise returns a null pointer. Also returns a null pointer if a parse isn't active. NOTE: The character pointer returned should not be used outside the handler that makes the call. */ XMLPARSEAPI(const char *) XML_GetInputContext(XML_Parser parser, int *offset, int *size); /* For backwards compatibility with previous versions. */ #define XML_GetErrorLineNumber XML_GetCurrentLineNumber #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber #define XML_GetErrorByteIndex XML_GetCurrentByteIndex /* Frees memory used by the parser. */ XMLPARSEAPI(void) XML_ParserFree(XML_Parser parser); /* Returns a string describing the error. */ XMLPARSEAPI(const XML_LChar *) XML_ErrorString(int code); /* Return a string containing the version number of this expat */ XMLPARSEAPI(const XML_LChar *) XML_ExpatVersion(void); typedef struct { int major; int minor; int micro; } XML_Expat_Version; /* Return an XML_Expat_Version structure containing numeric version number information for this version of expat */ XMLPARSEAPI(XML_Expat_Version) XML_ExpatVersionInfo(void); #define XML_MAJOR_VERSION 1 #define XML_MINOR_VERSION 95 #define XML_MICRO_VERSION 2 #ifdef __cplusplus } #endif #endif /* not XmlParse_INCLUDED */ From mal@lemburg.com Tue Feb 12 10:29:20 2002 From: mal@lemburg.com (M.-A. Lemburg) Date: Tue, 12 Feb 2002 11:29:20 +0100 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.303,2.304 References: Message-ID: <3C68EE80.259C22DF@lemburg.com> Tim Peters wrote: > > Update of /cvsroot/python/python/dist/src/Python > In directory usw-pr-cvs1:/tmp/cvs-serv22340/python/python > > Modified Files: > ceval.c > Log Message: > LOAD_FAST: rearrange branches to favor the expected case, and get > rid of a redundant NULL-pointer check in the expected case. If you move LOAD_FAST out of the switch altogether you'll get another performance boost. It is by far the most common opcode and avoiding the switch() overhead pays off. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.egenix.com/files/python/ From jackjansen@users.sourceforge.net Tue Feb 12 21:30:55 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 12 Feb 2002 13:30:55 -0800 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.74,1.75 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv28179 Modified Files: Makefile.pre.in Log Message: Two OSX fixes related to switching Python versions in an existing sourcetree: - Create the Python.framework/Versions/$(VERSION) dir if it doesn't exist - Override existing symlinks in the framework. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** Makefile.pre.in 17 Jan 2002 12:30:12 -0000 1.74 --- Makefile.pre.in 12 Feb 2002 21:30:53 -0000 1.75 *************** *** 348,351 **** --- 348,352 ---- # This rule is here for OPENSTEP/Rhapsody/MacOSX $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): $(LIBRARY) $(PYTHONFRAMEWORKDIR) + $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION) libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \ -framework System @LIBTOOL_CRUFT@ *************** *** 759,766 **** $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ $(FRAMEWORKDEST)/Resources/English.lproj/InfoPlist.strings ! $(LN) -fs $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current ! $(LN) -fs Versions/Current/Python $(PYTHONFRAMEWORKDIR)/Python ! $(LN) -fs Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers ! $(LN) -fs Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources # On install, we re-make the framework --- 760,767 ---- $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ $(FRAMEWORKDEST)/Resources/English.lproj/InfoPlist.strings ! $(LN) -fsh $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current ! $(LN) -fsh Versions/Current/Python $(PYTHONFRAMEWORKDIR)/Python ! $(LN) -fsh Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers ! $(LN) -fsh Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources # On install, we re-make the framework *************** *** 790,797 **** $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ $(FRAMEWORKFINALDEST)/Resources/English.lproj/InfoPlist.strings ! $(LN) -fs $(VERSION) $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current ! $(LN) -fs Versions/Current/Python $(PYTHONFRAMEWORKINSTALLDIR)/Python ! $(LN) -fs Versions/Current/Headers $(PYTHONFRAMEWORKINSTALLDIR)/Headers ! $(LN) -fs Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) --- 791,798 ---- $(INSTALL_DATA) $(RESSRCDIR)/English.lproj/InfoPlist.strings \ $(FRAMEWORKFINALDEST)/Resources/English.lproj/InfoPlist.strings ! $(LN) -fsh $(VERSION) $(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current ! $(LN) -fsh Versions/Current/Python $(PYTHONFRAMEWORKINSTALLDIR)/Python ! $(LN) -fsh Versions/Current/Headers $(PYTHONFRAMEWORKINSTALLDIR)/Headers ! $(LN) -fsh Versions/Current/Resources $(PYTHONFRAMEWORKINSTALLDIR)/Resources $(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY) From tim_one@users.sourceforge.net Wed Feb 13 05:14:20 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 12 Feb 2002 21:14:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules timemodule.c,2.121,2.122 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv21638/python/Modules Modified Files: timemodule.c Log Message: Windows time_clock(): rewrite to get rid of horrid casting tricks. Don't blame Mark! The horrid casting tricks were my idea to begin with. The rewrite works fine under VC6, and I *expect* will work fine under VC7. Index: timemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/timemodule.c,v retrieving revision 2.121 retrieving revision 2.122 diff -C2 -d -r2.121 -r2.122 *** timemodule.c 12 Feb 2002 04:02:33 -0000 2.121 --- timemodule.c 13 Feb 2002 05:14:18 -0000 2.122 *************** *** 148,173 **** time_clock(PyObject *self, PyObject *args) { ! static LONG_LONG ctrStart; static double divisor = 0.0; ! LONG_LONG now; double diff; - assert(sizeof(LONG_LONG) == sizeof(LARGE_INTEGER)); if (!PyArg_ParseTuple(args, ":clock")) return NULL; if (divisor == 0.0) { ! LONG_LONG freq; ! QueryPerformanceCounter((LARGE_INTEGER*)&ctrStart); ! if (!QueryPerformanceFrequency((LARGE_INTEGER*)&freq) || ! freq == 0) { /* Unlikely to happen - this works on all intel machines at least! Revert to clock() */ return PyFloat_FromDouble(clock()); } ! divisor = (double)freq; } ! QueryPerformanceCounter((LARGE_INTEGER*)&now); ! diff = (double)(now - ctrStart); return PyFloat_FromDouble(diff / divisor); } --- 148,171 ---- time_clock(PyObject *self, PyObject *args) { ! static LARGE_INTEGER ctrStart; static double divisor = 0.0; ! LARGE_INTEGER now; double diff; if (!PyArg_ParseTuple(args, ":clock")) return NULL; if (divisor == 0.0) { ! LARGE_INTEGER freq; ! QueryPerformanceCounter(&ctrStart); ! if (!QueryPerformanceFrequency(&freq) || freq.QuadPart == 0) { /* Unlikely to happen - this works on all intel machines at least! Revert to clock() */ return PyFloat_FromDouble(clock()); } ! divisor = (double)freq.QuadPart; } ! QueryPerformanceCounter(&now); ! diff = (double)(now.QuadPart - ctrStart.QuadPart); return PyFloat_FromDouble(diff / divisor); } *************** *** 221,225 **** 9, }; ! static PyTypeObject StructTimeType; --- 219,223 ---- 9, }; ! static PyTypeObject StructTimeType; *************** *** 230,234 **** if (v == NULL) return NULL; ! #define SET(i,val) PyStructSequence_SET_ITEM(v, i, PyInt_FromLong((long) val)) --- 228,232 ---- if (v == NULL) return NULL; ! #define SET(i,val) PyStructSequence_SET_ITEM(v, i, PyInt_FromLong((long) val)) From loewis@users.sourceforge.net Wed Feb 13 07:47:18 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Tue, 12 Feb 2002 23:47:18 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules/expat expat.h,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules/expat In directory usw-pr-cvs1:/tmp/cvs-serv18129/Modules/expat Modified Files: expat.h Log Message: Define VERSION in expat.h. Index: expat.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/expat/expat.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** expat.h 12 Feb 2002 09:52:22 -0000 1.1 --- expat.h 13 Feb 2002 07:47:16 -0000 1.2 *************** *** 725,728 **** --- 725,732 ---- XML_ExpatVersionInfo(void); + /* VERSION is not defined in expat.h.in, but it really belongs here, + and defining it on the command line gives difficulties with MSVC. */ + #define VERSION "1.95.2" + #define XML_MAJOR_VERSION 1 #define XML_MINOR_VERSION 95 From loewis@users.sourceforge.net Wed Feb 13 07:47:18 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Tue, 12 Feb 2002 23:47:18 -0800 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.79,1.80 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv18129 Modified Files: setup.py Log Message: Define VERSION in expat.h. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** setup.py 11 Feb 2002 23:27:45 -0000 1.79 --- setup.py 13 Feb 2002 07:47:16 -0000 1.80 *************** *** 568,572 **** define_macros = [ ('HAVE_EXPAT_H',None), - ('VERSION', '"1.95.2"'), ('XML_NS', '1'), ('XML_DTD', '1'), --- 568,571 ---- From loewis@users.sourceforge.net Wed Feb 13 07:47:18 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Tue, 12 Feb 2002 23:47:18 -0800 Subject: [Python-checkins] CVS: python/dist/src/PCbuild pyexpat.dsp,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv18129/PCbuild Modified Files: pyexpat.dsp Log Message: Define VERSION in expat.h. Index: pyexpat.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pyexpat.dsp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pyexpat.dsp 12 Feb 2002 00:05:49 -0000 1.7 --- pyexpat.dsp 13 Feb 2002 07:47:16 -0000 1.8 *************** *** 46,50 **** CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /I "..\Modules\expat" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_EXPAT_H" /D "XML_NS" /D "XML_DTD" /D XML_BYTE_ORDER=12 /D XML_CONTEXT_BYTES=1024 /D VERSION=\"1.95.2\" /YX /FD /c MTL=midl.exe # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 46,50 ---- CPP=cl.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /I "..\Modules\expat" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_EXPAT_H" /D "XML_NS" /D "XML_DTD" /D XML_BYTE_ORDER=12 /D XML_CONTEXT_BYTES=1024 /YX /FD /c MTL=midl.exe # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 77,81 **** CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /I "..\Modules\expat" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_EXPAT_H" /D "XML_NS" /D "XML_DTD" /D XML_BYTE_ORDER=12 /D XML_CONTEXT_BYTES=1024 /D VERSION="1.95.2" /YX /FD /c MTL=midl.exe # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 77,81 ---- CPP=cl.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /I "..\Modules\expat" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_EXPAT_H" /D "XML_NS" /D "XML_DTD" /D XML_BYTE_ORDER=12 /D XML_CONTEXT_BYTES=1024 /YX /FD /c MTL=midl.exe # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 From mwh@users.sourceforge.net Wed Feb 13 11:58:27 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Wed, 13 Feb 2002 03:58:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules readline.c,2.42,2.43 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv24419 Modified Files: readline.c Log Message: Simon Budig's patch (posted by me): [ #513235 ] prevent readline filename completion Index: readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.42 retrieving revision 2.43 diff -C2 -d -r2.42 -r2.43 *** readline.c 12 Jan 2002 11:05:07 -0000 2.42 --- readline.c 13 Feb 2002 11:58:25 -0000 2.43 *************** *** 461,464 **** --- 461,467 ---- save_tstate = PyThreadState_Swap(NULL); PyEval_RestoreThread(completer_tstate); + /* Don't use the default filename completion if we + * have a custom completion function... */ + rl_attempted_completion_over = 1; r = PyObject_CallFunction(completer, "si", text, state); if (r == NULL) From tim_one@users.sourceforge.net Wed Feb 13 23:56:48 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 13 Feb 2002 15:56:48 -0800 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.99,1.100 readme.txt,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv16607/python/PCbuild Modified Files: python20.wse readme.txt Log Message: Finish the pyexpat rework for Windows: builders needn't suck down the Expat installer from SF anymore, and the installer shouldn't install expat.dll anymore. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** python20.wse 21 Dec 2001 22:06:12 -0000 1.99 --- python20.wse 13 Feb 2002 23:56:46 -0000 1.100 *************** *** 1833,1847 **** end item: Remark - Text=More DLLs - end - item: Install File - Source=..\..\expat\libs\expat.dll - Destination=%MAINDIR%\DLLs\expat.dll - Description=Expat library - Flags=0000000000000010 - end - item: Remark - end - item: Remark Text=Main Python DLL end --- 1833,1836 ---- Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** readme.txt 28 Jul 2001 07:56:38 -0000 1.21 --- readme.txt 13 Feb 2002 23:56:46 -0000 1.22 *************** *** 53,56 **** --- 53,59 ---- parser the parser module + pyexpat + Python wrapper for accelerated XML parsing, which incorporates stable + code from the Expat project: http://sourceforge.net/projects/expat/ select selectmodule.c *************** *** 99,112 **** TODO: make this work like zlib (in particular, MSVC runs the prelink step in an enviroment that already has the correct envars set up). - - pyexpat - Python wrapper for accelerated XML parsing. Requires the Windows - expat_win32bin installer from - http://sourceforge.net/projects/expat/ - Currently using version 1.95.2. - Install into dist\expat. - You should also copy expat\Libs\expat.dll into your PCbuild directory, - else at least two tests will fail (test_pyexpat and test_sax), and - others will erroneously get skipped (at least test_minidom). --- 102,105 ---- From loewis@users.sourceforge.net Thu Feb 14 01:25:39 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 13 Feb 2002 17:25:39 -0800 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.80,1.81 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv4684 Modified Files: setup.py Log Message: Compute expat -I directives from srcdir. Fixes #517214. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** setup.py 13 Feb 2002 07:47:16 -0000 1.80 --- setup.py 14 Feb 2002 01:25:37 -0000 1.81 *************** *** 225,228 **** --- 225,229 ---- platform = self.get_platform() + (srcdir,) = sysconfig.get_config_vars('srcdir') # Check for MacOS X, which doesn't need libm.a at all *************** *** 559,562 **** --- 560,564 ---- else: xmlbo = "21" + expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat') exts.append(Extension('pyexpat', sources = [ *************** *** 573,577 **** ('XML_CONTEXT_BYTES','1024'), ], ! include_dirs = ['Modules/expat'] )) --- 575,579 ---- ('XML_CONTEXT_BYTES','1024'), ], ! include_dirs = [expatinc] )) From fdrake@users.sourceforge.net Thu Feb 14 06:59:29 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 13 Feb 2002 22:59:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules resource.c,2.21,2.22 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv18897/Modules Modified Files: resource.c Log Message: Use PyModule_AddIntConstant() instead of creating a private helper function. This also avoids directly accessing the module'd __dict__. Index: resource.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/resource.c,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** resource.c 17 Jan 2002 23:15:58 -0000 2.21 --- resource.c 14 Feb 2002 06:59:26 -0000 2.22 *************** *** 158,176 **** /* Module initialization */ - static void - ins(PyObject *dict, char *name, int value) - { - PyObject *v = PyInt_FromLong((long) value); - if (v) { - PyDict_SetItemString(dict, name, v); - Py_DECREF(v); - } - /* errors will be checked by initresource() */ - } - DL_EXPORT(void) initresource(void) { ! PyObject *m, *d; /* Create the module and add the functions */ --- 158,165 ---- /* Module initialization */ DL_EXPORT(void) initresource(void) { ! PyObject *m; /* Create the module and add the functions */ *************** *** 178,244 **** /* Add some symbolic constants to the module */ ! d = PyModule_GetDict(m); ! ResourceError = PyErr_NewException("resource.error", NULL, NULL); ! PyDict_SetItemString(d, "error", ResourceError); /* insert constants */ #ifdef RLIMIT_CPU ! ins(d, "RLIMIT_CPU", RLIMIT_CPU); #endif #ifdef RLIMIT_FSIZE ! ins(d, "RLIMIT_FSIZE", RLIMIT_FSIZE); #endif #ifdef RLIMIT_DATA ! ins(d, "RLIMIT_DATA", RLIMIT_DATA); #endif #ifdef RLIMIT_STACK ! ins(d, "RLIMIT_STACK", RLIMIT_STACK); #endif #ifdef RLIMIT_CORE ! ins(d, "RLIMIT_CORE", RLIMIT_CORE); #endif #ifdef RLIMIT_NOFILE ! ins(d, "RLIMIT_NOFILE", RLIMIT_NOFILE); #endif #ifdef RLIMIT_OFILE ! ins(d, "RLIMIT_OFILE", RLIMIT_OFILE); #endif #ifdef RLIMIT_VMEM ! ins(d, "RLIMIT_VMEM", RLIMIT_VMEM); #endif #ifdef RLIMIT_AS ! ins(d, "RLIMIT_AS", RLIMIT_AS); #endif #ifdef RLIMIT_RSS ! ins(d, "RLIMIT_RSS", RLIMIT_RSS); #endif #ifdef RLIMIT_NPROC ! ins(d, "RLIMIT_NPROC", RLIMIT_NPROC); #endif #ifdef RLIMIT_MEMLOCK ! ins(d, "RLIMIT_MEMLOCK", RLIMIT_MEMLOCK); #endif #ifdef RUSAGE_SELF ! ins(d, "RUSAGE_SELF", RUSAGE_SELF); #endif #ifdef RUSAGE_CHILDREN ! ins(d, "RUSAGE_CHILDREN", RUSAGE_CHILDREN); #endif #ifdef RUSAGE_BOTH ! ins(d, "RUSAGE_BOTH", RUSAGE_BOTH); #endif } --- 167,236 ---- /* Add some symbolic constants to the module */ ! if (ResourceError == NULL) { ! ResourceError = PyErr_NewException("resource.error", ! NULL, NULL); ! } ! Py_INCREF(ResourceError); ! PyModule_AddObject(m, "error", ResourceError); /* insert constants */ #ifdef RLIMIT_CPU ! PyModule_AddIntConstant(m, "RLIMIT_CPU", RLIMIT_CPU); #endif #ifdef RLIMIT_FSIZE ! PyModule_AddIntConstant(m, "RLIMIT_FSIZE", RLIMIT_FSIZE); #endif #ifdef RLIMIT_DATA ! PyModule_AddIntConstant(m, "RLIMIT_DATA", RLIMIT_DATA); #endif #ifdef RLIMIT_STACK ! PyModule_AddIntConstant(m, "RLIMIT_STACK", RLIMIT_STACK); #endif #ifdef RLIMIT_CORE ! PyModule_AddIntConstant(m, "RLIMIT_CORE", RLIMIT_CORE); #endif #ifdef RLIMIT_NOFILE ! PyModule_AddIntConstant(m, "RLIMIT_NOFILE", RLIMIT_NOFILE); #endif #ifdef RLIMIT_OFILE ! PyModule_AddIntConstant(m, "RLIMIT_OFILE", RLIMIT_OFILE); #endif #ifdef RLIMIT_VMEM ! PyModule_AddIntConstant(m, "RLIMIT_VMEM", RLIMIT_VMEM); #endif #ifdef RLIMIT_AS ! PyModule_AddIntConstant(m, "RLIMIT_AS", RLIMIT_AS); #endif #ifdef RLIMIT_RSS ! PyModule_AddIntConstant(m, "RLIMIT_RSS", RLIMIT_RSS); #endif #ifdef RLIMIT_NPROC ! PyModule_AddIntConstant(m, "RLIMIT_NPROC", RLIMIT_NPROC); #endif #ifdef RLIMIT_MEMLOCK ! PyModule_AddIntConstant(m, "RLIMIT_MEMLOCK", RLIMIT_MEMLOCK); #endif #ifdef RUSAGE_SELF ! PyModule_AddIntConstant(m, "RUSAGE_SELF", RUSAGE_SELF); #endif #ifdef RUSAGE_CHILDREN ! PyModule_AddIntConstant(m, "RUSAGE_CHILDREN", RUSAGE_CHILDREN); #endif #ifdef RUSAGE_BOTH ! PyModule_AddIntConstant(m, "RUSAGE_BOTH", RUSAGE_BOTH); #endif } From fdrake@users.sourceforge.net Thu Feb 14 07:08:33 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 13 Feb 2002 23:08:33 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules termios.c,2.32,2.33 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv20965/Modules Modified Files: termios.c Log Message: Use PyModule_AddObject() instead of accessing the module dict directly. Index: termios.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/termios.c,v retrieving revision 2.32 retrieving revision 2.33 diff -C2 -d -r2.32 -r2.33 *** termios.c 12 Jan 2002 11:05:08 -0000 2.32 --- termios.c 14 Feb 2002 07:08:31 -0000 2.33 *************** *** 892,896 **** PyInit_termios(void) { ! PyObject *m, *d; struct constant *constant = termios_constants; --- 892,896 ---- PyInit_termios(void) { ! PyObject *m; struct constant *constant = termios_constants; *************** *** 898,904 **** (PyObject *)NULL, PYTHON_API_VERSION); ! d = PyModule_GetDict(m); ! TermiosError = PyErr_NewException("termios.error", NULL, NULL); ! PyDict_SetItemString(d, "error", TermiosError); while (constant->name != NULL) { --- 898,906 ---- (PyObject *)NULL, PYTHON_API_VERSION); ! if (TermiosError == NULL) { ! TermiosError = PyErr_NewException("termios.error", NULL, NULL); ! } ! Py_INCREF(TermiosError); ! PyModule_AddObject(m, "error", TermiosError); while (constant->name != NULL) { From fdrake@users.sourceforge.net Thu Feb 14 07:11:25 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 13 Feb 2002 23:11:25 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules structmodule.c,2.51,2.52 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv21476/Modules Modified Files: structmodule.c Log Message: Use PyModule_AddObject() instead of accessing the module dict directly. Index: structmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/structmodule.c,v retrieving revision 2.51 retrieving revision 2.52 diff -C2 -d -r2.51 -r2.52 *** structmodule.c 24 Oct 2001 20:37:10 -0000 2.51 --- structmodule.c 14 Feb 2002 07:11:23 -0000 2.52 *************** *** 1503,1507 **** initstruct(void) { ! PyObject *m, *d; /* Create the module and add the functions */ --- 1503,1507 ---- initstruct(void) { ! PyObject *m; /* Create the module and add the functions */ *************** *** 1510,1517 **** /* Add some symbolic constants to the module */ ! d = PyModule_GetDict(m); ! StructError = PyErr_NewException("struct.error", NULL, NULL); ! if (StructError == NULL) ! return; ! PyDict_SetItemString(d, "error", StructError); } --- 1510,1519 ---- /* Add some symbolic constants to the module */ ! if (StructError == NULL) { ! StructError = PyErr_NewException("struct.error", NULL, NULL); ! if (StructError == NULL) ! return; ! } ! Py_INCREF(StructError); ! PyModule_AddObject(d, "error", StructError); } From fdrake@users.sourceforge.net Thu Feb 14 07:16:32 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 13 Feb 2002 23:16:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules structmodule.c,2.52,2.53 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv22548/Modules Modified Files: structmodule.c Log Message: Fix typo. Index: structmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/structmodule.c,v retrieving revision 2.52 retrieving revision 2.53 diff -C2 -d -r2.52 -r2.53 *** structmodule.c 14 Feb 2002 07:11:23 -0000 2.52 --- structmodule.c 14 Feb 2002 07:16:30 -0000 2.53 *************** *** 1516,1519 **** } Py_INCREF(StructError); ! PyModule_AddObject(d, "error", StructError); } --- 1516,1519 ---- } Py_INCREF(StructError); ! PyModule_AddObject(m, "error", StructError); } From fdrake@users.sourceforge.net Thu Feb 14 15:19:33 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 14 Feb 2002 07:19:33 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.73,1.74 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv15875/lib Modified Files: libre.tex Log Message: Consistently use \textasciicircum to produce a ^ character. LaTeX really falls flat on this one! Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** libre.tex 29 Nov 2001 20:23:14 -0000 1.73 --- libre.tex 14 Feb 2002 15:19:30 -0000 1.74 *************** *** 94,99 **** specified, this matches any character including a newline. ! \item[\character{\^}] (Caret.) Matches the start of the string, and in ! \constant{MULTILINE} mode also matches immediately after each newline. \item[\character{\$}] Matches the end of the string or just before the --- 94,100 ---- specified, this matches any character including a newline. ! \item[\character{\textasciicircum}] (Caret.) Matches the start of the ! string, and in \constant{MULTILINE} mode also matches immediately ! after each newline. \item[\character{\$}] Matches the end of the string or just before the *************** *** 182,189 **** You can match the characters not within a range by \dfn{complementing} ! the set. This is indicated by including a \character{\^} as the first ! character of the set; \character{\^} elsewhere will simply match the ! \character{\^} character. For example, \regexp{[{\^}5]} will match ! any character except \character{5}. \item[\character{|}]\code{A|B}, where A and B can be arbitrary REs, --- 183,194 ---- You can match the characters not within a range by \dfn{complementing} ! the set. This is indicated by including a ! \character{\textasciicircum} as the first character of the set; ! \character{\textasciicircum} elsewhere will simply match the ! \character{\textasciicircum} character. For example, ! \regexp{[{\textasciicircum}5]} will match ! any character except \character{5}, and ! \regexp{[\textasciicircum\code{\textasciicircum}]} will match any character ! except \character{\textasciicircum}. \item[\character{|}]\code{A|B}, where A and B can be arbitrary REs, *************** *** 319,323 **** \item[\code{\e D}]Matches any non-digit character; this is ! equivalent to the set \regexp{[{\^}0-9]}. \item[\code{\e s}]Matches any whitespace character; this is --- 324,328 ---- \item[\code{\e D}]Matches any non-digit character; this is ! equivalent to the set \regexp{[{\textasciicircum}0-9]}. \item[\code{\e s}]Matches any whitespace character; this is *************** *** 325,329 **** \item[\code{\e S}]Matches any non-whitespace character; this is ! equivalent to the set \regexp{[\^\ \e t\e n\e r\e f\e v]}. \item[\code{\e w}]When the \constant{LOCALE} and \constant{UNICODE} --- 330,334 ---- \item[\code{\e S}]Matches any non-whitespace character; this is ! equivalent to the set \regexp{[\textasciicircum\ \e t\e n\e r\e f\e v]}. \item[\code{\e w}]When the \constant{LOCALE} and \constant{UNICODE} *************** *** 338,342 **** \item[\code{\e W}]When the \constant{LOCALE} and \constant{UNICODE} flags are not specified, matches any non-alphanumeric character; this ! is equivalent to the set \regexp{[{\^}a-zA-Z0-9_]}. With \constant{LOCALE}, it will match any character not in the set \regexp{[0-9_]}, and not defined as a letter for the current locale. --- 343,347 ---- \item[\code{\e W}]When the \constant{LOCALE} and \constant{UNICODE} flags are not specified, matches any non-alphanumeric character; this ! is equivalent to the set \regexp{[{\textasciicircum}a-zA-Z0-9_]}. With \constant{LOCALE}, it will match any character not in the set \regexp{[0-9_]}, and not defined as a letter for the current locale. *************** *** 362,366 **** Note that match may differ from search using a regular expression ! beginning with \character{\^}: \character{\^} matches only at the start of the string, or in \constant{MULTILINE} mode also immediately following a newline. The ``match'' operation succeeds only if the --- 367,372 ---- Note that match may differ from search using a regular expression ! beginning with \character{\textasciicircum}: ! \character{\textasciicircum} matches only at the start of the string, or in \constant{MULTILINE} mode also immediately following a newline. The ``match'' operation succeeds only if the *************** *** 430,441 **** \begin{datadesc}{M} \dataline{MULTILINE} ! When specified, the pattern character \character{\^} matches at the ! beginning of the string and at the beginning of each line ! (immediately following each newline); and the pattern character \character{\$} matches at the end of the string and at the end of each ! line (immediately preceding each newline). By default, \character{\^} ! matches only at the beginning of the string, and \character{\$} only ! at the end of the string and immediately before the newline (if any) ! at the end of the string. \end{datadesc} --- 436,447 ---- \begin{datadesc}{M} \dataline{MULTILINE} ! When specified, the pattern character \character{\textasciicircum} ! matches at the beginning of the string and at the beginning of each ! line (immediately following each newline); and the pattern character \character{\$} matches at the end of the string and at the end of each ! line (immediately preceding each newline). By default, ! \character{\textasciicircum} matches only at the beginning of the ! string, and \character{\$} only at the end of the string and ! immediately before the newline (if any) at the end of the string. \end{datadesc} *************** *** 624,628 **** The optional second parameter \var{pos} gives an index in the string where the search is to start; it defaults to \code{0}. This is not ! completely equivalent to slicing the string; the \code{'\^'} pattern character matches at the real beginning of the string and at positions just after a newline, but not necessarily at the index where the search --- 630,635 ---- The optional second parameter \var{pos} gives an index in the string where the search is to start; it defaults to \code{0}. This is not ! completely equivalent to slicing the string; the ! \code{'\textasciicircum'} pattern character matches at the real beginning of the string and at positions just after a newline, but not necessarily at the index where the search From fdrake@users.sourceforge.net Thu Feb 14 15:22:06 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 14 Feb 2002 07:22:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.73,1.73.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv17139/lib Modified Files: Tag: release22-maint libre.tex Log Message: Consistently use \textasciicircum to produce a ^ character. LaTeX really falls flat on this one! Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.73 retrieving revision 1.73.6.1 diff -C2 -d -r1.73 -r1.73.6.1 *** libre.tex 29 Nov 2001 20:23:14 -0000 1.73 --- libre.tex 14 Feb 2002 15:22:04 -0000 1.73.6.1 *************** *** 94,99 **** specified, this matches any character including a newline. ! \item[\character{\^}] (Caret.) Matches the start of the string, and in ! \constant{MULTILINE} mode also matches immediately after each newline. \item[\character{\$}] Matches the end of the string or just before the --- 94,100 ---- specified, this matches any character including a newline. ! \item[\character{\textasciicircum}] (Caret.) Matches the start of the ! string, and in \constant{MULTILINE} mode also matches immediately ! after each newline. \item[\character{\$}] Matches the end of the string or just before the *************** *** 182,189 **** You can match the characters not within a range by \dfn{complementing} ! the set. This is indicated by including a \character{\^} as the first ! character of the set; \character{\^} elsewhere will simply match the ! \character{\^} character. For example, \regexp{[{\^}5]} will match ! any character except \character{5}. \item[\character{|}]\code{A|B}, where A and B can be arbitrary REs, --- 183,194 ---- You can match the characters not within a range by \dfn{complementing} ! the set. This is indicated by including a ! \character{\textasciicircum} as the first character of the set; ! \character{\textasciicircum} elsewhere will simply match the ! \character{\textasciicircum} character. For example, ! \regexp{[{\textasciicircum}5]} will match ! any character except \character{5}, and ! \regexp{[\textasciicircum\code{\textasciicircum}]} will match any character ! except \character{\textasciicircum}. \item[\character{|}]\code{A|B}, where A and B can be arbitrary REs, *************** *** 319,323 **** \item[\code{\e D}]Matches any non-digit character; this is ! equivalent to the set \regexp{[{\^}0-9]}. \item[\code{\e s}]Matches any whitespace character; this is --- 324,328 ---- \item[\code{\e D}]Matches any non-digit character; this is ! equivalent to the set \regexp{[{\textasciicircum}0-9]}. \item[\code{\e s}]Matches any whitespace character; this is *************** *** 325,329 **** \item[\code{\e S}]Matches any non-whitespace character; this is ! equivalent to the set \regexp{[\^\ \e t\e n\e r\e f\e v]}. \item[\code{\e w}]When the \constant{LOCALE} and \constant{UNICODE} --- 330,334 ---- \item[\code{\e S}]Matches any non-whitespace character; this is ! equivalent to the set \regexp{[\textasciicircum\ \e t\e n\e r\e f\e v]}. \item[\code{\e w}]When the \constant{LOCALE} and \constant{UNICODE} *************** *** 338,342 **** \item[\code{\e W}]When the \constant{LOCALE} and \constant{UNICODE} flags are not specified, matches any non-alphanumeric character; this ! is equivalent to the set \regexp{[{\^}a-zA-Z0-9_]}. With \constant{LOCALE}, it will match any character not in the set \regexp{[0-9_]}, and not defined as a letter for the current locale. --- 343,347 ---- \item[\code{\e W}]When the \constant{LOCALE} and \constant{UNICODE} flags are not specified, matches any non-alphanumeric character; this ! is equivalent to the set \regexp{[{\textasciicircum}a-zA-Z0-9_]}. With \constant{LOCALE}, it will match any character not in the set \regexp{[0-9_]}, and not defined as a letter for the current locale. *************** *** 362,366 **** Note that match may differ from search using a regular expression ! beginning with \character{\^}: \character{\^} matches only at the start of the string, or in \constant{MULTILINE} mode also immediately following a newline. The ``match'' operation succeeds only if the --- 367,372 ---- Note that match may differ from search using a regular expression ! beginning with \character{\textasciicircum}: ! \character{\textasciicircum} matches only at the start of the string, or in \constant{MULTILINE} mode also immediately following a newline. The ``match'' operation succeeds only if the *************** *** 430,441 **** \begin{datadesc}{M} \dataline{MULTILINE} ! When specified, the pattern character \character{\^} matches at the ! beginning of the string and at the beginning of each line ! (immediately following each newline); and the pattern character \character{\$} matches at the end of the string and at the end of each ! line (immediately preceding each newline). By default, \character{\^} ! matches only at the beginning of the string, and \character{\$} only ! at the end of the string and immediately before the newline (if any) ! at the end of the string. \end{datadesc} --- 436,447 ---- \begin{datadesc}{M} \dataline{MULTILINE} ! When specified, the pattern character \character{\textasciicircum} ! matches at the beginning of the string and at the beginning of each ! line (immediately following each newline); and the pattern character \character{\$} matches at the end of the string and at the end of each ! line (immediately preceding each newline). By default, ! \character{\textasciicircum} matches only at the beginning of the ! string, and \character{\$} only at the end of the string and ! immediately before the newline (if any) at the end of the string. \end{datadesc} *************** *** 624,628 **** The optional second parameter \var{pos} gives an index in the string where the search is to start; it defaults to \code{0}. This is not ! completely equivalent to slicing the string; the \code{'\^'} pattern character matches at the real beginning of the string and at positions just after a newline, but not necessarily at the index where the search --- 630,635 ---- The optional second parameter \var{pos} gives an index in the string where the search is to start; it defaults to \code{0}. This is not ! completely equivalent to slicing the string; the ! \code{'\textasciicircum'} pattern character matches at the real beginning of the string and at positions just after a newline, but not necessarily at the index where the search From fdrake@users.sourceforge.net Thu Feb 14 15:26:17 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 14 Feb 2002 07:26:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.60.2.2,1.60.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv18828/lib Modified Files: Tag: release21-maint libre.tex Log Message: Consistently use \textasciicircum to produce a ^ character. LaTeX really falls flat on this one! Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.60.2.2 retrieving revision 1.60.2.3 diff -C2 -d -r1.60.2.2 -r1.60.2.3 *** libre.tex 12 Jul 2001 14:15:03 -0000 1.60.2.2 --- libre.tex 14 Feb 2002 15:26:15 -0000 1.60.2.3 *************** *** 94,99 **** specified, this matches any character including a newline. ! \item[\character{\^}] (Caret.) Matches the start of the string, and in ! \constant{MULTILINE} mode also matches immediately after each newline. \item[\character{\$}] Matches the end of the string, and in --- 94,100 ---- specified, this matches any character including a newline. ! \item[\character{\textasciicircum}] (Caret.) Matches the start of the ! string, and in \constant{MULTILINE} mode also matches immediately ! after each newline. \item[\character{\$}] Matches the end of the string, and in *************** *** 169,175 **** You can match the characters not within a range by \dfn{complementing} the set. This is indicated by including a ! \character{\^} as the first character of the set; \character{\^} elsewhere will ! simply match the \character{\^} character. For example, \regexp{[{\^}5]} ! will match any character except \character{5}. \item[\character{|}]\code{A|B}, where A and B can be arbitrary REs, --- 170,179 ---- You can match the characters not within a range by \dfn{complementing} the set. This is indicated by including a ! \character{\textasciicircum} as the first character of the set; ! \character{\textasciicircum} elsewhere will simply match the ! \character{\textasciicircum} character. For example, ! \regexp{[{\textasciicircum}5]} will match any character except ! \character{5}, and \regexp{[\textasciicircum\code{\textasciicircum}]} ! will match any character except \character{\textasciicircum}. \item[\character{|}]\code{A|B}, where A and B can be arbitrary REs, *************** *** 301,305 **** \item[\code{\e D}]Matches any non-digit character; this is ! equivalent to the set \regexp{[{\^}0-9]}. \item[\code{\e s}]Matches any whitespace character; this is --- 305,309 ---- \item[\code{\e D}]Matches any non-digit character; this is ! equivalent to the set \regexp{[{\textasciicircum}0-9]}. \item[\code{\e s}]Matches any whitespace character; this is *************** *** 307,311 **** \item[\code{\e S}]Matches any non-whitespace character; this is ! equivalent to the set \regexp{[\^\ \e t\e n\e r\e f\e v]}. \item[\code{\e w}]When the \constant{LOCALE} and \constant{UNICODE} --- 311,315 ---- \item[\code{\e S}]Matches any non-whitespace character; this is ! equivalent to the set \regexp{[\textasciicircum\ \e t\e n\e r\e f\e v]}. \item[\code{\e w}]When the \constant{LOCALE} and \constant{UNICODE} *************** *** 320,324 **** \item[\code{\e W}]When the \constant{LOCALE} and \constant{UNICODE} flags are not specified, matches any non-alphanumeric character; this ! is equivalent to the set \regexp{[{\^}a-zA-Z0-9_]}. With \constant{LOCALE}, it will match any character not in the set \regexp{[0-9_]}, and not defined as a letter for the current locale. --- 324,328 ---- \item[\code{\e W}]When the \constant{LOCALE} and \constant{UNICODE} flags are not specified, matches any non-alphanumeric character; this ! is equivalent to the set \regexp{[{\textasciicircum}a-zA-Z0-9_]}. With \constant{LOCALE}, it will match any character not in the set \regexp{[0-9_]}, and not defined as a letter for the current locale. *************** *** 344,348 **** Note that match may differ from search using a regular expression ! beginning with \character{\^}: \character{\^} matches only at the start of the string, or in \constant{MULTILINE} mode also immediately following a newline. The ``match'' operation succeeds only if the --- 348,353 ---- Note that match may differ from search using a regular expression ! beginning with \character{\textasciicircum}: ! \character{\textasciicircum} matches only at the start of the string, or in \constant{MULTILINE} mode also immediately following a newline. The ``match'' operation succeeds only if the *************** *** 411,422 **** \begin{datadesc}{M} \dataline{MULTILINE} ! When specified, the pattern character \character{\^} matches at the ! beginning of the string and at the beginning of each line ! (immediately following each newline); and the pattern character \character{\$} matches at the end of the string and at the end of each line ! (immediately preceding each newline). ! By default, \character{\^} matches only at the beginning of the string, and ! \character{\$} only at the end of the string and immediately before the ! newline (if any) at the end of the string. \end{datadesc} --- 416,427 ---- \begin{datadesc}{M} \dataline{MULTILINE} ! When specified, the pattern character \character{\textasciicircum} ! matches at the beginning of the string and at the beginning of each ! line (immediately following each newline); and the pattern character \character{\$} matches at the end of the string and at the end of each line ! (immediately preceding each newline). By default, ! \character{\textasciicircum} matches only at the beginning of the ! string, and \character{\$} only at the end of the string and ! immediately before the newline (if any) at the end of the string. \end{datadesc} *************** *** 592,596 **** The optional second parameter \var{pos} gives an index in the string where the search is to start; it defaults to \code{0}. This is not ! completely equivalent to slicing the string; the \code{'\^'} pattern character matches at the real beginning of the string and at positions just after a newline, but not necessarily at the index where the search --- 597,602 ---- The optional second parameter \var{pos} gives an index in the string where the search is to start; it defaults to \code{0}. This is not ! completely equivalent to slicing the string; the ! \code{'\textasciicircum'} pattern character matches at the real beginning of the string and at positions just after a newline, but not necessarily at the index where the search From bwarsaw@users.sourceforge.net Fri Feb 15 04:08:57 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 14 Feb 2002 20:08:57 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.157,1.158 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv23103 Modified Files: pep-0000.txt Log Message: PEP 282, A Logging System, Trent Mick Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.157 retrieving revision 1.158 diff -C2 -d -r1.157 -r1.158 *** pep-0000.txt 11 Feb 2002 16:43:40 -0000 1.157 --- pep-0000.txt 15 Feb 2002 04:08:55 -0000 1.158 *************** *** 85,88 **** --- 85,89 ---- S 280 Optimizing access to globals van Rossum S 281 Loop Counter Iteration with range and xrange Hetland + S 282 A Logging System Mick Finished PEPs (done, implemented in CVS) *************** *** 246,249 **** --- 247,251 ---- S 280 Optimizing access to globals van Rossum S 281 Loop Counter Iteration with range and xrange Hetland + S 282 A Logging System Mick SR 666 Reject Foolish Indentation Creighton *************** *** 287,290 **** --- 289,293 ---- von Loewis, Martin loewis@informatik.hu-berlin.de McMillan, Gordon gmcm@hypernet.com + Mick, Trent trentm@activestate.com Montanaro, Skip skip@pobox.com Moore, Paul gustav@morpheus.demon.co.uk From bwarsaw@users.sourceforge.net Fri Feb 15 04:09:19 2002 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 14 Feb 2002 20:09:19 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0282.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv23194 Added Files: pep-0282.txt Log Message: PEP 282, A Logging System, Trent Mick (spell check and formatting by Barry) --- NEW FILE: pep-0282.txt --- PEP: 282 Title: A Logging System Version: $Revision: 1.1 $ Last-Modified: $Date: 2002/02/15 04:09:17 $ Author: trentm@activestate.com (Trent Mick) Status: Draft Type: Standards Track Created: 4-Feb-2002 Python-Version: 2.3 Post-History: Abstract This PEP describes a proposed logging package for Python's standard library. Basically the system involves the user creating one or more logging objects on which methods are called to log debugging notes/general information/warnings/errors/etc. Different logging 'levels' can be used to distinguish important messages from trivial ones. A registry of named singleton logger objects is maintained so that 1) different logical logging streams (or 'channels') exist (say, one for 'zope.zodb' stuff and another for 'mywebsite'-specific stuff) 2) one does not have to pass logger object references around. The system is configurable at runtime. This configuration mechanism allows one to tune the level and type of logging done while not touching the application itself. Motivation If a single logging mechanism is enshrined in the standard library, 1) logging is more likely to be done 'well', and 2) multiple libraries will be able to be integrated into larger applications which can be logged reasonably coherently. Influences This proposal was put together after having somewhat studied the following logging packages: o java.util.logging in JDK 1.4 (a.k.a. JSR047) [1] o log4j [2] These two systems are *very* similar. o the Syslog package from the Protomatter project [3] o MAL's mx.Log package [4] This proposal will basically look like java.util.logging with a smattering of log4j. Simple Example This shows a very simple example of how the logging package can be used to generate simple logging output on stdout. --------- mymodule.py ------------------------------- import logging log = logging.getLogger("MyModule") def doit(): log.debug("doin' stuff") # do stuff ... ----------------------------------------------------- --------- myapp.py ---------------------------------- import mymodule, logging log = logging.getLogger("MyApp") log.info("start my app") try: mymodule.doit() except Exception, e: log.error("There was a problem doin' stuff.") log.info("end my app") ----------------------------------------------------- > python myapp.py 0 [myapp.py:4] INFO MyApp - start my app 36 [mymodule.py:5] DEBUG MyModule - doin' stuff 51 [myapp.py:9] INFO MyApp - end my app ^^ ^^^^^^^^^^^^ ^^^^ ^^^^^ ^^^^^^^^^^ | | | | `-- message | | | `-- logging name/channel | | `-- level | `-- location `-- time NOTE: Not sure exactly what the default format will look like yet. Control Flow [Note: excerpts from Java Logging Overview. [5]] Applications make logging calls on *Logger* objects. Loggers are organized in a hierarchical namespace and child Loggers may inherit some logging properties from their parents in the namespace. Notes on namespace: Logger names fit into a "dotted name" namespace, with dots (periods) indicating sub-namespaces. The namespace of logger objects therefore corresponds to a single tree data structure. "" is the root of the namespace "Zope" would be a child node of the root "Zope.ZODB" would be a child node of "Zope" These Logger objects allocate *LogRecord* objects which are passed to *Handler* objects for publication. Both Loggers and Handlers may use logging *levels* and (optionally) *Filters* to decide if they are interested in a particular LogRecord. When it is necessary to publish a LogRecord externally, a Handler can (optionally) use a *Formatter* to localize and format the message before publishing it to an I/O stream. Each Logger keeps track of a set of output Handlers. By default all Loggers also send their output to their parent Logger. But Loggers may also be configured to ignore Handlers higher up the tree. The APIs are structured so that calls on the Logger APIs can be cheap when logging is disabled. If logging is disabled for a given log level, then the Logger can make a cheap comparison test and return. If logging is enabled for a given log level, the Logger is still careful to minimize costs before passing the LogRecord into the Handlers. In particular, localization and formatting (which are relatively expensive) are deferred until the Handler requests them. Levels The logging levels, in increasing order of importance, are: DEBUG INFO WARN ERROR FATAL ALL This is consistent with log4j and Protomatter's Syslog and not with JSR047 which has a few more levels and some different names. Implementation-wise: these are just integer constants, to allow simple comparison of importance. See "What Logging Levels?" below for a debate on what standard levels should be defined. Loggers Each Logger object keeps track of a log level (or threshold) that it is interested in, and discards log requests below that level. The *LogManager* maintains a hierarchical namespace of named Logger objects. Generations are denoted with dot-separated names: Logger "foo" is the parent of Loggers "foo.bar" and "foo.baz". The main logging method is: class Logger: def log(self, level, msg, *args): """Log 'msg % args' at logging level 'level'.""" ... however convenience functions are defined for each logging level: def debug(self, msg, *args): ... def info(self, msg, *args): ... def warn(self, msg, *args): ... def error(self, msg, *args): ... def fatal(self, msg, *args): ... XXX How to defined a nice convenience function for logging an exception? mx.Log has something like this, doesn't it? XXX What about a .raising() convenience function? How about: def raising(self, exception, level=ERROR): ... It would create a log message describing an exception that is about to be raised. I don't like that 'level' is not first when it *is* first for .log(). Handlers Handlers are responsible for doing something useful with a given LogRecord. The following core Handlers will be implemented: - StreamHandler: A handler for writing to a file-like object. - FileHandler: A handler for writing to a single file or set of rotating files. More standard Handlers may be implemented if deemed desirable and feasible. Other interesting candidates: - SocketHandler: A handler for writing to remote TCP ports. - CreosoteHandler: A handler for writing to UDP packets, for low-cost logging. Jeff Bauer already had such a system [5]. - MemoryHandler: A handler that buffers log records in memory (JSR047). - SMTPHandler: Akin to log4j's SMTPAppender. - SyslogHandler: Akin to log4j's SyslogAppender. - NTEventLogHandler: Akin to log4j's NTEventLogAppender. Formatters A Formatter is responsible for converting a LogRecord to a string representation. A Handler may call its Formatter before writing a record. The following core Formatters will be implemented: - Formatter: Provide printf-like formatting, perhaps akin to log4j's PatternAppender. Other possible candidates for implementation: - XMLFormatter: Serialize a LogRecord according to a specific schema. Could copy the schema from JSR047's XMLFormatter or log4j's XMLAppender. - HTMLFormatter: Provide a simple HTML output of log information. (See log4j's HTMLAppender.) Filters A Filter can be called by a Logger or Handler to decide if a LogRecord should be logged. JSR047 and log4j have slightly different filtering interfaces. The former is simpler: class Filter: def isLoggable(self): """Return a boolean.""" The latter is modeled after Linux's ipchains (where Filter's can be chained with each filter either 'DENY'ing, 'ACCEPT'ing, or being 'NEUTRAL' on each check). I would probably favor to former because it is simpler and I don't immediate see the need for the latter. No filter implementations are currently proposed (other that the do nothing base class) because I don't have enough experience to know what kinds of filters would be common. Users can always subclass Filter for their own purposes. Log4j includes a few filters that might be interesting. Configuration Note: Configuration for the proposed logging system is currently under-specified. The main benefit of a logging system like this is that one can control how much and what logging output one gets from an application without changing that application's source code. Log4j and Syslog provide for configuration via an external XML file. Log4j and JSR047 provide for configuration via Java properties (similar to -D #define's to a C/C++ compiler). All three provide for configuration via API calls. Configuration includes the following: - What logging level a logger should be interested in. - What handlers should be attached to which loggers. - What filters should be attached to which handlers and loggers. - Specifying attributes specific to certain Handlers and Filters. - Defining the default configuration. - XXX Add others. In general each application will have its own requirements for how a user may configure logging output. One application (e.g. distutils) may want to control logging levels via '-q,--quiet,-v,--verbose' options to setup.py. Zope may want to configure logging via certain environment variables (e.g. 'STUPID_LOG_FILE' :). Komodo may want to configure logging via its preferences system. This PEP proposes to clearly document the API for configuring each of the above listed configurable elements and to define a reasonable default configuration. This PEP does not propose to define a general XML or .ini file configuration schema and the backend to parse it. It might, however, be worthwhile to define an abstraction of the configuration API to allow the expressiveness of Syslog configuration. Greg Wilson made this argument: In Protomatter [Syslog], you configure by saying "give me everything that matches these channel+level combinations", such as "server.error" and "database.*". The log4j "configure by inheritance" model, on the other hand, is very clever, but hard for non-programmers to manage without a GUI that essentially reduces it to Protomatter's. Case Scenarios This section presents a few usage scenarios which will be used to help decide how best to specify the logging API. (1) A short simple script. This script does not have many lines. It does not heavily use any third party modules (i.e. the only code doing any logging would be the main script). Only one logging channel is really needed and thus, the channel name is unnecessary. The user doesn't want to bother with logging system configuration much. (2) Medium sized app with C extension module. Includes a few Python modules and a main script. Employs, perhaps, a few logging channels. Includes a C extension module which might want to make logging calls as well. (3) Distutils. A large number of Python packages/modules. Perhaps (but not necessarily) a number of logging channels are used. Specifically needs to facilitate the controlling verbosity levels via simple command line options to 'setup.py'. (4) Large, possibly multi-language, app. E.g. Zope or (my experience) Komodo. (I don't expect this logging system to deal with any cross-language issues but it is something to think about.) Many channels are used. Many developers involved. People providing user support are possibly not the same people who developed the application. Users should be able to generate log files (i.e. configure logging) while reproducing a bug to send back to developers. Implementation XXX Details to follow consensus that this proposal is a good idea. What Logging Levels? The following are the logging levels defined by the systems I looked at: - log4j: DEBUG, INFO, WARN, ERROR, FATAL - syslog: DEBUG, INFO, WARNING, ERROR, FATAL - JSR047: FINEST, FINER, FINE, CONFIG, INFO, WARNING, SEVERE - zLOG (used by Zope): TRACE=-300 -- Trace messages DEBUG=-200 -- Debugging messages BLATHER=-100 -- Somebody shut this app up. INFO=0 -- For things like startup and shutdown. PROBLEM=100 -- This isn't causing any immediate problems, but deserves attention. WARNING=100 -- A wishy-washy alias for PROBLEM. ERROR=200 -- This is going to have adverse effects. PANIC=300 -- We're dead! - mx.Log: SYSTEM_DEBUG SYSTEM_INFO SYSTEM_UNIMPORTANT SYSTEM_MESSAGE SYSTEM_WARNING SYSTEM_IMPORTANT SYSTEM_CANCEL SYSTEM_ERROR SYSTEM_PANIC SYSTEM_FATAL The current proposal is to copy log4j. XXX I suppose I could see adding zLOG's "TRACE" level, but I am not sure of the usefulness of others. Static Logging Methods (as per Syslog)? Both zLOG and Syslog provide module-level logging functions rather (or in addition to) logging methods on a created Logger object. XXX Is this something that is deemed worth including? Pros: - It would make the simplest case shorter: import logging logging.error("Something is wrong") instead of import logging log = logging.getLogger("") log.error("Something is wrong") Cons: - It provides more than one way to do it. - It encourages logging without a channel name, because this mechanism would likely be implemented by implicitly logging on the root (and nameless) logger of the hierarchy. References [1] java.util.logging http://java.sun.com/j2se/1.4/docs/guide/util/logging/ [2] log4j: a Java logging package http://jakarta.apache.org/log4j/docs/index.html [3] Protomatter's Syslog http://protomatter.sourceforge.net/1.1.6/index.html http://protomatter.sourceforge.net/1.1.6/javadoc/com/protomatter/syslog/syslog-whitepaper.html [4] MAL mentions his mx.Log logging module: http://mail.python.org/pipermail/python-dev/2002-February/019767.html [5] Jeff Bauer's Mr. Creosote http://starship.python.net/crew/jbauer/creosote/ Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil fill-column: 70 End: From fdrake@users.sourceforge.net Fri Feb 15 04:13:01 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 14 Feb 2002 20:13:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib email.tex,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv23708 Modified Files: email.tex Log Message: The "%" character does not need to be escaped in verbatim environments. This closes SF bug #517811. Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** email.tex 16 Nov 2001 22:16:04 -0000 1.9 --- email.tex 15 Feb 2002 04:12:59 -0000 1.10 *************** *** 354,358 **** # me == the sender's email address # you == the recipient's email address ! msg['Subject'] = 'The contents of \%s' \% textfile msg['From'] = me msg['To'] = you --- 354,358 ---- # me == the sender's email address # you == the recipient's email address ! msg['Subject'] = 'The contents of %s' % textfile msg['From'] = me msg['To'] = you *************** *** 481,485 **** # Create the enclosing (outer) message outer = MIMEBase('multipart', 'mixed') ! outer['Subject'] = 'Contents of directory \%s' \% os.path.abspath(dir) outer['To'] = sender outer['From'] = COMMASPACE.join(recips) --- 481,485 ---- # Create the enclosing (outer) message outer = MIMEBase('multipart', 'mixed') ! outer['Subject'] = 'Contents of directory %s' % os.path.abspath(dir) outer['To'] = sender outer['From'] = COMMASPACE.join(recips) *************** *** 618,622 **** # Use a generic bag-of-bits extension ext = '.bin' ! filename = 'part-\%03d\%s' \% (counter, ext) counter += 1 fp = open(os.path.join(dir, filename), 'wb') --- 618,622 ---- # Use a generic bag-of-bits extension ext = '.bin' ! filename = 'part-%03d%s' % (counter, ext) counter += 1 fp = open(os.path.join(dir, filename), 'wb') From fdrake@users.sourceforge.net Fri Feb 15 04:21:47 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 14 Feb 2002 20:21:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib email.tex,1.9,1.9.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv25061 Modified Files: Tag: release22-maint email.tex Log Message: The "%" character does not need to be escaped in verbatim environments. This closes SF bug #517811. Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.9 retrieving revision 1.9.6.1 diff -C2 -d -r1.9 -r1.9.6.1 *** email.tex 16 Nov 2001 22:16:04 -0000 1.9 --- email.tex 15 Feb 2002 04:21:45 -0000 1.9.6.1 *************** *** 354,358 **** # me == the sender's email address # you == the recipient's email address ! msg['Subject'] = 'The contents of \%s' \% textfile msg['From'] = me msg['To'] = you --- 354,358 ---- # me == the sender's email address # you == the recipient's email address ! msg['Subject'] = 'The contents of %s' % textfile msg['From'] = me msg['To'] = you *************** *** 481,485 **** # Create the enclosing (outer) message outer = MIMEBase('multipart', 'mixed') ! outer['Subject'] = 'Contents of directory \%s' \% os.path.abspath(dir) outer['To'] = sender outer['From'] = COMMASPACE.join(recips) --- 481,485 ---- # Create the enclosing (outer) message outer = MIMEBase('multipart', 'mixed') ! outer['Subject'] = 'Contents of directory %s' % os.path.abspath(dir) outer['To'] = sender outer['From'] = COMMASPACE.join(recips) *************** *** 618,622 **** # Use a generic bag-of-bits extension ext = '.bin' ! filename = 'part-\%03d\%s' \% (counter, ext) counter += 1 fp = open(os.path.join(dir, filename), 'wb') --- 618,622 ---- # Use a generic bag-of-bits extension ext = '.bin' ! filename = 'part-%03d%s' % (counter, ext) counter += 1 fp = open(os.path.join(dir, filename), 'wb') From fdrake@users.sourceforge.net Fri Feb 15 14:35:12 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 15 Feb 2002 06:35:12 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/mac libmac.tex,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory usw-pr-cvs1:/tmp/cvs-serv21534/mac Modified Files: libmac.tex Log Message: Added deprecatioon information for mac.xstat(). This closes SF bug #505150. Index: libmac.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/libmac.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libmac.tex 14 Oct 2000 05:39:08 -0000 1.21 --- libmac.tex 15 Feb 2002 14:35:09 -0000 1.22 *************** *** 32,36 **** values in MacPython. ! One additional function is available: \begin{funcdesc}{xstat}{path} --- 32,37 ---- values in MacPython. ! One additional function is available, but only under Classic MacPython, ! not under Carbon MacPython: \begin{funcdesc}{xstat}{path} *************** *** 38,41 **** --- 39,48 ---- with three additional values appended: the size of the resource fork of the file and its 4-character creator and type. + Availability: Classic MacPython only. + \deprecated{2.3}{Use the \function{\refmodule{macfs}.FSSpec()} + function to get an FSSpec object for the file, then + use the \method{GetCreatorType()} method to get the + creator and type information. It will no longer be + possible to get the size of the resource fork.} \end{funcdesc} From fdrake@users.sourceforge.net Fri Feb 15 14:40:54 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 15 Feb 2002 06:40:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/mac libmac.tex,1.21,1.21.24.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory usw-pr-cvs1:/tmp/cvs-serv23202/mac Modified Files: Tag: release22-maint libmac.tex Log Message: Added deprecatioon information for mac.xstat(). This closes SF bug #505150. Index: libmac.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/libmac.tex,v retrieving revision 1.21 retrieving revision 1.21.24.1 diff -C2 -d -r1.21 -r1.21.24.1 *** libmac.tex 14 Oct 2000 05:39:08 -0000 1.21 --- libmac.tex 15 Feb 2002 14:40:52 -0000 1.21.24.1 *************** *** 32,36 **** values in MacPython. ! One additional function is available: \begin{funcdesc}{xstat}{path} --- 32,37 ---- values in MacPython. ! One additional function is available, but only under Classic MacPython, ! not under Carbon MacPython: \begin{funcdesc}{xstat}{path} *************** *** 38,41 **** --- 39,48 ---- with three additional values appended: the size of the resource fork of the file and its 4-character creator and type. + Availability: Classic MacPython only. + \deprecated{2.3}{Use the \function{\refmodule{macfs}.FSSpec()} + function to get an FSSpec object for the file, then + use the \method{GetCreatorType()} method to get the + creator and type information. It will no longer be + possible to get the size of the resource fork.} \end{funcdesc} From montanaro@users.sourceforge.net Fri Feb 15 20:36:21 2002 From: montanaro@users.sourceforge.net (Skip Montanaro) Date: Fri, 15 Feb 2002 12:36:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libsignal.tex,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv21972 Modified Files: libsignal.tex Log Message: note that the alarm function is not available on Windows. Index: libsignal.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsignal.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libsignal.tex 6 Jul 2001 20:30:11 -0000 1.21 --- libsignal.tex 15 Feb 2002 20:36:19 -0000 1.22 *************** *** 104,109 **** alarm is canceled. The return value is the number of seconds remaining before a previously scheduled alarm. If the return value ! is zero, no alarm is currently scheduled. (See the \UNIX{} man page ! \manpage{alarm}{2}.) \end{funcdesc} --- 104,109 ---- alarm is canceled. The return value is the number of seconds remaining before a previously scheduled alarm. If the return value ! is zero, no alarm is currently scheduled. Not on Windows. (See the ! \UNIX{} man page \manpage{alarm}{2}.) \end{funcdesc} *************** *** 121,126 **** \begin{funcdesc}{pause}{} Cause the process to sleep until a signal is received; the ! appropriate handler will then be called. Returns nothing. (See the ! \UNIX{} man page \manpage{signal}{2}.) \end{funcdesc} --- 121,126 ---- \begin{funcdesc}{pause}{} Cause the process to sleep until a signal is received; the ! appropriate handler will then be called. Returns nothing. Not on ! Windows. (See the \UNIX{} man page \manpage{signal}{2}.) \end{funcdesc} From fdrake@users.sourceforge.net Fri Feb 15 20:59:45 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 15 Feb 2002 12:59:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libsignal.tex,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv28337/lib Modified Files: libsignal.tex Log Message: Use the standard expression for the availability statement for alarm(). Index: libsignal.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsignal.tex,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** libsignal.tex 15 Feb 2002 20:36:19 -0000 1.22 --- libsignal.tex 15 Feb 2002 20:59:43 -0000 1.23 *************** *** 104,109 **** alarm is canceled. The return value is the number of seconds remaining before a previously scheduled alarm. If the return value ! is zero, no alarm is currently scheduled. Not on Windows. (See the ! \UNIX{} man page \manpage{alarm}{2}.) \end{funcdesc} --- 104,110 ---- alarm is canceled. The return value is the number of seconds remaining before a previously scheduled alarm. If the return value ! is zero, no alarm is currently scheduled. (See the \UNIX{} man page ! \manpage{alarm}{2}.) ! Availability: \UNIX. \end{funcdesc} From fdrake@users.sourceforge.net Fri Feb 15 21:00:19 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 15 Feb 2002 13:00:19 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libsignal.tex,1.21,1.21.18.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv28603/lib Modified Files: Tag: release22-maint libsignal.tex Log Message: Add an availability statement for alarm(). Index: libsignal.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsignal.tex,v retrieving revision 1.21 retrieving revision 1.21.18.1 diff -C2 -d -r1.21 -r1.21.18.1 *** libsignal.tex 6 Jul 2001 20:30:11 -0000 1.21 --- libsignal.tex 15 Feb 2002 21:00:17 -0000 1.21.18.1 *************** *** 106,109 **** --- 106,110 ---- is zero, no alarm is currently scheduled. (See the \UNIX{} man page \manpage{alarm}{2}.) + Availability: \UNIX. \end{funcdesc} From fdrake@users.sourceforge.net Fri Feb 15 21:00:37 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 15 Feb 2002 13:00:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libsignal.tex,1.19,1.19.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv28705/lib Modified Files: Tag: release21-maint libsignal.tex Log Message: Add an availability statement for alarm(). Index: libsignal.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsignal.tex,v retrieving revision 1.19 retrieving revision 1.19.6.1 diff -C2 -d -r1.19 -r1.19.6.1 *** libsignal.tex 10 Oct 2000 17:03:45 -0000 1.19 --- libsignal.tex 15 Feb 2002 21:00:35 -0000 1.19.6.1 *************** *** 106,109 **** --- 106,110 ---- is zero, no alarm is currently scheduled. (See the \UNIX{} man page \manpage{alarm}{2}.) + Availability: \UNIX. \end{funcdesc} From tim_one@users.sourceforge.net Sat Feb 16 07:26:29 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 15 Feb 2002 23:26:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_thread.py,1.9,1.10 test_threaded_import.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv30496/python/Lib/test Modified Files: test_thread.py test_threaded_import.py Log Message: SF bug #516372: test_thread: unhandled exc. in thread Fix exit races in test_thread.py and test_threaded_import.py. I suspect the bug is provokable only under Linux (where child threads seem to get lots of cycles before they get killed after the main thread exits), or on multi-processor machines running other OSes. Bugfix candidate. Index: test_thread.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_thread.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_thread.py 17 Jan 2001 21:51:36 -0000 1.9 --- test_thread.py 16 Feb 2002 07:26:27 -0000 1.10 *************** *** 98,105 **** print 'task', ident, 'leaving barrier', i mutex.acquire() ! running = running - 1 ! if running == 0: ! done.release() mutex.release() print '\n*** Barrier Test ***' --- 98,109 ---- print 'task', ident, 'leaving barrier', i mutex.acquire() ! running -= 1 ! # Must release mutex before releasing done, else the main thread can ! # exit and set mutex to None as part of global teardown; then ! # mutex.release() raises AttributeError. ! finished = running == 0 mutex.release() + if finished: + done.release() print '\n*** Barrier Test ***' Index: test_threaded_import.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_threaded_import.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_threaded_import.py 30 Aug 2001 05:16:13 -0000 1.4 --- test_threaded_import.py 16 Feb 2002 07:26:27 -0000 1.5 *************** *** 18,24 **** critical_section.acquire() N -= 1 ! if N == 0: ! done.release() critical_section.release() # Tricky: When regrtest imports this module, the thread running regrtest --- 18,28 ---- critical_section.acquire() N -= 1 ! # Must release critical_section before releasing done, else the main ! # thread can exit and set critical_section to None as part of global ! # teardown; then critical_section.release() raises AttributeError. ! finished = N == 0 critical_section.release() + if finished: + done.release() # Tricky: When regrtest imports this module, the thread running regrtest From tim_one@users.sourceforge.net Sat Feb 16 07:34:22 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 15 Feb 2002 23:34:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_StringIO.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv32747/python/Lib/test Modified Files: test_StringIO.py Log Message: Whitespace normalization. Index: test_StringIO.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_StringIO.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_StringIO.py 6 Jan 2002 17:15:05 -0000 1.11 --- test_StringIO.py 16 Feb 2002 07:34:19 -0000 1.12 *************** *** 77,81 **** # snippets to larger Unicode strings. This is tested by this # method. Note that cStringIO does not support this extension. ! f = self.MODULE.StringIO() f.write(self._line[:6]) --- 77,81 ---- # snippets to larger Unicode strings. This is tested by this # method. Note that cStringIO does not support this extension. ! f = self.MODULE.StringIO() f.write(self._line[:6]) From tim_one@users.sourceforge.net Sat Feb 16 07:34:21 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 15 Feb 2002 23:34:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/compiler pycodegen.py,1.59,1.60 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/compiler In directory usw-pr-cvs1:/tmp/cvs-serv32747/python/Lib/compiler Modified Files: pycodegen.py Log Message: Whitespace normalization. Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/pycodegen.py,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** pycodegen.py 21 Dec 2001 20:03:35 -0000 1.59 --- pycodegen.py 16 Feb 2002 07:34:19 -0000 1.60 *************** *** 1188,1192 **** def get_module(self): return self ! def visitDiscard(self, node): # XXX Discard means it's an expression. Perhaps this is a bad --- 1188,1192 ---- def get_module(self): return self ! def visitDiscard(self, node): # XXX Discard means it's an expression. Perhaps this is a bad From tim_one@users.sourceforge.net Sat Feb 16 07:34:21 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 15 Feb 2002 23:34:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib dumbdbm.py,1.16,1.17 ftplib.py,1.63,1.64 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv32747/python/Lib Modified Files: dumbdbm.py ftplib.py Log Message: Whitespace normalization. Index: dumbdbm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dumbdbm.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** dumbdbm.py 21 Dec 2001 05:13:37 -0000 1.16 --- dumbdbm.py 16 Feb 2002 07:34:19 -0000 1.17 *************** *** 151,155 **** if self._index is not None: self._commit() ! --- 151,155 ---- if self._index is not None: self._commit() ! Index: ftplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ftplib.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** ftplib.py 28 Dec 2001 20:54:55 -0000 1.63 --- ftplib.py 16 Feb 2002 07:34:19 -0000 1.64 *************** *** 352,362 **** if not acct: acct = '' if user == 'anonymous' and passwd in ('', '-'): ! # If there is no anonymous ftp password specified ! # then we'll just use anonymous@ ! # We don't send any other thing because: ! # - We want to remain anonymous ! # - We want to stop SPAM ! # - We don't want to let ftp sites to discriminate by the user, ! # host or country. passwd = passwd + 'anonymous@' resp = self.sendcmd('USER ' + user) --- 352,362 ---- if not acct: acct = '' if user == 'anonymous' and passwd in ('', '-'): ! # If there is no anonymous ftp password specified ! # then we'll just use anonymous@ ! # We don't send any other thing because: ! # - We want to remain anonymous ! # - We want to stop SPAM ! # - We don't want to let ftp sites to discriminate by the user, ! # host or country. passwd = passwd + 'anonymous@' resp = self.sendcmd('USER ' + user) From lemburg@users.sourceforge.net Sat Feb 16 10:44:36 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Sat, 16 Feb 2002 02:44:36 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep2html.py,1.30,1.31 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv3767 Modified Files: pep2html.py Log Message: Fix for the case when no PEP title is given. Index: pep2html.py =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** pep2html.py 4 Feb 2002 22:38:27 -0000 1.30 --- pep2html.py 16 Feb 2002 10:44:32 -0000 1.31 *************** *** 140,144 **** if basename <> 'pep-0000.txt': print >> fo, '[index]' ! print >> fo, '[PEP source]' % int(pep) print >> fo, '' print >> fo, '
\n' --- 140,145 ---- if basename <> 'pep-0000.txt': print >> fo, '[index]' ! if pep: ! print >> fo, '[PEP source]' % int(pep) print >> fo, '' print >> fo, '
\n
' From lemburg@users.sourceforge.net Sat Feb 16 18:23:32 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Sat, 16 Feb 2002 10:23:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.355,1.356 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv17421/Misc Modified Files: NEWS Log Message: Break SSL support out of _socket module and place it into a new helper module _ssl. The support for the RAND_* APIs in _ssl is now only enabled for OpenSSL 0.9.5 and up since they were added in that release. Note that socketmodule.* should really be renamed to _socket.* -- unfortunately, this seems to lose the CVS history of the file. Please review and test... I was only able to test the header file chaos in socketmodule.c/h on Linux. The test run through fine and compiles don't give errors or warnings. WARNING: This patch does *not* include changes to the various non-Unix build process files. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.355 retrieving revision 1.356 diff -C2 -d -r1.355 -r1.356 *** NEWS 10 Feb 2002 21:42:47 -0000 1.355 --- NEWS 16 Feb 2002 18:23:30 -0000 1.356 *************** *** 22,25 **** --- 22,29 ---- Library + - socket module: the SSL support was broken out of the main + _socket module C helper and placed into a new _ssl helper + which now gets imported by socket.py if available and working. + - encodings package: added aliases for all supported IANA character sets From lemburg@users.sourceforge.net Sat Feb 16 18:23:32 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Sat, 16 Feb 2002 10:23:32 -0800 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.81,1.82 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv17421 Modified Files: setup.py Log Message: Break SSL support out of _socket module and place it into a new helper module _ssl. The support for the RAND_* APIs in _ssl is now only enabled for OpenSSL 0.9.5 and up since they were added in that release. Note that socketmodule.* should really be renamed to _socket.* -- unfortunately, this seems to lose the CVS history of the file. Please review and test... I was only able to test the header file chaos in socketmodule.c/h on Linux. The test run through fine and compiles don't give errors or warnings. WARNING: This patch does *not* include changes to the various non-Unix build process files. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** setup.py 14 Feb 2002 01:25:37 -0000 1.81 --- setup.py 16 Feb 2002 18:23:29 -0000 1.82 *************** *** 174,192 **** try: imp.load_dynamic(ext.name, ext_filename) ! except ImportError: ! self.announce('WARNING: removing "%s" since importing it failed' % ! ext.name) ! assert not self.inplace ! fullname = self.get_ext_fullname(ext.name) ! ext_filename = os.path.join(self.build_lib, ! self.get_ext_filename(fullname)) ! os.remove(ext_filename) ! # XXX -- This relies on a Vile HACK in ! # distutils.command.build_ext.build_extension(). The ! # _built_objects attribute is stored there strictly for ! # use here. ! for filename in self._built_objects: ! os.remove(filename) def get_platform (self): --- 174,197 ---- try: imp.load_dynamic(ext.name, ext_filename) ! except ImportError, why: ! if 1: ! self.announce('*** WARNING: removing "%s" since importing it' ! ' failed: %s' % (ext.name, why)) ! assert not self.inplace ! fullname = self.get_ext_fullname(ext.name) ! ext_filename = os.path.join(self.build_lib, ! self.get_ext_filename(fullname)) ! os.remove(ext_filename) ! ! # XXX -- This relies on a Vile HACK in ! # distutils.command.build_ext.build_extension(). The ! # _built_objects attribute is stored there strictly for ! # use here. ! for filename in self._built_objects: ! os.remove(filename) ! else: ! self.announce('*** WARNING: importing extension "%s" ' ! 'failed: %s' % (ext.name, why)) def get_platform (self): *************** *** 360,364 **** # socket(2) ! # Detect SSL support for the socket module ssl_incs = find_file('openssl/ssl.h', inc_dirs, ['/usr/local/ssl/include', --- 365,370 ---- # socket(2) ! exts.append( Extension('_socket', ['socketmodule.c']) ) ! # Detect SSL support for the socket module (via _ssl) ssl_incs = find_file('openssl/ssl.h', inc_dirs, ['/usr/local/ssl/include', *************** *** 373,383 **** 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 --- 379,386 ---- if (ssl_incs is not None and ssl_libs is not None): ! exts.append( Extension('_ssl', ['_ssl.c'], include_dirs = ssl_incs, library_dirs = ssl_libs, ! libraries = ['ssl', 'crypto']) ) # Modules that provide persistent dictionary-like semantics. You will From lemburg@users.sourceforge.net Sat Feb 16 18:23:32 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Sat, 16 Feb 2002 10:23:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib socket.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17421/Lib Modified Files: socket.py Log Message: Break SSL support out of _socket module and place it into a new helper module _ssl. The support for the RAND_* APIs in _ssl is now only enabled for OpenSSL 0.9.5 and up since they were added in that release. Note that socketmodule.* should really be renamed to _socket.* -- unfortunately, this seems to lose the CVS history of the file. Please review and test... I was only able to test the header file chaos in socketmodule.c/h on Linux. The test run through fine and compiles don't give errors or warnings. WARNING: This patch does *not* include changes to the various non-Unix build process files. Index: socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** socket.py 18 Dec 2001 22:22:25 -0000 1.16 --- socket.py 16 Feb 2002 18:23:30 -0000 1.17 *************** *** 40,43 **** --- 40,47 ---- from _socket import * + try: + from _ssl import * + except ImportError: + pass import os, sys *************** *** 57,61 **** try: ! _realsslcall = _socket.ssl except AttributeError: pass # No ssl --- 61,65 ---- try: ! _realsslcall = _ssl.ssl except AttributeError: pass # No ssl From lemburg@users.sourceforge.net Sat Feb 16 18:23:32 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Sat, 16 Feb 2002 10:23:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _ssl.c,NONE,1.1 socketmodule.h,NONE,1.1 Setup.dist,1.24,1.25 socketmodule.c,1.203,1.204 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17421/Modules Modified Files: Setup.dist socketmodule.c Added Files: _ssl.c socketmodule.h Log Message: Break SSL support out of _socket module and place it into a new helper module _ssl. The support for the RAND_* APIs in _ssl is now only enabled for OpenSSL 0.9.5 and up since they were added in that release. Note that socketmodule.* should really be renamed to _socket.* -- unfortunately, this seems to lose the CVS history of the file. Please review and test... I was only able to test the header file chaos in socketmodule.c/h on Linux. The test run through fine and compiles don't give errors or warnings. WARNING: This patch does *not* include changes to the various non-Unix build process files. --- NEW FILE: _ssl.c --- /* SSL socket module SSL support based on patches by Brian E Gallew and Laszlo Kovacs. This module is imported by socket.py. It should *not* be used directly. */ #include "Python.h" /* Include symbols from _socket module */ #include "socketmodule.h" /* Include OpenSSL header files */ #include "openssl/rsa.h" #include "openssl/crypto.h" #include "openssl/x509.h" #include "openssl/pem.h" #include "openssl/ssl.h" #include "openssl/err.h" #include "openssl/rand.h" /* SSL error object */ static PyObject *PySSLErrorObject; /* SSL socket object */ #define X509_NAME_MAXLEN 256 /* RAND_* APIs got added to OpenSSL in 0.9.5 */ #if OPENSSL_VERSION_NUMBER >= 0x0090500fL # define HAVE_OPENSSL_RAND 1 #else # undef HAVE_OPENSSL_RAND #endif typedef struct { PyObject_HEAD PySocketSockObject *Socket; /* Socket on which we're layered */ SSL_CTX* ctx; SSL* ssl; X509* server_cert; BIO* sbio; char server[X509_NAME_MAXLEN]; char issuer[X509_NAME_MAXLEN]; } PySSLObject; staticforward PyTypeObject PySSL_Type; staticforward PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args); staticforward PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args); #define PySSLObject_Check(v) ((v)->ob_type == &PySSL_Type) /* XXX It might be helpful to augment the error message generated below with the name of the SSL function that generated the error. I expect it's obvious most of the time. */ static PyObject * PySSL_SetError(PySSLObject *obj, int ret) { PyObject *v, *n, *s; char *errstr; int err; assert(ret <= 0); err = SSL_get_error(obj->ssl, ret); n = PyInt_FromLong(err); if (n == NULL) return NULL; v = PyTuple_New(2); if (v == NULL) { Py_DECREF(n); return NULL; } switch (SSL_get_error(obj->ssl, ret)) { case SSL_ERROR_ZERO_RETURN: errstr = "TLS/SSL connection has been closed"; break; case SSL_ERROR_WANT_READ: errstr = "The operation did not complete (read)"; break; case SSL_ERROR_WANT_WRITE: errstr = "The operation did not complete (write)"; break; case SSL_ERROR_WANT_X509_LOOKUP: errstr = "The operation did not complete (X509 lookup)"; break; case SSL_ERROR_SYSCALL: case SSL_ERROR_SSL: { unsigned long e = ERR_get_error(); if (e == 0) { /* an EOF was observed that violates the protocol */ errstr = "EOF occurred in violation of protocol"; } else if (e == -1) { /* the underlying BIO reported an I/O error */ Py_DECREF(v); Py_DECREF(n); return obj->Socket->errorhandler(); } else { /* XXX Protected by global interpreter lock */ errstr = ERR_error_string(e, NULL); } break; } default: errstr = "Invalid error code"; } s = PyString_FromString(errstr); if (s == NULL) { Py_DECREF(v); Py_DECREF(n); } PyTuple_SET_ITEM(v, 0, n); PyTuple_SET_ITEM(v, 1, s); PyErr_SetObject(PySSLErrorObject, v); return NULL; } /* This is a C function to be called for new object initialization */ static PySSLObject * newPySSLObject(PySocketSockObject *Sock, char *key_file, char *cert_file) { PySSLObject *self; char *errstr = NULL; int ret; self = PyObject_New(PySSLObject, &PySSL_Type); /* Create new object */ if (self == NULL){ errstr = "newPySSLObject error"; goto fail; } memset(self->server, '\0', sizeof(char) * X509_NAME_MAXLEN); memset(self->issuer, '\0', sizeof(char) * X509_NAME_MAXLEN); self->server_cert = NULL; self->ssl = NULL; self->ctx = NULL; self->Socket = NULL; if ((key_file && !cert_file) || (!key_file && cert_file)) { errstr = "Both the key & certificate files must be specified"; goto fail; } self->ctx = SSL_CTX_new(SSLv23_method()); /* Set up context */ if (self->ctx == NULL) { errstr = "SSL_CTX_new error"; goto fail; } if (key_file) { if (SSL_CTX_use_PrivateKey_file(self->ctx, key_file, SSL_FILETYPE_PEM) < 1) { errstr = "SSL_CTX_use_PrivateKey_file error"; goto fail; } if (SSL_CTX_use_certificate_chain_file(self->ctx, cert_file) < 1) { errstr = "SSL_CTX_use_certificate_chain_file error"; goto fail; } } SSL_CTX_set_verify(self->ctx, SSL_VERIFY_NONE, NULL); /* set verify lvl */ self->ssl = SSL_new(self->ctx); /* New ssl struct */ SSL_set_fd(self->ssl, Sock->sock_fd); /* Set the socket for SSL */ SSL_set_connect_state(self->ssl); /* Actually negotiate SSL connection */ /* XXX If SSL_connect() returns 0, it's also a failure. */ ret = SSL_connect(self->ssl); if (ret <= 0) { PySSL_SetError(self, ret); goto fail; } self->ssl->debug = 1; if ((self->server_cert = SSL_get_peer_certificate(self->ssl))) { X509_NAME_oneline(X509_get_subject_name(self->server_cert), self->server, X509_NAME_MAXLEN); X509_NAME_oneline(X509_get_issuer_name(self->server_cert), self->issuer, X509_NAME_MAXLEN); } self->Socket = Sock; Py_INCREF(self->Socket); return self; fail: if (errstr) PyErr_SetString(PySSLErrorObject, errstr); Py_DECREF(self); return NULL; } /* This is the Python function called for new object initialization */ static PyObject * PySocket_ssl(PyObject *self, PyObject *args) { PySSLObject *rv; PySocketSockObject *Sock; char *key_file = NULL; char *cert_file = NULL; if (!PyArg_ParseTuple(args, "O!|zz:ssl", PySocketModule.Sock_Type, (PyObject*)&Sock, &key_file, &cert_file)) return NULL; rv = newPySSLObject(Sock, key_file, cert_file); if (rv == NULL) return NULL; return (PyObject *)rv; } static char ssl_doc[] = "ssl(socket, [keyfile, certfile]) -> sslobject"; /* SSL object methods */ static PyObject * PySSL_server(PySSLObject *self) { return PyString_FromString(self->server); } static PyObject * PySSL_issuer(PySSLObject *self) { return PyString_FromString(self->issuer); } static void PySSL_dealloc(PySSLObject *self) { if (self->server_cert) /* Possible not to have one? */ X509_free (self->server_cert); if (self->ssl) SSL_free(self->ssl); if (self->ctx) SSL_CTX_free(self->ctx); Py_XDECREF(self->Socket); PyObject_Del(self); } static PyObject *PySSL_SSLwrite(PySSLObject *self, PyObject *args) { char *data; int len; if (!PyArg_ParseTuple(args, "s#:write", &data, &len)) return NULL; Py_BEGIN_ALLOW_THREADS len = SSL_write(self->ssl, data, len); Py_END_ALLOW_THREADS if (len > 0) return PyInt_FromLong(len); else return PySSL_SetError(self, len); } static char PySSL_SSLwrite_doc[] = "write(s) -> len\n\ \n\ Writes the string s into the SSL object. Returns the number\n\ of bytes written."; static PyObject *PySSL_SSLread(PySSLObject *self, PyObject *args) { PyObject *buf; int count = 0; int len = 1024; if (!PyArg_ParseTuple(args, "|i:read", &len)) return NULL; if (!(buf = PyString_FromStringAndSize((char *) 0, len))) return NULL; Py_BEGIN_ALLOW_THREADS count = SSL_read(self->ssl, PyString_AsString(buf), len); Py_END_ALLOW_THREADS if (count <= 0) { Py_DECREF(buf); return PySSL_SetError(self, count); } if (count != len && _PyString_Resize(&buf, count) < 0) return NULL; return buf; } static char PySSL_SSLread_doc[] = "read([len]) -> string\n\ \n\ Read up to len bytes from the SSL socket."; static PyMethodDef PySSLMethods[] = { {"write", (PyCFunction)PySSL_SSLwrite, METH_VARARGS, PySSL_SSLwrite_doc}, {"read", (PyCFunction)PySSL_SSLread, METH_VARARGS, PySSL_SSLread_doc}, {"server", (PyCFunction)PySSL_server, METH_NOARGS}, {"issuer", (PyCFunction)PySSL_issuer, METH_NOARGS}, {NULL, NULL} }; static PyObject *PySSL_getattr(PySSLObject *self, char *name) { return Py_FindMethod(PySSLMethods, (PyObject *)self, name); } staticforward PyTypeObject PySSL_Type = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "socket.SSL", /*tp_name*/ sizeof(PySSLObject), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ (destructor)PySSL_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ (getattrfunc)PySSL_getattr, /*tp_getattr*/ 0, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ }; #ifdef HAVE_OPENSSL_RAND /* helper routines for seeding the SSL PRNG */ static PyObject * PySSL_RAND_add(PyObject *self, PyObject *args) { char *buf; int len; double entropy; if (!PyArg_ParseTuple(args, "s#d:RAND_add", &buf, &len, &entropy)) return NULL; RAND_add(buf, len, entropy); Py_INCREF(Py_None); return Py_None; } static char PySSL_RAND_add_doc[] = "RAND_add(string, entropy)\n\ \n\ Mix string into the OpenSSL PRNG state. entropy (a float) is a lower\n\ bound on the entropy contained in string."; static PyObject * PySSL_RAND_status(PyObject *self) { return PyInt_FromLong(RAND_status()); } static char PySSL_RAND_status_doc[] = "RAND_status() -> 0 or 1\n\ \n\ Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not.\n\ It is necessary to seed the PRNG with RAND_add() on some platforms before\n\ using the ssl() function."; static PyObject * PySSL_RAND_egd(PyObject *self, PyObject *arg) { int bytes; if (!PyString_Check(arg)) return PyErr_Format(PyExc_TypeError, "RAND_egd() expected string, found %s", arg->ob_type->tp_name); bytes = RAND_egd(PyString_AS_STRING(arg)); if (bytes == -1) { PyErr_SetString(PySSLErrorObject, "EGD connection failed or EGD did not return " "enough data to seed the PRNG"); return NULL; } return PyInt_FromLong(bytes); } static char PySSL_RAND_egd_doc[] = "RAND_egd(path) -> bytes\n\ \n\ Queries the entropy gather daemon (EGD) on socket path. Returns number\n\ of bytes read. Raises socket.sslerror if connection to EGD fails or\n\ if it does provide enough data to seed PRNG."; #endif /* List of functions exported by this module. */ static PyMethodDef PySSL_methods[] = { {"ssl", PySocket_ssl, METH_VARARGS, ssl_doc}, #ifdef HAVE_OPENSSL_RAND {"RAND_add", PySSL_RAND_add, METH_VARARGS, PySSL_RAND_add_doc}, {"RAND_egd", PySSL_RAND_egd, METH_O, PySSL_RAND_egd_doc}, {"RAND_status", (PyCFunction)PySSL_RAND_status, METH_NOARGS, PySSL_RAND_status_doc}, #endif {NULL, NULL} /* Sentinel */ }; static char module_doc[] = "Implementation module for SSL socket operations. See the socket module\n\ for documentation."; DL_EXPORT(void) init_ssl(void) { PyObject *m, *d; PySSL_Type.ob_type = &PyType_Type; m = Py_InitModule3("_ssl", PySSL_methods, module_doc); d = PyModule_GetDict(m); /* Load _socket module and its C API */ if (PySocketModule_ImportModuleAndAPI()) return; /* Init OpenSSL */ SSL_load_error_strings(); SSLeay_add_ssl_algorithms(); /* Add symbols to module dict */ PySSLErrorObject = PyErr_NewException("socket.sslerror", NULL, NULL); if (PySSLErrorObject == NULL) return; PyDict_SetItemString(d, "sslerror", PySSLErrorObject); if (PyDict_SetItemString(d, "SSLType", (PyObject *)&PySSL_Type) != 0) return; PyModule_AddIntConstant(m, "SSL_ERROR_ZERO_RETURN", SSL_ERROR_ZERO_RETURN); PyModule_AddIntConstant(m, "SSL_ERROR_WANT_READ", SSL_ERROR_WANT_READ); PyModule_AddIntConstant(m, "SSL_ERROR_WANT_WRITE", SSL_ERROR_WANT_WRITE); PyModule_AddIntConstant(m, "SSL_ERROR_WANT_X509_LOOKUP", SSL_ERROR_WANT_X509_LOOKUP); PyModule_AddIntConstant(m, "SSL_ERROR_SYSCALL", SSL_ERROR_SYSCALL); PyModule_AddIntConstant(m, "SSL_ERROR_SSL", SSL_ERROR_SSL); } --- NEW FILE: socketmodule.h --- /* Socket module header file */ /* Includes needed for the sockaddr_* symbols below */ #ifndef MS_WINDOWS # include # include # if !(defined(__BEOS__) || defined(__CYGWIN__) || (defined(PYOS_OS2) && defined(PYCC_VACPP))) # include # endif #else /* MS_WINDOWS */ # include #endif #ifdef HAVE_SYS_UN_H # include #else # undef AF_UNIX #endif #ifdef HAVE_NETPACKET_PACKET_H # include # include # include #endif #ifndef Py__SOCKET_H #define Py__SOCKET_H #ifdef __cplusplus extern "C" { #endif /* Python module and C API name */ #define PySocket_MODULE_NAME "_socket" #define PySocket_CAPI_NAME "CAPI" /* Abstract the socket file descriptor type */ #ifdef MS_WINDOWS typedef SOCKET SOCKET_T; # ifdef MS_WIN64 # define SIZEOF_SOCKET_T 8 # else # define SIZEOF_SOCKET_T 4 # endif #else typedef int SOCKET_T; # define SIZEOF_SOCKET_T SIZEOF_INT #endif /* The object holding a socket. It holds some extra information, like the address family, which is used to decode socket address arguments properly. */ typedef struct { PyObject_HEAD SOCKET_T sock_fd; /* Socket file descriptor */ int sock_family; /* Address family, e.g., AF_INET */ int sock_type; /* Socket type, e.g., SOCK_STREAM */ int sock_proto; /* Protocol type, usually 0 */ union sock_addr { struct sockaddr_in in; #ifdef AF_UNIX struct sockaddr_un un; #endif #ifdef ENABLE_IPV6 struct sockaddr_in6 in6; struct sockaddr_storage storage; #endif #ifdef HAVE_NETPACKET_PACKET_H struct sockaddr_ll ll; #endif } sock_addr; PyObject *(*errorhandler)(void); /* Error handler; checks errno, returns NULL and sets a Python exception */ } PySocketSockObject; /* A forward reference to the Socktype type object. The Socktype variable contains pointers to various functions, some of which call newsockobject(), which uses Socktype, so there has to be a circular reference. */ extern DL_IMPORT(PyTypeObject) PySocketSock_Type; /* --- C API ----------------------------------------------------*/ /* C API for usage by other Python modules */ typedef struct { PyTypeObject *Sock_Type; } PySocketModule_APIObject; #ifndef PySocket_BUILDING_SOCKET /* --- C API ----------------------------------------------------*/ /* Interfacestructure to C API for other modules. Call PySocket_ImportModuleAPI() to initialize this structure. After that usage is simple: if (!PyArg_ParseTuple(args, "O!|zz:ssl", &PySocketModule.Sock_Type, (PyObject*)&Sock, &key_file, &cert_file)) return NULL; ... */ static PySocketModule_APIObject PySocketModule; /* You *must* call this before using any of the functions in PySocketModule and check its outcome; otherwise all accesses will result in a segfault. Returns 0 on success. */ #ifndef DPRINTF # define DPRINTF if (0) printf #endif static int PySocketModule_ImportModuleAndAPI(void) { PyObject *mod = 0, *v = 0; char *apimodule = PySocket_MODULE_NAME; char *apiname = PySocket_CAPI_NAME; void *api; DPRINTF("Importing the %s C API...\n",apimodule); mod = PyImport_ImportModule(apimodule); if (mod == NULL) goto onError; DPRINTF(" %s package found\n",apimodule); v = PyObject_GetAttrString(mod,apiname); if (v == NULL) goto onError; Py_DECREF(mod); DPRINTF(" API object %s found\n",apiname); api = PyCObject_AsVoidPtr(v); if (api == NULL) goto onError; Py_DECREF(v); memcpy(&PySocketModule, api, sizeof(PySocketModule)); DPRINTF(" API object loaded and initialized.\n"); return 0; onError: DPRINTF(" not found.\n"); Py_XDECREF(mod); Py_XDECREF(v); return -1; } #endif #ifdef __cplusplus } #endif #endif /* !Py__SOCKET_H */ Index: Setup.dist =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/Setup.dist,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Setup.dist 17 Oct 2001 13:46:28 -0000 1.24 --- Setup.dist 16 Feb 2002 18:23:30 -0000 1.25 *************** *** 176,186 **** #xreadlines xreadlinesmodule.c ! # for socket(2), without SSL support. #_socket socketmodule.c ! # Socket module compiled with SSL support; you must comment out the other # socket line above, and possibly edit the SSL variable: #SSL=/usr/local/ssl ! #_socket socketmodule.c \ # -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ # -L$(SSL)/lib -lssl -lcrypto --- 176,186 ---- #xreadlines xreadlinesmodule.c ! # Socket module helper for socket(2) #_socket socketmodule.c ! # Socket module helper for SSL support; you must comment out the other # socket line above, and possibly edit the SSL variable: #SSL=/usr/local/ssl ! #_ssl _ssl.c \ # -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ # -L$(SSL)/lib -lssl -lcrypto Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.203 retrieving revision 1.204 diff -C2 -d -r1.203 -r1.204 *** socketmodule.c 17 Jan 2002 23:15:58 -0000 1.203 --- socketmodule.c 16 Feb 2002 18:23:30 -0000 1.204 *************** *** 1,6 **** /* Socket module */ - /* SSL support based on patches by Brian E Gallew and Laszlo Kovacs */ - /* This module provides an interface to Berkeley socket IPC. --- 1,4 ---- *************** *** 36,40 **** - socket.inet_aton(IP address) -> 32-bit packed IP representation [...1015 lines suppressed...] - SSL_ERROR_SYSCALL); - PyModule_AddIntConstant(m, "SSL_ERROR_SSL", - SSL_ERROR_SSL); - #endif /* USE_SSL */ if (PyDict_SetItemString(d, "SocketType", (PyObject *)&PySocketSock_Type) != 0) --- 2716,2719 ---- *************** *** 3188,3191 **** --- 2721,2730 ---- if (PyDict_SetItemString(d, "socket", (PyObject *)&PySocketSock_Type) != 0) + return; + + /* Export C API */ + if (PyDict_SetItemString(d, PySocket_CAPI_NAME, + PyCObject_FromVoidPtr((void *)&PySocketModuleAPI, NULL) + ) != 0) return; From lemburg@users.sourceforge.net Sat Feb 16 18:44:54 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Sat, 16 Feb 2002 10:44:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.204,1.205 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv25920/Modules Modified Files: socketmodule.c Log Message: Fix the name of the header file. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.204 retrieving revision 1.205 diff -C2 -d -r1.204 -r1.205 *** socketmodule.c 16 Feb 2002 18:23:30 -0000 1.204 --- socketmodule.c 16 Feb 2002 18:44:52 -0000 1.205 *************** *** 134,138 **** /* Generic _socket.h definitions and includes */ #define PySocket_BUILDING_SOCKET ! #include "_socket.h" /* Addressing includes */ --- 134,138 ---- /* Generic _socket.h definitions and includes */ #define PySocket_BUILDING_SOCKET ! #include "socketmodule.h" /* Addressing includes */ From lemburg@users.sourceforge.net Sat Feb 16 18:47:10 2002 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Sat, 16 Feb 2002 10:47:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.205,1.206 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv26268/Modules Modified Files: socketmodule.c Log Message: Also fix the comment. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.205 retrieving revision 1.206 diff -C2 -d -r1.205 -r1.206 *** socketmodule.c 16 Feb 2002 18:44:52 -0000 1.205 --- socketmodule.c 16 Feb 2002 18:47:07 -0000 1.206 *************** *** 132,136 **** #include ! /* Generic _socket.h definitions and includes */ #define PySocket_BUILDING_SOCKET #include "socketmodule.h" --- 132,136 ---- #include ! /* Generic socket object definitions and includes */ #define PySocket_BUILDING_SOCKET #include "socketmodule.h" From loewis@users.sourceforge.net Sat Feb 16 23:13:56 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 16 Feb 2002 15:13:56 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.206,1.207 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv23101 Modified Files: socketmodule.c Log Message: Remove extraneous variable 'total', as reported by James Rucker. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.206 retrieving revision 1.207 diff -C2 -d -r1.206 -r1.207 *** socketmodule.c 16 Feb 2002 18:47:07 -0000 1.206 --- socketmodule.c 16 Feb 2002 23:13:54 -0000 1.207 *************** *** 1498,1502 **** { char *buf; ! int len, n, flags = 0, total = 0; if (!PyArg_ParseTuple(args, "s#|i:sendall", &buf, &len, &flags)) return NULL; --- 1498,1502 ---- { char *buf; ! int len, n, flags = 0; if (!PyArg_ParseTuple(args, "s#|i:sendall", &buf, &len, &flags)) return NULL; *************** *** 1506,1510 **** if (n < 0) break; - total += n; buf += n; len -= n; --- 1506,1509 ---- From loewis@users.sourceforge.net Sat Feb 16 23:16:55 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 16 Feb 2002 15:16:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk tkCommonDialog.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv23750 Modified Files: tkCommonDialog.py Log Message: Patch #515598: removed unused import of os. Index: tkCommonDialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/tkCommonDialog.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tkCommonDialog.py 23 Oct 2000 18:31:14 -0000 1.5 --- tkCommonDialog.py 16 Feb 2002 23:16:53 -0000 1.6 *************** *** 14,18 **** from Tkinter import * - import os class Dialog: --- 14,17 ---- From loewis@users.sourceforge.net Sat Feb 16 23:08:28 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 16 Feb 2002 15:08:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib ftplib.py,1.60.10.1,1.60.10.2 gopherlib.py,1.10,1.10.16.1 httplib.py,1.42,1.42.10.1 imaplib.py,1.39.8.2,1.39.8.3 nntplib.py,1.28,1.28.10.1 poplib.py,1.19,1.19.6.1 smtplib.py,1.46,1.46.4.1 socket.py,1.16,1.16.4.1 telnetlib.py,1.16,1.16.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22003 Modified Files: Tag: release22-maint ftplib.py gopherlib.py httplib.py imaplib.py nntplib.py poplib.py smtplib.py socket.py telnetlib.py Log Message: The Grande 'sendall()' patch, copied from release21-maint. Fixes #516715. Replaces calls to socket.send() (which isn't guaranteed to send all data) with the new socket.sendall() method. Index: ftplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ftplib.py,v retrieving revision 1.60.10.1 retrieving revision 1.60.10.2 diff -C2 -d -r1.60.10.1 -r1.60.10.2 *** ftplib.py 28 Dec 2001 10:11:32 -0000 1.60.10.1 --- ftplib.py 16 Feb 2002 23:08:24 -0000 1.60.10.2 *************** *** 169,173 **** line = line + CRLF if self.debugging > 1: print '*put*', self.sanitize(line) ! self.sock.send(line) # Internal: send one command to the server (through putline()) --- 169,173 ---- line = line + CRLF if self.debugging > 1: print '*put*', self.sanitize(line) ! self.sock.sendall(line) # Internal: send one command to the server (through putline()) *************** *** 232,236 **** line = 'ABOR' + CRLF if self.debugging > 1: print '*put urgent*', self.sanitize(line) ! self.sock.send(line, MSG_OOB) resp = self.getmultiline() if resp[:3] not in ('426', '226'): --- 232,236 ---- line = 'ABOR' + CRLF if self.debugging > 1: print '*put urgent*', self.sanitize(line) ! self.sock.sendall(line, MSG_OOB) resp = self.getmultiline() if resp[:3] not in ('426', '226'): *************** *** 423,427 **** buf = fp.read(blocksize) if not buf: break ! conn.send(buf) conn.close() return self.voidresp() --- 423,427 ---- buf = fp.read(blocksize) if not buf: break ! conn.sendall(buf) conn.close() return self.voidresp() *************** *** 437,441 **** if buf[-1] in CRLF: buf = buf[:-1] buf = buf + CRLF ! conn.send(buf) conn.close() return self.voidresp() --- 437,441 ---- if buf[-1] in CRLF: buf = buf[:-1] buf = buf + CRLF ! conn.sendall(buf) conn.close() return self.voidresp() Index: gopherlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gopherlib.py,v retrieving revision 1.10 retrieving revision 1.10.16.1 diff -C2 -d -r1.10 -r1.10.16.1 *** gopherlib.py 13 Aug 2001 14:52:37 -0000 1.10 --- gopherlib.py 16 Feb 2002 23:08:24 -0000 1.10.16.1 *************** *** 67,71 **** s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) ! s.send(selector + CRLF) s.shutdown(1) return s.makefile('rb') --- 67,71 ---- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) ! s.sendall(selector + CRLF) s.shutdown(1) return s.makefile('rb') Index: httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v retrieving revision 1.42 retrieving revision 1.42.10.1 diff -C2 -d -r1.42 -r1.42.10.1 *** httplib.py 11 Oct 2001 18:15:51 -0000 1.42 --- httplib.py 16 Feb 2002 23:08:24 -0000 1.42.10.1 *************** *** 404,408 **** print "send:", repr(str) try: ! self.sock.send(str) except socket.error, v: if v[0] == 32: # Broken pipe --- 404,408 ---- print "send:", repr(str) try: ! self.sock.sendall(str) except socket.error, v: if v[0] == 32: # Broken pipe Index: imaplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/imaplib.py,v retrieving revision 1.39.8.2 retrieving revision 1.39.8.3 diff -C2 -d -r1.39.8.2 -r1.39.8.3 *** imaplib.py 5 Jan 2002 17:22:20 -0000 1.39.8.2 --- imaplib.py 16 Feb 2002 23:08:25 -0000 1.39.8.3 *************** *** 223,234 **** def send(self, data): """Send data to remote.""" ! bytes = len(data) ! while bytes > 0: ! sent = self.sock.send(data) ! if sent == bytes: ! break # avoid copy ! data = data[sent:] ! bytes = bytes - sent ! def shutdown(self): --- 223,227 ---- def send(self, data): """Send data to remote.""" ! self.sock.sendall(data) def shutdown(self): Index: nntplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/nntplib.py,v retrieving revision 1.28 retrieving revision 1.28.10.1 diff -C2 -d -r1.28 -r1.28.10.1 *** nntplib.py 18 Oct 2001 20:58:25 -0000 1.28 --- nntplib.py 16 Feb 2002 23:08:25 -0000 1.28.10.1 *************** *** 180,184 **** line = line + CRLF if self.debugging > 1: print '*put*', `line` ! self.sock.send(line) def putcmd(self, line): --- 180,184 ---- line = line + CRLF if self.debugging > 1: print '*put*', `line` ! self.sock.sendall(line) def putcmd(self, line): Index: poplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/poplib.py,v retrieving revision 1.19 retrieving revision 1.19.6.1 diff -C2 -d -r1.19 -r1.19.6.1 *** poplib.py 5 Dec 2001 22:37:21 -0000 1.19 --- poplib.py 16 Feb 2002 23:08:25 -0000 1.19.6.1 *************** *** 98,102 **** def _putline(self, line): if self._debugging > 1: print '*put*', `line` ! self.sock.send('%s%s' % (line, CRLF)) --- 98,102 ---- def _putline(self, line): if self._debugging > 1: print '*put*', `line` ! self.sock.sendall('%s%s' % (line, CRLF)) Index: smtplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v retrieving revision 1.46 retrieving revision 1.46.4.1 diff -C2 -d -r1.46 -r1.46.4.1 *** smtplib.py 14 Dec 2001 20:34:20 -0000 1.46 --- smtplib.py 16 Feb 2002 23:08:25 -0000 1.46.4.1 *************** *** 291,297 **** if self.sock: try: ! sendptr = 0 ! while sendptr < len(str): ! sendptr = sendptr + self.sock.send(str[sendptr:]) except socket.error: self.close() --- 291,295 ---- if self.sock: try: ! self.sock.sendall(str) except socket.error: self.close() Index: socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v retrieving revision 1.16 retrieving revision 1.16.4.1 diff -C2 -d -r1.16 -r1.16.4.1 *** socket.py 18 Dec 2001 22:22:25 -0000 1.16 --- socket.py 16 Feb 2002 23:08:25 -0000 1.16.4.1 *************** *** 182,186 **** def flush(self): if self._wbuf: ! self._sock.send(self._wbuf) self._wbuf = "" --- 182,186 ---- def flush(self): if self._wbuf: ! self._sock.sendall(self._wbuf) self._wbuf = "" *************** *** 198,202 **** def writelines(self, list): ! filter(self._sock.send, list) self.flush() --- 198,202 ---- def writelines(self, list): ! filter(self._sock.sendall, list) self.flush() Index: telnetlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/telnetlib.py,v retrieving revision 1.16 retrieving revision 1.16.10.1 diff -C2 -d -r1.16 -r1.16.10.1 *** telnetlib.py 7 Oct 2001 08:53:32 -0000 1.16 --- telnetlib.py 16 Feb 2002 23:08:25 -0000 1.16.10.1 *************** *** 270,274 **** buffer = buffer.replace(IAC, IAC+IAC) self.msg("send %s", `buffer`) ! self.sock.send(buffer) def read_until(self, match, timeout=None): --- 270,274 ---- buffer = buffer.replace(IAC, IAC+IAC) self.msg("send %s", `buffer`) ! self.sock.sendall(buffer) def read_until(self, match, timeout=None): *************** *** 412,416 **** self.option_callback(self.sock, c, opt) else: ! self.sock.send(IAC + WONT + opt) elif c in (WILL, WONT): opt = self.rawq_getchar() --- 412,416 ---- self.option_callback(self.sock, c, opt) else: ! self.sock.sendall(IAC + WONT + opt) elif c in (WILL, WONT): opt = self.rawq_getchar() *************** *** 420,424 **** self.option_callback(self.sock, c, opt) else: ! self.sock.send(IAC + DONT + opt) else: self.msg('IAC %d not recognized' % ord(opt)) --- 420,424 ---- self.option_callback(self.sock, c, opt) else: ! self.sock.sendall(IAC + DONT + opt) else: self.msg('IAC %d not recognized' % ord(opt)) From loewis@users.sourceforge.net Sat Feb 16 23:06:22 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 16 Feb 2002 15:06:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib ftplib.py,1.64,1.65 gopherlib.py,1.10,1.11 httplib.py,1.43,1.44 imaplib.py,1.41,1.42 nntplib.py,1.28,1.29 poplib.py,1.19,1.20 smtplib.py,1.46,1.47 socket.py,1.17,1.18 telnetlib.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv21314 Modified Files: ftplib.py gopherlib.py httplib.py imaplib.py nntplib.py poplib.py smtplib.py socket.py telnetlib.py Log Message: The Grande 'sendall()' patch, copied from release21-maint. Fixes #516715. Replaces calls to socket.send() (which isn't guaranteed to send all data) with the new socket.sendall() method. Index: ftplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ftplib.py,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** ftplib.py 16 Feb 2002 07:34:19 -0000 1.64 --- ftplib.py 16 Feb 2002 23:06:15 -0000 1.65 *************** *** 169,173 **** line = line + CRLF if self.debugging > 1: print '*put*', self.sanitize(line) ! self.sock.send(line) # Internal: send one command to the server (through putline()) --- 169,173 ---- line = line + CRLF if self.debugging > 1: print '*put*', self.sanitize(line) ! self.sock.sendall(line) # Internal: send one command to the server (through putline()) *************** *** 232,236 **** line = 'ABOR' + CRLF if self.debugging > 1: print '*put urgent*', self.sanitize(line) ! self.sock.send(line, MSG_OOB) resp = self.getmultiline() if resp[:3] not in ('426', '226'): --- 232,236 ---- line = 'ABOR' + CRLF if self.debugging > 1: print '*put urgent*', self.sanitize(line) ! self.sock.sendall(line, MSG_OOB) resp = self.getmultiline() if resp[:3] not in ('426', '226'): *************** *** 418,422 **** buf = fp.read(blocksize) if not buf: break ! conn.send(buf) conn.close() return self.voidresp() --- 418,422 ---- buf = fp.read(blocksize) if not buf: break ! conn.sendall(buf) conn.close() return self.voidresp() *************** *** 432,436 **** if buf[-1] in CRLF: buf = buf[:-1] buf = buf + CRLF ! conn.send(buf) conn.close() return self.voidresp() --- 432,436 ---- if buf[-1] in CRLF: buf = buf[:-1] buf = buf + CRLF ! conn.sendall(buf) conn.close() return self.voidresp() Index: gopherlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gopherlib.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** gopherlib.py 13 Aug 2001 14:52:37 -0000 1.10 --- gopherlib.py 16 Feb 2002 23:06:16 -0000 1.11 *************** *** 67,71 **** s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) ! s.send(selector + CRLF) s.shutdown(1) return s.makefile('rb') --- 67,71 ---- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) ! s.sendall(selector + CRLF) s.shutdown(1) return s.makefile('rb') Index: httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** httplib.py 11 Feb 2002 17:59:51 -0000 1.43 --- httplib.py 16 Feb 2002 23:06:16 -0000 1.44 *************** *** 404,408 **** print "send:", repr(str) try: ! self.sock.send(str) except socket.error, v: if v[0] == 32: # Broken pipe --- 404,408 ---- print "send:", repr(str) try: ! self.sock.sendall(str) except socket.error, v: if v[0] == 32: # Broken pipe Index: imaplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/imaplib.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** imaplib.py 5 Jan 2002 17:17:09 -0000 1.41 --- imaplib.py 16 Feb 2002 23:06:17 -0000 1.42 *************** *** 223,234 **** def send(self, data): """Send data to remote.""" ! bytes = len(data) ! while bytes > 0: ! sent = self.sock.send(data) ! if sent == bytes: ! break # avoid copy ! data = data[sent:] ! bytes = bytes - sent ! def shutdown(self): --- 223,227 ---- def send(self, data): """Send data to remote.""" ! self.sock.sendall(data) def shutdown(self): Index: nntplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/nntplib.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** nntplib.py 18 Oct 2001 20:58:25 -0000 1.28 --- nntplib.py 16 Feb 2002 23:06:17 -0000 1.29 *************** *** 180,184 **** line = line + CRLF if self.debugging > 1: print '*put*', `line` ! self.sock.send(line) def putcmd(self, line): --- 180,184 ---- line = line + CRLF if self.debugging > 1: print '*put*', `line` ! self.sock.sendall(line) def putcmd(self, line): Index: poplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/poplib.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** poplib.py 5 Dec 2001 22:37:21 -0000 1.19 --- poplib.py 16 Feb 2002 23:06:18 -0000 1.20 *************** *** 98,102 **** def _putline(self, line): if self._debugging > 1: print '*put*', `line` ! self.sock.send('%s%s' % (line, CRLF)) --- 98,102 ---- def _putline(self, line): if self._debugging > 1: print '*put*', `line` ! self.sock.sendall('%s%s' % (line, CRLF)) Index: smtplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** smtplib.py 14 Dec 2001 20:34:20 -0000 1.46 --- smtplib.py 16 Feb 2002 23:06:18 -0000 1.47 *************** *** 291,297 **** if self.sock: try: ! sendptr = 0 ! while sendptr < len(str): ! sendptr = sendptr + self.sock.send(str[sendptr:]) except socket.error: self.close() --- 291,295 ---- if self.sock: try: ! self.sock.sendall(str) except socket.error: self.close() Index: socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** socket.py 16 Feb 2002 18:23:30 -0000 1.17 --- socket.py 16 Feb 2002 23:06:18 -0000 1.18 *************** *** 186,190 **** def flush(self): if self._wbuf: ! self._sock.send(self._wbuf) self._wbuf = "" --- 186,190 ---- def flush(self): if self._wbuf: ! self._sock.sendall(self._wbuf) self._wbuf = "" *************** *** 202,206 **** def writelines(self, list): ! filter(self._sock.send, list) self.flush() --- 202,206 ---- def writelines(self, list): ! filter(self._sock.sendall, list) self.flush() Index: telnetlib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/telnetlib.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** telnetlib.py 7 Oct 2001 08:53:32 -0000 1.16 --- telnetlib.py 16 Feb 2002 23:06:19 -0000 1.17 *************** *** 270,274 **** buffer = buffer.replace(IAC, IAC+IAC) self.msg("send %s", `buffer`) ! self.sock.send(buffer) def read_until(self, match, timeout=None): --- 270,274 ---- buffer = buffer.replace(IAC, IAC+IAC) self.msg("send %s", `buffer`) ! self.sock.sendall(buffer) def read_until(self, match, timeout=None): *************** *** 412,416 **** self.option_callback(self.sock, c, opt) else: ! self.sock.send(IAC + WONT + opt) elif c in (WILL, WONT): opt = self.rawq_getchar() --- 412,416 ---- self.option_callback(self.sock, c, opt) else: ! self.sock.sendall(IAC + WONT + opt) elif c in (WILL, WONT): opt = self.rawq_getchar() *************** *** 420,424 **** self.option_callback(self.sock, c, opt) else: ! self.sock.send(IAC + DONT + opt) else: self.msg('IAC %d not recognized' % ord(opt)) --- 420,424 ---- self.option_callback(self.sock, c, opt) else: ! self.sock.sendall(IAC + DONT + opt) else: self.msg('IAC %d not recognized' % ord(opt)) From loewis@users.sourceforge.net Sat Feb 16 23:33:25 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 16 Feb 2002 15:33:25 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.221,2.222 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv26421/Modules Modified Files: posixmodule.c Log Message: Patch #511193: Implement killpg in posixmodule. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.221 retrieving revision 2.222 diff -C2 -d -r2.221 -r2.222 *** posixmodule.c 1 Feb 2002 15:46:29 -0000 2.221 --- posixmodule.c 16 Feb 2002 23:33:23 -0000 2.222 *************** *** 2200,2203 **** --- 2200,2221 ---- #endif + #ifdef HAVE_KILLPG + static char posix_killpg__doc__[] = + "killpg(pgid, sig) -> None\n\ + Kill a process group with a signal."; + + static PyObject * + posix_killpg(PyObject *self, PyObject *args) + { + int pgid, sig; + if (!PyArg_ParseTuple(args, "ii:killpg", &pgid, &sig)) + return NULL; + if (killpg(pgid, sig) == -1) + return posix_error(); + Py_INCREF(Py_None); + return Py_None; + } + #endif + #ifdef HAVE_PLOCK *************** *** 5574,5577 **** --- 5592,5598 ---- {"kill", posix_kill, METH_VARARGS, posix_kill__doc__}, #endif /* HAVE_KILL */ + #ifdef HAVE_KILLPG + {"killpg", posix_killpg, METH_VARARGS, posix_killpg__doc__}, + #endif /* HAVE_KILLPG */ #ifdef HAVE_PLOCK {"plock", posix_plock, METH_VARARGS, posix_plock__doc__}, From loewis@users.sourceforge.net Sat Feb 16 23:33:25 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 16 Feb 2002 15:33:25 -0800 Subject: [Python-checkins] CVS: python/dist/src configure,1.281,1.282 configure.in,1.290,1.291 pyconfig.h.in,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv26421 Modified Files: configure configure.in pyconfig.h.in Log Message: Patch #511193: Implement killpg in posixmodule. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.281 retrieving revision 1.282 diff -C2 -d -r1.281 -r1.282 *** configure 11 Feb 2002 16:31:10 -0000 1.281 --- configure 16 Feb 2002 23:33:22 -0000 1.282 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.289 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.290 [...3955 lines suppressed...] if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7605,7609 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7608: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7594,7598 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7597: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.290 retrieving revision 1.291 diff -C2 -d -r1.290 -r1.291 *** configure.in 11 Feb 2002 16:30:54 -0000 1.290 --- configure.in 16 Feb 2002 23:33:23 -0000 1.291 *************** *** 1424,1428 **** flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpid getpwent getwd \ ! hstrerror inet_pton kill link lstat mkfifo mktime mremap \ nice pathconf pause plock poll pthread_init \ putenv readlink \ --- 1424,1428 ---- flock fork fsync fdatasync fpathconf ftime ftruncate \ gai_strerror getgroups getlogin getpeername getpid getpwent getwd \ ! hstrerror inet_pton kill killpg link lstat mkfifo mktime mremap \ nice pathconf pause plock poll pthread_init \ putenv readlink \ Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** pyconfig.h.in 1 Jan 2002 18:41:32 -0000 1.21 --- pyconfig.h.in 16 Feb 2002 23:33:23 -0000 1.22 *************** *** 460,463 **** --- 460,466 ---- #undef HAVE_KILL + /* Define if you have the killpg function. */ + #undef HAVE_KILLPG + /* Define if you have the link function. */ #undef HAVE_LINK From loewis@users.sourceforge.net Sat Feb 16 23:35:43 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 16 Feb 2002 15:35:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.356,1.357 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv26950/Misc Modified Files: NEWS Log Message: Patch #511193: Implement killpg in posixmodule. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.356 retrieving revision 1.357 diff -C2 -d -r1.356 -r1.357 *** NEWS 16 Feb 2002 18:23:30 -0000 1.356 --- NEWS 16 Feb 2002 23:35:41 -0000 1.357 *************** *** 14,17 **** --- 14,19 ---- a ValueError when the xreadlines.next() method was called. + - posix.killpg has been added where available. + Extension modules From loewis@users.sourceforge.net Sat Feb 16 23:39:12 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 16 Feb 2002 15:39:12 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects longobject.c,1.112,1.113 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv27702 Modified Files: longobject.c Log Message: Patch #508038: Do not use a type as a variable name. Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** longobject.c 4 Nov 2001 23:09:40 -0000 1.112 --- longobject.c 16 Feb 2002 23:39:10 -0000 1.113 *************** *** 884,891 **** assert(accumbits >= basebits); do { ! char digit = (char)(accum & (base - 1)); ! digit += (digit < 10) ? '0' : 'A'-10; assert(p > PyString_AS_STRING(str)); ! *--p = digit; accumbits -= basebits; accum >>= basebits; --- 884,891 ---- assert(accumbits >= basebits); do { ! char cdigit = (char)(accum & (base - 1)); ! cdigit += (cdigit < 10) ? '0' : 'A'-10; assert(p > PyString_AS_STRING(str)); ! *--p = cdigit; accumbits -= basebits; accum >>= basebits; From loewis@users.sourceforge.net Sat Feb 16 23:41:41 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 16 Feb 2002 15:41:41 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects longobject.c,1.112,1.112.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv28418 Modified Files: Tag: release22-maint longobject.c Log Message: Patch #508038: Do not use a type as a variable name. Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.112 retrieving revision 1.112.8.1 diff -C2 -d -r1.112 -r1.112.8.1 *** longobject.c 4 Nov 2001 23:09:40 -0000 1.112 --- longobject.c 16 Feb 2002 23:41:39 -0000 1.112.8.1 *************** *** 884,891 **** assert(accumbits >= basebits); do { ! char digit = (char)(accum & (base - 1)); ! digit += (digit < 10) ? '0' : 'A'-10; assert(p > PyString_AS_STRING(str)); ! *--p = digit; accumbits -= basebits; accum >>= basebits; --- 884,891 ---- assert(accumbits >= basebits); do { ! char cdigit = (char)(accum & (base - 1)); ! cdigit += (cdigit < 10) ? '0' : 'A'-10; assert(p > PyString_AS_STRING(str)); ! *--p = cdigit; accumbits -= basebits; accum >>= basebits; From tim_one@users.sourceforge.net Sun Feb 17 03:58:53 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 16 Feb 2002 19:58:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.h,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv11015/python/Modules Modified Files: socketmodule.h Log Message: For readability, switch to tab indents; was using a mix of tab indents, 4-space indents, and ambiguous space+tab indents. Added an XXX comment about a confusing part. Still doesn't build on Windows. Index: socketmodule.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** socketmodule.h 16 Feb 2002 18:23:30 -0000 1.1 --- socketmodule.h 17 Feb 2002 03:58:51 -0000 1.2 *************** *** 71,75 **** #endif } sock_addr; ! PyObject *(*errorhandler)(void); /* Error handler; checks errno, returns NULL and sets a Python exception */ --- 71,75 ---- #endif } sock_addr; ! PyObject *(*errorhandler)(void); /* Error handler; checks errno, returns NULL and sets a Python exception */ *************** *** 87,95 **** /* C API for usage by other Python modules */ typedef struct { ! ! PyTypeObject *Sock_Type; ! } PySocketModule_APIObject; ! #ifndef PySocket_BUILDING_SOCKET --- 87,96 ---- /* C API for usage by other Python modules */ typedef struct { ! PyTypeObject *Sock_Type; } PySocketModule_APIObject; ! ! /* XXX The net effect of the following appears to be to define a function ! XXX named PySocketModule_APIObject in _ssl.c. It's unclear why it isn't ! XXX defined there directly. */ #ifndef PySocket_BUILDING_SOCKET *************** *** 105,112 **** return NULL; ... - */ ! static PySocketModule_APIObject PySocketModule; --- 106,112 ---- return NULL; ... */ ! static PySocketModule_APIObject PySocketModule; *************** *** 122,156 **** int PySocketModule_ImportModuleAndAPI(void) { ! PyObject *mod = 0, *v = 0; ! char *apimodule = PySocket_MODULE_NAME; ! char *apiname = PySocket_CAPI_NAME; ! void *api; ! ! DPRINTF("Importing the %s C API...\n",apimodule); ! mod = PyImport_ImportModule(apimodule); ! if (mod == NULL) ! goto onError; ! DPRINTF(" %s package found\n",apimodule); ! v = PyObject_GetAttrString(mod,apiname); ! if (v == NULL) ! goto onError; ! Py_DECREF(mod); ! DPRINTF(" API object %s found\n",apiname); ! api = PyCObject_AsVoidPtr(v); ! if (api == NULL) ! goto onError; ! Py_DECREF(v); ! memcpy(&PySocketModule, api, sizeof(PySocketModule)); ! DPRINTF(" API object loaded and initialized.\n"); ! return 0; ! onError: ! DPRINTF(" not found.\n"); ! Py_XDECREF(mod); ! Py_XDECREF(v); ! return -1; } ! #endif #ifdef __cplusplus --- 122,156 ---- int PySocketModule_ImportModuleAndAPI(void) { ! PyObject *mod = 0, *v = 0; ! char *apimodule = PySocket_MODULE_NAME; ! char *apiname = PySocket_CAPI_NAME; ! void *api; ! ! DPRINTF("Importing the %s C API...\n", apimodule); ! mod = PyImport_ImportModule(apimodule); ! if (mod == NULL) ! goto onError; ! DPRINTF(" %s package found\n", apimodule); ! v = PyObject_GetAttrString(mod, apiname); ! if (v == NULL) ! goto onError; ! Py_DECREF(mod); ! DPRINTF(" API object %s found\n", apiname); ! api = PyCObject_AsVoidPtr(v); ! if (api == NULL) ! goto onError; ! Py_DECREF(v); ! memcpy(&PySocketModule, api, sizeof(PySocketModule)); ! DPRINTF(" API object loaded and initialized.\n"); ! return 0; ! onError: ! DPRINTF(" not found.\n"); ! Py_XDECREF(mod); ! Py_XDECREF(v); ! return -1; } ! #endif /* !PySocket_BUILDING_SOCKET */ #ifdef __cplusplus From tim_one@users.sourceforge.net Sun Feb 17 04:13:23 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 16 Feb 2002 20:13:23 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.207,1.208 socketmodule.h,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12979/python/Modules Modified Files: socketmodule.c socketmodule.h Log Message: Moved the declaration of PySocketSock_Type from socketmodule.h to socketmodule.c. No code outside of the .c file references it, so it doesn't belong the .h file (at least not yet ...), and declaring it an imported symbol in the .h file can't be made to work on Windows (it's a cross-DLL symbol then) without substantial code rewriting. Also repaired the comment that goes along with the decl, to stop referring to names and functions that haven't existed for 7 years . socketmodule.c compiles cleanly on Windows again. The test_socket dies at once, though (later). Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.207 retrieving revision 1.208 diff -C2 -d -r1.207 -r1.208 *** socketmodule.c 16 Feb 2002 23:13:54 -0000 1.207 --- socketmodule.c 17 Feb 2002 04:13:21 -0000 1.208 *************** *** 252,255 **** --- 252,260 ---- #endif + /* A forward reference to the socket type object. + The PySocketSock_Type variable contains pointers to various functions, + some of which call PySocketSock_New(), which uses PySocketSock_Type, so + there has to be a circular reference. */ + staticforward PyTypeObject PySocketSock_Type; /* Convenience function to raise an error according to errno Index: socketmodule.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** socketmodule.h 17 Feb 2002 03:58:51 -0000 1.2 --- socketmodule.h 17 Feb 2002 04:13:21 -0000 1.3 *************** *** 76,86 **** } PySocketSockObject; - /* A forward reference to the Socktype type object. - The Socktype variable contains pointers to various functions, - some of which call newsockobject(), which uses Socktype, so - there has to be a circular reference. */ - - extern DL_IMPORT(PyTypeObject) PySocketSock_Type; - /* --- C API ----------------------------------------------------*/ --- 76,79 ---- From tim_one@users.sourceforge.net Sun Feb 17 04:25:26 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 16 Feb 2002 20:25:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib socket.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv15604/python/Lib Modified Files: socket.py Log Message: Repair so that importing socket doesn't blow up on platforms that lack SSL support. test_socket.py passes again on Windows. Added an XXX about adding _ssl exports to the __all__ list (it doesn't appear to be doing anything about that now, but since I don't have SSL on this box I can't really tell). Index: socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/socket.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** socket.py 16 Feb 2002 23:06:18 -0000 1.18 --- socket.py 17 Feb 2002 04:25:24 -0000 1.19 *************** *** 39,57 **** """ from _socket import * try: from _ssl import * except ImportError: ! pass import os, sys __all__ = ["getfqdn"] - import _socket __all__.extend(os._get_exports_list(_socket)) if (sys.platform.lower().startswith("win") or (hasattr(os, 'uname') and os.uname()[0] == "BeOS") ! or (sys.platform=="riscos")): _realsocketcall = _socket.socket --- 39,61 ---- """ + import _socket from _socket import * + + SSL_EXISTS = 1 try: + import _ssl from _ssl import * except ImportError: ! SSL_EXISTS = 0 import os, sys __all__ = ["getfqdn"] __all__.extend(os._get_exports_list(_socket)) + # XXX shouldn't there be something similar to the above for _ssl exports? if (sys.platform.lower().startswith("win") or (hasattr(os, 'uname') and os.uname()[0] == "BeOS") ! or sys.platform=="riscos"): _realsocketcall = _socket.socket *************** *** 60,68 **** return _socketobject(_realsocketcall(family, type, proto)) ! try: _realsslcall = _ssl.ssl - except AttributeError: - pass # No ssl - else: def ssl(sock, keyfile=None, certfile=None): if hasattr(sock, "_sock"): --- 64,69 ---- return _socketobject(_realsocketcall(family, type, proto)) ! if SSL_EXISTS: _realsslcall = _ssl.ssl def ssl(sock, keyfile=None, certfile=None): if hasattr(sock, "_sock"): *************** *** 70,73 **** --- 71,78 ---- return _realsslcall(sock, keyfile, certfile) + del _socket + if SSL_EXISTS: + del _ssl + del SSL_EXISTS # WSA error codes From aimacintyre@users.sourceforge.net Sun Feb 17 05:18:29 2002 From: aimacintyre@users.sourceforge.net (Andrew I MacIntyre) Date: Sat, 16 Feb 2002 21:18:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/PC/os2emx - New directory Message-ID: Update of /cvsroot/python/python/dist/src/PC/os2emx In directory usw-pr-cvs1:/tmp/cvs-serv23661/os2emx Log Message: Directory /cvsroot/python/python/dist/src/PC/os2emx added to the repository From aimacintyre@users.sourceforge.net Sun Feb 17 05:23:32 2002 From: aimacintyre@users.sourceforge.net (Andrew I MacIntyre) Date: Sat, 16 Feb 2002 21:23:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/PC/os2emx Makefile,NONE,1.1 README.os2emx,NONE,1.1 config.c,NONE,1.1 dlfcn.c,NONE,1.1 dlfcn.h,NONE,1.1 dllentry.c,NONE,1.1 getpathp.c,NONE,1.1 pyconfig.h,NONE,1.1 python23.def,NONE,1.1 pythonpm.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/PC/os2emx In directory usw-pr-cvs1:/tmp/cvs-serv24301/dist/src/PC/os2emx Added Files: Makefile README.os2emx config.c dlfcn.c dlfcn.h dllentry.c getpathp.c pyconfig.h python23.def pythonpm.c Log Message: Create and populate OS/2 EMX port build directory: PC/os2emx/ Makefile README.os2emx config.c dlfcn.c // libdl emulation code for loadable extensions dlfcn.h dllentry.c // DLL initialisation routine for Python DLL getpath.c pyconfig.h python23.def // Python DLL symbol export definitions pythonpm.c // console-less PM interpreter wrapper --- NEW FILE: Makefile --- #####################==================----------------úúúúúúúúúúúúú # # Top-Level Makefile for Building Python 2.3 for OS/2 using GCC/EMX # Originally written by Andrew Zabolotny, for Python 1.5.2 # Modified by Andrew MacIntyre, for Python 2.3 # # This makefile was developed for use with [P]GCC/EMX compiler any # version and GNU Make. # # The output of the build is a largish Python23.DLL containing the # essential modules of Python and a small Python.exe program to start # the interpreter. When embedding Python within another program, only # Python23.DLL is needed. We also build python_s.a static library (which # can be converted into OMF (.lib) format using emxomf tool) and both # python.a and python.lib import libraries. Then the optional # extension modules, which are OS/2 DLLs renamed with a PYD file extension. # # Recommended build order: # make depend (if you have makedep) # make all # make lx (if you have lxlite) # make test (optional) # #####################==================----------------úúúúúúúúúúúúú # === Compilation mode: debug or release === MODE= optimize #MODE= debug # === Assert() enabled === #ASSERTIONS=no ASSERTIONS=yes # === Optional modules === # Do you have the InfoZip compression library installed? ZLIB= no # Do you have the Ultra Fast Crypt (UFC) library installed? UFC= no # Do you have the Tcl/Tk library installed? TCLTK= no # Do you have the GNU multiprecision library installed? GMPZ= no # Do you have the GNU readline library installed? # NOTE: I'm using a modified version of Kai Uwe Rommel's port that # - is compiled with multithreading enabled # - is linked statically # I have had no success trying to use a DLL version, even with # the multithreading switch. GREADLINE= no # Do you have the BSD DB library (v1.85) as included in the EMXBSD package? # NOTE: this library needs to be recompiled with a structure member # renamed to avoid problems with the multithreaded errno support # (there is a structure member called errno, used for shadowing the # real errno, which conflicts with the errno redefinition of -Zmt) BSDDB= no # Do you have the ncurses library installed? EMX's BSD curses aren't enough! CURSES= no # Do you have the expat XML parsing library installed? EXPAT= no # Do you have the GDBM library installed? GDBM= no # === The Tools === CC= gcc CFLAGS= -Zmt -Wall $(INCLUDE) CFLAGS.LIB= $(CFLAGS) LD= gcc LDFLAGS= -Zmt -Zcrtdll -L. -lgcc LDFLAGS.EXE= $(LDFLAGS) LDFLAGS.DLL= $(LDFLAGS) -Zdll LDFLAGS.A= $(LDFLAGS) $(LIBS) ARFLAGS= crs IMPLIB= emximp EXPLIB= emxexp # adjust C compiler settings based on build options ifeq ($(MODE),debug) CFLAGS+= -g -O LDFLAGS+= -g else CFLAGS+= -s -O2 LDFLAGS+= -s endif ifeq ($(ASSERTIONS),no) CFLAGS+= -DNDEBUG endif # We're using the OMF format since EMX's ld has a obscure bug # because of which it sometimes fails to build relocations # in .data segment that point to another .data locations # (except for the final linking if the .EXEs) OMF= yes # if fork() support is required, the main executable must be linked with ld EXEOMF= no # File extensions MODULE.EXT= .pyd ifeq ($(OMF),yes) O= .obj A= .lib AR= emxomfar CFLAGS+= -Zomf LDFLAGS+= -Zomf ifeq ($(MODE),debug) ARFLAGS= -p64 crs else ARFLAGS= -p32 crs endif else O= .o A= .a AR= ar endif # Source file paths SRCPATH=.;../../Python;../../Parser;../../Objects;../../Include;../../Modules # Python contains the central core, containing the builtins and interpreter. # Parser contains Python's Internal Parser and # Standalone Parser Generator Program (Shares Some of Python's Modules) # Objects contains Python Object Types # Modules contains extension Modules (Built-In or as Separate DLLs) # Unix shells tend to use "$" as delimiter for variable names. # Test for this behaviour and set $(BUCK) variable correspondigly ... __TMP__:=$(shell echo $$$$) ifeq ($(__TMP__),$$$$) BUCK= $$ BRO= ( BRC= ) else BUCK= \$$ BRO= \( BRC= \) endif # Compute the "double quote" variable __TMP__:=$(shell echo "") ifeq ($(__TMP__),"") DQUOTE= " else DQUOTE= \" endif # Include paths #INCLUDE= -I$(subst ;, -I, $(SRCPATH)) INCLUDE= -I. -I../../Include # Path to search for .c files vpath %.c .;..;$(SRCPATH) # Top of the package tree TOP= ../../ # Directory for output files OUTBASE= out/ OUT= $(OUTBASE)$(MODE)/ # Additional libraries LIBS= -lsocket # Utility macro: replacement for $^ ^^= $(filter-out %$A,$^) # Use $(L^) to link with all libraries specified as dependencies L^= $(addprefix -l,$(basename $(notdir $(filter %$A,$+)))) # Build rules $(OUT)%$O: %.c $(CC) $(CFLAGS.LIB) -c $< -o $@ %.a: $(LD) $(LDFLAGS.A) -o $@ $(^^) $(L^) %.dll: $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) %.pyd: $(OUT)%module$O $(OUT)%_m.def $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(PYTHON.IMPLIB) $(LIBS) %.exe: $(LD) $(LDFLAGS.EXE) -o $@ $(^^) $(L^) %_m.def: @echo Creating .DEF file: $@ @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@ ifeq ($(DESCRIPTION.$(notdir $*)$(MODULE.EXT)),) @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@ else @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@ endif @echo DATA MULTIPLE NONSHARED >>$@ @echo EXPORTS >>$@ @echo init$(notdir $*) >>$@ %.def: @echo Creating .DEF file: $@ @echo NAME $(notdir $*) $(EXETYPE.$(notdir $*).exe) >$@ @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*).exe)$(DQUOTE) >>$@ @echo STACKSIZE 1048576 >>$@ # Output file names PYTHON_VER= 2.3 PYTHON_LIB= python23 PYTHON.LIB= $(PYTHON_LIB)_s$A PYTHON.IMPLIB= $(PYTHON_LIB)$A ifeq ($(EXEOMF),yes) PYTHON.EXEIMP= $(PYTHON.IMPLIB) LDMODE.EXE= -Zomf else PYTHON.EXEIMP= $(PYTHON_LIB).a LDMODE.EXE = endif PYTHON.DLL= $(PYTHON_LIB).dll PYTHON.DEF= $(PYTHON_LIB).def PYTHON.EXE= python.exe PYTHONPM.EXE= pythonpm.exe PGEN.EXE= pgen.exe LIBRARY= $(PYTHON.LIB) LD_LIBRARY= $(PYTHON.IMPLIB) # Additional executable parameters EXETYPE.$(PYTHON.EXE)= WINDOWCOMPAT EXETYPE.$(PYTHONPM.EXE)= WINDOWAPI EXETYPE.$(PGEN.EXE)= WINDOWCOMPAT DESCRIPTION.$(PYTHON.EXE)= Python object-oriented programming language interpreter for OS/2 DESCRIPTION.$(PYTHONPM.EXE)= $(DESCRIPTION.$(PYTHON.EXE)) DESCRIPTION.$(PGEN.EXE)= Python object-oriented programming language parser generator for OS/2 # Module descriptions DESCRIPTION.zlib$(MODULE.EXT)= Python Extension DLL for accessing the InfoZip compression library DESCRIPTION.crypt$(MODULE.EXT)= Python Extension DLL implementing the crypt$(BRO)$(BRC) function DESCRIPTION._tkinter$(MODULE.EXT)= Python Extension DLL for access to Tcl/Tk Environment DESCRIPTION.mpz$(MODULE.EXT)= Python Extension DLL for access to GNU multi-precision library DESCRIPTION.readline$(MODULE.EXT)= Python Extension DLL for access to GNU ReadLine library DESCRIPTION.bsddb$(MODULE.EXT)= Python Extension DLL for access to BSD DB (v1.85) library DESCRIPTION._curses$(MODULE.EXT)= Python Extension DLL for access to ncurses library DESCRIPTION.pyexpat$(MODULE.EXT)= Python Extension DLL for access to expat library # Source files SRC.PGEN= $(addprefix ../../Parser/, \ pgenmain.c \ pgen.c \ printgrammar.c \ grammar.c \ bitset.c \ firstsets.c) OBJ.PGEN= $(addprefix $(OUT),$(notdir $(SRC.PGEN:.c=$O))) SRC.OS2EMX= config.c dlfcn.c getpathp.c SRC.MAIN= $(addprefix $(TOP), \ Modules/getbuildinfo.c \ Modules/main.c) SRC.MODULES= $(addprefix $(TOP), \ Modules/gcmodule.c \ Modules/signalmodule.c \ Modules/posixmodule.c \ Modules/threadmodule.c \ Modules/_sre.c) SRC.PARSER= $(addprefix $(TOP), \ Parser/acceler.c \ Parser/grammar1.c \ Parser/listnode.c \ Parser/node.c \ Parser/parser.c \ Parser/parsetok.c \ Parser/tokenizer.c \ Parser/bitset.c \ Parser/metagrammar.c \ Parser/myreadline.c) SRC.PYTHON= $(addprefix $(TOP), \ Python/bltinmodule.c \ Python/exceptions.c \ Python/ceval.c \ Python/compile.c \ Python/codecs.c \ Python/errors.c \ Python/frozen.c \ Python/frozenmain.c \ Python/future.c \ Python/getargs.c \ Python/getcompiler.c \ Python/getcopyright.c \ Python/getmtime.c \ Python/getplatform.c \ Python/getversion.c \ Python/graminit.c \ Python/import.c \ Python/importdl.c \ Python/marshal.c \ Python/modsupport.c \ Python/mysnprintf.c \ Python/mystrtoul.c \ Python/pyfpe.c \ Python/pystate.c \ Python/pythonrun.c \ Python/structmember.c \ Python/symtable.c \ Python/sysmodule.c \ Python/traceback.c \ Python/getopt.c \ Python/dynload_shlib.c \ Python/thread.c) SRC.OBJECT= $(addprefix $(TOP), \ Objects/abstract.c \ Objects/bufferobject.c \ Objects/cellobject.c \ Objects/classobject.c \ Objects/cobject.c \ Objects/complexobject.c \ Objects/descrobject.c \ Objects/dictobject.c \ Objects/fileobject.c \ Objects/floatobject.c \ Objects/frameobject.c \ Objects/funcobject.c \ Objects/intobject.c \ Objects/iterobject.c \ Objects/listobject.c \ Objects/longobject.c \ Objects/methodobject.c \ Objects/moduleobject.c \ Objects/object.c \ Objects/rangeobject.c \ Objects/sliceobject.c \ Objects/stringobject.c \ Objects/structseq.c \ Objects/tupleobject.c \ Objects/typeobject.c \ Objects/unicodeobject.c \ Objects/unicodectype.c \ Objects/weakrefobject.c) SRC.LIB= $(SRC.OS2EMX) \ $(SRC.MAIN) \ $(SRC.PARSER) \ $(SRC.OBJECT) \ $(SRC.PYTHON) \ $(SRC.MODULES) OBJ.LIB= $(addprefix $(OUT),$(notdir $(SRC.LIB:.c=$O))) SRC.EXE= $(TOP)Modules/python.c SRC.PMEXE= pythonpm.c # Python modules to be dynamically loaded that: # 1) have only single source file and require no extra libs # 2) use the standard module naming convention # (the 'module' in ?????module.c is assumed) # - these can be built with implicit rules EASYEXTMODULES= array \ cmath \ _codecs \ dl \ errno \ fcntl \ fpectl \ fpetest \ _locale \ math \ new \ parser \ pwd \ rgbimg \ rotor \ select \ sha \ strop \ struct \ time \ timing # Python modules to be dynamically loaded that need explicit build rules # (either multiple source files and/or non-standard module naming) # (NOTE: use shortened names for modules affected by 8 char name limit) HARDEXTMODULES= binascii \ cPickle \ cStringI \ _hotshot \ imageop \ md5 \ operator \ pcre \ regex \ _socket \ termios \ _testcap \ unicoded \ _weakref \ xreadlin # Python external ($(MODULE.EXT)) modules - can be EASY or HARD ifeq ($(ZLIB),yes) HARDEXTMODULES+= zlib endif ifeq ($(UFC),yes) HARDEXTMODULES+= crypt endif ifeq ($(TCLTK),yes) HARDEXTMODULES+= _tkinter CFLAGS+= -DHAS_DIRENT -I/TclTk80/include TK_LIBS+= -L/TclTk80/lib -ltcl80 -ltk80 endif ifeq ($(GMPZ),yes) HARDEXTMODULES+= mpz endif ifeq ($(GREADLINE),yes) HARDEXTMODULES+= readline endif ifeq ($(BSDDB),yes) HARDEXTMODULES+= bsddb endif ifeq ($(CURSES),yes) HARDEXTMODULES+= _curses _curses_ endif ifeq ($(EXPAT),yes) HARDEXTMODULES+= pyexpat endif ifeq ($(GDBM),yes) HARDEXTMODULES+= gdbm dbm endif EXTERNDLLS= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(EASYEXTMODULES))) EXTERNDLLS+= $(addsuffix $(MODULE.EXT),$(patsubst %module,%,$(HARDEXTMODULES))) # Targets all: $(OUT) $(PYTHON.LIB) $(PYTHON.DEF) $(PYTHON.IMPLIB) $(PYTHON.DLL) \ $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) $(EXTERNDLLS) clean: rm -f $(OUT)* rm -f $(PYTHON.LIB) $(PYTHON.IMPLIB) $(PYTHON.EXEIMP) $(PYTHON.DLL) \ $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) *$(MODULE.EXT) lx: @echo Packing everything with lxLite... lxlite $(PYTHON.DLL) $(PYTHON.EXE) $(PYTHONPM.EXE) $(PGEN.EXE) depend: $(OUTBASE) makedep -f $(OUTBASE)python.dep -o $(BUCK)O -p $(BUCK)\(OUT\) \ -r -c $(INCLUDE) $(SRC.LIB) $(SRC.PGEN) $(OUT): $(OUTBASE) $(OUT) $(OUTBASE): mkdir.exe $@ $(PYTHON.LIB): $(OBJ.LIB) rm.exe -f $@ $(AR) $(ARFLAGS) $@ $^ $(PYTHON.DEF): $(PYTHON.LIB) @echo Creating .DEF file: $@ @echo LIBRARY $(PYTHON_LIB) INITINSTANCE TERMINSTANCE >$@ @echo DESCRIPTION $(DQUOTE)Python $(PYTHON_VER) Core DLL$(DQUOTE) >>$@ @echo PROTMODE >>$@ @echo DATA MULTIPLE NONSHARED >>$@ @echo EXPORTS >>$@ $(EXPLIB) -u $(PYTHON.LIB) >>$@ $(PYTHON.IMPLIB): $(PYTHON.DEF) $(IMPLIB) -o $@ $^ $(PYTHON.EXEIMP): $(PYTHON.DEF) $(IMPLIB) -o $@ $^ $(PYTHON.DLL): $(OUT)dllentry$O $(PYTHON.LIB) $(PYTHON.DEF) # Explicit make targets for the .EXEs to be able to use LD to link # (so that fork() will work if required) $(PYTHON.EXE): $(SRC.EXE) $(PYTHON.EXEIMP) $(OUT)python.def $(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.EXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)python.def $(PYTHONPM.EXE): $(SRC.PMEXE) $(PYTHON.EXEIMP) $(OUT)pythonpm.def $(CC) -Zmt $(LDMODE.EXE) -Zcrtdll -Wall $(INCLUDE) -L. -lgcc -o $@ $(SRC.PMEXE) $(PYTHON.EXEIMP) $(LIBS) $(OUT)pythonpm.def $(PGEN.EXE): $(OBJ.PGEN) $(PYTHON.LIB) $(OUT)pgen.def # Explicit building instructions for those external modules that require # awkward handling (due e.g. to non-std naming, or multiple source files) # - standard modules binascii$(MODULE.EXT): $(OUT)binascii$O $(OUT)binascii_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) cPickle$(MODULE.EXT): $(OUT)cPickle$O $(OUT)cPickle_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) # cStringIO needs to be renamed to be useful (8 char DLL name limit) cStringIO$(MODULE.EXT): $(OUT)cStringIO$O $(OUT)cStringIO_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) cStringI$(MODULE.EXT): cStringIO$(MODULE.EXT) cp $^ $@ _hotshot$(MODULE.EXT): $(OUT)_hotshot$O $(OUT)_hotshot_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) imageop$(MODULE.EXT): $(OUT)imageop$O $(OUT)imageop_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) md5$(MODULE.EXT): $(OUT)md5module$O $(OUT)md5c$O $(OUT)md5_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) operator$(MODULE.EXT): $(OUT)operator$O $(OUT)operator_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) pcre$(MODULE.EXT): $(OUT)pcremodule$O $(OUT)pypcre$O $(OUT)pcre_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) regex$(MODULE.EXT): $(OUT)regexmodule$O $(OUT)regexpr$O $(OUT)regex_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) _socket$(MODULE.EXT): $(OUT)socketmodule$O $(OUT)_socket_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) # _symtable needs to be renamed to be useful _symtable$(MODULE.EXT): $(OUT)symtablemodule$O $(OUT)_symtable_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) _symtabl$(MODULE.EXT): _symtable$(MODULE.EXT) cp $^ $@ termios$(MODULE.EXT): $(OUT)termios$O $(OUT)termios_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) # _testcapi needs to be renamed to be useful _testcapi$(MODULE.EXT): $(OUT)_testcapimodule$O $(OUT)_testcapi_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) _testcap$(MODULE.EXT): _testcapi$(MODULE.EXT) cp $^ $@ # unicodedata needs to be renamed to be useful unicodedata$(MODULE.EXT): $(OUT)unicodedata$O $(OUT)unicodedata_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(MODULE_LIBS) unicoded$(MODULE.EXT): unicodedata$(MODULE.EXT) cp $^ $@ _weakref$(MODULE.EXT): $(OUT)_weakref$O $(OUT)_weakref_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) # xreadlines needs to be renamed to be useful xreadlines$(MODULE.EXT): $(OUT)xreadlinesmodule$O $(OUT)xreadlines_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) xreadlin$(MODULE.EXT): xreadlines$(MODULE.EXT) cp $^ $@ # - optional modules (requiring other software to be installed) bsddb$(MODULE.EXT): $(OUT)bsddbmodule$O $(OUT)bsddb_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -ldb $(LIBS) crypt$(MODULE.EXT): $(OUT)cryptmodule$O $(OUT)crypt_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) -lufc $(LIBS) # The _curses_panel module requires a couple of ncurses library entry # points, which are best exposed as exports from the _curses module DLL $(OUT)_curses_m.def: @echo Creating .DEF file: $@ @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@ @echo DESCRIPTION $(DQUOTE)$(DESCRIPTION.$(notdir $*)$(MODULE.EXT))$(DQUOTE) >>$@ @echo DATA MULTIPLE NONSHARED >>$@ @echo EXPORTS >>$@ @echo init_curses >>$@ @echo wnoutrefresh >>$@ @echo _nc_panelhook >>$@ @echo is_linetouched >>$@ @echo mvwin >>$@ @echo stdscr >>$@ @echo wtouchln >>$@ $(OUT)_curses_panel_m.def: @echo Creating .DEF file: $@ @echo LIBRARY $(notdir $*) INITINSTANCE TERMINSTANCE >$@ @echo DESCRIPTION $(DQUOTE)Python standard module $(notdir $*)$(DQUOTE) >>$@ @echo DATA MULTIPLE NONSHARED >>$@ @echo IMPORTS >>$@ @echo _curses.wnoutrefresh >>$@ @echo _curses._nc_panelhook >>$@ @echo _curses.is_linetouched >>$@ @echo _curses.mvwin >>$@ @echo _curses.stdscr >>$@ @echo _curses.wtouchln >>$@ @echo EXPORTS >>$@ @echo init_curses_panel >>$@ _curses$(MODULE.EXT): $(OUT)_cursesmodule$O $(OUT)_curses_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lncurses # curses_panel needs to be renamed to be useful _curses_panel$(MODULE.EXT): $(OUT)_curses_panel$O $(OUT)_curses_panel_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lpanel _curses_$(MODULE.EXT): _curses_panel$(MODULE.EXT) cp $^ $@ dbm$(MODULE.EXT): $(OUT)dbmmodule$O $(OUT)dbm_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm gdbm$(MODULE.EXT): $(OUT)gdbmmodule$O $(OUT)gdbm_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgdbm mpz$(MODULE.EXT): $(OUT)mpzmodule$O $(OUT)mpz_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lgmp pyexpat$(MODULE.EXT): $(OUT)pyexpat$O $(OUT)pyexpat_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lexpat readline$(MODULE.EXT): $(OUT)readline$O $(OUT)readline_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lreadline -lncurses #_tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O $(OUT)tkappinit$O _tkinter$(MODULE.EXT): $(OUT)_tkinter$O $(OUT)tclNotify$O \ $(OUT)_tkinter_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) $(TK_LIBS) zlib$(MODULE.EXT): $(OUT)zlibmodule$O $(OUT)zlib_m.def $(PYTHON.IMPLIB) $(LD) $(LDFLAGS.DLL) -o $@ $(^^) $(L^) $(LIBS) -lz # the test target test: ./python -tt ../../lib/test/regrtest.py -l -u "network" -include $(OUTBASE)python.dep --- NEW FILE: README.os2emx --- This is a port of Python 2.3 to OS/2 using the EMX development tools ========================================================================= What's new since the previous release ------------------------------------- This release of the port incorporates the following changes from the December 24, 2001 release of the Python 2.2 port: - based on the Python v2.3 final release source. Licenses and info about Python and EMX -------------------------------------- Please read the file README.Python-2.3 included in this package for information about Python 2.3. This file is the README file from the Python 2.3 source distribution available via http://www.python.org/ and its mirrors. The file LICENCE.Python-2.3 is the text of the Licence from the Python 2.3 source distribution. Note that the EMX package that this package depends on is released under the GNU General Public Licence. Please refer to the documentation accompanying the EMX Runtime libraries for more information about the implications of this. A copy of version 2 of the GPL is included as the file COPYING.gpl2. Readline and GDBM are covered by the GNU General Public Licence. I think Eberhard Mattes' porting changes to BSD DB v1.85 are also GPL'ed (BSD DB itself is BSD Licenced). ncurses and expat appear to be covered by MIT style licences - please refer to the source distributions for more detail. zlib is distributable under a very free license. GNU MP and GNU UFC are under the GNU LGPL (see file COPYING.lib). My patches to the Python-2.x source distributions, and any other packages used in this port, are placed in the public domain. This software is provided 'as-is', without any express or implied warranty. In no event will the author be held liable for any damages arising from the use of the software. I do hope however that it proves useful to someone. Other ports ----------- There have been ports of previous versions of Python to OS/2. The best known would be that by Jeff Rush, most recently of version 1.5.2. Jeff used IBM's Visual Age C++ (v3) for his ports, and his patches have been included in the Python 2.3 source distribution. Andrew Zabolotny implemented a port of Python v1.5.2 using the EMX development tools. His patches against the Python v1.5.2 source distribution have become the core of this port, and without his efforts this port wouldn't exist. Andrew's port also appears to have been compiled with his port of gcc 2.95.2 to EMX, which I have but have chosen not to use for the binary distribution of this port (see item 21 of the "YOU HAVE BEEN WARNED" section below). Previous Python port releases by me:- - v2.0 on March 31, 2001; - v2.0 on April 25, 2001 (cleanup release + Stackless variant); - v2.1 on June 17, 2001; - v2.0 (Stackless re-release) on June 18, 2001. - v2.1.1 on August 5, 2001; - v2.1.1 on August 12, 2001 (cleanup release); - v2.1.1 (updated DLL) on August 14, 2001. - v2.2b2 on December 8, 2001 (not uploaded to archive sites) - v2.2c1 on December 16, 2001 (not uploaded to archive sites) - v2.2 on December 24, 2001 It is possible to have these earlier ports still usable after installing this port - see the README.os2emx.multiple_versions file, contributed by Dr David Mertz, for a suggested approach to achieving this. Software requirements --------------------- This package requires the EMX Runtime package, available from the Hobbes (http://hobbes.nmsu.edu/) and LEO (http://archiv.leo.org/) archives of OS/2 software. I have used EMX version 0.9d fix04 in developing this port. My development system is running OS/2 v4 with fixpack 12. 3rd party software which has been linked into dynamically loaded modules: - ncurses (see http://dickey.his.com/ for more info, v5.2) - GNU Readline (Kai Uwe Rommel's port available from Hobbes or LEO, v2.1) - GNU GDBM (Kai Uwe Rommel's port available from Hobbes or LEO, v1.7.3) - zlib (Hung-Chi Chu's port available from Hobbes or LEO, v1.1.3) - expat (from ftp://ftp.jclark.com/pub/xml/, v1.2) - GNU MP (Peter Meerwald's port available from LEO, v2.0.2) - GNU UFC (Kai Uwe Rommel's port available from LEO, v2.0.4) The zlib module requires the Z.DLL to be installed - see the Installation section and item 12 of the "YOU HAVE BEEN WARNED" section for more information. About this port --------------- I have attempted to make this port as complete and functional as I can, notwithstanding the issues in the "YOU HAVE BEEN WARNED" section below. Core components: Python.exe is linked as an a.out executable, ie using EMX method E1 to compile & link the executable. This is so that fork() works (see "YOU HAVE BEEN WARNED" item 2). Python23.dll is created as a normal OMF DLL, with an OMF import library and module definition file. There is also an a.out (.a) import library to support linking the DLL to a.out executables. This port has been built with complete support for multithreading. Modules: As far as possible, extension modules have been made dynamically loadable when the module is intended to be built this way. I haven't yet changed the building of Python's standard modules over to using the DistUtils. See "YOU HAVE BEEN WARNED" item 5 for notes about the fcntl module, and "YOU HAVE BEEN WARNED" item 14 for notes about the pwd and grp modules. Support for case sensitive module import semantics has been added to match the Windows release. This can be deactivated by setting the PYTHONCASEOK environment variable (the value doesn't matter) - see "YOU HAVE BEEN WARNED" item 16. Optional modules: Where I've been able to locate the required 3rd party packages already ported to OS/2, I've built and included them. These include ncurses (_curses, _curses_panel), BSD DB (bsddb), GNU GDBM (gdbm, dbm), zlib (zlib), GNU Readline (readline), expat (pyexpat), GNU MP (mpz) and GNU UFC (crypt). I have built these modules statically linked against the 3rd party libraries, with the exception of zlib. Unfortunately my attempts to use the dll version of GNU readline have been a dismal failure, in that when the dynamically linked readline module is active other modules immediately provoke a core dump when imported. Only the BSD DB package (part of the BSD package distributed with EMX) needed source modifications to be used for this port, pertaining to use of errno with multithreading. The other packages, except for ncurses and zlib, needed Makefile changes for multithreading support but no source changes. The _curses_panel module is a potential problem - see "YOU HAVE BEEN WARNED" item 17. Upstream source patches: No updates to the Python 2.3 release have become available. Eberhard Mattes' EMXFIX04 update to his EMX 0.9d tools suite includes bug fixes for the BSD DB library. The bsddb module included in this port incorporates these fixes. Library and other distributed Python code: The Python standard library lives in the Lib directory. All the standard library code included with the Python 2.3 source distribution is included in the binary archive, with the exception of the dos-8x3 and tkinter subdirectories which have been omitted to reduce the size of the binary archive - the dos-8x3 components are unnecessary duplicates and Tkinter is not supported by this port (yet). All the plat-* subdirectories in the source distribution have also been omitted, and a plat-os2emx directory included. The Tools and Demo directories contain a collection of Python scripts. To reduce the size of the binary archive, the Demo/sgi, Demo/Tix, Demo/tkinter, Tools/audiopy and Tools/IDLE subdirectories have been omitted as not being supported by this port. The Misc directory has also been omitted. All subdirectories omitted from the binary archive can be reconstituted from the Python 2.3 source distribution, if desired. Support for building Python extensions: The Config subdirectory contains the files describing the configuration of the interpreter and the Makefile, import libraries for the Python DLL, and the module definition file used to create the Python DLL. The Include subdirectory contains all the standard Python header files needed for building extensions. As I don't have the Visual Age C++ compiler, I've made no attempt to have this port support extensions built with that compiler. Packaging --------- This port is packaged into several archives: - python-2.3-os2emx-bin-02????.zip (binaries, library modules) - python-2.3-os2emx-src-03????.zip (source patches and makefiles) Documentation for the Python language, as well as the Python 2.3 source distibution, can be obtained from the Python website (http://www.python.org/) or the Python project pages at Sourceforge (http://sf.net/projects/python/). Installation ------------ Obtain and install, as per the included instructions, the EMX runtime package. If you wish to use the zlib module, you will need to obtain and install the Z.DLL from Hung-Chi Chu's port of zlib v1.1.3 (zlib113.zip). See also "YOU HAVE BEEN WARNED" item 12 below. Unpack this archive, preserving the subdirectories, in the root directory of the drive where you want Python to live. Add the Python directory (eg C:\Python23) to the PATH and LIBPATH variables in CONFIG.SYS. You should then set the PYTHONHOME and PYTHONPATH environment variables in CONFIG.SYS. PYTHONHOME should be set to Python's top level directory. PYTHONPATH should be set to the semicolon separated list of principal Python library directories. I use: SET PYTHONHOME=F:/Python23 SET PYTHONPATH=F:/Python23/Lib;F:/Python23/Lib/plat-os2emx; F:/Python23/Lib/lib-dynload;F:/Python23/Lib/site-packages NOTE!: the PYTHONPATH setting above is linewrapped for this document - it should all be on one line in CONFIG.SYS! If you wish to use the curses module, you should set the TERM and TERMINFO environment variables appropriately. If you don't already have ncurses installed, I have included a copy of the EMX subset of the Terminfo database included with the ncurses-5.2 source distribution. This can be used by setting the TERMINFO environment variable to the path of the Terminfo subdirectory below the Python home directory. On my system this looks like: SET TERMINFO=F:/Python23/Terminfo For the TERM environment variable, I would try one of the following: SET TERM=ansi SET TERM=os2 SET TERM=window You will have to reboot your system for these changes to CONFIG.SYS to take effect. If you wish to compile all the included Python library modules to bytecode, you can change into the Python home directory and run the COMPILEALL.CMD batch file. You can execute the regression tests included with the Python 2.3 source distribution by changing to the Python 2.3 home directory and executing the REGRTEST.CMD batch file. The following tests are known to fail at this time: - test_longexp (see "YOU HAVE BEEN WARNED" item 1); - test_mhlib (I don't know of any port of MH to OS/2); - test_pwd (see "YOU HAVE BEEN WARNED" item 14, probably a bug in my code); - test_grp (as per test_pwd); - test_strftime (see "YOU HAVE BEEN WARNED" item 20); - test_socketserver (fork() related, see "YOU HAVE BEEN WARNED" item 2). YOU HAVE BEEN WARNED!! ---------------------- I know about a number of nasties in this port. 1. EMX's malloc() and/or the underlying OS/2 VM system aren't particularly comfortable with Python's use of heap memory. The test_longexp regression test exhausts the available swap space on a machine with 64MB of RAM with 150MB of available swap space. Using a crudely instrumented wrapper around malloc()/realloc()/free(), the heap memory usage of the expression at the core of the test (eval('[' + '2,' * NUMREPS + ']')) is as follows (approximately): NUMREPS = 1 => 300k NUMREPS = 10000 => 22MB NUMREPS = 20500 => 59MB I don't even have enough memory to try for NUMREPS = 25000 :-(, let alone the NUMREPS = 65580 in test_longexp! I do have a report that the test succeeds in the presence of sufficient memory (~200MB RAM). During the course of running the test routine, the Python parser allocates lots of 21 byte memory chunks, each of which is actually a 64 byte allocation. There are a smaller number of 3 byte allocations which consume 12 bytes each. Consequently, more than 3 times as much memory is allocated than is actually used. The Python Object Allocator code (PyMalloc) was introduced in Python 2.1 for Python's core to be able to wrap the malloc() system to deal with problems with "unfriendly" malloc() behaviour, such as this. Unfortunately for the OS/2 port, it is only supported for the allocation of memory for objects, whereas my research into this problem indicates it is the parser which is source of this particular malloc() frenzy. I have attempted using PyMalloc to manage all of Python's memory allocation. While this works fine (modulo the socket regression test failing in the absence of a socket.pyc), it is a significant performance hit - the time to run the regression test blows out from ~3.5 minutes to ~5.75 minutes on my system. I therefore don't plan to pursue this any further for the time being. Be aware that certain types of expressions could well bring your system to its knees as a result of this issue. I have modified the longexp test to report failure to highlight this. 2. Eberhard Mattes, author of EMX, writes in his documentation that fork() is very inefficient in the OS/2 environment. It also requires that the executable be linked in a.out format rather than OMF. Use the os.exec and/or the os.spawn family of functions where possible. {3. Issue resolved...} 4. In the absence of GNU Readline, terminating the interpreter requires a control-Z (^Z) followed by a carriage return. Jeff Rush documented this problem in his Python 1.5.2 port. With Readline, a control-D (^D) works as per the standard Unix environment. 5. EMX only has a partial implementation of fcntl(). The fcntl module in this port supports what EMX supports. If fcntl is important to you, please review the EMX C Library Reference (included in .INF format in the EMXVIEW.ZIP archive as part of the complete EMX development tools suite). Because of other side-effects I have modified the test_fcntl.py test script to deactivate the exercising of the missing functionality. 6. The BSD DB module is linked against DB v1.85. This version is widely known to have bugs, although some patches have become available (and are incorporated into the included bsddb module). Unless you have problems with software licenses which would rule out GDBM (and the dbm module because it is linked against the GDBM library) or need it for file format compatibility, you may be better off deleting it and relying on GDBM. I haven't looked at porting the version of the module supporting the later SleepyCat releases of BSD DB, which would also require a port of the SleepyCat DB package. 7. The readline module has been linked against ncurses rather than the termcap library supplied with EMX. {8. Workaround implemented} 9. I have configured this port to use "/" as the preferred path separator character, rather than "\" ('\\'), in line with the convention supported by EMX. Backslashes are still supported of course, and still appear in unexpected places due to outside sources that don't get normalised. 10. While the DistUtils components are now functional, other packaging/binary handling tools and utilities such as those included in the Demo and Tools directories - freeze in particular - are unlikely to work. If you do get them going, I'd like to know about your success. 11. I haven't set out to support the [BEGIN|END]LIBPATH functionality supported by one of the earlier ports (Rush's??). If it works let me know. 12. There appear to be several versions of Z.DLL floating around - the one I have is 45061 bytes and dated January 22, 1999. I have a report that another version causes SYS3175s when the zlib module is imported. 14. As a result of the limitations imposed by EMX's library routines, the standard extension module pwd only synthesises a simple passwd database, and the grp module cannot be supported at all. I have written substitutes, in Python naturally, which can process real passwd and group files for those applications (such as MailMan) that require more than EMX emulates. I have placed pwd.py and grp.py in Lib/plat-os2emx, which is usually before Lib/lib-dynload (which contains pwd.pyd) in the PYTHONPATH. If you have become attached to what pwd.pyd supports, you can put Lib/lib-dynload before Lib/plat-os2emx in PYTHONPATH or delete/rename pwd.py & grp.py. pwd.py & grp.py support locating their data files by looking in the environment for them in the following sequence: pwd.py: $ETC_PASSWD (%ETC_PASSWD%) $ETC/passwd (%ETC%/passwd) $PYTHONHOME/Etc/passwd (%PYTHONHOME%/Etc/passwd) grp.py: $ETC_GROUP (%ETC_GROUP%) $ETC/group (%ETC%/group) $PYTHONHOME/Etc/group (%PYTHONHOME%/Etc/group) Both modules support using either the ":" character (Unix standard) or ";" (OS/2, DOS, Windows standard) field separator character, and pwd.py implements the following drive letter conversions for the home_directory and shell fields (for the ":" separator only): $x -> x: x; -> x: Example versions of passwd and group are in the Etc subdirectory. Note that as of this release, this code fails the regression test. I'm looking into why, and hope to have this fixed. 15. As of Python 2.1, termios support has mutated. There is no longer a platform specific TERMIOS.py containing the symbolic constants - these now live in the termios module. EMX's termios routines don't support all of the functionality now exposed by the termios module - refer to the EMX documentation to find out what is supported. 16. The case sensitive import semantics introduced in Python 2.1 for other case insensitive but case preserving file/operating systems (Windows etc), have been incorporated into this port, and are active by default. Setting the PYTHONCASEOK environment variable (to any value) reverts to the previous (case insensitive) semantics. 17. Because I am statically linking ncurses, the _curses_panel module has potential problems arising from separate library data areas. To avoid this, I have configured the _curses_.pyd (imported as "_curses_panel") to import the ncurses symbols it needs from _curses.pyd. As a result the _curses module must be imported before the _curses_panel module. As far as I can tell, the modules in the curses package do this. If you have problems attempting to use the _curses_panel support please let me know, and I'll look into an alternative solution. 18. I tried enabling the Python Object Allocator (PYMALLOC) code. While the port built this way passes the regression test, the Numpy extension (I tested v19.0.0) as built with with the port's DistUtils code doesn't work. Specifically, attempting to "import Numeric" provokes a core dump. Supposedly Numpy v20.1.0 contains a fix for this, but for reason outlined in item 1 above, PYMALLOC is not enabled in this release. 19. sys.platform now reports "os2emx" instead of "os2". os.name still reports "os2". This change was to make it easier to distinguish between the VAC++ build (being maintained by Michael Muller) and the EMX build (this port), principally for DistUtils. 20. it appears that the %W substitution in the EMX strftime() routine has an off-by-one bug. strftime was listed as passing the regression tests in previous releases, but this fact appears to have been an oversight in the regression test suite. To fix this really requires a portable strftime routine - I'm looking into using one from FreeBSD, but its not ready yet. 21. previous releases of my Python ports have used the GCC optimisations "-O2 -fomit-frame-pointer". After experimenting with various optimisation settings, including deactivating assert()ions, I have concluded that "-O2" appears the best compromise for GCC 2.8.1 on my hardware. Curiously, deactivating assert() (via defining NDEBUG) _negatively_ impacts performance, allbeit only slightly, so I've chosen to leave the assert()s active. I did try using Andrew Zabolotny's (p)gcc 2.95.2 compiler, and in general concluded that it produced larger objects that ran slower than Mattes' gcc 2.8.1 compiler. Pystone ratings varied from just over 2000/s (no optimisation at all) to just under 3300/s (gcc 2.8.1, -O2) on my K6/2-300 system, for 100,000 iterations per run (rather than the default 10000). As a result of the optimisation change, the Python DLL is about 10% smaller than in the 2.1 release, and many of the dynamically loadable modules are smaller too. [2001/08/12] 22. As of this release, os.spawnv() and os.spawnve() now expose EMX's library routines rather than use the emulation in os.py. In order to make use of some of the features this makes available in the OS/2 environment, you should peruse the relevant EMX documentation (EMXLIB.INF in the EMXVIEW.ZIP archive accompanying the EMX archives on Hobbes or LEO). Be aware that I have exposed all the "mode" options supported by EMX, but there are combinations that either cannot be practically used by/in Python or have the potential to compromise your system's stability. 23. pythonpm.exe in previous releases was just python.exe with the WINDOWAPI linker option set in the pythonpm.def file. In practice, this turns out to do nothing useful. I have written a replacement which wraps the Python DLL in a genuine Presentation Manager application. This version actually runs the Python interpreter in a separate thread from the PM shell, in order that PythonPM has a functioning message queue as good PM apps should. In its current state, PythonPM's window is hidden. It can be displayed, although it will have no content as nothing is ever written to the window. Only the "hide" button is available. Although the code has support for shutting PythonPM down when the Python interpreter is still busy (via the "control" menu), this is not well tested and given comments I've come across in EMX documentation suggesting that the thread killing operation has problems I would suggest caution in relying on this capability. PythonPM processes commandline parameters normally. The standard input, output and error streams are only useful if redirected, as PythonPM's window is not a console in any form and so cannot accept or display anything. This means that the -i option is ineffective. Because the Python thread doesn't create its own message queue, creating PM Windows and performing most PM operations is not possible from within this thread. How this will affect supporting PM extensions (such as Tkinter using a PM port of Tcl/Tk, or wxPython using the PM port of WxWindows) is still being researched. Note that os.fork() _DOES_NOT_WORK_ in PythonPM - SYS3175s are the result of trying. os.spawnv() _does_ work. PythonPM passes all regression tests that the standard Python interpreter (python.exe) passes, with the exception of test_fork1 and test_socket which both attempt to use os.fork(). I very much want feedback on the performance, behaviour and utility of PythonPM. I would like to add a PM console capability to it, but that will be a non-trivial effort. I may be able to leverage the code in Illya Vaes' Tcl/Tk port, which would make it easier. [2001/08/14] 24. os.chdir() now uses EMX's _chdir2(), which supports changing both drive and directory at once. Similarly, os.getcwd() now uses EMX's _getcwd() which returns drive as well as path. [2001/12/08] - 2.2 Beta 2 25. pyconfig.h (previously known as config.h) is now located in the Include subdirectory with all other include files. [2001/12/16] - 2.2 Release Candidate 1 [2001/12/08] - 2.2 Final ... probably other issues that I've not encountered, or don't remember :-( If you encounter other difficulties with this port, which can be characterised as peculiar to this port rather than to the Python release, I would like to hear about them. However I cannot promise to be able to do anything to resolve such problems. See the Contact section below... To do... -------- In no particular order of apparent importance or likelihood... - support Tkinter and/or alternative GUI (wxWindows??) Credits ------- In addition to people identified above, I'd like to thank: - the BDFL, Guido van Rossum, and crew for Python; - Dr David Mertz, for trying out a pre-release of this port; - the Python-list/comp.lang.python community; - John Poltorak, for input about pwd/grp. Contact ------- Constructive feedback, negative or positive, about this port is welcome and should be addressed to me at the e-mail addresses below. I intend creating a private mailing list for announcements of fixes & updates to this port. If you wish to receive such e-mail announcments, please send me an e-mail requesting that you be added to this list. Andrew MacIntyre E-mail: andymac@bullseye.apana.org.au, or andymac@pcug.org.au Web: http://www.andymac.org/ 24 December, 2001. --- NEW FILE: config.c --- /* -*- C -*- *********************************************** Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Stichting Mathematisch Centrum or CWI or Corporation for National Research Initiatives or CNRI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. While CWI is the initial source for this software, a modified version is made available by the Corporation for National Research Initiatives (CNRI) at the Internet address ftp://ftp.python.org. STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* Module configuration */ /* This file contains the table of built-in modules. See init_builtin() in import.c. */ #include "Python.h" extern void init_codecs(); extern void init_curses(); extern void init_curses_panel(); extern void init_hotshot(); extern void init_locale(); extern void init_socket(); extern void init_sre(); extern void init_testcapi(); extern void init_weakref(); extern void initarray(); extern void initbinascii(); extern void initbsddb(); extern void initcPickle(); extern void initcStringIO(); extern void initcmath(); extern void initdl(); extern void initerrno(); extern void initfcntl(); extern void initfpectl(); extern void initfpetest(); extern void initgc(); extern void initimageop(); extern void initmath(); extern void initmd5(); extern void initnew(); extern void initos2(); extern void initoperator(); extern void initparser(); extern void initpcre(); extern void initpwd(); extern void initregex(); extern void initrgbimg(); extern void initrotor(); extern void initselect(); extern void initsha(); extern void initsignal(); extern void initstrop(); extern void initstruct(); extern void inittermios(); extern void initthread(); extern void inittime(); extern void inittiming(); extern void initunicodedata(); extern void initxreadlines(); extern void initzlib(); /* -- ADDMODULE MARKER 1 -- */ extern void PyMarshal_Init(); extern void initimp(); struct _inittab _PyImport_Inittab[] = { {"gc", initgc}, {"os2", initos2}, {"_sre", init_sre}, {"signal", initsignal}, #ifdef WITH_THREAD {"thread", initthread}, #endif #if !HAVE_DYNAMIC_LOADING {"_codecs", init_codecs}, {"_curses", init_curses}, {"_curses_panel", init_curses_panel}, {"_hotshot", init_hotshot}, {"_locale", init_locale}, {"_testcapi", init_testcapi}, {"_weakref", init_weakref}, {"array", initarray}, {"binascii", initbinascii}, {"bsddb", initbsddb}, {"cPickle", initcPickle}, {"cStringIO", initcStringIO}, {"cmath", initcmath}, {"dl", initdl}, {"errno", initerrno}, {"fcntl", initfcntl}, {"fpectl", initfpectl}, {"fpetest", initfpetest}, {"imageop", initimageop}, {"math", initmath}, {"md5", initmd5}, {"new", initnew}, {"operator", initoperator}, {"parser", initparser}, {"pcre", initpcre}, {"pwd", initpwd}, {"regex", initregex}, {"rgbimg", initrgbimg}, {"rotor", initrotor}, {"sha", initsha}, {"strop", initstrop}, {"struct", initstruct}, {"termios", inittermios}, {"time", inittime}, {"timing", inittiming}, {"unicodedata", initunicodedata}, {"xreadlines", initxreadlines}, {"zlib", initzlib}, #ifdef USE_SOCKET {"_socket", init_socket}, {"select", initselect}, #endif #endif /* -- ADDMODULE MARKER 2 -- */ /* This module "lives in" with marshal.c */ {"marshal", PyMarshal_Init}, /* This lives it with import.c */ {"imp", initimp}, /* These entries are here for sys.builtin_module_names */ {"__main__", NULL}, {"__builtin__", NULL}, {"sys", NULL}, {"exceptions", NULL}, /* Sentinel */ {0, 0} }; --- NEW FILE: dlfcn.c --- /* -*- C -*- *********************************************** Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Stichting Mathematisch Centrum or CWI or Corporation for National Research Initiatives or CNRI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. While CWI is the initial source for this software, a modified version is made available by the Corporation for National Research Initiatives (CNRI) at the Internet address ftp://ftp.python.org. STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* This library implements dlopen() - functions for OS/2 using DosLoadModule() and company. */ #define INCL_DOS #define INCL_DOSERRORS #define INCL_DOSSESMGR #define INCL_WINPROGRAMLIST #define INCL_WINFRAMEMGR #include #include #include #include #include /*-------------------------------------- Unix-like dynamic linking emulation -*/ typedef struct _track_rec { char *name; HMODULE handle; void *id; struct _track_rec *next; } tDLLchain, *DLLchain; static DLLchain dlload = NULL; /* A simple chained list of DLL names */ static char dlerr [256]; /* last error text string */ static void *last_id; static DLLchain find_id(void *id) { DLLchain tmp; for (tmp = dlload; tmp; tmp = tmp->next) if (id == tmp->id) return (tmp); return (NULL); } /* load a dynamic-link library and return handle */ void *dlopen (char *filename, int flags) { HMODULE hm; DLLchain tmp; char err[256]; char *errtxt; int rc = 0, set_chain = 0; for (tmp = dlload; tmp; tmp = tmp->next) if (strnicmp(tmp->name, filename, 999) == 0) break; if (!tmp) { tmp = (DLLchain)malloc (sizeof (tDLLchain)); if (!tmp) goto nomem; tmp->name = strdup (filename); tmp->next = dlload; set_chain = 1; } switch (rc = DosLoadModule((PSZ)&err, sizeof(err), filename, &hm)) { case NO_ERROR: tmp->handle = hm; if (set_chain) { do { last_id++; } while ((last_id == 0) || (find_id(last_id))); tmp->id = last_id; dlload = tmp; } return (tmp->id); case ERROR_FILE_NOT_FOUND: case ERROR_PATH_NOT_FOUND: errtxt = "module `%s' not found"; break; case ERROR_TOO_MANY_OPEN_FILES: case ERROR_NOT_ENOUGH_MEMORY: case ERROR_SHARING_BUFFER_EXCEEDED: nomem: errtxt = "out of system resources"; break; case ERROR_ACCESS_DENIED: errtxt = "access denied"; break; case ERROR_BAD_FORMAT: case ERROR_INVALID_SEGMENT_NUMBER: case ERROR_INVALID_ORDINAL: case ERROR_INVALID_MODULETYPE: case ERROR_INVALID_EXE_SIGNATURE: case ERROR_EXE_MARKED_INVALID: case ERROR_ITERATED_DATA_EXCEEDS_64K: case ERROR_INVALID_MINALLOCSIZE: case ERROR_INVALID_SEGDPL: case ERROR_AUTODATASEG_EXCEEDS_64K: case ERROR_RELOCSRC_CHAIN_EXCEEDS_SEGLIMIT: errtxt = "invalid module format"; break; case ERROR_INVALID_NAME: errtxt = "filename doesn't match module name"; break; case ERROR_SHARING_VIOLATION: case ERROR_LOCK_VIOLATION: errtxt = "sharing violation"; break; case ERROR_INIT_ROUTINE_FAILED: errtxt = "module initialization failed"; break; default: errtxt = "cause `%s', error code = %d"; break; } snprintf (dlerr, sizeof (dlerr), errtxt, &err, rc); if (tmp) { if (tmp->name) free(tmp->name); free (tmp); } return (0); } /* return a pointer to the `symbol' in DLL */ void *dlsym (void *handle, char *symbol) { int rc = 0; PFN addr; char *errtxt; int symord = 0; DLLchain tmp = find_id (handle); if (!tmp) goto inv_handle; if (*symbol == '#') symord = atoi (symbol + 1); switch (rc = DosQueryProcAddr(tmp->handle, symord, symbol, &addr)) { case NO_ERROR: return ((void *)addr); case ERROR_INVALID_HANDLE: inv_handle: errtxt = "invalid module handle"; break; case ERROR_PROC_NOT_FOUND: case ERROR_INVALID_NAME: errtxt = "no symbol `%s' in module"; break; default: errtxt = "symbol `%s', error code = %d"; break; } snprintf (dlerr, sizeof (dlerr), errtxt, symbol, rc); return (NULL); } /* free dynamicaly-linked library */ int dlclose (void *handle) { int rc; DLLchain tmp = find_id (handle); if (!tmp) goto inv_handle; switch (rc = DosFreeModule (tmp->handle)) { case NO_ERROR: free (tmp->name); dlload = tmp->next; free (tmp); return (0); case ERROR_INVALID_HANDLE: inv_handle: strcpy(dlerr, "invalid module handle"); return (-1); case ERROR_INVALID_ACCESS: strcpy (dlerr, "access denied"); return (-1); default: return (-1); } } /* return a string describing last occured dl error */ char *dlerror() { return (dlerr); } --- NEW FILE: dlfcn.h --- /* -*- C -*- *********************************************** Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Stichting Mathematisch Centrum or CWI or Corporation for National Research Initiatives or CNRI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. While CWI is the initial source for this software, a modified version is made available by the Corporation for National Research Initiatives (CNRI) at the Internet address ftp://ftp.python.org. STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* This library implements dlopen() - functions for OS/2 using DosLoadModule() and company. */ #ifndef _DLFCN_H #define _DLFCN_H /*-------------------------------------- Unix-like dynamic linking emulation -*/ /* load a dynamic-link library and return handle */ void *dlopen (char *filename, int flags); /* return a pointer to the `symbol' in DLL */ void *dlsym (void *handle, char *symbol); /* free dynamicaly-linked library */ int dlclose (void *handle); /* return a string describing last occured dl error */ char *dlerror(void); #endif /* !_DLFCN_H */ --- NEW FILE: dllentry.c --- /* This is the entry point for Python DLL(s). It also provides an getenv() function that works from within DLLs. */ #define NULL 0 /* Make references to imported symbols to pull them from static library */ #define REF(s) extern void s (); void *____ref_##s = &s; REF (Py_Main); #if defined (__EMX__) #include extern int _CRT_init (void); extern void _CRT_term (void); extern void __ctordtorInit (void); extern void __ctordtorTerm (void); unsigned long _DLL_InitTerm (unsigned long mod_handle, unsigned long flag) { switch (flag) { case 0: if (_CRT_init ()) return 0; __ctordtorInit (); /* Ignore fatal signals */ signal (SIGSEGV, SIG_IGN); signal (SIGFPE, SIG_IGN); return 1; case 1: __ctordtorTerm (); _CRT_term (); return 1; default: return 0; } } #endif /* A version of getenv() that works from DLLs */ extern int DosScanEnv (const char *pszName, char **ppszValue); char *getenv (const char *name) { char *value; if (DosScanEnv (name, &value)) return NULL; else return value; } --- NEW FILE: getpathp.c --- /* Return the initial module search path. */ /* This version used by OS/2+EMX */ /* ---------------------------------------------------------------- PATH RULES FOR OS/2+EMX: This describes how sys.path is formed on OS/2+EMX. It describes the functionality, not the implementation (ie, the order in which these are actually fetched is different) * Python always adds an empty entry at the start, which corresponds to the current directory. * If the PYTHONPATH env. var. exists, it's entries are added next. * We attempt to locate the "Python Home" - if the PYTHONHOME env var is set, we believe it. Otherwise, we use the path of our host .EXE's to try and locate our "landmark" (lib\\os.py) and deduce our home. - If we DO have a Python Home: The relevant sub-directories (Lib, plat-win, lib-tk, etc) are based on the Python Home - If we DO NOT have a Python Home, the core Python Path is loaded from the registry. This is the main PythonPath key, and both HKLM and HKCU are combined to form the path) * Iff - we can not locate the Python Home, and have not had a PYTHONPATH specified (ie, we have _nothing_ we can assume is a good path), a default path with relative entries is used (eg. .\Lib;.\plat-win, etc) The end result of all this is: * When running python.exe, or any other .exe in the main Python directory (either an installed version, or directly from the PCbuild directory), the core path is deduced. * When Python is hosted in another exe (different directory, embedded via COM, etc), the Python Home will not be deduced, so the core path from the registry is used. Other "application paths "in the registry are always read. * If Python can't find its home and there is no registry (eg, frozen exe, some very strange installation setup) you get a path with some default, but relative, paths. ---------------------------------------------------------------- */ #include "Python.h" #include "osdefs.h" #ifndef PYOS_OS2 #error This file only compilable on OS/2 #endif #define INCL_DOS #include #include #include #include #if HAVE_UNISTD_H #include #endif /* HAVE_UNISTD_H */ /* Search in some common locations for the associated Python libraries. * * Py_GetPath() tries to return a sensible Python module search path. * * The approach is an adaptation for Windows of the strategy used in * ../Modules/getpath.c; it uses the Windows Registry as one of its * information sources. */ #ifndef LANDMARK #if defined(PYCC_GCC) #define LANDMARK "lib/os.py" #else #define LANDMARK "lib\\os.py" #endif #endif static char prefix[MAXPATHLEN+1]; static char progpath[MAXPATHLEN+1]; static char *module_search_path = NULL; static int is_sep(char ch) /* determine if "ch" is a separator character */ { #ifdef ALTSEP return ch == SEP || ch == ALTSEP; #else return ch == SEP; #endif } /* assumes 'dir' null terminated in bounds. Never writes beyond existing terminator. */ static void reduce(char *dir) { size_t i = strlen(dir); while (i > 0 && !is_sep(dir[i])) --i; dir[i] = '\0'; } static int exists(char *filename) { struct stat buf; return stat(filename, &buf) == 0; } /* Assumes 'filename' MAXPATHLEN+1 bytes long - may extend 'filename' by one character. */ static int ismodule(char *filename) /* Is module -- check for .pyc/.pyo too */ { if (exists(filename)) return 1; /* Check for the compiled version of prefix. */ if (strlen(filename) < MAXPATHLEN) { strcat(filename, Py_OptimizeFlag ? "o" : "c"); if (exists(filename)) return 1; } return 0; } /* guarantees buffer will never overflow MAXPATHLEN+1 bytes */ static void join(char *buffer, char *stuff) { size_t n, k; if (is_sep(stuff[0])) n = 0; else { n = strlen(buffer); if (n > 0 && !is_sep(buffer[n-1]) && n < MAXPATHLEN) buffer[n++] = SEP; } k = strlen(stuff); if (n + k > MAXPATHLEN) k = MAXPATHLEN - n; strncpy(buffer+n, stuff, k); buffer[n+k] = '\0'; } /* gotlandmark only called by search_for_prefix, which ensures 'prefix' is null terminated in bounds. join() ensures 'landmark' can not overflow prefix if too long. */ static int gotlandmark(char *landmark) { int n, ok; n = strlen(prefix); join(prefix, landmark); ok = ismodule(prefix); prefix[n] = '\0'; return ok; } /* assumes argv0_path is MAXPATHLEN+1 bytes long, already \0 term'd. assumption provided by only caller, calculate_path() */ static int search_for_prefix(char *argv0_path, char *landmark) { /* Search from argv0_path, until landmark is found */ strcpy(prefix, argv0_path); do { if (gotlandmark(landmark)) return 1; reduce(prefix); } while (prefix[0]); return 0; } static void get_progpath(void) { extern char *Py_GetProgramName(void); char *path = getenv("PATH"); char *prog = Py_GetProgramName(); PPIB pib; if ((DosGetInfoBlocks(NULL, &pib) == 0) && (DosQueryModuleName(pib->pib_hmte, sizeof(progpath), progpath) == 0)) return; if (prog == NULL || *prog == '\0') prog = "python"; /* If there is no slash in the argv0 path, then we have to * assume python is on the user's $PATH, since there's no * other way to find a directory to start the search from. If * $PATH isn't exported, you lose. */ #ifdef ALTSEP if (strchr(prog, SEP) || strchr(prog, ALTSEP)) #else if (strchr(prog, SEP)) #endif strncpy(progpath, prog, MAXPATHLEN); else if (path) { while (1) { char *delim = strchr(path, DELIM); if (delim) { size_t len = delim - path; /* ensure we can't overwrite buffer */ #if !defined(PYCC_GCC) len = min(MAXPATHLEN,len); #else len = MAXPATHLEN < len ? MAXPATHLEN : len; #endif strncpy(progpath, path, len); *(progpath + len) = '\0'; } else strncpy(progpath, path, MAXPATHLEN); /* join() is safe for MAXPATHLEN+1 size buffer */ join(progpath, prog); if (exists(progpath)) break; if (!delim) { progpath[0] = '\0'; break; } path = delim + 1; } } else progpath[0] = '\0'; } static void calculate_path(void) { char argv0_path[MAXPATHLEN+1]; char *buf; size_t bufsz; char *pythonhome = Py_GetPythonHome(); char *envpath = getenv("PYTHONPATH"); get_progpath(); /* progpath guaranteed \0 terminated in MAXPATH+1 bytes. */ strcpy(argv0_path, progpath); reduce(argv0_path); if (pythonhome == NULL || *pythonhome == '\0') { if (search_for_prefix(argv0_path, LANDMARK)) pythonhome = prefix; else pythonhome = NULL; } else strncpy(prefix, pythonhome, MAXPATHLEN); if (envpath && *envpath == '\0') envpath = NULL; /* We need to construct a path from the following parts. (1) the PYTHONPATH environment variable, if set; (2) the PYTHONPATH config macro, with the leading "." of each component replaced with pythonhome, if set; (3) the directory containing the executable (argv0_path). The length calculation calculates #2 first. */ /* Calculate size of return buffer */ if (pythonhome != NULL) { char *p; bufsz = 1; for (p = PYTHONPATH; *p; p++) { if (*p == DELIM) bufsz++; /* number of DELIM plus one */ } bufsz *= strlen(pythonhome); } else bufsz = 0; bufsz += strlen(PYTHONPATH) + 1; bufsz += strlen(argv0_path) + 1; if (envpath != NULL) bufsz += strlen(envpath) + 1; module_search_path = buf = malloc(bufsz); if (buf == NULL) { /* We can't exit, so print a warning and limp along */ fprintf(stderr, "Can't malloc dynamic PYTHONPATH.\n"); if (envpath) { fprintf(stderr, "Using environment $PYTHONPATH.\n"); module_search_path = envpath; } else { fprintf(stderr, "Using default static path.\n"); module_search_path = PYTHONPATH; } return; } if (envpath) { strcpy(buf, envpath); buf = strchr(buf, '\0'); *buf++ = DELIM; } if (pythonhome == NULL) { strcpy(buf, PYTHONPATH); buf = strchr(buf, '\0'); } else { char *p = PYTHONPATH; char *q; size_t n; for (;;) { q = strchr(p, DELIM); if (q == NULL) n = strlen(p); else n = q-p; if (p[0] == '.' && is_sep(p[1])) { strcpy(buf, pythonhome); buf = strchr(buf, '\0'); p++; n--; } strncpy(buf, p, n); buf += n; if (q == NULL) break; *buf++ = DELIM; p = q+1; } } if (argv0_path) { *buf++ = DELIM; strcpy(buf, argv0_path); buf = strchr(buf, '\0'); } *buf = '\0'; } /* External interface */ char * Py_GetPath(void) { if (!module_search_path) calculate_path(); return module_search_path; } char * Py_GetPrefix(void) { if (!module_search_path) calculate_path(); return prefix; } char * Py_GetExecPrefix(void) { return Py_GetPrefix(); } char * Py_GetProgramFullPath(void) { if (!module_search_path) calculate_path(); return progpath; } --- NEW FILE: pyconfig.h --- #ifndef Py_CONFIG_H #define Py_CONFIG_H /* config.h. At some time in the past, generated automatically by configure. Maintained manually for better results. */ #define PLATFORM "os2emx" #define COMPILER "[EMX GCC " __VERSION__ "]" #define PYOS_OS2 #define PYCC_GCC #define PREFIX "/usr" /* Debugging */ #ifndef Py_DEBUG /*#define Py_DEBUG 1*/ #endif /* so that emx socket headers will define IP V4 socket types */ #define TCPIPV4 /* Use OS/2 flavour of threads */ #define WITH_THREAD #define OS2_THREADS /* We want sockets */ #define USE_SOCKET #define socklen_t int /* enable the GC module */ #define WITH_CYCLE_GC 1 /* Unicode related */ #define Py_USING_UNICODE #define PY_UNICODE_TYPE wchar_t #define Py_UNICODE_SIZE SIZEOF_SHORT /* enable the Python object allocator */ /*#define WITH_PYMALLOC 1*/ #define PYTHONPATH ".;./Lib;./Lib/plat-" PLATFORM ";./Lib/lib-dynload;./Lib/site-packages" #define HAVE_TTYNAME 1 #define HAVE_WAIT 1 #define HAVE_GETEGID 1 #define HAVE_GETEUID 1 #define HAVE_GETGID 1 #define HAVE_GETPPID 1 #define HAVE_GETUID 1 #define HAVE_OPENDIR 1 #define HAVE_PIPE 1 #define HAVE_POPEN 1 #define HAVE_SYSTEM 1 #define HAVE_TTYNAME 1 #define HAVE_DYNAMIC_LOADING 1 /* if port of GDBM installed, it includes NDBM emulation */ #define HAVE_NDBM_H 1 /* need this for spawnv code in posixmodule (cloned from WIN32 def'n) */ typedef long intptr_t; /* we don't have tm_zone but do have the external array tzname. */ #define HAVE_TZNAME 1 /* Define as the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Define if you can safely include both and . */ #define TIME_WITH_SYS_TIME 1 /* Used for BeOS configuration */ /* #undef DL_EXPORT_HEADER */ #ifdef DL_EXPORT_HEADER #include DL_EXPORT_HEADER #endif /* Define this if you have the type long long */ #define HAVE_LONG_LONG 1 /* Define if your compiler supports function prototypes */ #define HAVE_PROTOTYPES 1 /* Define if your compiler supports variable length function prototypes (e.g. void fprintf(FILE *, char *, ...);) *and* */ #define HAVE_STDARG_PROTOTYPES 1 /* Define if malloc(0) returns a NULL pointer */ #define MALLOC_ZERO_RETURNS_NULL 1 /* Define to force use of thread-safe errno, h_errno, and other functions */ #define _REENTRANT 1 /* Define if you can safely include both and (which you can't on SCO ODT 3.0). */ #define SYS_SELECT_WITH_SYS_TIME 1 /* The number of bytes in an off_t. */ #define SIZEOF_OFF_T 4 /* The number of bytes in an time_t. */ #define SIZEOF_TIME_T 4 /* The number of bytes in a short. */ #define SIZEOF_SHORT 2 /* The number of bytes in a int. */ #define SIZEOF_INT 4 /* The number of bytes in a long. */ #define SIZEOF_LONG 4 /* The number of bytes in a long long. */ #define SIZEOF_LONG_LONG 8 /* The number of bytes in a void *. */ #define SIZEOF_VOID_P 4 /* Define if you have the alarm function. */ #define HAVE_ALARM 1 /* Define if you have the clock function. */ #define HAVE_CLOCK 1 /* Define if you have the dup2 function. */ #define HAVE_DUP2 1 /* Define if you have the execv function. */ #define HAVE_EXECV 1 /* Define if you have the spawnv function. */ #define HAVE_SPAWNV 1 /* Define if you have the flock function. */ #define HAVE_FLOCK 1 /* Define if you have the fork function. */ #define HAVE_FORK 1 /* Define if you have the fsync function. */ #define HAVE_FSYNC 1 /* Define if you have the ftime function. */ #define HAVE_FTIME 1 /* Define if you have the ftruncate function. */ #define HAVE_FTRUNCATE 1 /* Define if you have the getcwd function. */ #define HAVE_GETCWD 1 /* Define if you have the getpeername function. */ #define HAVE_GETPEERNAME 1 /* Define if you have the getpgrp function. */ #define HAVE_GETPGRP 1 /* Define if you have the getpid function. */ #define HAVE_GETPID 1 /* Define if you have the getpwent function. */ #define HAVE_GETPWENT 1 /* Define if you have the gettimeofday function. */ #define HAVE_GETTIMEOFDAY 1 /* Define if you have the getwd function. */ #define HAVE_GETWD 1 /* Define if you have the hypot function. */ #define HAVE_HYPOT 1 /* Define if you have the kill function. */ #define HAVE_KILL 1 /* Define if you have the memmove function. */ #define HAVE_MEMMOVE 1 /* Define if you have the mktime function. */ #define HAVE_MKTIME 1 /* Define if you have the pause function. */ #define HAVE_PAUSE 1 /* Define if you have the putenv function. */ #define HAVE_PUTENV 1 /* Define if you have the select function. */ #define HAVE_SELECT 1 /* Define if you have the setgid function. */ #define HAVE_SETGID 1 /* Define if you have the setlocale function. */ #define HAVE_SETLOCALE 1 /* Define if you have the setpgid function. */ #define HAVE_SETPGID 1 /* Define if you have the setuid function. */ #define HAVE_SETUID 1 /* Define if you have the setvbuf function. */ #define HAVE_SETVBUF 1 /* Define if you have the sigaction function. */ #define HAVE_SIGACTION 1 /* Define if you have the strdup function. */ #define HAVE_STRDUP 1 /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have the strptime function. */ #define HAVE_STRPTIME 1 /* Define if you have the tcgetpgrp function. */ #define HAVE_TCGETPGRP 1 /* Define if you have the tcsetpgrp function. */ #define HAVE_TCSETPGRP 1 /* Define if you have the times function. */ #define HAVE_TIMES 1 /* Define if you have the truncate function. */ #define HAVE_TRUNCATE 1 /* Define if you have the uname function. */ #define HAVE_UNAME 1 /* Define if you have the waitpid function. */ #define HAVE_WAITPID 1 /* Define if you have the header file. */ #define HAVE_DIRENT_H 1 /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #define HAVE_LOCALE_H 1 /* Define if you have the header file. */ #define HAVE_NCURSES_H 1 /* Define if you have the header file. */ #define HAVE_SIGNAL_H 1 /* Define if you have the header file. */ #define HAVE_STDARG_H 1 /* Define if you have the header file. */ #define HAVE_STDDEF_H 1 /* Define if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define if you have the header file. */ #define HAVE_SYS_FILE_H 1 /* Define if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define if you have the header file. */ #define HAVE_SYS_TIME_H 1 /* Define if you have the header file. */ #define HAVE_SYS_TIMES_H 1 /* Define if you have the header file. */ #define HAVE_SYS_UN_H 1 /* Define if you have the header file. */ #define HAVE_SYS_UTSNAME_H 1 /* Define if you have the header file. */ #define HAVE_SYS_WAIT_H 1 /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define if you have the header file. */ #define HAVE_UTIME_H 1 /* EMX has an snprintf() */ #define HAVE_SNPRINTF #endif /* !Py_CONFIG_H */ --- NEW FILE: python23.def --- LIBRARY python23 INITINSTANCE TERMINSTANCE DESCRIPTION "Python 2.3 Core DLL" PROTMODE DATA MULTIPLE NONSHARED EXPORTS ; From python23_s.lib(config) "_PyImport_Inittab" ; From python23_s.lib(dlfcn) "dlopen" "dlsym" "dlclose" "dlerror" ; From python23_s.lib(getpathp) "Py_GetPath" "Py_GetPrefix" "Py_GetExecPrefix" "Py_GetProgramFullPath" ; From python23_s.lib(getbuildinfo) "Py_GetBuildInfo" ; From python23_s.lib(main) "Py_Main" "Py_GetArgcArgv" ; From python23_s.lib(acceler) "PyGrammar_AddAccelerators" "PyGrammar_RemoveAccelerators" ; From python23_s.lib(grammar1) "PyGrammar_FindDFA" "PyGrammar_LabelRepr" ; From python23_s.lib(listnode) "PyNode_ListTree" ; From python23_s.lib(node) "PyNode_New" "PyNode_AddChild" "PyNode_Free" ; From python23_s.lib(parser) "PyParser_New" "PyParser_Delete" "PyParser_AddToken" ; From python23_s.lib(parsetok) "Py_TabcheckFlag" "PyParser_ParseString" "PyParser_ParseStringFlags" "PyParser_ParseFile" "PyParser_ParseFileFlags" ; From python23_s.lib(tokenizer) "PyTokenizer_FromString" "PyTokenizer_FromFile" "PyTokenizer_Free" "PyToken_OneChar" "PyToken_TwoChars" "PyToken_ThreeChars" "PyTokenizer_Get" "_PyParser_TokenNames" ; From python23_s.lib(bitset) "_Py_newbitset" "_Py_delbitset" "_Py_addbit" "_Py_samebitset" "_Py_mergebitset" ; From python23_s.lib(metagrammar) "_Py_meta_grammar" ; From python23_s.lib(myreadline) "PyOS_ReadlineFunctionPointer" "PyOS_StdioReadline" "PyOS_Readline" "PyOS_InputHook" ; From python23_s.lib(abstract) "PyObject_Cmp" "PyObject_Type" "PyObject_Size" "PyMapping_Size" "PyObject_Length" "PyObject_GetItem" "PySequence_GetItem" "PyObject_SetItem" "PySequence_SetItem" "PyObject_DelItem" "PySequence_DelItem" "PyObject_DelItemString" "PyObject_AsCharBuffer" "PyObject_CheckReadBuffer" "PyObject_AsReadBuffer" "PyObject_AsWriteBuffer" "PyNumber_Check" "PyNumber_Or" "PyNumber_Xor" "PyNumber_And" "PyNumber_Lshift" "PyNumber_Rshift" "PyNumber_Subtract" "PyNumber_Multiply" "PyNumber_Divide" "PyNumber_Divmod" "PyNumber_Add" "PyNumber_FloorDivide" "PyNumber_TrueDivide" "PyNumber_Remainder" "PyNumber_Power" "PyNumber_InPlaceOr" "PyNumber_InPlaceXor" "PyNumber_InPlaceAnd" "PyNumber_InPlaceLshift" "PyNumber_InPlaceRshift" "PyNumber_InPlaceSubtract" "PyNumber_InPlaceDivide" "PyNumber_InPlaceFloorDivide" "PyNumber_InPlaceTrueDivide" "PyNumber_InPlaceAdd" "PyNumber_InPlaceMultiply" "PyNumber_InPlaceRemainder" "PyNumber_InPlacePower" "PyNumber_Negative" "PyNumber_Positive" "PyNumber_Invert" "PyNumber_Absolute" "PyNumber_Int" "PyNumber_Long" "PyNumber_Float" "PySequence_Check" "PySequence_Size" "PySequence_Length" "PySequence_Concat" "PySequence_Repeat" "PySequence_InPlaceConcat" "PySequence_InPlaceRepeat" "PySequence_GetSlice" "PySequence_SetSlice" "PySequence_DelSlice" "PySequence_Tuple" "PyObject_GetIter" "PyIter_Next" "PySequence_List" "PySequence_Fast" "_PySequence_IterSearch" "PySequence_Count" "PySequence_Contains" "PySequence_In" "PySequence_Index" "PyMapping_Check" "PyMapping_Length" "PyMapping_GetItemString" "PyMapping_SetItemString" "PyMapping_HasKeyString" "PyMapping_HasKey" "PyObject_CallObject" "PyObject_Call" "PyObject_CallFunction" "PyObject_CallMethod" "PyObject_CallMethodObjArgs" "PyObject_CallFunctionObjArgs" "PyObject_IsInstance" "PyObject_IsSubclass" ; From python23_s.lib(bufferobject) "PyBuffer_FromObject" "PyBuffer_FromReadWriteObject" "PyBuffer_FromMemory" "PyBuffer_FromReadWriteMemory" "PyBuffer_New" "PyBuffer_Type" ; From python23_s.lib(cellobject) "PyCell_New" "PyCell_Get" "PyCell_Set" "PyCell_Type" ; From python23_s.lib(classobject) "PyClass_New" "PyMethod_Function" "PyMethod_Self" "PyMethod_Class" "PyClass_IsSubclass" "PyInstance_New" "PyInstance_NewRaw" "PyMethod_New" "PyMethod_Fini" "PyClass_Type" "PyMethod_Type" "PyInstance_Type" ; From python23_s.lib(cobject) "PyCObject_FromVoidPtr" "PyCObject_FromVoidPtrAndDesc" "PyCObject_AsVoidPtr" "PyCObject_GetDesc" "PyCObject_Import" "PyCObject_Type" ; From python23_s.lib(complexobject) "_Py_c_sum" "_Py_c_diff" "_Py_c_neg" "_Py_c_prod" "_Py_c_quot" "_Py_c_pow" "PyComplex_FromCComplex" "PyComplex_FromDoubles" "PyComplex_RealAsDouble" "PyComplex_ImagAsDouble" "PyComplex_AsCComplex" "PyComplex_Type" ; From python23_s.lib(descrobject) "PyWrapper_New" "PyDescr_NewMethod" "PyDescr_NewMember" "PyDescr_NewGetSet" "PyDescr_NewWrapper" "PyDescr_IsData" "PyDictProxy_New" "PyWrapperDescr_Type" "PyProperty_Type" ; From python23_s.lib(dictobject) "PyDict_New" "PyDict_GetItem" "PyDict_SetItem" "PyDict_DelItem" "PyDict_Clear" "PyDict_Next" "PyDict_Update" "PyDict_MergeFromSeq2" "PyDict_Merge" "PyDict_Copy" "PyDict_Size" "PyDict_Keys" "PyDict_Values" "PyDict_Items" "PyDict_GetItemString" "PyDict_SetItemString" "PyDict_DelItemString" "PyDict_Type" "PyDictIter_Type" ; From python23_s.lib(fileobject) "PyFile_AsFile" "PyFile_Name" "PyFile_FromFile" "PyFile_FromString" "PyFile_SetBufSize" "PyFile_GetLine" "PyFile_SoftSpace" "PyFile_WriteObject" "PyFile_WriteString" "PyObject_AsFileDescriptor" "PyFile_Type" ; From python23_s.lib(floatobject) "PyFloat_FromDouble" "PyFloat_FromString" "PyFloat_AsDouble" "PyFloat_AsStringEx" "PyFloat_AsString" "PyFloat_AsReprString" "PyFloat_Fini" "PyFloat_Type" ; From python23_s.lib(frameobject) "PyFrame_FastToLocals" "PyFrame_New" "PyFrame_BlockSetup" "PyFrame_BlockPop" "PyFrame_LocalsToFast" "PyFrame_Fini" "PyFrame_Type" ; From python23_s.lib(funcobject) "PyFunction_New" "PyFunction_GetCode" "PyFunction_GetGlobals" "PyFunction_GetDefaults" "PyFunction_SetDefaults" "PyFunction_GetClosure" "PyFunction_SetClosure" "PyClassMethod_New" "PyStaticMethod_New" "PyFunction_Type" "PyClassMethod_Type" "PyStaticMethod_Type" ; From python23_s.lib(intobject) "PyInt_GetMax" "PyInt_FromLong" "PyInt_AsLong" "PyInt_FromString" "PyInt_FromUnicode" "PyInt_Fini" "_Py_ZeroStruct" "PyInt_Type" "_Py_TrueStruct" ; From python23_s.lib(iterobject) "PySeqIter_New" "PyCallIter_New" "PySeqIter_Type" "PyCallIter_Type" ; From python23_s.lib(listobject) "PyList_New" "PyList_Size" "PyList_GetItem" "PyList_SetItem" "PyList_Insert" "PyList_Append" "PyList_GetSlice" "PyList_SetSlice" "PyList_Sort" "PyList_Reverse" "PyList_AsTuple" "PyList_Type" ; From python23_s.lib(longobject) "_PyLong_New" "_PyLong_Copy" "PyLong_FromLong" "PyLong_FromUnsignedLong" "PyLong_FromDouble" "PyLong_AsLong" "PyLong_AsUnsignedLong" "_PyLong_FromByteArray" "_PyLong_AsByteArray" "_PyLong_AsScaledDouble" "PyLong_AsDouble" "PyLong_FromVoidPtr" "PyLong_AsVoidPtr" "PyLong_FromLongLong" "PyLong_FromUnsignedLongLong" "PyLong_AsLongLong" "PyLong_AsUnsignedLongLong" "PyLong_FromString" "PyLong_FromUnicode" "PyLong_Type" ; From python23_s.lib(methodobject) "PyCFunction_New" "PyCFunction_GetFunction" "PyCFunction_GetSelf" "PyCFunction_GetFlags" "PyCFunction_Call" "Py_FindMethodInChain" "Py_FindMethod" "PyCFunction_Fini" "PyCFunction_Type" ; From python23_s.lib(moduleobject) "PyModule_New" "PyModule_GetDict" "PyModule_GetName" "PyModule_GetFilename" "_PyModule_Clear" "PyModule_Type" ; From python23_s.lib(object) "Py_DivisionWarningFlag" "PyObject_Init" "PyObject_InitVar" "_PyObject_New" "_PyObject_NewVar" "_PyObject_Del" "PyObject_Print" "PyObject_Str" "PyObject_Repr" "_PyObject_Dump" "PyObject_Unicode" "PyObject_GetAttr" "PyObject_IsTrue" "PyNumber_CoerceEx" "PyObject_Compare" "PyObject_RichCompare" "PyObject_RichCompareBool" "_Py_HashDouble" "PyObject_Hash" "_Py_HashPointer" "PyObject_GetAttrString" "PyObject_HasAttrString" "PyObject_SetAttrString" "PyObject_SetAttr" "PyObject_HasAttr" "_PyObject_GetDictPtr" "PyObject_GenericGetAttr" "PyObject_GenericSetAttr" "PyObject_Not" "PyNumber_Coerce" "PyCallable_Check" "PyObject_Dir" "_Py_ReadyTypes" "PyMem_Malloc" "PyMem_Realloc" "PyMem_Free" "PyObject_Malloc" "PyObject_Realloc" "PyObject_Free" "Py_ReprEnter" "Py_ReprLeave" "_PyTrash_deposit_object" "_PyTrash_destroy_chain" "_Py_NotImplementedStruct" "_Py_NoneStruct" "_Py_cobject_hack" "_Py_abstract_hack" "_PyTrash_delete_nesting" "_PyTrash_delete_later" ; From python23_s.lib(rangeobject) "PyRange_New" "PyRange_Type" ; From python23_s.lib(sliceobject) "PySlice_New" "PySlice_GetIndices" "_Py_EllipsisObject" "PySlice_Type" ; From python23_s.lib(stringobject) "PyString_FromStringAndSize" "PyString_InternInPlace" "PyString_FromString" "PyString_FromFormatV" "PyString_AsString" "_PyString_Resize" "PyString_FromFormat" "PyString_Decode" "PyString_AsDecodedString" "PyString_AsDecodedObject" "PyString_Encode" "PyString_AsEncodedString" "PyString_AsEncodedObject" "PyString_AsStringAndSize" "PyString_Size" "_PyString_Eq" "_PyString_Join" "PyString_Concat" "PyString_ConcatAndDel" "_PyString_FormatLong" "PyString_Format" "PyString_InternFromString" "PyString_Fini" "_Py_ReleaseInternedStrings" "PyString_Type" ; From python23_s.lib(structseq) "PyStructSequence_New" "PyStructSequence_InitType" ; From python23_s.lib(tupleobject) "PyTuple_New" "PyTuple_Size" "PyTuple_GetItem" "PyTuple_SetItem" "PyTuple_GetSlice" "_PyTuple_Resize" "PyTuple_Fini" "PyTuple_Type" ; From python23_s.lib(typeobject) "PyType_IsSubtype" "PyType_GenericAlloc" "PyType_GenericNew" "_PyType_Lookup" "PyType_Ready" "_PyObject_SlotCompare" "PyType_Type" "PyBaseObject_Type" "PySuper_Type" ; From python23_s.lib(unicodeobject) "PyUnicodeUCS2_GetMax" "PyUnicodeUCS2_Resize" "PyUnicodeUCS2_FromUnicode" "PyUnicodeUCS2_FromObject" "PyUnicodeUCS2_FromEncodedObject" "PyUnicodeUCS2_Decode" "PyUnicodeUCS2_GetDefaultEncoding" "PyUnicodeUCS2_DecodeUTF8" "PyUnicodeUCS2_DecodeLatin1" "PyUnicodeUCS2_DecodeASCII" "PyUnicodeUCS2_Encode" "PyUnicodeUCS2_AsEncodedString" "PyUnicodeUCS2_AsUTF8String" "PyUnicodeUCS2_AsLatin1String" "PyUnicodeUCS2_AsASCIIString" "_PyUnicodeUCS2_AsDefaultEncodedString" "PyUnicodeUCS2_AsUnicode" "PyUnicodeUCS2_GetSize" "PyUnicodeUCS2_SetDefaultEncoding" "PyUnicode_DecodeUTF7" "PyUnicode_EncodeUTF7" "PyUnicodeUCS2_EncodeUTF8" "PyUnicodeUCS2_DecodeUTF16" "PyUnicodeUCS2_EncodeUTF16" "PyUnicodeUCS2_AsUTF16String" "PyUnicodeUCS2_DecodeUnicodeEscape" "PyUnicodeUCS2_EncodeUnicodeEscape" "PyUnicodeUCS2_AsUnicodeEscapeString" "PyUnicodeUCS2_DecodeRawUnicodeEscape" "PyUnicodeUCS2_EncodeRawUnicodeEscape" "PyUnicodeUCS2_AsRawUnicodeEscapeString" "PyUnicodeUCS2_EncodeLatin1" "PyUnicodeUCS2_EncodeASCII" "PyUnicodeUCS2_DecodeCharmap" "PyUnicodeUCS2_EncodeCharmap" "PyUnicodeUCS2_AsCharmapString" "PyUnicodeUCS2_TranslateCharmap" "PyUnicodeUCS2_Translate" "PyUnicodeUCS2_EncodeDecimal" "PyUnicodeUCS2_Count" "PyUnicodeUCS2_Find" "PyUnicodeUCS2_Tailmatch" "PyUnicodeUCS2_Join" "PyUnicodeUCS2_Splitlines" "PyUnicodeUCS2_Compare" "PyUnicodeUCS2_Contains" "PyUnicodeUCS2_Concat" "PyUnicodeUCS2_Replace" "PyUnicodeUCS2_Split" "PyUnicodeUCS2_Format" "_PyUnicodeUCS2_Init" "_PyUnicodeUCS2_Fini" "PyUnicode_Type" ; From python23_s.lib(unicodectype) "_PyUnicode_TypeRecords" "_PyUnicodeUCS2_IsLinebreak" "_PyUnicodeUCS2_ToTitlecase" "_PyUnicodeUCS2_IsTitlecase" "_PyUnicodeUCS2_ToDecimalDigit" "_PyUnicodeUCS2_IsDecimalDigit" "_PyUnicodeUCS2_ToDigit" "_PyUnicodeUCS2_IsDigit" "_PyUnicodeUCS2_ToNumeric" "_PyUnicodeUCS2_IsNumeric" "_PyUnicodeUCS2_IsWhitespace" "_PyUnicodeUCS2_IsLowercase" "_PyUnicodeUCS2_IsUppercase" "_PyUnicodeUCS2_ToUppercase" "_PyUnicodeUCS2_ToLowercase" "_PyUnicodeUCS2_IsAlpha" ; From python23_s.lib(weakrefobject) "_PyWeakref_GetWeakrefCount" "PyWeakref_NewRef" "PyWeakref_NewProxy" "PyWeakref_GetObject" "PyObject_ClearWeakRefs" "_PyWeakref_RefType" "_PyWeakref_ProxyType" "_PyWeakref_CallableProxyType" ; From python23_s.lib(bltinmodule) "_PyBuiltin_Init" "Py_FileSystemDefaultEncoding" ; From python23_s.lib(exceptions) "PyExc_TypeError" "PyExc_Exception" "PyExc_StopIteration" "PyExc_StandardError" "PyExc_SystemExit" "PyExc_KeyboardInterrupt" "PyExc_ImportError" "PyExc_EnvironmentError" "PyExc_IOError" "PyExc_OSError" "PyExc_EOFError" "PyExc_RuntimeError" "PyExc_NotImplementedError" "PyExc_NameError" "PyExc_UnboundLocalError" "PyExc_AttributeError" "PyExc_SyntaxError" "PyExc_IndentationError" "PyExc_TabError" "PyExc_AssertionError" "PyExc_LookupError" "PyExc_IndexError" "PyExc_KeyError" "PyExc_ArithmeticError" "PyExc_OverflowError" "PyExc_ZeroDivisionError" "PyExc_FloatingPointError" "PyExc_ValueError" "PyExc_UnicodeError" "PyExc_ReferenceError" "PyExc_SystemError" "PyExc_MemoryError" "PyExc_Warning" "PyExc_UserWarning" "PyExc_DeprecationWarning" "PyExc_SyntaxWarning" "PyExc_OverflowWarning" "PyExc_RuntimeWarning" "PyExc_MemoryErrorInst" "_PyExc_Init" "_PyExc_Fini" ; From python23_s.lib(ceval) "PyEval_InitThreads" "PyEval_AcquireLock" "PyEval_ReleaseLock" "PyEval_AcquireThread" "PyEval_ReleaseThread" "PyEval_ReInitThreads" "PyEval_SaveThread" "PyEval_RestoreThread" "Py_AddPendingCall" "Py_MakePendingCalls" "Py_GetRecursionLimit" "Py_SetRecursionLimit" "PyEval_EvalCode" "PyEval_EvalCodeEx" "PyEval_CallObjectWithKeywords" "PyEval_SetProfile" "PyEval_SetTrace" "PyEval_GetBuiltins" "PyEval_GetLocals" "PyEval_GetGlobals" "PyEval_GetFrame" "PyEval_GetRestricted" "PyEval_MergeCompilerFlags" "Py_FlushLine" "PyEval_CallObject" "PyEval_GetFuncName" "PyEval_GetFuncDesc" "_PyEval_SliceIndex" ; From python23_s.lib(compile) "PyCode_New" "PyNode_Compile" "PyNode_CompileFlags" "PyNode_CompileSymtable" "PySymtable_Free" "PyCode_Addr2Line" "Py_OptimizeFlag" "PyCode_Type" ; From python23_s.lib(codecs) "PyCodec_Register" "_PyCodec_Lookup" "PyCodec_Encoder" "PyCodec_Decoder" "PyCodec_StreamReader" "PyCodec_StreamWriter" "PyCodec_Encode" "PyCodec_Decode" "_PyCodecRegistry_Init" "_PyCodecRegistry_Fini" ; From python23_s.lib(errors) "PyErr_Restore" "PyErr_SetObject" "PyErr_SetNone" "PyErr_SetString" "PyErr_Occurred" "PyErr_GivenExceptionMatches" "PyErr_ExceptionMatches" "PyErr_NormalizeException" "PyErr_Fetch" "PyErr_Clear" "PyErr_BadArgument" "PyErr_NoMemory" "PyErr_SetFromErrnoWithFilename" "PyErr_SetFromErrno" "_PyErr_BadInternalCall" "PyErr_Format" "PyErr_BadInternalCall" "PyErr_NewException" "PyErr_WriteUnraisable" "PyErr_Warn" "PyErr_WarnExplicit" "PyErr_SyntaxLocation" "PyErr_ProgramText" ; From python23_s.lib(frozen) "PyImport_FrozenModules" ; From python23_s.lib(frozenmain) "Py_FrozenMain" ; From python23_s.lib(future) "PyNode_Future" ; From python23_s.lib(getargs) "PyArg_Parse" "PyArg_ParseTuple" "PyArg_VaParse" "PyArg_ParseTupleAndKeywords" "PyArg_UnpackTuple" ; From python23_s.lib(getcompiler) "Py_GetCompiler" ; From python23_s.lib(getcopyright) "Py_GetCopyright" ; From python23_s.lib(getmtime) "PyOS_GetLastModificationTime" ; From python23_s.lib(getplatform) "Py_GetPlatform" ; From python23_s.lib(getversion) "Py_GetVersion" ; From python23_s.lib(graminit) "_PyParser_Grammar" ; From python23_s.lib(import) "_PyImport_Init" "_PyImport_Fini" "PyImport_GetModuleDict" "PyImport_Cleanup" "PyImport_GetMagicNumber" "_PyImport_FixupExtension" "_PyImport_FindExtension" "PyImport_AddModule" "PyImport_ExecCodeModule" "PyImport_ExecCodeModuleEx" "PyImport_ImportFrozenModule" "PyImport_ImportModule" "PyImport_Import" "PyImport_ImportModuleEx" "PyImport_ReloadModule" ; "initimp" "PyImport_ExtendInittab" "PyImport_AppendInittab" "PyImport_Inittab" "_PyImport_Filetab" ; From python23_s.lib(importdl) "_PyImport_LoadDynamicModule" ; From python23_s.lib(marshal) "PyMarshal_WriteLongToFile" "PyMarshal_WriteObjectToFile" "PyMarshal_ReadShortFromFile" "PyMarshal_ReadLongFromFile" "PyMarshal_ReadLastObjectFromFile" "PyMarshal_ReadObjectFromString" "PyMarshal_ReadObjectFromFile" "PyMarshal_WriteObjectToString" "PyMarshal_Init" ; From python23_s.lib(modsupport) "Py_InitModule4" "Py_BuildValue" "Py_VaBuildValue" "PyEval_CallFunction" "PyEval_CallMethod" "PyModule_AddObject" "PyModule_AddIntConstant" "PyModule_AddStringConstant" "_Py_PackageContext" ; From python23_s.lib(mysnprintf) "PyOS_snprintf" "PyOS_vsnprintf" ; From python23_s.lib(mystrtoul) "PyOS_strtoul" "PyOS_strtol" ; From python23_s.lib(pyfpe) "PyFPE_dummy" ; From python23_s.lib(pystate) "PyInterpreterState_New" "PyInterpreterState_Clear" "PyThreadState_Clear" "PyThreadState_Delete" "PyInterpreterState_Delete" "PyThreadState_New" "PyThreadState_DeleteCurrent" "PyThreadState_Get" "PyThreadState_Swap" "PyThreadState_GetDict" "PyInterpreterState_Head" "PyInterpreterState_Next" "PyInterpreterState_ThreadHead" "PyThreadState_Next" "_PyThreadState_Current" ; From python23_s.lib(pythonrun) "Py_IgnoreEnvironmentFlag" "Py_DebugFlag" "Py_VerboseFlag" "Py_NoSiteFlag" "Py_InteractiveFlag" "Py_FrozenFlag" "Py_IsInitialized" "Py_Initialize" "Py_FatalError" "Py_Finalize" "Py_NewInterpreter" "PyErr_Print" "Py_EndInterpreter" "Py_SetProgramName" "Py_GetProgramName" "Py_SetPythonHome" "Py_GetPythonHome" "PyRun_AnyFile" "PyRun_AnyFileExFlags" "PyRun_AnyFileFlags" "PyRun_AnyFileEx" "Py_FdIsInteractive" "PyRun_InteractiveLoopFlags" "PyRun_SimpleFileExFlags" "PyRun_InteractiveLoop" "PyRun_InteractiveOneFlags" "PyRun_InteractiveOne" "PyRun_SimpleFile" "PyRun_SimpleFileEx" "PyRun_FileExFlags" "PyRun_SimpleString" "PyRun_SimpleStringFlags" "PyRun_StringFlags" "PyErr_PrintEx" "Py_Exit" "PyErr_Display" "PyRun_String" "PyParser_SimpleParseString" "PyRun_File" "PyRun_FileEx" "PyParser_SimpleParseFile" "PyParser_SimpleParseStringFlags" "PyRun_FileFlags" "PyParser_SimpleParseFileFlags" "Py_CompileString" "Py_CompileStringFlags" "Py_SymtableString" "Py_AtExit" "PyOS_getsig" "PyOS_setsig" "Py_UseClassExceptionsFlag" "Py_UnicodeFlag" "_Py_QnewFlag" "_PyThread_Started" ; From python23_s.lib(structmember) "PyMember_Get" "PyMember_GetOne" "PyMember_Set" "PyMember_SetOne" ; From python23_s.lib(symtable) "PySymtableEntry_New" "PySymtableEntry_Type" ; From python23_s.lib(sysmodule) "PySys_GetObject" "PySys_GetFile" "PySys_SetObject" "PySys_ResetWarnOptions" "PySys_AddWarnOption" "_PySys_Init" "PySys_SetPath" "PySys_SetArgv" "PySys_WriteStdout" "PySys_WriteStderr" ; From python23_s.lib(traceback) "PyTraceBack_Here" "PyTraceBack_Print" "PyTraceBack_Type" ; From python23_s.lib(getopt) "_PyOS_GetOpt" "_PyOS_opterr" "_PyOS_optind" "_PyOS_optarg" ; From python23_s.lib(dynload_shlib) "_PyImport_DynLoadFiletab" "_PyImport_GetDynLoadFunc" ; From python23_s.lib(thread) "PyThread_init_thread" "PyThread_start_new_thread" "PyThread_get_thread_ident" "PyThread_exit_thread" "PyThread__exit_thread" "PyThread_allocate_lock" "PyThread_free_lock" "PyThread_acquire_lock" "PyThread_release_lock" ; From python23_s.lib(gcmodule) ; "initgc" "_PyGC_Dump" "_PyObject_GC_Track" "_PyObject_GC_UnTrack" "_PyObject_GC_Malloc" "_PyObject_GC_New" "_PyObject_GC_NewVar" "_PyObject_GC_Resize" "_PyObject_GC_Del" "_PyGC_generation0" ; From python23_s.lib(signalmodule) "PyErr_CheckSignals" ; "initsignal" "PyErr_SetInterrupt" "PyOS_InitInterrupts" "PyOS_FiniInterrupts" "PyOS_InterruptOccurred" "PyOS_AfterFork" ; From python23_s.lib(posixmodule) ; "initos2" ; From python23_s.lib(threadmodule) ; "initthread" ; From python23_s.lib(_sre) ; "init_sre" --- NEW FILE: pythonpm.c --- /* OS/2 PM main program - creates a hidden window, and starts Python * interpreter in a separate thread, so that Python scripts can be * run in PM process space without a console Window. The interpreter * is incorporated by linking in the Python DLL. * * As it stands, I don't think this is adequate for supporting Python * GUI modules, as the Python thread doesn't have its own message * queue - which is required of threads that want to create/use * PM windows. * * This code owes a lot to "OS/2 Presentation Manager Programming", by * Charles Petzold. * * Andrew MacIntyre , August 2001. * Released under the terms of the Python 2.1.1 licence - see the LICENCE * file in the Python v2.1.1 (or later) source distribution. * Copyright assigned to the Python Software Foundation, 2001. */ #define INCL_DOS #define INCL_WIN #include #include #include "Python.h" /* use structure to pass command line to Python thread */ typedef struct { int argc; char **argv; HWND Frame; int running; } arglist; /* make this a global to simplify access. * it should only be set from the Python thread, or by the code that * initiates the Python thread when the thread cannot be created. */ int PythonRC; extern DL_EXPORT(int) Py_Main(int, char **); void PythonThread(void *); int main(int argc, char **argv) { ULONG FrameFlags = FCF_TITLEBAR | FCF_SYSMENU | FCF_SIZEBORDER | FCF_HIDEBUTTON | FCF_SHELLPOSITION | FCF_TASKLIST; HAB hab; HMQ hmq; HWND Client; QMSG qmsg; arglist args; int python_tid; /* init PM and create message queue */ hab = WinInitialize(0); hmq = WinCreateMsgQueue(hab, 0); /* create a (hidden) Window to house the window procedure */ args.Frame = WinCreateStdWindow(HWND_DESKTOP, 0, &FrameFlags, NULL, "PythonPM", 0L, 0, 0, &Client); /* run Python interpreter in a thread */ args.argc = argc; args.argv = argv; args.running = 0; if (-1 == (python_tid = _beginthread(PythonThread, NULL, 1024 * 1024, &args))) { /* couldn't start thread */ WinAlarm(HWND_DESKTOP, WA_ERROR); PythonRC = 1; } else { /* process PM messages, until Python exits */ while (WinGetMsg(hab, &qmsg, NULLHANDLE, 0, 0)) WinDispatchMsg(hab, &qmsg); if (args.running > 0) DosKillThread(python_tid); } /* destroy window, shutdown message queue and PM */ WinDestroyWindow(args.Frame); WinDestroyMsgQueue(hmq); WinTerminate(hab); return PythonRC; } void PythonThread(void *argl) { HAB hab; arglist *args; /* PM initialisation */ hab = WinInitialize(0); /* start Python */ args = (arglist *)argl; args->running = 1; PythonRC = Py_Main(args->argc, args->argv); /* enter a critical section and send the termination message */ DosEnterCritSec(); args->running = 0; WinPostMsg(args->Frame, WM_QUIT, NULL, NULL); /* shutdown PM and terminate thread */ WinTerminate(hab); _endthread(); } From tim_one@users.sourceforge.net Sun Feb 17 07:03:09 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 16 Feb 2002 23:03:09 -0800 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts reindent.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory usw-pr-cvs1:/tmp/cvs-serv5787/python/Tools/scripts Modified Files: reindent.py Log Message: SF bug #497839: reindent chokes on empty first lines. Reindenter.run(): copy over initial all-whitespace lines (if any, and after normalizing to remove trailing blanks and tabs). Bugfix candidate. Index: reindent.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/reindent.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** reindent.py 4 Oct 2001 19:44:10 -0000 1.2 --- reindent.py 17 Feb 2002 07:03:05 -0000 1.3 *************** *** 158,161 **** --- 158,165 ---- # Program after transformation. after = self.after = [] + # Copy over initial empty lines -- there's nothing to do until + # we see a line with *something* on it. + i = stats[0][0] + after.extend(lines[1:i]) for i in range(len(stats)-1): thisstmt, thislevel = stats[i] From nascheme@users.sourceforge.net Sun Feb 17 19:10:16 2002 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Sun, 17 Feb 2002 11:10:16 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.304,2.305 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv16826 Modified Files: ceval.c Log Message: Move some opcodes to top of big eval_frame switch statement. Skip things_to_do block for a few common opcodes that don't do any real work. Closes SF patch #512256. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.304 retrieving revision 2.305 diff -C2 -d -r2.304 -r2.305 *** ceval.c 12 Feb 2002 04:31:21 -0000 2.304 --- ceval.c 17 Feb 2002 19:10:14 -0000 2.305 *************** *** 681,684 **** --- 681,685 ---- } + fast_next_opcode: /* Extract opcode and argument */ *************** *** 725,732 **** /* case STOP_CODE: this is an error! */ case POP_TOP: v = POP(); Py_DECREF(v); ! continue; case ROT_TWO: --- 726,776 ---- /* case STOP_CODE: this is an error! */ + case SET_LINENO: + #ifdef LLTRACE + if (lltrace) + printf("--- %s:%d \n", filename, oparg); + #endif + f->f_lineno = oparg; + if (tstate->c_tracefunc == NULL || tstate->tracing) + goto fast_next_opcode; + /* Trace each line of code reached */ + f->f_lasti = INSTR_OFFSET(); + /* Inline call_trace() for performance: */ + tstate->tracing++; + tstate->use_tracing = 0; + err = (tstate->c_tracefunc)(tstate->c_traceobj, f, + PyTrace_LINE, Py_None); + tstate->use_tracing = (tstate->c_tracefunc + || tstate->c_profilefunc); + tstate->tracing--; + break; + + case LOAD_FAST: + x = GETLOCAL(oparg); + if (x != NULL) { + Py_INCREF(x); + PUSH(x); + goto fast_next_opcode; + } + format_exc_check_arg(PyExc_UnboundLocalError, + UNBOUNDLOCAL_ERROR_MSG, + PyTuple_GetItem(co->co_varnames, oparg)); + break; + + case LOAD_CONST: + x = GETCONST(oparg); + Py_INCREF(x); + PUSH(x); + goto fast_next_opcode; + + case STORE_FAST: + v = POP(); + SETLOCAL(oparg, v); + goto fast_next_opcode; + case POP_TOP: v = POP(); Py_DECREF(v); ! goto fast_next_opcode; case ROT_TWO: *************** *** 1618,1627 **** break; - case LOAD_CONST: - x = GETCONST(oparg); - Py_INCREF(x); - PUSH(x); - break; - case LOAD_NAME: w = GETNAMEV(oparg); --- 1662,1665 ---- *************** *** 1665,1685 **** break; - case LOAD_FAST: - x = GETLOCAL(oparg); - if (x != NULL) { - Py_INCREF(x); - PUSH(x); - continue; - } - format_exc_check_arg(PyExc_UnboundLocalError, - UNBOUNDLOCAL_ERROR_MSG, - PyTuple_GetItem(co->co_varnames, oparg)); - break; - - case STORE_FAST: - v = POP(); - SETLOCAL(oparg, v); - continue; - case DELETE_FAST: x = GETLOCAL(oparg); --- 1703,1706 ---- *************** *** 1949,1972 **** STACK_LEVEL()); continue; - - case SET_LINENO: - #ifdef LLTRACE - if (lltrace) - printf("--- %s:%d \n", filename, oparg); - #endif - f->f_lineno = oparg; - if (tstate->c_tracefunc == NULL || tstate->tracing) - continue; - /* Trace each line of code reached */ - f->f_lasti = INSTR_OFFSET(); - /* Inline call_trace() for performance: */ - tstate->tracing++; - tstate->use_tracing = 0; - err = (tstate->c_tracefunc)(tstate->c_traceobj, f, - PyTrace_LINE, Py_None); - tstate->use_tracing = (tstate->c_tracefunc - || tstate->c_profilefunc); - tstate->tracing--; - break; case CALL_FUNCTION: --- 1970,1973 ---- From loewis@users.sourceforge.net Mon Feb 18 17:46:50 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Mon, 18 Feb 2002 09:46:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.126,2.127 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv20825 Modified Files: typeobject.c Log Message: Allow __doc__ to be of arbitrary type. Patch by James Henstridge, fixes #504343. 2.2.1 candidate. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.126 retrieving revision 2.127 diff -C2 -d -r2.126 -r2.127 *** typeobject.c 17 Dec 2001 17:14:22 -0000 2.126 --- typeobject.c 18 Feb 2002 17:46:48 -0000 2.127 *************** *** 9,13 **** {"__itemsize__", T_INT, offsetof(PyTypeObject, tp_itemsize), READONLY}, {"__flags__", T_LONG, offsetof(PyTypeObject, tp_flags), READONLY}, - {"__doc__", T_STRING, offsetof(PyTypeObject, tp_doc), READONLY}, {"__weakrefoffset__", T_LONG, offsetof(PyTypeObject, tp_weaklistoffset), READONLY}, --- 9,12 ---- *************** *** 1045,1051 **** /* Set tp_doc to a copy of dict['__doc__'], if the latter is there ! and is a string (tp_doc is a char* -- can't copy a general object ! into it). ! XXX What if it's a Unicode string? Don't know -- this ignores it. */ { --- 1044,1050 ---- /* Set tp_doc to a copy of dict['__doc__'], if the latter is there ! and is a string. Note that the tp_doc slot will only be used ! by C code -- python code will use the version in tp_dict, so ! it isn't that important that non string __doc__'s are ignored. */ { *************** *** 2023,2026 **** --- 2022,2038 ---- if (PyType_Check(b)) inherit_slots(type, (PyTypeObject *)b); + } + + /* if the type dictionary doesn't contain a __doc__, set it from + the tp_doc slot. + */ + if (PyDict_GetItemString(type->tp_dict, "__doc__") == NULL) { + if (type->tp_doc != NULL) { + PyObject *doc = PyString_FromString(type->tp_doc); + PyDict_SetItemString(type->tp_dict, "__doc__", doc); + Py_DECREF(doc); + } else { + PyDict_SetItemString(type->tp_dict, "__doc__", Py_None); + } } From neal@metaslash.com Tue Feb 19 02:45:06 2002 From: neal@metaslash.com (Neal Norwitz) Date: Mon, 18 Feb 2002 21:45:06 -0500 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.81,1.82 References: Message-ID: <3C71BC32.2CA0A9EA@metaslash.com> Was the if 1: meant to be left in (around line 178)? Neal -- "M.-A. Lemburg" wrote: > Index: setup.py > =================================================================== > RCS file: /cvsroot/python/python/dist/src/setup.py,v > retrieving revision 1.81 > retrieving revision 1.82 > diff -C2 -d -r1.81 -r1.82 > *** setup.py 14 Feb 2002 01:25:37 -0000 1.81 > --- setup.py 16 Feb 2002 18:23:29 -0000 1.82 > *************** > *** 174,192 **** > try: > imp.load_dynamic(ext.name, ext_filename) > ! except ImportError: > ! self.announce('WARNING: removing "%s" since importing it failed' % > ! ext.name) > ! assert not self.inplace > ! fullname = self.get_ext_fullname(ext.name) > ! ext_filename = os.path.join(self.build_lib, > ! self.get_ext_filename(fullname)) > ! os.remove(ext_filename) > > ! # XXX -- This relies on a Vile HACK in > ! # distutils.command.build_ext.build_extension(). The > ! # _built_objects attribute is stored there strictly for > ! # use here. > ! for filename in self._built_objects: > ! os.remove(filename) > > def get_platform (self): > --- 174,197 ---- > try: > imp.load_dynamic(ext.name, ext_filename) > ! except ImportError, why: > > ! if 1: > ! self.announce('*** WARNING: removing "%s" since importing it' > ! ' failed: %s' % (ext.name, why)) > ! assert not self.inplace > ! fullname = self.get_ext_fullname(ext.name) > ! ext_filename = os.path.join(self.build_lib, > ! self.get_ext_filename(fullname)) > ! os.remove(ext_filename) > ! > ! # XXX -- This relies on a Vile HACK in > ! # distutils.command.build_ext.build_extension(). The > ! # _built_objects attribute is stored there strictly for > ! # use here. > ! for filename in self._built_objects: > ! os.remove(filename) > ! else: > ! self.announce('*** WARNING: importing extension "%s" ' > ! 'failed: %s' % (ext.name, why)) > From nnorwitz@users.sourceforge.net Tue Feb 19 02:57:07 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 18 Feb 2002 18:57:07 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libsite.tex,1.22,1.22.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv25134 Modified Files: Tag: release22-maint libsite.tex Log Message: SF #515041, Update path for 2.2 Index: libsite.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsite.tex,v retrieving revision 1.22 retrieving revision 1.22.6.1 diff -C2 -d -r1.22 -r1.22.6.1 *** libsite.tex 28 Nov 2001 07:26:15 -0000 1.22 --- libsite.tex 19 Feb 2002 02:57:05 -0000 1.22.6.1 *************** *** 68,73 **** \begin{verbatim} ! /usr/local/lib/python1.5/site-packages/bar ! /usr/local/lib/python1.5/site-packages/foo \end{verbatim} --- 68,73 ---- \begin{verbatim} ! /usr/local/lib/python2.2/site-packages/bar ! /usr/local/lib/python2.2/site-packages/foo \end{verbatim} From nnorwitz@users.sourceforge.net Tue Feb 19 02:58:56 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 18 Feb 2002 18:58:56 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libsite.tex,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv25409 Modified Files: libsite.tex Log Message: SF #515041, Update path for 2.3 Index: libsite.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsite.tex,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** libsite.tex 28 Nov 2001 07:26:15 -0000 1.22 --- libsite.tex 19 Feb 2002 02:58:54 -0000 1.23 *************** *** 68,73 **** \begin{verbatim} ! /usr/local/lib/python1.5/site-packages/bar ! /usr/local/lib/python1.5/site-packages/foo \end{verbatim} --- 68,73 ---- \begin{verbatim} ! /usr/local/lib/python2.3/site-packages/bar ! /usr/local/lib/python2.3/site-packages/foo \end{verbatim} From nnorwitz@users.sourceforge.net Tue Feb 19 03:01:38 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 18 Feb 2002 19:01:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib threading.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv26006 Modified Files: threading.py Log Message: SF #515023. Make _DummyThread.join() signature match base class (Thread) Index: threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** threading.py 28 Dec 2001 22:07:09 -0000 1.20 --- threading.py 19 Feb 2002 03:01:36 -0000 1.21 *************** *** 573,577 **** return 1 ! def join(self): assert 0, "cannot join a dummy thread" --- 573,577 ---- return 1 ! def join(self, timeout=None): assert 0, "cannot join a dummy thread" From nnorwitz@users.sourceforge.net Tue Feb 19 03:02:35 2002 From: nnorwitz@users.sourceforge.net (Neal Norwitz) Date: Mon, 18 Feb 2002 19:02:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib threading.py,1.19.12.1,1.19.12.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv26469 Modified Files: Tag: release22-maint threading.py Log Message: SF #515023. Make _DummyThread.join() signature match base class (Thread) Index: threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v retrieving revision 1.19.12.1 retrieving revision 1.19.12.2 diff -C2 -d -r1.19.12.1 -r1.19.12.2 *** threading.py 4 Jan 2002 12:29:45 -0000 1.19.12.1 --- threading.py 19 Feb 2002 03:02:33 -0000 1.19.12.2 *************** *** 573,577 **** return 1 ! def join(self): assert 0, "cannot join a dummy thread" --- 573,577 ---- return 1 ! def join(self, timeout=None): assert 0, "cannot join a dummy thread" From tim_one@users.sourceforge.net Tue Feb 19 04:25:21 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 18 Feb 2002 20:25:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descrtut.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv9648/python/Lib/test Modified Files: test_descrtut.py Log Message: Somebody made list.__dict__ grow a '__doc__' key, but apparently didn't run the test suite afterwards. Either that, or whether '__doc__' shows up is platform-dependent! Index: test_descrtut.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descrtut.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_descrtut.py 29 Oct 2001 22:25:44 -0000 1.10 --- test_descrtut.py 19 Feb 2002 04:25:19 -0000 1.11 *************** *** 192,195 **** --- 192,196 ---- '__delitem__', '__delslice__', + '__doc__', '__eq__', '__ge__', From mwh@users.sourceforge.net Tue Feb 19 14:15:42 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Tue, 19 Feb 2002 06:15:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils/command build_py.py,1.34,1.34.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv12046/Lib/distutils/command Modified Files: Tag: release22-maint build_py.py Log Message: Backport theller's checkin of revision 1.35: package_dir must be converted from the distutils path conventions to local conventions before being used by build_py. Fixes SF bug #509288, probably a candidate for 2.2.1 Index: build_py.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_py.py,v retrieving revision 1.34 retrieving revision 1.34.6.1 diff -C2 -d -r1.34 -r1.34.6.1 *** build_py.py 6 Dec 2001 20:59:17 -0000 1.34 --- build_py.py 19 Feb 2002 14:15:40 -0000 1.34.6.1 *************** *** 13,16 **** --- 13,17 ---- from distutils.core import Command from distutils.errors import * + from distutils.util import convert_path *************** *** 51,55 **** self.packages = self.distribution.packages self.py_modules = self.distribution.py_modules ! self.package_dir = self.distribution.package_dir # Ick, copied straight from install_lib.py (fancy_getopt needs a --- 52,59 ---- self.packages = self.distribution.packages self.py_modules = self.distribution.py_modules ! self.package_dir = {} ! if self.distribution.package_dir: ! for name, path in self.distribution.package_dir.items(): ! self.package_dir[name] = convert_path(path) # Ick, copied straight from install_lib.py (fancy_getopt needs a From mwh@users.sourceforge.net Tue Feb 19 14:17:05 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Tue, 19 Feb 2002 06:17:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects intobject.c,2.79,2.79.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv12405/Objects Modified Files: Tag: release22-maint intobject.c Log Message: Backport gvanrossum's checkin of revision 2.80: Bugfix candidate. Fix SF bug #511603: Error calling str on subclass of int Explicitly fill in tp_str with the same pointer as tp_repr. Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.79 retrieving revision 2.79.6.1 diff -C2 -d -r2.79 -r2.79.6.1 *** intobject.c 4 Dec 2001 23:05:10 -0000 2.79 --- intobject.c 19 Feb 2002 14:17:02 -0000 2.79.6.1 *************** *** 894,898 **** (hashfunc)int_hash, /* tp_hash */ 0, /* tp_call */ ! 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ --- 894,898 ---- (hashfunc)int_hash, /* tp_hash */ 0, /* tp_call */ ! (reprfunc)int_repr, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ From theller@users.sourceforge.net Tue Feb 19 20:47:30 2002 From: theller@users.sourceforge.net (Thomas Heller) Date: Tue, 19 Feb 2002 12:47:30 -0800 Subject: [Python-checkins] CVS: distutils/misc install.c,1.15,1.16 install.rc,1.8,1.9 resource.h,1.6,1.7 wininst.exe,1.12,1.13 Message-ID: Update of /cvsroot/python/distutils/misc In directory usw-pr-cvs1:/tmp/cvs-serv31352 Modified Files: install.c install.rc resource.h wininst.exe Log Message: First version which runs an install-script (specified by the --install-script ... command line option to bdist_wininst) at the end of the installation and at the start of deinstallation. Output (stdout, stderr) of the script (if any) is displayed in the last screen at installation, or in a simple message box at deinstallation. Index: install.c =================================================================== RCS file: /cvsroot/python/distutils/misc/install.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** install.c 18 Dec 2001 20:57:45 -0000 1.15 --- install.c 19 Feb 2002 20:47:27 -0000 1.16 *************** *** 70,73 **** --- 70,76 ---- #include #include + #include + #include + #include #include "resource.h" *************** *** 80,83 **** --- 83,100 ---- #include "archive.h" + /* Only for debugging! + static int dprintf (char *fmt, ...) + { + char Buffer[4096]; + va_list marker; + int result; + + va_start (marker, fmt); + result = wvsprintf (Buffer, fmt, marker); + OutputDebugString (Buffer); + return result; + } + */ + /* Bah: global variables */ FILE *logfile; *************** *** 100,104 **** char meta_name[80]; /* package name without version like 'Distutils' */ ! --- 117,121 ---- char meta_name[80]; /* package name without version like 'Distutils' */ ! char install_script[MAX_PATH]; *************** *** 241,286 **** } /* * Returns number of files which failed to compile, * -1 if python could not be loaded at all */ ! static int compile_filelist (BOOL optimize_flag) { ! void (__cdecl * Py_Initialize)(void); ! void (__cdecl * Py_SetProgramName)(char *); ! void (__cdecl * Py_Finalize)(void); ! int (__cdecl * PyRun_SimpleString)(char *); ! void* (__cdecl * PySys_GetObject)(char *); - int *Py_OptimizeFlag; int errors = 0; - HINSTANCE hPython; struct tagFile *p = file_list; if (!p) return 0; - SetDlgItemText (hDialog, IDC_INFO, "Loading python..."); - - hPython = LoadLibrary (pythondll); - if (!hPython) - return -1; - Py_Initialize = (void (*)(void))GetProcAddress - (hPython,"Py_Initialize"); - - Py_SetProgramName = (void (*)(char *))GetProcAddress - (hPython,"Py_SetProgramName"); ! Py_Finalize = (void (*)(void))GetProcAddress (hPython, ! "Py_Finalize"); ! PyRun_SimpleString = (int (*)(char *))GetProcAddress ( ! hPython, "PyRun_SimpleString"); ! Py_OptimizeFlag = (int *)GetProcAddress (hPython, ! "Py_OptimizeFlag"); ! ! PySys_GetObject = (void* (*)(char *))GetProcAddress ! (hPython,"PySys_GetObject"); ! *Py_OptimizeFlag = optimize_flag; Py_SetProgramName(modulename); Py_Initialize (); --- 258,298 ---- } + #define DECLPROC(dll, result, name, args)\ + typedef result (*__PROC__##name) args;\ + result (*name)args = (__PROC__##name)GetProcAddress(dll, #name) + + + #define DECLVAR(dll, type, name)\ + type *name = (type*)GetProcAddress(dll, #name) + + typedef void PyObject; + + /* * Returns number of files which failed to compile, * -1 if python could not be loaded at all */ ! static int compile_filelist (HINSTANCE hPython, BOOL optimize_flag) { ! DECLPROC(hPython, void, Py_Initialize, (void)); ! DECLPROC(hPython, void, Py_SetProgramName, (char *)); ! DECLPROC(hPython, void, Py_Finalize, (void)); ! DECLPROC(hPython, int, PyRun_SimpleString, (char *)); ! DECLPROC(hPython, PyObject *, PySys_GetObject, (char *)); ! DECLVAR(hPython, int, Py_OptimizeFlag); int errors = 0; struct tagFile *p = file_list; if (!p) return 0; ! if (!Py_Initialize || !Py_SetProgramName || !Py_Finalize) ! return -1; ! if (!PyRun_SimpleString || !PySys_GetObject || !Py_OptimizeFlag) ! return -1; ! *Py_OptimizeFlag = optimize_flag ? 1 : 0; Py_SetProgramName(modulename); Py_Initialize (); *************** *** 288,296 **** errors += do_compile_files (PyRun_SimpleString, optimize_flag); Py_Finalize (); - FreeLibrary (hPython); return errors; } static BOOL SystemError (int error, char *msg) { --- 300,466 ---- errors += do_compile_files (PyRun_SimpleString, optimize_flag); Py_Finalize (); return errors; } + typedef PyObject *(*PyCFunction)(PyObject *, PyObject *); + + struct PyMethodDef { + char *ml_name; + PyCFunction ml_meth; + int ml_flags; + char *ml_doc; + }; + typedef struct PyMethodDef PyMethodDef; + + void *(*g_Py_BuildValue)(char *, ...); + int (*g_PyArg_ParseTuple)(PyObject *, char *, ...); + + static PyObject *CreateShortcut(PyObject *self, PyObject *args) + { + char *path; /* path and filename */ + char *description; + char *filename; + + char *arguments = NULL; + char *iconpath = NULL; + int iconindex = 0; + char *workdir = NULL; + + WCHAR wszFilename[MAX_PATH]; + + IShellLink *ps1 = NULL; + IPersistFile *pPf = NULL; + + HRESULT hr; + + hr = CoInitialize(NULL); + if (FAILED(hr)) + return g_Py_BuildValue("si", "CoInitialize", hr); + + if (!g_PyArg_ParseTuple(args, "sss|sssi", + &path, &description, &filename, + &arguments, &workdir, &iconpath, &iconindex)) + return NULL; + + hr = CoCreateInstance(&CLSID_ShellLink, + NULL, + CLSCTX_INPROC_SERVER, + &IID_IShellLink, + &ps1); + if (FAILED(hr)) + return g_Py_BuildValue("si", "CoCreateInstance", hr); + + hr = ps1->lpVtbl->QueryInterface(ps1, &IID_IPersistFile, (void **)&pPf); + if (FAILED(hr)) + return g_Py_BuildValue("si", "QueryInterface(IPersistFile)", hr); + + + hr = ps1->lpVtbl->SetPath(ps1, path); + if (FAILED(hr)) + return g_Py_BuildValue("si", "SetPath", hr); + + hr = ps1->lpVtbl->SetDescription(ps1, description); + if (FAILED(hr)) + return g_Py_BuildValue("si", "SetDescription", hr); + + if (arguments) { + hr = ps1->lpVtbl->SetArguments(ps1, arguments); + if (FAILED(hr)) + return g_Py_BuildValue("si", "SetArguments", hr); + + } + + if (iconpath) { + hr = ps1->lpVtbl->SetIconLocation(ps1, iconpath, iconindex); + if (FAILED(hr)) + return g_Py_BuildValue("si", "SetIconLocation", hr); + } + + if (workdir) { + hr = ps1->lpVtbl->SetWorkingDirectory(ps1, workdir); + if (FAILED(hr)) + return g_Py_BuildValue("si", "SetWorkingDirectory", hr); + + } + + MultiByteToWideChar(CP_ACP, 0, + filename, -1, + wszFilename, MAX_PATH); + + hr = pPf->lpVtbl->Save(pPf, wszFilename, TRUE); + if (FAILED(hr)) + return g_Py_BuildValue("si", "Save()", hr); + + pPf->lpVtbl->Release(pPf); + + ps1->lpVtbl->Release(ps1); + + CoUninitialize(); + + return g_Py_BuildValue("i", 0); + } + + #define METH_VARARGS 0x0001 + + PyMethodDef meth = { + "create_shortcut", CreateShortcut, METH_VARARGS, NULL + }; + + static int run_installscript(HINSTANCE hPython, char *pathname, int argc, char **argv) + { + DECLPROC(hPython, void, Py_Initialize, (void)); + DECLPROC(hPython, int, PySys_SetArgv, (int, char **)); + DECLPROC(hPython, int, PyRun_SimpleFile, (FILE *, char *)); + DECLPROC(hPython, void, Py_Finalize, (void)); + DECLPROC(hPython, PyObject *, PyImport_ImportModule, (char *)); + DECLPROC(hPython, int, PyObject_SetAttrString, (PyObject *, char *, PyObject *)); + DECLPROC(hPython, PyObject *, Py_BuildValue, (char *, ...)); + DECLPROC(hPython, PyObject *, PyCFunction_New, (PyMethodDef *, PyObject *)); + DECLPROC(hPython, int, PyArg_ParseTuple, (PyObject *, char *, ...)); + + PyObject *mod; + + int result = 0; + FILE *fp; + + if (!Py_Initialize || !PySys_SetArgv || !PyRun_SimpleFile || !Py_Finalize) + return -1; + + if (!PyImport_ImportModule || !PyObject_SetAttrString || !Py_BuildValue) + return -1; + + if (!PyCFunction_New || !PyArg_ParseTuple) + return -1; + + g_Py_BuildValue = Py_BuildValue; + g_PyArg_ParseTuple = PyArg_ParseTuple; + + + if (pathname == NULL || pathname[0] == '\0') + return -1; + + fp = fopen(pathname, "r"); + if (!fp) { + return -1; + } + + SetDlgItemText (hDialog, IDC_INFO, "Running Script..."); + + Py_Initialize (); + + mod = PyImport_ImportModule("__builtin__"); + if (mod) + PyObject_SetAttrString(mod, "create_shortcut", PyCFunction_New(&meth, NULL)); + + PySys_SetArgv(argc, argv); + result = PyRun_SimpleFile(fp, pathname); + Py_Finalize (); + + fclose(fp); + + return result; + } + static BOOL SystemError (int error, char *msg) { *************** *** 1222,1228 **** if (pyc_compile) { int errors; SetDlgItemText (hwnd, IDC_TITLE, "Compiling files to .pyc..."); ! errors = compile_filelist (FALSE); /* Compilation errors are intentionally ignored: * Python2.0 contains a bug which will result --- 1392,1405 ---- if (pyc_compile) { int errors; + HINSTANCE hPython; SetDlgItemText (hwnd, IDC_TITLE, "Compiling files to .pyc..."); ! ! SetDlgItemText (hDialog, IDC_INFO, "Loading python..."); ! hPython = LoadLibrary (pythondll); ! if (hPython) { ! errors = compile_filelist (hPython, FALSE); ! FreeLibrary (hPython); ! } /* Compilation errors are intentionally ignored: * Python2.0 contains a bug which will result *************** *** 1234,1244 **** if (pyo_compile) { int errors; SetDlgItemText (hwnd, IDC_TITLE, "Compiling files to .pyo..."); ! errors = compile_filelist (TRUE); /* Errors ignored: see above */ } - CloseLogfile(); break; --- 1411,1427 ---- if (pyo_compile) { int errors; + HINSTANCE hPython; SetDlgItemText (hwnd, IDC_TITLE, "Compiling files to .pyo..."); ! ! SetDlgItemText (hDialog, IDC_INFO, "Loading python..."); ! hPython = LoadLibrary (pythondll); ! if (hPython) { ! errors = compile_filelist (hPython, TRUE); ! FreeLibrary (hPython); ! } /* Errors ignored: see above */ } break; *************** *** 1267,1270 **** --- 1450,1520 ---- if (!success) SetDlgItemText (hwnd, IDC_INFO, "Installation failed."); + + /* async delay: will show the dialog box completely before + the install_script is started */ + PostMessage(hwnd, WM_USER, 0, 0L); + return TRUE; + + case WM_USER: + + if (install_script && install_script[0]) { + char fname[MAX_PATH]; + char *tempname; + FILE *fp; + char buffer[4096]; + int n; + HCURSOR hCursor; + HINSTANCE hPython; + + char *argv[3] = {NULL, "-install", NULL}; + + SetDlgItemText (hwnd, IDC_TITLE, + "Please wait while running postinstall script..."); + strcpy(fname, python_dir); + strcat(fname, "\\Scripts\\"); + strcat(fname, install_script); + + if (logfile) + fprintf(logfile, "300 Run Script: [%s]%s\n", pythondll, fname); + + CloseLogfile(); + + tempname = tmpnam(NULL); + + if (!freopen(tempname, "a", stderr)) + MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); + if (!freopen(tempname, "a", stdout)) + MessageBox(GetFocus(), "freopen stdout", NULL, MB_OK); + /* + if (0 != setvbuf(stdout, NULL, _IONBF, 0)) + MessageBox(GetFocus(), "setvbuf stdout", NULL, MB_OK); + */ + hCursor = SetCursor(LoadCursor(NULL, IDC_WAIT)); + + argv[0] = fname; + + hPython = LoadLibrary(pythondll); + if (hPython) { + run_installscript(hPython, fname, 2, argv); + FreeLibrary(hPython); + } + fflush(stderr); + fflush(stdout); + + fp = fopen(tempname, "rb"); + n = fread(buffer, 1, sizeof(buffer), fp); + fclose(fp); + remove(tempname); + + buffer[n] = '\0'; + + SetDlgItemText(hwnd, IDC_INFO, buffer); + SetDlgItemText (hwnd, IDC_TITLE, + "Postinstall script finished.\n" + "Click the Finish button to exit the Setup wizard."); + + SetCursor(hCursor); + } + return TRUE; *************** *** 1373,1376 **** --- 1623,1631 ---- ini_file); + GetPrivateProfileString ("Setup", "install_script", "", + install_script, sizeof (install_script), + ini_file); + + hwndMain = CreateBackground (title); *************** *** 1527,1530 **** --- 1782,1843 ---- } + BOOL Run_RemoveScript(char *line) + { + char *dllname; + char *scriptname; + static char lastscript[MAX_PATH]; + + /* Format is 'Run Scripts: [pythondll]scriptname' */ + /* XXX Currently, pythondll carries no path!!! */ + dllname = strchr(line, '['); + if (!dllname) + return FALSE; + ++dllname; + scriptname = strchr(dllname, ']'); + if (!scriptname) + return FALSE; + *scriptname++ = '\0'; + /* this function may be called more than one time with the same + script, only run it one time */ + if (strcmp(lastscript, scriptname)) { + HINSTANCE hPython; + char *argv[3] = {NULL, "-remove", NULL}; + char buffer[4096]; + FILE *fp; + char *tempname; + int n; + + argv[0] = scriptname; + + tempname = tmpnam(NULL); + + if (!freopen(tempname, "a", stderr)) + MessageBox(GetFocus(), "freopen stderr", NULL, MB_OK); + if (!freopen(tempname, "a", stdout)) + MessageBox(GetFocus(), "freopen stdout", NULL, MB_OK); + + hPython = LoadLibrary(dllname); + if (hPython) { + run_installscript(hPython, scriptname, 2, argv); + FreeLibrary(hPython); + } + + fflush(stderr); + fflush(stdout); + + fp = fopen(tempname, "rb"); + n = fread(buffer, 1, sizeof(buffer), fp); + fclose(fp); + remove(tempname); + + buffer[n] = '\0'; + if (buffer[0]) + MessageBox(GetFocus(), buffer, "uninstall-script", MB_OK); + + strcpy(lastscript, scriptname); + } + return TRUE; + } + int DoUninstall(int argc, char **argv) { *************** *** 1635,1638 **** --- 1948,1953 ---- } else if (2 == sscanf(cp, "%d Reg DB Value: %s", &ign, &buffer)) { DeleteRegistryValue(cp); + } else if (2 == sscanf(cp, "%d Run Script: %s", &ign, &buffer)) { + Run_RemoveScript(cp); } } Index: install.rc =================================================================== RCS file: /cvsroot/python/distutils/misc/install.rc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** install.rc 18 Dec 2001 20:59:22 -0000 1.8 --- install.rc 19 Feb 2002 20:47:27 -0000 1.9 *************** *** 101,105 **** STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Setup" ! FONT 8, "MS Sans Serif" BEGIN LTEXT "Select python installation to use:",IDC_TITLE,125,10, --- 101,105 ---- STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Setup" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "Select python installation to use:",IDC_TITLE,125,10, *************** *** 135,139 **** STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Setup" ! FONT 8, "MS Sans Serif", 0, 0, 0x1 BEGIN LTEXT "Click the Finish button to exit the Setup wizard.", --- 135,139 ---- STYLE WS_CHILD | WS_DISABLED | WS_CAPTION CAPTION "Setup" ! FONT 8, "MS Sans Serif" BEGIN LTEXT "Click the Finish button to exit the Setup wizard.", *************** *** 141,146 **** CONTROL 110,IDC_BITMAP,"Static",SS_BITMAP | SS_CENTERIMAGE,6,8, 104,163,WS_EX_CLIENTEDGE ! LTEXT "Installation completed successfully.",IDC_INFO,125,41, ! 247,130 END --- 141,146 ---- CONTROL 110,IDC_BITMAP,"Static",SS_BITMAP | SS_CENTERIMAGE,6,8, 104,163,WS_EX_CLIENTEDGE ! EDITTEXT IDC_INFO,125,40,247,131,ES_MULTILINE | ES_READONLY | ! WS_VSCROLL | WS_HSCROLL | NOT WS_TABSTOP END Index: resource.h =================================================================== RCS file: /cvsroot/python/distutils/misc/resource.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** resource.h 5 Oct 2001 20:38:11 -0000 1.6 --- resource.h 19 Feb 2002 20:47:27 -0000 1.7 *************** *** 33,37 **** #define _APS_NEXT_RESOURCE_VALUE 112 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1027 #define _APS_NEXT_SYMED_VALUE 101 #endif --- 33,37 ---- #define _APS_NEXT_RESOURCE_VALUE 112 #define _APS_NEXT_COMMAND_VALUE 40001 ! #define _APS_NEXT_CONTROL_VALUE 1028 #define _APS_NEXT_SYMED_VALUE 101 #endif Index: wininst.exe =================================================================== RCS file: /cvsroot/python/distutils/misc/wininst.exe,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 Binary files /tmp/cvs1fFc8h and /tmp/cvsIEQ6Xp differ From fdrake@users.sourceforge.net Wed Feb 20 05:07:39 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 19 Feb 2002 21:07:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/api refcounts.dat,1.38,1.39 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv23599/api Modified Files: refcounts.dat Log Message: Correct the refcount information for the PyWeakref_GetObject() function. This closes SF bug #520087. Index: refcounts.dat =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounts.dat,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** refcounts.dat 29 Nov 2001 22:42:59 -0000 1.38 --- refcounts.dat 20 Feb 2002 05:07:36 -0000 1.39 *************** *** 1414,1418 **** PyWeakref_GET_OBJECT:PyObject*:ref:0: ! PyWeakref_GetObject:PyObject*::+1: PyWeakref_GetObject:PyObject*:ref:0: --- 1414,1418 ---- PyWeakref_GET_OBJECT:PyObject*:ref:0: ! PyWeakref_GetObject:PyObject*::0: PyWeakref_GetObject:PyObject*:ref:0: From fdrake@users.sourceforge.net Wed Feb 20 05:08:04 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 19 Feb 2002 21:08:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/api refcounts.dat,1.38,1.38.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv23706/api Modified Files: Tag: release22-maint refcounts.dat Log Message: Correct the refcount information for the PyWeakref_GetObject() function. This closes SF bug #520087. Index: refcounts.dat =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounts.dat,v retrieving revision 1.38 retrieving revision 1.38.6.1 diff -C2 -d -r1.38 -r1.38.6.1 *** refcounts.dat 29 Nov 2001 22:42:59 -0000 1.38 --- refcounts.dat 20 Feb 2002 05:08:02 -0000 1.38.6.1 *************** *** 1414,1418 **** PyWeakref_GET_OBJECT:PyObject*:ref:0: ! PyWeakref_GetObject:PyObject*::+1: PyWeakref_GetObject:PyObject*:ref:0: --- 1414,1418 ---- PyWeakref_GET_OBJECT:PyObject*:ref:0: ! PyWeakref_GetObject:PyObject*::0: PyWeakref_GetObject:PyObject*:ref:0: From theller@users.sourceforge.net Wed Feb 20 08:01:21 2002 From: theller@users.sourceforge.net (Thomas Heller) Date: Wed, 20 Feb 2002 00:01:21 -0800 Subject: [Python-checkins] CVS: distutils/distutils/command bdist_wininst.py,1.28,1.29 Message-ID: Update of /cvsroot/python/distutils/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv23817 Modified Files: bdist_wininst.py Log Message: First version which runs an install-script (specified by the --install-script ... command line option to bdist_wininst) at the end of the installation and at the start of deinstallation. Output (stdout, stderr) of the script (if any) is displayed in the last screen at installation, or in a simple message box at deinstallation. sys.argv[1] for the script will contain '-install' at installation time or '-remove' at deinstallation time. The installation script runs in an environment (embedded by the bdist_wininst runtime) where an additional function is available as builtin: create_shortcut(path, description, filename, [arguments[, workdir[, iconpath, iconindex]]]) Recreated this file after source changes. Index: bdist_wininst.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/command/bdist_wininst.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** bdist_wininst.py 12 Jan 2002 11:27:42 -0000 1.28 --- bdist_wininst.py 20 Feb 2002 08:01:19 -0000 1.29 *************** *** 39,42 **** --- 39,45 ---- ('skip-build', None, "skip rebuilding everything (for testing/debugging)"), + ('install-script=', None, + "installation script to be run after installation" + " or before deinstallation"), ] *************** *** 53,56 **** --- 56,60 ---- self.title = None self.skip_build = 0 + self.install_script = None # initialize_options() *************** *** 72,75 **** --- 76,84 ---- self.set_undefined_options('bdist', ('dist_dir', 'dist_dir')) + if self.install_script and \ + self.install_script not in self.distribution.scripts: + raise DistutilsOptionError, \ + "install_script '%s' not found in scripts" % self.install_script + # finalize_options() *************** *** 160,163 **** --- 169,174 ---- # the installer runtime. lines.append("\n[Setup]") + if self.install_script: + lines.append("install_script=%s" % self.install_script) lines.append("info=%s" % repr(info)[1:-1]) lines.append("target_compile=%d" % (not self.no_target_compile)) *************** *** 224,227 **** --- 235,249 ---- if __name__ == '__main__': # recreate EXEDATA from wininst.exe by rewriting this file + + # If you want to do this at home, you should: + # - checkout the *distutils* source code + # (see also http://sourceforge.net/cvs/?group_id=5470) + # by doing: + # cvs -d:pserver:anonymous@cvs.python.sourceforge.net:/cvsroot/python login + # and + # cvs -z3 -d:pserver:anonymous@cvs.python.sourceforge.net:/cvsroot/python co distutils + # - Built wininst.exe from the MSVC project file distutils/misc/wininst.dsw + # - Execute this file (distutils/distutils/command/bdist_wininst.py) + import re, base64 moddata = open("bdist_wininst.py", "r").read() *************** *** 237,250 **** EXEDATA = """\ TVqQAAMAAAAEAAAA//8AALgAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ! AAAA8AAAAA4fug4AtAnNIbgBTM0hVGhpcyBwcm9ncmFtIGNhbm5vdCBiZSBydW4gaW4gRE9TIG1v ! ZGUuDQ0KJAAAAAAAAAA/SHa+eykY7XspGO17KRjtADUU7XkpGO0UNhLtcCkY7fg1Fu15KRjtFDYc ! 7XkpGO0ZNgvtcykY7XspGe0GKRjteykY7XYpGO19ChLteSkY7bwvHu16KRjtUmljaHspGO0AAAAA ! AAAAAAAAAAAAAAAAUEUAAEwBAwCUrh88AAAAAAAAAADgAA8BCwEGAABQAAAAEAAAAKAAANDuAAAA ! sAAAAAABAAAAQAAAEAAAAAIAAAQAAAAAAAAABAAAAAAAAAAAEAEAAAQAAAAAAAACAAAAAAAQAAAQ ! AAAAABAAABAAAAAAAAAQAAAAAAAAAAAAAAAwAQEAbAEAAAAAAQAwAQAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ! AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABVUFgwAAAAAACgAAAAEAAAAAAAAAAEAAAA ! AAAAAAAAAAAAAACAAADgVVBYMQAAAAAAUAAAALAAAABCAAAABAAAAAAAAAAAAAAAAAAAQAAA4C5y ! c3JjAAAAABAAAAAAAQAABAAAAEYAAAAAAAAAAAAAAAAAAEAAAMAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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Q29Jbml0aWFsaXplAABHZXREQwAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA *************** *** 568,572 **** AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ! AAAAAAAAAAAAAAAAAAAAAAAAAAA= """ --- 608,612 ---- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ! AAAAAAAAAAAAAAAAAAAAAAAA """ From repliesforgh7@yahoo.com Thu Feb 21 15:22:31 2002 From: repliesforgh7@yahoo.com (repliesforgh7@yahoo.com) Date: Thu, 21 Feb 2002 07:22:31 -0800 Subject: [Python-checkins] ---Aging can be reversed with HGH!--- 31151076543 Message-ID: HAVE YOU HEARD OF HUMAN GROWTH HORMONE (HGH)??? Released by your own pituitary gland, HGH starts declining in your 20s, even more in your 30s and 40s, eventually resulting in the shrinkage of major organs -- plus, all other symptoms related to old age. IN THOUSANDS OF CLINICAL STUDIES, HGH HAS BEEN SHOWN TO ACCOMPLISH THE FOLLOWING: * Reduce Body Fat and Build Lean Muscle WITHOUT EXERCISE! * Enhance Sexual Performance * Remove Wrinkles and Cellulite * Lower Blood Pressure and Improve Cholesterol Profile * Improve Sleep, Vision and Memory * Restore Hair Color and Growth * Strengthen the Immune System * Increase Energy and Cardiac Output * Turn back your body's Biological Time Clock 10 - 20 years * Live Longer AND Stronger All natural and organic plant based FEEL 10 YEARS YOUNGER WITH ORAL SPRAY HGH. GUARANTEED We are the manufacturer and we sell directly to Doctors, Chiropractors, and consumers world wide the highest grade HGH Oral Spray available. With internet marketing, we are able to save advertising cost and pass those savings along to you. But you must act now. To receive more information call us now. TOLL FREE 1-888-621-7300 We must speak to you in person to qualify your usage. All of your questions will be addressed and answered in a friendly, no pressure manner. Our main purpose is to provide you with information so you can make an educated decision. For more information call 1-888-621-7300 If you are on line write down our phone number and call us when you can. Soon, you and your loved ones will be very glad you did. Read what people are saying: "The effects of 6 months of GH on lean body mass and fat were equivalent in magnitude to the changes incurred during 10-20 years of aging." Dr. Daniel Rudman, MD, New England Journal of Medicine. "Within four months, my body fat decreased form 30% down to 21%! I noticed my skin is more supple and my overall mental outlook improved significantly." D.W., New Jersey "We have been on the spray for just 3 weeks now, and besides the tremendous energy we both feel, my husbands allergies and spells of depression have lifted. I am healing extremely fast after an accident and have lost 7 lbs. without trying!" C.B., Flagstaff. AZ Thanks for reading our letter, The HGH Staff USA Division PS: The HGH Staff guarantees the highest quality and lowest price. We manufacture and ship directly to your door. Call us now 1-888-621-7300 *********************************************************** ======= End of message ======== To Qualify for a Free HGH Consultation call the HGH Staff -- Today. *********************************************************** The following statement is provided to be in compliance with commercial email laws. If you do not wish to receive further mailings, please click reply http://remove.81832.com and enteryour email address. This message is in full compliance with U.S. Federal requirements for commercial email under bill S.1618 Title lll, Section 301, Paragraph (a)(2)(C) passed by the 105th U.S. Congress and is not considered SPAM since it includes a remove mechanism. *********************************************************** This message is not intended for residents in the states of CA, NC, NV, RI, TN, VA & WA. If you have received this message in error, please delete this message. Screening of addresses has been done to the best of our technical ability. *********************************************************** Call us now 1-888-621-7300 for your free HGH consultation. From pierslauder@users.sourceforge.net Fri Feb 22 01:15:20 2002 From: pierslauder@users.sourceforge.net (Piers Lauder) Date: Thu, 21 Feb 2002 17:15:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib imaplib.py,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv30274/dist/src/Lib Modified Files: imaplib.py Log Message: moved command logging routines into IMAP4 class: thread safe/faster Index: imaplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/imaplib.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** imaplib.py 16 Feb 2002 23:06:17 -0000 1.42 --- imaplib.py 22 Feb 2002 01:15:17 -0000 1.43 *************** *** 17,21 **** # GET/SETACL contributed by Anthony Baxter April 2001. ! __version__ = "2.49" import binascii, re, socket, time, random, sys --- 17,21 ---- # GET/SETACL contributed by Anthony Baxter April 2001. ! __version__ = "2.50" import binascii, re, socket, time, random, sys *************** *** 53,57 **** 'NAMESPACE': ('AUTH', 'SELECTED'), 'NOOP': ('NONAUTH', 'AUTH', 'SELECTED', 'LOGOUT'), ! 'PARTIAL': ('SELECTED',), 'RENAME': ('AUTH', 'SELECTED'), 'SEARCH': ('SELECTED',), --- 53,57 ---- 'NAMESPACE': ('AUTH', 'SELECTED'), 'NOOP': ('NONAUTH', 'AUTH', 'SELECTED', 'LOGOUT'), ! 'PARTIAL': ('SELECTED',), # NB: obsolete 'RENAME': ('AUTH', 'SELECTED'), 'SEARCH': ('SELECTED',), *************** *** 159,165 **** if __debug__: if self.debug >= 1: ! _mesg('imaplib version %s' % __version__) ! _mesg('new IMAP4 connection, tag=%s' % self.tagpre) self.welcome = self._get_response() --- 159,168 ---- if __debug__: + self._cmd_log_len = 10 + self._cmd_log_idx = 0 + self._cmd_log = {} # Last `_cmd_log_len' interactions if self.debug >= 1: ! self._mesg('imaplib version %s' % __version__) ! self._mesg('new IMAP4 connection, tag=%s' % self.tagpre) self.welcome = self._get_response() *************** *** 179,183 **** if __debug__: if self.debug >= 3: ! _mesg('CAPABILITIES: %s' % `self.capabilities`) for version in AllowedVersions: --- 182,186 ---- if __debug__: if self.debug >= 3: ! self._mesg('CAPABILITIES: %s' % `self.capabilities`) for version in AllowedVersions: *************** *** 225,228 **** --- 228,232 ---- self.sock.sendall(data) + def shutdown(self): """Close I/O established in "open".""" *************** *** 483,487 **** if __debug__: if self.debug >= 3: ! _dump_ur(self.untagged_responses) return self._simple_command('NOOP') --- 487,491 ---- if __debug__: if self.debug >= 3: ! self._dump_ur(self.untagged_responses) return self._simple_command('NOOP') *************** *** 547,551 **** if __debug__: if self.debug >= 1: ! _dump_ur(self.untagged_responses) raise self.readonly('%s is not writable' % mailbox) return typ, self.untagged_responses.get('EXISTS', [None]) --- 551,555 ---- if __debug__: if self.debug >= 1: ! self._dump_ur(self.untagged_responses) raise self.readonly('%s is not writable' % mailbox) return typ, self.untagged_responses.get('EXISTS', [None]) *************** *** 664,668 **** if __debug__: if self.debug >= 5: ! _mesg('untagged_responses[%s] %s += ["%s"]' % (typ, len(ur.get(typ,'')), dat)) if ur.has_key(typ): --- 668,672 ---- if __debug__: if self.debug >= 5: ! self._mesg('untagged_responses[%s] %s += ["%s"]' % (typ, len(ur.get(typ,'')), dat)) if ur.has_key(typ): *************** *** 710,716 **** if __debug__: if self.debug >= 4: ! _mesg('> %s' % data) else: ! _log('> %s' % data) try: --- 714,720 ---- if __debug__: if self.debug >= 4: ! self._mesg('> %s' % data) else: ! self._log('> %s' % data) try: *************** *** 736,740 **** if __debug__: if self.debug >= 4: ! _mesg('write literal size %s' % len(literal)) try: --- 740,744 ---- if __debug__: if self.debug >= 4: ! self._mesg('write literal size %s' % len(literal)) try: *************** *** 815,819 **** if __debug__: if self.debug >= 4: ! _mesg('read literal size %s' % size) data = self.read(size) --- 819,823 ---- if __debug__: if self.debug >= 4: ! self._mesg('read literal size %s' % size) data = self.read(size) *************** *** 835,839 **** if __debug__: if self.debug >= 1 and typ in ('NO', 'BAD', 'BYE'): ! _mesg('%s response: %s' % (typ, dat)) return resp --- 839,843 ---- if __debug__: if self.debug >= 1 and typ in ('NO', 'BAD', 'BYE'): ! self._mesg('%s response: %s' % (typ, dat)) return resp *************** *** 858,862 **** if __debug__: if self.debug >= 1: ! print_log() raise --- 862,866 ---- if __debug__: if self.debug >= 1: ! self.print_log() raise *************** *** 873,879 **** if __debug__: if self.debug >= 4: ! _mesg('< %s' % line) else: ! _log('< %s' % line) return line --- 877,883 ---- if __debug__: if self.debug >= 4: ! self._mesg('< %s' % line) else: ! self._log('< %s' % line) return line *************** *** 887,891 **** if __debug__: if self.mo is not None and self.debug >= 5: ! _mesg("\tmatched r'%s' => %s" % (cre.pattern, `self.mo.groups()`)) return self.mo is not None --- 891,895 ---- if __debug__: if self.mo is not None and self.debug >= 5: ! self._mesg("\tmatched r'%s' => %s" % (cre.pattern, `self.mo.groups()`)) return self.mo is not None *************** *** 935,943 **** if __debug__: if self.debug >= 5: ! _mesg('untagged_responses[%s] => %s' % (name, data)) del self.untagged_responses[name] return typ, data class _Authenticator: --- 939,985 ---- if __debug__: if self.debug >= 5: ! self._mesg('untagged_responses[%s] => %s' % (name, data)) del self.untagged_responses[name] return typ, data + if __debug__: + + def _mesg(self, s, secs=None): + if secs is None: + secs = time.time() + tm = time.strftime('%M:%S', time.localtime(secs)) + sys.stderr.write(' %s.%02d %s\n' % (tm, (secs*100)%100, s)) + sys.stderr.flush() + + def _dump_ur(self, dict): + # Dump untagged responses (in `dict'). + l = dict.items() + if not l: return + t = '\n\t\t' + l = map(lambda x:'%s: "%s"' % (x[0], x[1][0] and '" "'.join(x[1]) or ''), l) + self._mesg('untagged responses dump:%s%s' % (t, t.join(l))) + + def _log(self, line): + # Keep log of last `_cmd_log_len' interactions for debugging. + self._cmd_log[self._cmd_log_idx] = (line, time.time()) + self._cmd_log_idx += 1 + if self._cmd_log_idx >= self._cmd_log_len: + self._cmd_log_idx = 0 + + def print_log(self): + self._mesg('last %d IMAP4 interactions:' % len(self._cmd_log)) + i, n = self._cmd_log_idx, self._cmd_log_len + while n: + try: + apply(self._mesg, self._cmd_log[i]) + except: + pass + i += 1 + if i >= self._cmd_log_len: + i = 0 + n -= 1 + + class _Authenticator: *************** *** 1083,1119 **** - if __debug__: - - def _mesg(s, secs=None): - if secs is None: - secs = time.time() - tm = time.strftime('%M:%S', time.localtime(secs)) - sys.stderr.write(' %s.%02d %s\n' % (tm, (secs*100)%100, s)) - sys.stderr.flush() - - def _dump_ur(dict): - # Dump untagged responses (in `dict'). - l = dict.items() - if not l: return - t = '\n\t\t' - l = map(lambda x:'%s: "%s"' % (x[0], x[1][0] and '" "'.join(x[1]) or ''), l) - _mesg('untagged responses dump:%s%s' % (t, t.join(l))) - - _cmd_log = [] # Last `_cmd_log_len' interactions - _cmd_log_len = 10 - - def _log(line): - # Keep log of last `_cmd_log_len' interactions for debugging. - if len(_cmd_log) == _cmd_log_len: - del _cmd_log[0] - _cmd_log.append((time.time(), line)) - - def print_log(): - _mesg('last %d IMAP4 interactions:' % len(_cmd_log)) - for secs,line in _cmd_log: - _mesg(line, secs) - - - if __name__ == '__main__': --- 1125,1128 ---- *************** *** 1146,1150 **** ('select', ('/tmp/yyz 2',)), ('search', (None, 'SUBJECT', 'test')), ! ('partial', ('1', 'RFC822', 1, 1024)), ('store', ('1', 'FLAGS', '(\Deleted)')), ('namespace', ()), --- 1155,1159 ---- ('select', ('/tmp/yyz 2',)), ('search', (None, 'SUBJECT', 'test')), ! ('fetch', ('1', '(FLAGS INTERNALDATE RFC822)')), ('store', ('1', 'FLAGS', '(\Deleted)')), ('namespace', ()), *************** *** 1165,1177 **** def run(cmd, args): ! _mesg('%s %s' % (cmd, args)) typ, dat = apply(getattr(M, cmd), args) ! _mesg('%s => %s %s' % (cmd, typ, dat)) return dat try: M = IMAP4(host) ! _mesg('PROTOCOL_VERSION = %s' % M.PROTOCOL_VERSION) ! _mesg('CAPABILITIES = %s' % `M.capabilities`) for cmd,args in test_seq1: --- 1174,1186 ---- def run(cmd, args): ! M._mesg('%s %s' % (cmd, args)) typ, dat = apply(getattr(M, cmd), args) ! M._mesg('%s => %s %s' % (cmd, typ, dat)) return dat try: M = IMAP4(host) ! M._mesg('PROTOCOL_VERSION = %s' % M.PROTOCOL_VERSION) ! M._mesg('CAPABILITIES = %s' % `M.capabilities`) for cmd,args in test_seq1: From aimacintyre@users.sourceforge.net Fri Feb 22 11:03:15 2002 From: aimacintyre@users.sourceforge.net (Andrew I MacIntyre) Date: Fri, 22 Feb 2002 03:03:15 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-os2emx - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-os2emx In directory usw-pr-cvs1:/tmp/cvs-serv9944/plat-os2emx Log Message: Directory /cvsroot/python/python/dist/src/Lib/plat-os2emx added to the repository From aimacintyre@users.sourceforge.net Fri Feb 22 11:06:32 2002 From: aimacintyre@users.sourceforge.net (Andrew I MacIntyre) Date: Fri, 22 Feb 2002 03:06:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/plat-os2emx IN.py,NONE,1.1 SOCKET.py,NONE,1.1 grp.py,NONE,1.1 pwd.py,NONE,1.1 regen,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/plat-os2emx In directory usw-pr-cvs1:/tmp/cvs-serv10921/dist/src/Lib/plat-os2emx Added Files: IN.py SOCKET.py grp.py pwd.py regen Log Message: Create and populate OS/2 EMX port platform specific library directory: Lib/plat-os2emx/ IN.py SOCKET.py grp.py pwd.py // pwd module that can process real passwd files regen --- NEW FILE: IN.py --- # Generated by h2py from f:/emx/include/netinet/in.h # Included from sys/param.h PAGE_SIZE = 0x1000 HZ = 100 MAXNAMLEN = 260 MAXPATHLEN = 260 def htonl(X): return _swapl(X) def ntohl(X): return _swapl(X) def htons(X): return _swaps(X) def ntohs(X): return _swaps(X) IPPROTO_IP = 0 IPPROTO_ICMP = 1 IPPROTO_IGMP = 2 IPPROTO_GGP = 3 IPPROTO_TCP = 6 IPPROTO_EGP = 8 IPPROTO_PUP = 12 IPPROTO_UDP = 17 IPPROTO_IDP = 22 IPPROTO_TP = 29 IPPROTO_EON = 80 IPPROTO_RAW = 255 IPPROTO_MAX = 256 IPPORT_RESERVED = 1024 IPPORT_USERRESERVED = 5000 def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 24 IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_MAX = 128 def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 16 IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_MAX = 65536 def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 8 IN_CLASSC_HOST = 0x000000ff def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 28 IN_CLASSD_HOST = 0x0fffffff def IN_MULTICAST(i): return IN_CLASSD(i) def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000) def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) INADDR_ANY = 0x00000000 INADDR_LOOPBACK = 0x7f000001 INADDR_BROADCAST = 0xffffffff INADDR_NONE = 0xffffffff INADDR_UNSPEC_GROUP = 0xe0000000 INADDR_ALLHOSTS_GROUP = 0xe0000001 INADDR_MAX_LOCAL_GROUP = 0xe00000ff IN_LOOPBACKNET = 127 IP_OPTIONS = 1 IP_MULTICAST_IF = 2 IP_MULTICAST_TTL = 3 IP_MULTICAST_LOOP = 4 IP_ADD_MEMBERSHIP = 5 IP_DROP_MEMBERSHIP = 6 IP_HDRINCL = 2 IP_TOS = 3 IP_TTL = 4 IP_RECVOPTS = 5 IP_RECVRETOPTS = 6 IP_RECVDSTADDR = 7 IP_RETOPTS = 8 IP_DEFAULT_MULTICAST_TTL = 1 IP_DEFAULT_MULTICAST_LOOP = 1 IP_MAX_MEMBERSHIPS = 20 --- NEW FILE: SOCKET.py --- # Generated by h2py from f:/emx/include/sys/socket.h # Included from sys/types.h FD_SETSIZE = 256 # Included from sys/uio.h FREAD = 1 FWRITE = 2 SOCK_STREAM = 1 SOCK_DGRAM = 2 SOCK_RAW = 3 SOCK_RDM = 4 SOCK_SEQPACKET = 5 SO_DEBUG = 0x0001 SO_ACCEPTCONN = 0x0002 SO_REUSEADDR = 0x0004 SO_KEEPALIVE = 0x0008 SO_DONTROUTE = 0x0010 SO_BROADCAST = 0x0020 SO_USELOOPBACK = 0x0040 SO_LINGER = 0x0080 SO_OOBINLINE = 0x0100 SO_L_BROADCAST = 0x0200 SO_RCV_SHUTDOWN = 0x0400 SO_SND_SHUTDOWN = 0x0800 SO_SNDBUF = 0x1001 SO_RCVBUF = 0x1002 SO_SNDLOWAT = 0x1003 SO_RCVLOWAT = 0x1004 SO_SNDTIMEO = 0x1005 SO_RCVTIMEO = 0x1006 SO_ERROR = 0x1007 SO_TYPE = 0x1008 SO_OPTIONS = 0x1010 SOL_SOCKET = 0xffff AF_UNSPEC = 0 AF_UNIX = 1 AF_INET = 2 AF_IMPLINK = 3 AF_PUP = 4 AF_CHAOS = 5 AF_NS = 6 AF_NBS = 7 AF_ISO = 7 AF_OSI = AF_ISO AF_ECMA = 8 AF_DATAKIT = 9 AF_CCITT = 10 AF_SNA = 11 AF_DECnet = 12 AF_DLI = 13 AF_LAT = 14 AF_HYLINK = 15 AF_APPLETALK = 16 AF_NB = 17 AF_NETBIOS = AF_NB AF_OS2 = AF_UNIX AF_MAX = 18 PF_UNSPEC = AF_UNSPEC PF_UNIX = AF_UNIX PF_INET = AF_INET PF_IMPLINK = AF_IMPLINK PF_PUP = AF_PUP PF_CHAOS = AF_CHAOS PF_NS = AF_NS PF_NBS = AF_NBS PF_ISO = AF_ISO PF_OSI = AF_ISO PF_ECMA = AF_ECMA PF_DATAKIT = AF_DATAKIT PF_CCITT = AF_CCITT PF_SNA = AF_SNA PF_DECnet = AF_DECnet PF_DLI = AF_DLI PF_LAT = AF_LAT PF_HYLINK = AF_HYLINK PF_APPLETALK = AF_APPLETALK PF_NB = AF_NB PF_NETBIOS = AF_NB PF_OS2 = AF_UNIX PF_MAX = AF_MAX SOMAXCONN = 5 MSG_OOB = 0x1 MSG_PEEK = 0x2 MSG_DONTROUTE = 0x4 MSG_EOR = 0x8 MSG_TRUNC = 0x10 MSG_CTRUNC = 0x20 MSG_WAITALL = 0x40 MSG_MAXIOVLEN = 16 SCM_RIGHTS = 0x01 MT_FREE = 0 MT_DATA = 1 MT_HEADER = 2 MT_SOCKET = 3 MT_PCB = 4 MT_RTABLE = 5 MT_HTABLE = 6 MT_ATABLE = 7 MT_SONAME = 8 MT_ZOMBIE = 9 MT_SOOPTS = 10 MT_FTABLE = 11 MT_RIGHTS = 12 MT_IFADDR = 13 MAXSOCKETS = 2048 --- NEW FILE: grp.py --- # this module is an OS/2 oriented replacement for the grp standard # extension module. # written by Andrew MacIntyre, April 2001. # released into the public domain "as is", with NO WARRANTY # note that this implementation checks whether ":" or ";" as used as # the field separator character. """Replacement for grp standard extension module, intended for use on OS/2 and similar systems which don't normally have an /etc/group file. The standard Unix group database is an ASCII text file with 4 fields per record (line), separated by a colon: - group name (string) - group password (optional encrypted string) - group id (integer) - group members (comma delimited list of userids, with no spaces) Note that members are only included in the group file for groups that aren't their primary groups. (see the section 8.2 of the Python Library Reference) This implementation differs from the standard Unix implementation by allowing use of the platform's native path separator character - ';' on OS/2, DOS and MS-Windows - as the field separator in addition to the Unix standard ":". The module looks for the group database at the following locations (in order first to last): - ${ETC_GROUP} (or %ETC_GROUP%) - ${ETC}/group (or %ETC%/group) - ${PYTHONHOME}/Etc/group (or %PYTHONHOME%/Etc/group) Classes ------- None Functions --------- getgrgid(gid) - return the record for group-id gid as a 4-tuple getgrnam(name) - return the record for group 'name' as a 4-tuple getgrall() - return a list of 4-tuples, each tuple being one record (NOTE: the order is arbitrary) Attributes ---------- group_file - the path of the group database file """ import os # try and find the group file __group_path = [] if os.environ.has_key('ETC_GROUP'): __group_path.append(os.environ['ETC_GROUP']) if os.environ.has_key('ETC'): __group_path.append('%s/group' % os.environ['ETC']) if os.environ.has_key('PYTHONHOME'): __group_path.append('%s/Etc/group' % os.environ['PYTHONHOME']) group_file = None for __i in __group_path: try: __f = open(__i, 'r') __f.close() group_file = __i break except: pass # decide what field separator we can try to use - Unix standard, with # the platform's path separator as an option. No special field conversion # handlers are required for the group file. __field_sep = [':'] if os.pathsep: if os.pathsep != ':': __field_sep.append(os.pathsep) # helper routine to identify which separator character is in use def __get_field_sep(record): fs = None for c in __field_sep: # there should be 3 delimiter characters (for 4 fields) if record.count(c) == 3: fs = c break if fs: return fs else: raise KeyError, '>> group database fields not delimited <<' # read the whole file, parsing each entry into tuple form # with dictionaries to speed recall by GID or group name def __read_group_file(): if group_file: group = open(group_file, 'r') else: raise KeyError, '>> no group database <<' gidx = {} namx = {} sep = None while 1: entry = group.readline().strip() if len(entry) > 3: if sep == None: sep = __get_field_sep(entry) fields = entry.split(sep) fields[2] = int(fields[2]) record = tuple(fields) if not gidx.has_key(fields[2]): gidx[fields[2]] = record if not namx.has_key(fields[0]): namx[fields[0]] = record elif len(entry) > 0: pass # skip empty or malformed records else: break group.close() if len(gidx) == 0: raise KeyError return (gidx, namx) # return the group database entry by GID def getgrgid(gid): g, n = __read_group_file() return g[gid] # return the group database entry by group name def getgrnam(name): g, n = __read_group_file() return n[name] # return all the group database entries def getgrall(): g, n = __read_group_file() return g.values() # test harness if __name__ == '__main__': getgrall() --- NEW FILE: pwd.py --- # this module is an OS/2 oriented replacement for the pwd standard # extension module. # written by Andrew MacIntyre, April 2001. # released into the public domain "as is", with NO WARRANTY # note that this implementation checks whether ":" or ";" as used as # the field separator character. Path conversions are are applied when # the database uses ":" as the field separator character. """Replacement for pwd standard extension module, intended for use on OS/2 and similar systems which don't normally have an /etc/passwd file. The standard Unix password database is an ASCII text file with 7 fields per record (line), separated by a colon: - user name (string) - password (encrypted string, or "*" or "") - user id (integer) - group id (integer) - description (usually user's name) - home directory (path to user's home directory) - shell (path to the user's login shell) (see the section 8.1 of the Python Library Reference) This implementation differs from the standard Unix implementation by allowing use of the platform's native path separator character - ';' on OS/2, DOS and MS-Windows - as the field separator in addition to the Unix standard ":". Additionally, when ":" is the separator path conversions are applied to deal with any munging of the drive letter reference. The module looks for the password database at the following locations (in order first to last): - ${ETC_PASSWD} (or %ETC_PASSWD%) - ${ETC}/passwd (or %ETC%/passwd) - ${PYTHONHOME}/Etc/passwd (or %PYTHONHOME%/Etc/passwd) Classes ------- None Functions --------- getpwuid(uid) - return the record for user-id uid as a 7-tuple getpwnam(name) - return the record for user 'name' as a 7-tuple getpwall() - return a list of 7-tuples, each tuple being one record (NOTE: the order is arbitrary) Attributes ---------- passwd_file - the path of the password database file """ import os # try and find the passwd file __passwd_path = [] if os.environ.has_key('ETC_PASSWD'): __passwd_path.append(os.environ['ETC_PASSWD']) if os.environ.has_key('ETC'): __passwd_path.append('%s/passwd' % os.environ['ETC']) if os.environ.has_key('PYTHONHOME'): __passwd_path.append('%s/Etc/passwd' % os.environ['PYTHONHOME']) passwd_file = None for __i in __passwd_path: try: __f = open(__i, 'r') __f.close() passwd_file = __i break except: pass # path conversion handlers def __nullpathconv(path): return path.replace(os.altsep, os.sep) def __unixpathconv(path): # two known drive letter variations: "x;" and "$x" if path[0] == '$': conv = path[1] + ':' + path[2:] elif path[1] == ';': conv = path[0] + ':' + path[2:] else: conv = path return conv.replace(os.altsep, os.sep) # decide what field separator we can try to use - Unix standard, with # the platform's path separator as an option. No special field conversion # handler is required when using the platform's path separator as field # separator, but are required for the home directory and shell fields when # using the standard Unix (":") field separator. __field_sep = {':': __unixpathconv} if os.pathsep: if os.pathsep != ':': __field_sep[os.pathsep] = __nullpathconv # helper routine to identify which separator character is in use def __get_field_sep(record): fs = None for c in __field_sep.keys(): # there should be 6 delimiter characters (for 7 fields) if record.count(c) == 6: fs = c break if fs: return fs else: raise KeyError, '>> passwd database fields not delimited <<' # read the whole file, parsing each entry into tuple form # with dictionaries to speed recall by UID or passwd name def __read_passwd_file(): if passwd_file: passwd = open(passwd_file, 'r') else: raise KeyError, '>> no password database <<' uidx = {} namx = {} sep = None while 1: entry = passwd.readline().strip() if len(entry) > 6: if sep == None: sep = __get_field_sep(entry) fields = entry.split(sep) for i in (2, 3): fields[i] = int(fields[i]) for i in (5, 6): fields[i] = __field_sep[sep](fields[i]) record = tuple(fields) if not uidx.has_key(fields[2]): uidx[fields[2]] = record if not namx.has_key(fields[0]): namx[fields[0]] = record elif len(entry) > 0: pass # skip empty or malformed records else: break passwd.close() if len(uidx) == 0: raise KeyError return (uidx, namx) # return the passwd database entry by UID def getpwuid(uid): u, n = __read_passwd_file() return u[uid] # return the passwd database entry by passwd name def getpwnam(name): u, n = __read_passwd_file() return n[name] # return all the passwd database entries def getpwall(): u, n = __read_passwd_file() return n.values() # test harness if __name__ == '__main__': getpwall() --- NEW FILE: regen --- #! /bin/sh export INCLUDE=$C_INCLUDE_PATH set -v python.exe ../../Tools/scripts/h2py.py $C_INCLUDE_PATH/fcntl.h python.exe ../../Tools/scripts/h2py.py $C_INCLUDE_PATH/sys/socket.h python.exe ../../Tools/scripts/h2py.py -i '(u_long)' $C_INCLUDE_PATH/netinet/in.h #python.exe ../../Tools/scripts/h2py.py $C_INCLUDE_PATH/termios.h From mwh@users.sourceforge.net Fri Feb 22 13:19:56 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:19:56 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils/command install_scripts.py,1.10,1.10.26.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory usw-pr-cvs1:/tmp/cvs-serv14034 Modified Files: Tag: release22-maint install_scripts.py Log Message: backport akuchling's checkin of revision 1.11 of install_scripts.py Restrict the mode to the lowest four octal positions; higher positions contain the type of the file (regular file, socket, link, &c.). This means that install_scripts will now print "changing mode of to 775" instead of "... to 100775". 2.2 bugfix candidate, I suppose, though this isn't actually fixing a bug. This patch was applied by an alarmingly automated system -- I hope it worked... Index: install_scripts.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/install_scripts.py,v retrieving revision 1.10 retrieving revision 1.10.26.1 diff -C2 -d -r1.10 -r1.10.26.1 *** install_scripts.py 30 Sep 2000 18:27:54 -0000 1.10 --- install_scripts.py 22 Feb 2002 13:19:54 -0000 1.10.26.1 *************** *** 51,55 **** self.announce("changing mode of %s" % file) else: ! mode = (os.stat(file)[ST_MODE]) | 0111 self.announce("changing mode of %s to %o" % (file, mode)) os.chmod(file, mode) --- 51,55 ---- self.announce("changing mode of %s" % file) else: ! mode = ((os.stat(file)[ST_MODE]) | 0111) & 07777 self.announce("changing mode of %s to %o" % (file, mode)) os.chmod(file, mode) From mwh@users.sourceforge.net Fri Feb 22 13:22:33 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:22:33 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib CGIHTTPServer.py,1.20,1.20.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14874 Modified Files: Tag: release22-maint CGIHTTPServer.py Log Message: backport gvanrossum's checkin of revision 1.21 of CGIHTTPServer.py date: 2002/02/01 16:27:59; author: gvanrossum; state: Exp; lines: +18 -4 Wesley Chun's SF patch 511380: add CGIHTTPServer error supt for Win32 This uses os.popen3 (if it exists) to ensure that errors from a non-Python CGI script are logged. Bugfix candidate. Index: CGIHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/CGIHTTPServer.py,v retrieving revision 1.20 retrieving revision 1.20.8.1 diff -C2 -d -r1.20 -r1.20.8.1 *** CGIHTTPServer.py 26 Oct 2001 03:38:14 -0000 1.20 --- CGIHTTPServer.py 22 Feb 2002 13:22:31 -0000 1.20.8.1 *************** *** 42,45 **** --- 42,46 ---- have_fork = hasattr(os, 'fork') have_popen2 = hasattr(os, 'popen2') + have_popen3 = hasattr(os, 'popen3') # Make rfile unbuffered -- we need to read one line and then pass *************** *** 124,128 **** ispy = self.is_python(scriptname) if not ispy: ! if not (self.have_fork or self.have_popen2): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) --- 125,129 ---- ispy = self.is_python(scriptname) if not ispy: ! if not (self.have_fork or self.have_popen2 or self.have_popen3): self.send_error(403, "CGI script is not a Python script (%s)" % `scriptname`) *************** *** 215,221 **** os._exit(127) ! elif self.have_popen2: ! # Windows -- use popen2 to create a subprocess import shutil os.environ.update(env) cmdline = scriptfile --- 216,226 ---- os._exit(127) ! elif self.have_popen2 or self.have_popen3: ! # Windows -- use popen2 or popen3 to create a subprocess import shutil + if self.have_popen3: + popenx = os.popen3 + else: + popenx = os.popen2 os.environ.update(env) cmdline = scriptfile *************** *** 233,237 **** except: nbytes = 0 ! fi, fo = os.popen2(cmdline, 'b') if self.command.lower() == "post" and nbytes > 0: data = self.rfile.read(nbytes) --- 238,246 ---- except: nbytes = 0 ! files = popenx(cmdline, 'b') ! fi = files[0] ! fo = files[1] ! if self.have_popen3: ! fe = files[2] if self.command.lower() == "post" and nbytes > 0: data = self.rfile.read(nbytes) *************** *** 239,242 **** --- 248,256 ---- fi.close() shutil.copyfileobj(fo, self.wfile) + if self.have_popen3: + errors = fe.read() + fe.close() + if errors: + self.log_error('%s', errors) sts = fo.close() if sts: From mwh@users.sourceforge.net Fri Feb 22 13:22:57 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:22:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils file_util.py,1.11,1.11.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv15013 Modified Files: Tag: release22-maint file_util.py Log Message: backport akuchling's checkin of revision 1.12 of file_util.py [Bug #220993; may also fix bug #479469] Fix flakiness when old installations are present, by always unlinking the destination file before copying to it. Without the unlink(), the copied file remains owned by its previous UID, causing the subsequent chmod() to fail. Bugfix candidate, though it may cause changes on platforms where file ownership behaves differently. Index: file_util.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/file_util.py,v retrieving revision 1.11 retrieving revision 1.11.6.1 diff -C2 -d -r1.11 -r1.11.6.1 *** file_util.py 6 Dec 2001 20:51:35 -0000 1.11 --- file_util.py 22 Feb 2002 13:22:55 -0000 1.11.6.1 *************** *** 37,40 **** --- 37,47 ---- "could not open '%s': %s" % (src, errstr) + if os.path.exists(dst): + try: + os.unlink(dst) + except os.error, (errno, errstr): + raise DistutilsFileError, \ + "could not delete '%s': %s" % (dst, errstr) + try: fdst = open(dst, 'wb') From mwh@users.sourceforge.net Fri Feb 22 13:23:35 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:23:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.53,2.53.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv15196 Modified Files: Tag: release22-maint complexobject.c Log Message: backport gvanrossum's checkin of revision 2.54 of complexobject.c Declare real and imag as read-only attributes. This fixes SF bug #514858 (Gregory Smith): complex not entirely immutable 2.2.1 Bugfix candidate! Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.53 retrieving revision 2.53.4.1 diff -C2 -d -r2.53 -r2.53.4.1 *** complexobject.c 13 Dec 2001 19:52:22 -0000 2.53 --- complexobject.c 22 Feb 2002 13:23:33 -0000 2.53.4.1 *************** *** 630,636 **** static PyMemberDef complex_members[] = { ! {"real", T_DOUBLE, offsetof(PyComplexObject, cval.real), 0, "the real part of a complex number"}, ! {"imag", T_DOUBLE, offsetof(PyComplexObject, cval.imag), 0, "the imaginary part of a complex number"}, {0}, --- 630,636 ---- static PyMemberDef complex_members[] = { ! {"real", T_DOUBLE, offsetof(PyComplexObject, cval.real), READONLY, "the real part of a complex number"}, ! {"imag", T_DOUBLE, offsetof(PyComplexObject, cval.imag), READONLY, "the imaginary part of a complex number"}, {0}, From mwh@users.sourceforge.net Fri Feb 22 13:26:56 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:26:56 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib urllib2.py,1.24,1.24.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv16236 Modified Files: Tag: release22-maint urllib2.py Log Message: backport gward's checkin of revision 1.25 of urllib2.py Fix bug #511786 (2.2.1 candidate): ensure that custom-supplied headers are preserved for redirected requests. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.24 retrieving revision 1.24.8.1 diff -C2 -d -r1.24 -r1.24.8.1 *** urllib2.py 9 Nov 2001 16:46:51 -0000 1.24 --- urllib2.py 22 Feb 2002 13:26:54 -0000 1.24.8.1 *************** *** 417,421 **** # request, although that might interact poorly with other # handlers that also use handler-specific request attributes ! new = Request(newurl, req.get_data()) new.error_302_dict = {} if hasattr(req, 'error_302_dict'): --- 417,421 ---- # request, although that might interact poorly with other # handlers that also use handler-specific request attributes ! new = Request(newurl, req.get_data(), req.headers) new.error_302_dict = {} if hasattr(req, 'error_302_dict'): From mwh@users.sourceforge.net Fri Feb 22 13:29:34 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:29:34 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_thread.py,1.9,1.9.24.1 test_threaded_import.py,1.4,1.4.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv16961 Modified Files: Tag: release22-maint test_thread.py test_threaded_import.py Log Message: backport tim_one's checkin of revision 1.10 of test_thread.py revision 1.5 of test_threaded_import.py SF bug #516372: test_thread: unhandled exc. in thread Fix exit races in test_thread.py and test_threaded_import.py. I suspect the bug is provokable only under Linux (where child threads seem to get lots of cycles before they get killed after the main thread exits), or on multi-processor machines running other OSes. Bugfix candidate. Index: test_thread.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_thread.py,v retrieving revision 1.9 retrieving revision 1.9.24.1 diff -C2 -d -r1.9 -r1.9.24.1 *** test_thread.py 17 Jan 2001 21:51:36 -0000 1.9 --- test_thread.py 22 Feb 2002 13:29:32 -0000 1.9.24.1 *************** *** 98,105 **** print 'task', ident, 'leaving barrier', i mutex.acquire() ! running = running - 1 ! if running == 0: ! done.release() mutex.release() print '\n*** Barrier Test ***' --- 98,109 ---- print 'task', ident, 'leaving barrier', i mutex.acquire() ! running -= 1 ! # Must release mutex before releasing done, else the main thread can ! # exit and set mutex to None as part of global teardown; then ! # mutex.release() raises AttributeError. ! finished = running == 0 mutex.release() + if finished: + done.release() print '\n*** Barrier Test ***' Index: test_threaded_import.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_threaded_import.py,v retrieving revision 1.4 retrieving revision 1.4.14.1 diff -C2 -d -r1.4 -r1.4.14.1 *** test_threaded_import.py 30 Aug 2001 05:16:13 -0000 1.4 --- test_threaded_import.py 22 Feb 2002 13:29:32 -0000 1.4.14.1 *************** *** 18,24 **** critical_section.acquire() N -= 1 ! if N == 0: ! done.release() critical_section.release() # Tricky: When regrtest imports this module, the thread running regrtest --- 18,28 ---- critical_section.acquire() N -= 1 ! # Must release critical_section before releasing done, else the main ! # thread can exit and set critical_section to None as part of global ! # teardown; then critical_section.release() raises AttributeError. ! finished = N == 0 critical_section.release() + if finished: + done.release() # Tricky: When regrtest imports this module, the thread running regrtest From mwh@users.sourceforge.net Fri Feb 22 13:30:19 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:30:19 -0800 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts reindent.py,1.2,1.2.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory usw-pr-cvs1:/tmp/cvs-serv17278 Modified Files: Tag: release22-maint reindent.py Log Message: backport tim_one's checkin of revision 1.3 of reindent.py SF bug #497839: reindent chokes on empty first lines. Reindenter.run(): copy over initial all-whitespace lines (if any, and after normalizing to remove trailing blanks and tabs). Bugfix candidate. Index: reindent.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/reindent.py,v retrieving revision 1.2 retrieving revision 1.2.10.1 diff -C2 -d -r1.2 -r1.2.10.1 *** reindent.py 4 Oct 2001 19:44:10 -0000 1.2 --- reindent.py 22 Feb 2002 13:30:17 -0000 1.2.10.1 *************** *** 158,161 **** --- 158,165 ---- # Program after transformation. after = self.after = [] + # Copy over initial empty lines -- there's nothing to do until + # we see a line with *something* on it. + i = stats[0][0] + after.extend(lines[1:i]) for i in range(len(stats)-1): thisstmt, thislevel = stats[i] From mwh@users.sourceforge.net Fri Feb 22 13:31:21 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:31:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.126,2.126.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv17606 Modified Files: Tag: release22-maint typeobject.c Log Message: backport loewis' checkin of revision 2.127 of typeobject.c Allow __doc__ to be of arbitrary type. Patch by James Henstridge, fixes #504343. 2.2.1 candidate. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.126 retrieving revision 2.126.4.1 diff -C2 -d -r2.126 -r2.126.4.1 *** typeobject.c 17 Dec 2001 17:14:22 -0000 2.126 --- typeobject.c 22 Feb 2002 13:31:18 -0000 2.126.4.1 *************** *** 9,13 **** {"__itemsize__", T_INT, offsetof(PyTypeObject, tp_itemsize), READONLY}, {"__flags__", T_LONG, offsetof(PyTypeObject, tp_flags), READONLY}, - {"__doc__", T_STRING, offsetof(PyTypeObject, tp_doc), READONLY}, {"__weakrefoffset__", T_LONG, offsetof(PyTypeObject, tp_weaklistoffset), READONLY}, --- 9,12 ---- *************** *** 1045,1051 **** /* Set tp_doc to a copy of dict['__doc__'], if the latter is there ! and is a string (tp_doc is a char* -- can't copy a general object ! into it). ! XXX What if it's a Unicode string? Don't know -- this ignores it. */ { --- 1044,1050 ---- /* Set tp_doc to a copy of dict['__doc__'], if the latter is there ! and is a string. Note that the tp_doc slot will only be used ! by C code -- python code will use the version in tp_dict, so ! it isn't that important that non string __doc__'s are ignored. */ { *************** *** 2023,2026 **** --- 2022,2038 ---- if (PyType_Check(b)) inherit_slots(type, (PyTypeObject *)b); + } + + /* if the type dictionary doesn't contain a __doc__, set it from + the tp_doc slot. + */ + if (PyDict_GetItemString(type->tp_dict, "__doc__") == NULL) { + if (type->tp_doc != NULL) { + PyObject *doc = PyString_FromString(type->tp_doc); + PyDict_SetItemString(type->tp_dict, "__doc__", doc); + Py_DECREF(doc); + } else { + PyDict_SetItemString(type->tp_dict, "__doc__", Py_None); + } } From mwh@users.sourceforge.net Fri Feb 22 13:44:45 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:44:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.124,2.124.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv21115 Modified Files: Tag: release22-maint unicodeobject.c Log Message: Fix the problem reported in [ #495401 ] Build troubles: --with-pymalloc in a slightly different manner to the trunk, as discussed on python-dev. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.124 retrieving revision 2.124.6.1 diff -C2 -d -r2.124 -r2.124.6.1 *** unicodeobject.c 6 Dec 2001 20:03:56 -0000 2.124 --- unicodeobject.c 22 Feb 2002 13:44:43 -0000 2.124.6.1 *************** *** 1172,1176 **** PyObject *v; char *p; - char *q; Py_UCS4 ch2; unsigned int cbAllocated = 3 * size; --- 1172,1175 ---- *************** *** 1184,1188 **** return v; ! p = q = PyString_AS_STRING(v); while (i < size) { Py_UCS4 ch = s[i++]; --- 1183,1187 ---- return v; ! p = PyString_AS_STRING(v); while (i < size) { Py_UCS4 ch = s[i++]; *************** *** 1209,1212 **** --- 1208,1212 ---- if (_PyString_Resize(&v, cbAllocated)) goto onError; + p = PyString_AS_STRING(v) + cbWritten; } *************** *** 1228,1231 **** --- 1228,1238 ---- *p++ = (char)(0x80 | (ch & 0x3f)); } else { + if (cbWritten >= (cbAllocated - 4)) { + /* Provide enough room for some more large characters. */ + cbAllocated += 4*10; + if (_PyString_Resize(&v, cbAllocated)) + goto onError; + p = PyString_AS_STRING(v) + cbWritten; + } *p++ = 0xf0 | (ch>>18); *p++ = 0x80 | ((ch>>12) & 0x3f); *************** *** 1236,1240 **** } *p = '\0'; ! if (_PyString_Resize(&v, p - q)) goto onError; return v; --- 1243,1247 ---- } *p = '\0'; ! if (_PyString_Resize(&v, cbWritten)) goto onError; return v; From mwh@users.sourceforge.net Fri Feb 22 13:50:53 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:50:53 -0800 Subject: [Python-checkins] CVS: python/dist/src README,1.136,1.136.4.1 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv23130 Modified Files: Tag: release22-maint README Log Message: backport guido's checkin of revision 1.139: Updates related to Modules/Setup and setup.py. This addresses SF bug #512871 (Jon Ribbens): Installation instructions are wrong. Bugfix candidate. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.136 retrieving revision 1.136.4.1 diff -C2 -d -r1.136 -r1.136.4.1 *** README 19 Dec 2001 22:09:09 -0000 1.136 --- README 22 Feb 2002 13:50:51 -0000 1.136.4.1 *************** *** 43,47 **** To start building right away (on UNIX): type "./configure" in the current directory and when it finishes, type "make". The section ! `Build Instructions' below is still recommended reading, especially the part on customizing Modules/Setup. --- 43,47 ---- To start building right away (on UNIX): type "./configure" in the current directory and when it finishes, type "make". The section ! `Build instructions' below is still recommended reading, especially the part on customizing Modules/Setup. *************** *** 149,178 **** ================== ! Before you can build Python, you must first configure it. Fortunately, ! the configuration and build process has been streamlined for most Unix ! installations, so all you have to do is type a few commands, ! optionally edit one file, and sit back. There are some platforms ! where things are not quite as smooth; see the platform specific notes ! below. If you want to build for multiple platforms sharing the same ! source tree, see the section on VPATH below. ! Start by running the script "./configure", which determines your system ! configuration and creates the Makefile. (It takes a minute or two -- ! please be patient!) You may want to pass options to the configure ! script or edit the Modules/Setup file after running configure -- see the ! section below on configuration options and variables. When it's done, ! you are ready to run make. ! To build Python, you normally type "make" in the toplevel directory. If ! you have changed the configuration or have modified Modules/Setup, the ! Makefile may have to be rebuilt. In this case you may have to run make ! again to correctly build your desired target. The interpreter ! executable is built in the top level directory. Once you have built a Python interpreter, see the subsections below on ! testing, configuring additional modules, and installation. If you run ! into trouble, see the next section. Editing the Modules/Setup file ! after running make is supported; just run "make" again after making ! the desired changes. --- 149,182 ---- ================== ! Before you can build Python, you must first configure it. ! Fortunately, the configuration and build process has been automated ! for Unix and Linux installations, so all you usually have to do is ! type a few commands and sit back. There are some platforms where ! things are not quite as smooth; see the platform specific notes below. ! If you want to build for multiple platforms sharing the same source ! tree, see the section on VPATH below. ! Start by running the script "./configure", which determines your ! system configuration and creates the Makefile. (It takes a minute or ! two -- please be patient!) You may want to pass options to the ! configure script -- see the section below on configuration options and ! variables. When it's done, you are ready to run make. ! To build Python, you normally type "make" in the toplevel directory. ! If you have changed the configuration, the Makefile may have to be ! rebuilt. In this case you may have to run make again to correctly ! build your desired target. The interpreter executable is built in the ! top level directory. Once you have built a Python interpreter, see the subsections below on ! testing and installation. If you run into trouble, see the next ! section. ! ! Previous versions of Python used a manual configuration process that ! involved editing the file Modules/Setup. While this file still exists ! and manual configuration is still supported, it is rarely needed any ! more: almost all modules are automatically built as appropriate under ! guidance of the setup.py script, which is run by Make after the ! interpreter has been built. *************** *** 226,229 **** --- 230,234 ---- 64-bit platforms: The modules audioop, imageop and rgbimg don't work. + The setup.py script disables them on 64-bit installations. Don't try to enable them in the Modules/Setup file. They contain code that is quite wordsize sensitive. (If you have a *************** *** 242,248 **** Under Linux systems using GNU libc 2 (aka libc6), the crypt ! module now needs the -lcrypt option. Uncomment this flag in ! Modules/Setup, or comment out the crypt module in the same ! file. Most modern Linux systems use glibc2. FreeBSD 3.x and probably platforms with NCurses that use libmytinfo or --- 247,252 ---- Under Linux systems using GNU libc 2 (aka libc6), the crypt ! module now needs the -lcrypt option. The setup.py script ! takes care of this automatically. FreeBSD 3.x and probably platforms with NCurses that use libmytinfo or *************** *** 550,554 **** distribution attempts to detect which modules can be built and automatically compiles them. Autodetection doesn't always work, so ! you can customize the configuration by editing the Modules/Setup file. This file is initially copied from Setup.dist by the configure script; if it does not exist yet, create it by copying Modules/Setup.dist --- 554,563 ---- distribution attempts to detect which modules can be built and automatically compiles them. Autodetection doesn't always work, so ! you can still customize the configuration by editing the Modules/Setup ! file; but this should be considered a last resort. The rest of this ! section only applies if you decide to edit the Modules/Setup file. ! You also need this to enable static linking of certain modules (which ! is needed to enable profiling on some systems). ! This file is initially copied from Setup.dist by the configure script; if it does not exist yet, create it by copying Modules/Setup.dist *************** *** 618,623 **** the compiled files left by the previous test run). The test set produces some output. You can generally ignore the messages about ! skipped tests due to optional features which can't be imported. (If ! you want to test those modules, edit Modules/Setup to configure them.) If a message is printed about a failed test or a traceback or core dump is produced, something is wrong. On some Linux systems (those --- 627,631 ---- the compiled files left by the previous test run). The test set produces some output. You can generally ignore the messages about ! skipped tests due to optional features which can't be imported. If a message is printed about a failed test or a traceback or core dump is produced, something is wrong. On some Linux systems (those *************** *** 722,727 **** about the install prefix. ! --with-readline: This option is no longer supported. To use GNU ! readline, enable module "readline" in the Modules/Setup file. --with-threads: On most Unix systems, you can now use multiple --- 730,735 ---- about the install prefix. ! --with-readline: This option is no longer supported. GNU ! readline is automatically enabled by setup.py when present. --with-threads: On most Unix systems, you can now use multiple *************** *** 878,901 **** ! The Tk interface ! ---------------- ! Tk (the user interface component of John Ousterhout's Tcl language) is ! also usable from Python. Since this requires that you first build and ! install Tcl/Tk, the Tk interface is not enabled by default when ! building Python from source. Python supports Tcl/Tk version 8.0 and higher. - See http://dev.ajubasolutions.com/ for more info on Tcl/Tk, including - the on-line manual pages. - - - To enable the Python/Tk interface, once you've built and installed - Tcl/Tk, load the file Modules/Setup into your favorite text editor and - search for the string "_tkinter". Then follow the instructions found - there. If you have installed Tcl/Tk or X11 in unusual places, you - will have to edit the first line to fix or add the -I and -L options. - (Also see the general instructions at the top of that file.) - For more Tkinter information, see the Tkinter Resource page: http://www.python.org/topics/tkinter/ --- 886,896 ---- ! Tkinter ! ------- ! The setup.py script automatically configures this when it detects a ! usable Tcl/Tk installation. This requires Tcl/Tk version 8.0 or higher. For more Tkinter information, see the Tkinter Resource page: http://www.python.org/topics/tkinter/ *************** *** 909,921 **** (lower case t and leading underscore) which lives in Modules/_tkinter.c. Demos and normal Tk applications import only the ! Python Tkinter module -- the latter uses the C _tkinter module ! directly. In order to find the C _tkinter module, it must be compiled ! and linked into the Python interpreter -- the _tkinter line in the ! Setup file does this. In order to find the Python Tkinter module, ! sys.path must be set correctly -- the TKPATH assignment in the Setup ! file takes care of this, but only if you install Python properly ! ("make install libinstall"). (You can also use dynamic loading for ! the C _tkinter module, in which case you must manually fix up sys.path ! or set $PYTHONPATH for the Python Tkinter module.) --- 904,912 ---- (lower case t and leading underscore) which lives in Modules/_tkinter.c. Demos and normal Tk applications import only the ! Python Tkinter module -- only the latter imports the C _tkinter ! module. In order to find the C _tkinter module, it must be compiled ! and linked into the Python interpreter -- the setup.py script does ! this. In order to find the Python Tkinter module, sys.path must be ! set correctly -- normal installation takes care of this. From mwh@users.sourceforge.net Fri Feb 22 13:55:31 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 22 Feb 2002 05:55:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils msvccompiler.py,1.43.6.1,1.43.6.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv24321 Modified Files: Tag: release22-maint msvccompiler.py Log Message: Backport theller's check-in of revision 1.45: Make it 1.5.2 compatible again. (I'm not sure how having symlinks around the repository interacts with branches -- I'm going to tread carefully in here) Index: msvccompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/msvccompiler.py,v retrieving revision 1.43.6.1 retrieving revision 1.43.6.2 diff -C2 -d -r1.43.6.1 -r1.43.6.2 *** msvccompiler.py 6 Feb 2002 17:09:18 -0000 1.43.6.1 --- msvccompiler.py 22 Feb 2002 13:55:28 -0000 1.43.6.2 *************** *** 118,125 **** V = string.split(v,';') for v in V: ! try: ! v = v.encode("mbcs") ! except UnicodeError: ! pass if v == '' or v in L: continue L.append(v) --- 118,126 ---- V = string.split(v,';') for v in V: ! if hasattr(v, "encode"): ! try: ! v = v.encode("mbcs") ! except UnicodeError: ! pass if v == '' or v in L: continue L.append(v) From fdrake@users.sourceforge.net Fri Feb 22 15:40:26 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 22 Feb 2002 07:40:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref7.tex,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv29831/ref Modified Files: ref7.tex Log Message: Typo: thsi -> this. Closes SF bug #521450. Index: ref7.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref7.tex,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ref7.tex 27 Dec 2001 18:38:10 -0000 1.30 --- ref7.tex 22 Feb 2002 15:40:23 -0000 1.31 *************** *** 281,285 **** exception is lost. A \keyword{continue} statement is illegal in the \keyword{finally} clause. (The reason is a problem with the current ! implementation -- thsi restriction may be lifted in the future). The exception information is not available to the program during execution of the \keyword{finally} clause. --- 281,285 ---- exception is lost. A \keyword{continue} statement is illegal in the \keyword{finally} clause. (The reason is a problem with the current ! implementation -- this restriction may be lifted in the future). The exception information is not available to the program during execution of the \keyword{finally} clause. From fdrake@users.sourceforge.net Fri Feb 22 15:40:47 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 22 Feb 2002 07:40:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref7.tex,1.29.8.1,1.29.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv29950/ref Modified Files: Tag: release22-maint ref7.tex Log Message: Typo: thsi -> this. Closes SF bug #521450. Index: ref7.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref7.tex,v retrieving revision 1.29.8.1 retrieving revision 1.29.8.2 diff -C2 -d -r1.29.8.1 -r1.29.8.2 *** ref7.tex 28 Dec 2001 04:35:43 -0000 1.29.8.1 --- ref7.tex 22 Feb 2002 15:40:45 -0000 1.29.8.2 *************** *** 281,285 **** exception is lost. A \keyword{continue} statement is illegal in the \keyword{finally} clause. (The reason is a problem with the current ! implementation -- thsi restriction may be lifted in the future). The exception information is not available to the program during execution of the \keyword{finally} clause. --- 281,285 ---- exception is lost. A \keyword{continue} statement is illegal in the \keyword{finally} clause. (The reason is a problem with the current ! implementation -- this restriction may be lifted in the future). The exception information is not available to the program during execution of the \keyword{finally} clause. From fdrake@users.sourceforge.net Fri Feb 22 15:41:15 2002 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 22 Feb 2002 07:41:15 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref7.tex,1.24.2.2,1.24.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv30084/ref Modified Files: Tag: release21-maint ref7.tex Log Message: Typo: thsi -> this. Closes SF bug #521450. Index: ref7.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref7.tex,v retrieving revision 1.24.2.2 retrieving revision 1.24.2.3 diff -C2 -d -r1.24.2.2 -r1.24.2.3 *** ref7.tex 27 Dec 2001 18:38:47 -0000 1.24.2.2 --- ref7.tex 22 Feb 2002 15:41:13 -0000 1.24.2.3 *************** *** 264,268 **** exception is lost. A \keyword{continue} statement is illegal in the \keyword{finally} clause. (The reason is a problem with the current ! implementation -- thsi restriction may be lifted in the future). The exception information is not available to the program during execution of the \keyword{finally} clause. --- 264,268 ---- exception is lost. A \keyword{continue} statement is illegal in the \keyword{finally} clause. (The reason is a problem with the current ! implementation -- this restriction may be lifted in the future). The exception information is not available to the program during execution of the \keyword{finally} clause. From gward@users.sourceforge.net Fri Feb 22 21:24:34 2002 From: gward@users.sourceforge.net (Greg Ward) Date: Fri, 22 Feb 2002 13:24:34 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib emailparser.tex,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv23864 Modified Files: emailparser.tex Log Message: Grammar tweak. Index: emailparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailparser.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** emailparser.tex 16 Oct 2001 19:22:51 -0000 1.4 --- emailparser.tex 22 Feb 2002 21:24:32 -0000 1.5 *************** *** 23,27 **** no magical connection between the \module{email} package's bundled parser and the \class{Message} class, so your custom parser can create ! message object trees in any way it find necessary. The primary parser class is \class{Parser} which parses both the --- 23,27 ---- no magical connection between the \module{email} package's bundled parser and the \class{Message} class, so your custom parser can create ! message object trees any way it finds necessary. The primary parser class is \class{Parser} which parses both the From gward@users.sourceforge.net Fri Feb 22 21:26:51 2002 From: gward@users.sourceforge.net (Greg Ward) Date: Fri, 22 Feb 2002 13:26:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib emailparser.tex,1.4,1.4.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv24817 Modified Files: Tag: release22-maint emailparser.tex Log Message: Merge trunk. Index: emailparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailparser.tex,v retrieving revision 1.4 retrieving revision 1.4.10.1 diff -C2 -d -r1.4 -r1.4.10.1 *** emailparser.tex 16 Oct 2001 19:22:51 -0000 1.4 --- emailparser.tex 22 Feb 2002 21:26:49 -0000 1.4.10.1 *************** *** 23,27 **** no magical connection between the \module{email} package's bundled parser and the \class{Message} class, so your custom parser can create ! message object trees in any way it find necessary. The primary parser class is \class{Parser} which parses both the --- 23,27 ---- no magical connection between the \module{email} package's bundled parser and the \class{Message} class, so your custom parser can create ! message object trees any way it finds necessary. The primary parser class is \class{Parser} which parses both the From tim_one@users.sourceforge.net Sat Feb 23 04:40:18 2002 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 22 Feb 2002 20:40:18 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libfuncs.tex,1.100,1.101 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv30378/python/Doc/lib Modified Files: libfuncs.tex Log Message: SF bug #501591: dir() doc is old Bugfix candidate. + Updated dir() description to match actual 2.2 behavior. + Replaced the dir(sys) example with dir(struct), because the former was way out of date and is bound to change frequently, while the latter is stable. + Added a note cautioning that dir() is supplied primarily for convenience at an interactive prompt (hoping to discourage its use as the foundation of introspective code outside the core). Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.100 retrieving revision 1.101 diff -C2 -d -r1.100 -r1.101 *** libfuncs.tex 18 Dec 2001 16:31:08 -0000 1.100 --- libfuncs.tex 23 Feb 2002 04:40:15 -0000 1.101 *************** *** 207,224 **** Without arguments, return the list of names in the current local symbol table. With an argument, attempts to return a list of valid ! attribute for that object. This information is gleaned from the object's \member{__dict__} attribute, if defined, and from the class ! or type object. The list is not necessarily complete. For ! example, for classes, attributes defined in base classes are not ! included, and for class instances, methods are not included. ! The resulting list is sorted alphabetically. For example: \begin{verbatim} ! >>> import sys >>> dir() ! ['sys'] ! >>> dir(sys) ! ['argv', 'exit', 'modules', 'path', 'stderr', 'stdin', 'stdout'] \end{verbatim} \end{funcdesc} --- 207,237 ---- Without arguments, return the list of names in the current local symbol table. With an argument, attempts to return a list of valid ! attributes for that object. This information is gleaned from the object's \member{__dict__} attribute, if defined, and from the class ! or type object. The list is not necessarily complete. ! If the object is a module object, the list contains the names of the ! module's attributes. ! If the object is a type or class object, ! the list contains the names of its attributes, ! and recursively of the attributes of its bases. ! Otherwise, the list contains the object's attributes' names, ! the names of its class's attributes, ! and recursively of the attributes of its class's base classes. ! The resulting list is sorted alphabetically. ! For example: \begin{verbatim} ! >>> import struct >>> dir() ! ['__builtins__', '__doc__', '__name__', 'struct'] ! >>> dir(struct) ! ['__doc__', '__name__', 'calcsize', 'error', 'pack', 'unpack'] \end{verbatim} + + \note{Because \function{dir()} is supplied primarily as a convenience + for use at an interactive prompt, + it tries to supply an interesting set of names more than it tries to + supply a rigorously or consistently defined set of names, + and its detailed behavior may change across releases.} \end{funcdesc} From mwh@users.sourceforge.net Sat Feb 23 08:31:40 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Sat, 23 Feb 2002 00:31:40 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libfuncs.tex,1.100,1.100.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv9160 Modified Files: Tag: release22-maint libfuncs.tex Log Message: backport tim_one's checkin of revision 1.101 of libfuncs.tex SF bug #501591: dir() doc is old Bugfix candidate. + Updated dir() description to match actual 2.2 behavior. + Replaced the dir(sys) example with dir(struct), because the former was way out of date and is bound to change frequently, while the latter is stable. + Added a note cautioning that dir() is supplied primarily for convenience at an interactive prompt (hoping to discourage its use as the foundation of introspective code outside the core). Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.100 retrieving revision 1.100.4.1 diff -C2 -d -r1.100 -r1.100.4.1 *** libfuncs.tex 18 Dec 2001 16:31:08 -0000 1.100 --- libfuncs.tex 23 Feb 2002 08:31:37 -0000 1.100.4.1 *************** *** 207,224 **** Without arguments, return the list of names in the current local symbol table. With an argument, attempts to return a list of valid ! attribute for that object. This information is gleaned from the object's \member{__dict__} attribute, if defined, and from the class ! or type object. The list is not necessarily complete. For ! example, for classes, attributes defined in base classes are not ! included, and for class instances, methods are not included. ! The resulting list is sorted alphabetically. For example: \begin{verbatim} ! >>> import sys >>> dir() ! ['sys'] ! >>> dir(sys) ! ['argv', 'exit', 'modules', 'path', 'stderr', 'stdin', 'stdout'] \end{verbatim} \end{funcdesc} --- 207,237 ---- Without arguments, return the list of names in the current local symbol table. With an argument, attempts to return a list of valid ! attributes for that object. This information is gleaned from the object's \member{__dict__} attribute, if defined, and from the class ! or type object. The list is not necessarily complete. ! If the object is a module object, the list contains the names of the ! module's attributes. ! If the object is a type or class object, ! the list contains the names of its attributes, ! and recursively of the attributes of its bases. ! Otherwise, the list contains the object's attributes' names, ! the names of its class's attributes, ! and recursively of the attributes of its class's base classes. ! The resulting list is sorted alphabetically. ! For example: \begin{verbatim} ! >>> import struct >>> dir() ! ['__builtins__', '__doc__', '__name__', 'struct'] ! >>> dir(struct) ! ['__doc__', '__name__', 'calcsize', 'error', 'pack', 'unpack'] \end{verbatim} + + \note{Because \function{dir()} is supplied primarily as a convenience + for use at an interactive prompt, + it tries to supply an interesting set of names more than it tries to + supply a rigorously or consistently defined set of names, + and its detailed behavior may change across releases.} \end{funcdesc} From mwh@users.sourceforge.net Sat Feb 23 08:43:05 2002 From: mwh@users.sourceforge.net (Michael Hudson) Date: Sat, 23 Feb 2002 00:43:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python thread_pthread.h,2.36,2.36.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv10304 Modified Files: Tag: release22-maint thread_pthread.h Log Message: Backport jackjansen's checkin of revision 2.37: Workaround for what is probably a problem in Apple's gcc: fails on a function pointer formal argument called "destructor", which is typedeffed as a different function pointer type in object.h. Index: thread_pthread.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_pthread.h,v retrieving revision 2.36 retrieving revision 2.36.8.1 diff -C2 -d -r2.36 -r2.36.8.1 *** thread_pthread.h 9 Nov 2001 16:00:41 -0000 2.36 --- thread_pthread.h 23 Feb 2002 08:43:03 -0000 2.36.8.1 *************** *** 4,8 **** --- 4,14 ---- #include #include + #ifdef __APPLE__ + #define destructor xxdestructor + #endif #include + #ifdef __APPLE__ + #undef destructor + #endif #include From loewis@users.sourceforge.net Sat Feb 23 22:31:55 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 23 Feb 2002 14:31:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/curses textpad.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/curses In directory usw-pr-cvs1:/tmp/cvs-serv8640 Modified Files: textpad.py Log Message: Patch #521670: Remove unused sys import. Index: textpad.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/curses/textpad.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** textpad.py 13 Aug 2001 13:47:23 -0000 1.6 --- textpad.py 23 Feb 2002 22:31:53 -0000 1.7 *************** *** 1,5 **** """Simple textbox editing widget with Emacs-like keybindings.""" ! import sys, curses, ascii def rectangle(win, uly, ulx, lry, lrx): --- 1,5 ---- """Simple textbox editing widget with Emacs-like keybindings.""" ! import curses, ascii def rectangle(win, uly, ulx, lry, lrx): *************** *** 133,137 **** self.win.move(y, 0) stop = self._end_of_line(y) - #sys.stderr.write("y=%d, _end_of_line(y)=%d\n" % (y, stop)) if stop == 0 and self.stripspaces: continue --- 133,136 ---- From loewis@users.sourceforge.net Sat Feb 23 22:35:35 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 23 Feb 2002 14:35:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/compiler ast.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/compiler In directory usw-pr-cvs1:/tmp/cvs-serv9481 Modified Files: ast.py Log Message: Patch #521714: fix pychecker warnings in ast.py. Index: ast.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/ast.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ast.py 21 Dec 2001 20:03:35 -0000 1.20 --- ast.py 23 Feb 2002 22:35:33 -0000 1.21 *************** *** 20,26 **** return [n for n in flatten(list) if isinstance(n, Node)] ! def asList(nodes): l = [] ! for item in nodes: if hasattr(item, "asList"): l.append(item.asList()) --- 20,26 ---- return [n for n in flatten(list) if isinstance(n, Node)] ! def asList(nodearg): l = [] ! for item in nodearg: if hasattr(item, "asList"): l.append(item.asList()) *************** *** 66,74 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.expr) ! if self.lower is not None: nodes.append(self.lower) ! if self.upper is not None: nodes.append(self.upper) ! return tuple(nodes) def __repr__(self): --- 66,74 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.expr) ! if self.lower is not None: nodelist.append(self.lower) ! if self.upper is not None: nodelist.append(self.upper) ! return tuple(nodelist) def __repr__(self): *************** *** 104,112 **** def getChildNodes(self): ! nodes = [] ! if self.expr1 is not None: nodes.append(self.expr1) ! if self.expr2 is not None: nodes.append(self.expr2) ! if self.expr3 is not None: nodes.append(self.expr3) ! return tuple(nodes) def __repr__(self): --- 104,112 ---- def getChildNodes(self): ! nodelist = [] ! if self.expr1 is not None: nodelist.append(self.expr1) ! if self.expr2 is not None: nodelist.append(self.expr2) ! if self.expr3 is not None: nodelist.append(self.expr3) ! return tuple(nodelist) def __repr__(self): *************** *** 130,139 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.assign) ! nodes.append(self.list) ! nodes.append(self.body) ! if self.else_ is not None: nodes.append(self.else_) ! return tuple(nodes) def __repr__(self): --- 130,139 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.assign) ! nodelist.append(self.list) ! nodelist.append(self.body) ! if self.else_ is not None: nodelist.append(self.else_) ! return tuple(nodelist) def __repr__(self): *************** *** 151,157 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 151,157 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 213,219 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 213,219 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 261,267 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.items)) ! return tuple(nodes) def __repr__(self): --- 261,267 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.items)) ! return tuple(nodelist) def __repr__(self): *************** *** 339,346 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! if self.dest is not None: nodes.append(self.dest) ! return tuple(nodes) def __repr__(self): --- 339,346 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! if self.dest is not None: nodelist.append(self.dest) ! return tuple(nodelist) def __repr__(self): *************** *** 376,383 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.expr) ! nodes.extend(flatten_nodes(self.subs)) ! return tuple(nodes) def __repr__(self): --- 376,383 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.expr) ! nodelist.extend(flatten_nodes(self.subs)) ! return tuple(nodelist) def __repr__(self): *************** *** 399,407 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.body) ! nodes.extend(flatten_nodes(self.handlers)) ! if self.else_ is not None: nodes.append(self.else_) ! return tuple(nodes) def __repr__(self): --- 399,407 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.body) ! nodelist.extend(flatten_nodes(self.handlers)) ! if self.else_ is not None: nodelist.append(self.else_) ! return tuple(nodelist) def __repr__(self): *************** *** 419,425 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 419,425 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 468,475 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.defaults)) ! nodes.append(self.code) ! return tuple(nodes) def __repr__(self): --- 468,475 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.defaults)) ! nodelist.append(self.code) ! return tuple(nodelist) def __repr__(self): *************** *** 489,496 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.test) ! if self.fail is not None: nodes.append(self.fail) ! return tuple(nodes) def __repr__(self): --- 489,496 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.test) ! if self.fail is not None: nodelist.append(self.fail) ! return tuple(nodelist) def __repr__(self): *************** *** 541,549 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.expr) ! if self.locals is not None: nodes.append(self.locals) ! if self.globals is not None: nodes.append(self.globals) ! return tuple(nodes) def __repr__(self): --- 541,549 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.expr) ! if self.locals is not None: nodelist.append(self.locals) ! if self.globals is not None: nodelist.append(self.globals) ! return tuple(nodelist) def __repr__(self): *************** *** 561,567 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 561,567 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 579,585 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 579,585 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 611,617 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 611,617 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 679,686 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.bases)) ! nodes.append(self.code) ! return tuple(nodes) def __repr__(self): --- 679,686 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.bases)) ! nodelist.append(self.code) ! return tuple(nodelist) def __repr__(self): *************** *** 715,722 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! if self.dest is not None: nodes.append(self.dest) ! return tuple(nodes) def __repr__(self): --- 715,722 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! if self.dest is not None: nodelist.append(self.dest) ! return tuple(nodelist) def __repr__(self): *************** *** 734,740 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 734,740 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 799,805 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 799,805 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 865,873 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.test) ! nodes.append(self.body) ! if self.else_ is not None: nodes.append(self.else_) ! return tuple(nodes) def __repr__(self): --- 865,873 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.test) ! nodelist.append(self.body) ! if self.else_ is not None: nodelist.append(self.else_) ! return tuple(nodelist) def __repr__(self): *************** *** 944,951 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! nodes.append(self.expr) ! return tuple(nodes) def __repr__(self): --- 944,951 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! nodelist.append(self.expr) ! return tuple(nodelist) def __repr__(self): *************** *** 975,982 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.defaults)) ! nodes.append(self.code) ! return tuple(nodes) def __repr__(self): --- 975,982 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.defaults)) ! nodelist.append(self.code) ! return tuple(nodelist) def __repr__(self): *************** *** 994,1000 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 994,1000 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 1014,1021 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.expr) ! nodes.extend(flatten_nodes(self.ops)) ! return tuple(nodes) def __repr__(self): --- 1014,1021 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.expr) ! nodelist.extend(flatten_nodes(self.ops)) ! return tuple(nodelist) def __repr__(self): *************** *** 1033,1039 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 1033,1039 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 1051,1057 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.nodes)) ! return tuple(nodes) def __repr__(self): --- 1051,1057 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.nodes)) ! return tuple(nodelist) def __repr__(self): *************** *** 1075,1084 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.node) ! nodes.extend(flatten_nodes(self.args)) ! if self.star_args is not None: nodes.append(self.star_args) ! if self.dstar_args is not None: nodes.append(self.dstar_args) ! return tuple(nodes) def __repr__(self): --- 1075,1084 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.node) ! nodelist.extend(flatten_nodes(self.args)) ! if self.star_args is not None: nodelist.append(self.star_args) ! if self.dstar_args is not None: nodelist.append(self.dstar_args) ! return tuple(nodelist) def __repr__(self): *************** *** 1184,1191 **** def getChildNodes(self): ! nodes = [] ! nodes.extend(flatten_nodes(self.tests)) ! if self.else_ is not None: nodes.append(self.else_) ! return tuple(nodes) def __repr__(self): --- 1184,1191 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.extend(flatten_nodes(self.tests)) ! if self.else_ is not None: nodelist.append(self.else_) ! return tuple(nodelist) def __repr__(self): *************** *** 1205,1212 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.expr) ! nodes.extend(flatten_nodes(self.quals)) ! return tuple(nodes) def __repr__(self): --- 1205,1212 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.expr) ! nodelist.extend(flatten_nodes(self.quals)) ! return tuple(nodelist) def __repr__(self): *************** *** 1228,1236 **** def getChildNodes(self): ! nodes = [] ! nodes.append(self.assign) ! nodes.append(self.list) ! nodes.extend(flatten_nodes(self.ifs)) ! return tuple(nodes) def __repr__(self): --- 1228,1236 ---- def getChildNodes(self): ! nodelist = [] ! nodelist.append(self.assign) ! nodelist.append(self.list) ! nodelist.extend(flatten_nodes(self.ifs)) ! return tuple(nodelist) def __repr__(self): From loewis@users.sourceforge.net Sat Feb 23 22:39:39 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 23 Feb 2002 14:39:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Tools/idle OutputWindow.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/idle In directory usw-pr-cvs1:/tmp/cvs-serv10453 Modified Files: OutputWindow.py Log Message: Patch #520483: Make IDLE OutputWindow handle Unicode. 2.2.1 candidate. Index: OutputWindow.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/idle/OutputWindow.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** OutputWindow.py 17 Jan 2001 08:48:39 -0000 1.5 --- OutputWindow.py 23 Feb 2002 22:39:37 -0000 1.6 *************** *** 35,39 **** def write(self, s, tags=(), mark="insert"): ! self.text.insert(mark, str(s), tags) self.text.see(mark) self.text.update() --- 35,39 ---- def write(self, s, tags=(), mark="insert"): ! self.text.insert(mark, s, tags) self.text.see(mark) self.text.update() From aimacintyre@users.sourceforge.net Sun Feb 24 05:32:34 2002 From: aimacintyre@users.sourceforge.net (Andrew I MacIntyre) Date: Sat, 23 Feb 2002 21:32:34 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_fcntl.py,1.20,1.21 test_longexp.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv28705/dist/src/Lib/test Modified Files: test_fcntl.py test_longexp.py Log Message: OS/2 EMX port Library and regression test changes: Lib/ os.py os2emxpath.py // added - OS/2 EMX specific path manipulation routines popen2.py site.py Lib/test/ test_fcntl.py test_longexp.py Index: test_fcntl.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_fcntl.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test_fcntl.py 5 Dec 2001 23:27:32 -0000 1.20 --- test_fcntl.py 24 Feb 2002 05:32:32 -0000 1.21 *************** *** 1,4 **** --- 1,5 ---- #! /usr/bin/env python """Test program for the fcntl C module. + OS/2+EMX doesn't support the file locking operations. Roger E. Masse """ *************** *** 24,32 **** elif sys.platform in ['aix3', 'aix4', 'hp-uxB', 'unixware7']: lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) else: lockdata = struct.pack('hh'+start_len+'hh', fcntl.F_WRLCK, 0, 0, 0, 0, 0) ! if verbose: ! print 'struct.pack: ', `lockdata` ! # the example from the library docs --- 25,35 ---- elif sys.platform in ['aix3', 'aix4', 'hp-uxB', 'unixware7']: lockdata = struct.pack('hhlllii', fcntl.F_WRLCK, 0, 0, 0, 0, 0, 0) + elif sys.platform in ['os2emx']: + lockdata = None else: lockdata = struct.pack('hh'+start_len+'hh', fcntl.F_WRLCK, 0, 0, 0, 0, 0) ! if lockdata: ! if verbose: ! print 'struct.pack: ', `lockdata` # the example from the library docs *************** *** 36,42 **** print 'Status from fnctl with O_NONBLOCK: ', rv ! rv = fcntl.fcntl(f.fileno(), fcntl.F_SETLKW, lockdata) ! if verbose: ! print 'String from fcntl with F_SETLKW: ', `rv` f.close() --- 39,46 ---- print 'Status from fnctl with O_NONBLOCK: ', rv ! if sys.platform not in ['os2emx']: ! rv = fcntl.fcntl(f.fileno(), fcntl.F_SETLKW, lockdata) ! if verbose: ! print 'String from fcntl with F_SETLKW: ', `rv` f.close() *************** *** 48,52 **** rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NONBLOCK) ! rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata) f.close() --- 52,57 ---- rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NONBLOCK) ! if sys.platform not in ['os2emx']: ! rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata) f.close() Index: test_longexp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_longexp.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_longexp.py 23 Oct 2000 17:22:07 -0000 1.3 --- test_longexp.py 24 Feb 2002 05:32:32 -0000 1.4 *************** *** 1,4 **** REPS = 65580 ! l = eval("[" + "2," * REPS + "]") ! print len(l) --- 1,12 ---- + # this test has a malloc problem on OS/2+EMX, so skip test in that environment + + import sys + from test_support import TestFailed + REPS = 65580 ! if sys.platform == "os2emx": ! raise TestFailed, "OS/2+EMX port has malloc problems with long expressions" ! else: ! l = eval("[" + "2," * REPS + "]") ! print len(l) From aimacintyre@users.sourceforge.net Sun Feb 24 05:32:34 2002 From: aimacintyre@users.sourceforge.net (Andrew I MacIntyre) Date: Sat, 23 Feb 2002 21:32:34 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib os2emxpath.py,NONE,1.1 os.py,1.50,1.51 popen2.py,1.20,1.21 site.py,1.40,1.41 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv28705/dist/src/Lib Modified Files: os.py popen2.py site.py Added Files: os2emxpath.py Log Message: OS/2 EMX port Library and regression test changes: Lib/ os.py os2emxpath.py // added - OS/2 EMX specific path manipulation routines popen2.py site.py Lib/test/ test_fcntl.py test_longexp.py --- NEW FILE: os2emxpath.py --- # Module 'os2emxpath' -- common operations on OS/2 pathnames """Common pathname manipulations, OS/2 EMX version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import stat __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","islink","exists","isdir","isfile","ismount", "walk","expanduser","expandvars","normpath","abspath","splitunc"] # Normalize the case of a pathname and map slashes to backslashes. # Other normalizations (such as optimizing '../' away) are not done # (this is done by normpath). def normcase(s): """Normalize case of pathname. Makes all characters lowercase and all altseps into seps.""" return s.replace('\\', '/').lower() # Return whether a path is absolute. # Trivial in Posix, harder on the Mac or MS-DOS. # For DOS it is absolute if it starts with a slash or backslash (current # volume), or if a pathname after the volume letter and colon / UNC resource # starts with a slash or backslash. def isabs(s): """Test whether a path is absolute""" s = splitdrive(s)[1] return s != '' and s[:1] in '/\\' # Join two (or more) paths. def join(a, *p): """Join two or more pathname components, inserting sep as needed""" path = a for b in p: if isabs(b): path = b elif path == '' or path[-1:] in '/\\:': path = path + b else: path = path + '/' + b return path # Split a path in a drive specification (a drive letter followed by a # colon) and the path specification. # It is always true that drivespec + pathspec == p def splitdrive(p): """Split a pathname into drive and path specifiers. Returns a 2-tuple "(drive,path)"; either part may be empty""" if p[1:2] == ':': return p[0:2], p[2:] return '', p # Parse UNC paths def splitunc(p): """Split a pathname into UNC mount point and relative path specifiers. Return a 2-tuple (unc, rest); either part may be empty. If unc is not empty, it has the form '//host/mount' (or similar using backslashes). unc+rest is always the input path. Paths containing drive letters never have an UNC part. """ if p[1:2] == ':': return '', p # Drive letter present firstTwo = p[0:2] if firstTwo == '/' * 2 or firstTwo == '\\' * 2: # is a UNC path: # vvvvvvvvvvvvvvvvvvvv equivalent to drive letter # \\machine\mountpoint\directories... # directory ^^^^^^^^^^^^^^^ normp = normcase(p) index = normp.find('/', 2) if index == -1: ##raise RuntimeError, 'illegal UNC path: "' + p + '"' return ("", p) index = normp.find('/', index + 1) if index == -1: index = len(p) return p[:index], p[index:] return '', p # Split a path in head (everything up to the last '/') and tail (the # rest). After the trailing '/' is stripped, the invariant # join(head, tail) == p holds. # The resulting head won't end in '/' unless it is the root. def split(p): """Split a pathname. Return tuple (head, tail) where tail is everything after the final slash. Either part may be empty.""" d, p = splitdrive(p) # set i to index beyond p's last slash i = len(p) while i and p[i-1] not in '/\\': i = i - 1 head, tail = p[:i], p[i:] # now tail has no slashes # remove trailing slashes from head, unless it's all slashes head2 = head while head2 and head2[-1] in '/\\': head2 = head2[:-1] head = head2 or head return d + head, tail # Split a path in root and extension. # The extension is everything starting at the last dot in the last # pathname component; the root is everything before that. # It is always true that root + ext == p. def splitext(p): """Split the extension from a pathname. Extension is everything from the last dot to the end. Return (root, ext), either part may be empty.""" root, ext = '', '' for c in p: if c in ['/','\\']: root, ext = root + ext + c, '' elif c == '.': if ext: root, ext = root + ext, c else: ext = c elif ext: ext = ext + c else: root = root + c return root, ext # Return the tail (basename) part of a path. def basename(p): """Returns the final component of a pathname""" return split(p)[1] # Return the head (dirname) part of a path. def dirname(p): """Returns the directory component of a pathname""" return split(p)[0] # Return the longest prefix of all list elements. def commonprefix(m): "Given a list of pathnames, returns the longest common leading component" if not m: return '' prefix = m[0] for item in m: for i in range(len(prefix)): if prefix[:i+1] != item[:i+1]: prefix = prefix[:i] if i == 0: return '' break return prefix # Get size, mtime, atime of files. def getsize(filename): """Return the size of a file, reported by os.stat()""" st = os.stat(filename) return st[stat.ST_SIZE] def getmtime(filename): """Return the last modification time of a file, reported by os.stat()""" st = os.stat(filename) return st[stat.ST_MTIME] def getatime(filename): """Return the last access time of a file, reported by os.stat()""" st = os.stat(filename) return st[stat.ST_ATIME] # Is a path a symbolic link? # This will always return false on systems where posix.lstat doesn't exist. def islink(path): """Test for symbolic link. On OS/2 always returns false""" return 0 # Does a path exist? # This is false for dangling symbolic links. def exists(path): """Test whether a path exists""" try: st = os.stat(path) except os.error: return 0 return 1 # Is a path a directory? def isdir(path): """Test whether a path is a directory""" try: st = os.stat(path) except os.error: return 0 return stat.S_ISDIR(st[stat.ST_MODE]) # Is a path a regular file? # This follows symbolic links, so both islink() and isdir() can be true # for the same path. def isfile(path): """Test whether a path is a regular file""" try: st = os.stat(path) except os.error: return 0 return stat.S_ISREG(st[stat.ST_MODE]) # Is a path a mount point? Either a root (with or without drive letter) # or an UNC path with at most a / or \ after the mount point. def ismount(path): """Test whether a path is a mount point (defined as root of drive)""" unc, rest = splitunc(path) if unc: return rest in ("", "/", "\\") p = splitdrive(path)[1] return len(p) == 1 and p[0] in '/\\' # Directory tree walk. # For each directory under top (including top itself, but excluding # '.' and '..'), func(arg, dirname, filenames) is called, where # dirname is the name of the directory and filenames is the list # files files (and subdirectories etc.) in the directory. # The func may modify the filenames list, to implement a filter, # or to impose a different order of visiting. def walk(top, func, arg): """Directory tree walk whth callback function. walk(top, func, arg) calls func(arg, d, files) for each directory d in the tree rooted at top (including top itself); files is a list of all the files and subdirs in directory d.""" try: names = os.listdir(top) except os.error: return func(arg, top, names) exceptions = ('.', '..') for name in names: if name not in exceptions: name = join(top, name) if isdir(name): walk(name, func, arg) # Expand paths beginning with '~' or '~user'. # '~' means $HOME; '~user' means that user's home directory. # If the path doesn't begin with '~', or if the user or $HOME is unknown, # the path is returned unchanged (leaving error reporting to whatever # function is called with the expanded path as argument). # See also module 'glob' for expansion of *, ? and [...] in pathnames. # (A function should also be defined to do full *sh-style environment # variable expansion.) def expanduser(path): """Expand ~ and ~user constructs. If user or $HOME is unknown, do nothing.""" if path[:1] != '~': return path i, n = 1, len(path) while i < n and path[i] not in '/\\': i = i + 1 if i == 1: if os.environ.has_key('HOME'): userhome = os.environ['HOME'] elif not os.environ.has_key('HOMEPATH'): return path else: try: drive = os.environ['HOMEDRIVE'] except KeyError: drive = '' userhome = join(drive, os.environ['HOMEPATH']) else: return path return userhome + path[i:] # Expand paths containing shell variable substitutions. # The following rules apply: # - no expansion within single quotes # - no escape character, except for '$$' which is translated into '$' # - ${varname} is accepted. # - varnames can be made out of letters, digits and the character '_' # XXX With COMMAND.COM you can use any characters in a variable name, # XXX except '^|<>='. def expandvars(path): """Expand shell variables of form $var and ${var}. Unknown variables are left unchanged.""" if '$' not in path: return path import string varchars = string.letters + string.digits + '_-' res = '' index = 0 pathlen = len(path) while index < pathlen: c = path[index] if c == '\'': # no expansion within single quotes path = path[index + 1:] pathlen = len(path) try: index = path.index('\'') res = res + '\'' + path[:index + 1] except ValueError: res = res + path index = pathlen - 1 elif c == '$': # variable or '$$' if path[index + 1:index + 2] == '$': res = res + c index = index + 1 elif path[index + 1:index + 2] == '{': path = path[index+2:] pathlen = len(path) try: index = path.index('}') var = path[:index] if os.environ.has_key(var): res = res + os.environ[var] except ValueError: res = res + path index = pathlen - 1 else: var = '' index = index + 1 c = path[index:index + 1] while c != '' and c in varchars: var = var + c index = index + 1 c = path[index:index + 1] if os.environ.has_key(var): res = res + os.environ[var] if c != '': res = res + c else: res = res + c index = index + 1 return res # Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B. def normpath(path): """Normalize path, eliminating double slashes, etc.""" path = path.replace('\\', '/') prefix, path = splitdrive(path) while path[:1] == '/': prefix = prefix + '/' path = path[1:] comps = path.split('/') i = 0 while i < len(comps): if comps[i] == '.': del comps[i] elif comps[i] == '..' and i > 0 and comps[i-1] not in ('', '..'): del comps[i-1:i+1] i = i - 1 elif comps[i] == '' and i > 0 and comps[i-1] != '': del comps[i] else: i = i + 1 # If the path is now empty, substitute '.' if not prefix and not comps: comps.append('.') return prefix + '/'.join(comps) # Return an absolute path. def abspath(path): """Return the absolute version of a path""" if not isabs(path): path = join(os.getcwd(), path) return normpath(path) Index: os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/os.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** os.py 30 Oct 2001 05:56:40 -0000 1.50 --- os.py 24 Feb 2002 05:32:32 -0000 1.51 *************** *** 96,100 **** name = 'os2' linesep = '\r\n' ! curdir = '.'; pardir = '..'; sep = '\\'; pathsep = ';' defpath = '.;C:\\bin' from os2 import * --- 96,106 ---- name = 'os2' linesep = '\r\n' ! curdir = '.'; pardir = '..'; pathsep = ';' ! if sys.version.find('EMX GCC') == -1: ! # standard OS/2 compiler (VACPP or Watcom?) ! sep = '\\'; altsep = '/' ! else: ! # EMX ! sep = '/'; altsep = '\\' defpath = '.;C:\\bin' from os2 import * *************** *** 103,109 **** except ImportError: pass ! import ntpath ! path = ntpath ! del ntpath import os2 --- 109,120 ---- except ImportError: pass ! if sys.version.find('EMX GCC') == -1: ! import ntpath ! path = ntpath ! del ntpath ! else: ! import os2emxpath ! path = os2emxpath ! del os2emxpath import os2 Index: popen2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/popen2.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** popen2.py 2 Dec 2001 13:32:15 -0000 1.20 --- popen2.py 24 Feb 2002 05:32:32 -0000 1.21 *************** *** 113,117 **** ! if sys.platform[:3] == "win": # Some things don't make sense on non-Unix platforms. del Popen3, Popen4 --- 113,117 ---- ! if sys.platform[:3] == "win" or sys.platform == "os2emx": # Some things don't make sense on non-Unix platforms. del Popen3, Popen4 Index: site.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/site.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** site.py 11 Feb 2002 18:34:41 -0000 1.40 --- site.py 24 Feb 2002 05:32:32 -0000 1.41 *************** *** 165,169 **** for prefix in prefixes: if prefix: ! if os.sep == '/': sitedirs = [os.path.join(prefix, "lib", --- 165,171 ---- for prefix in prefixes: if prefix: ! if sys.platform == 'os2emx': ! sitedirs = [os.path.join(prefix, "Lib", "site-packages")] ! elif os.sep == '/': sitedirs = [os.path.join(prefix, "lib", From loewis@users.sourceforge.net Sun Feb 24 15:07:26 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 24 Feb 2002 07:07:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib smtplib.py,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25348 Modified Files: smtplib.py Log Message: Accept Unicode strings as SMTP TO addresses. Fixes #521270. 2.2.1 candidate. Index: smtplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** smtplib.py 16 Feb 2002 23:06:18 -0000 1.47 --- smtplib.py 24 Feb 2002 15:07:24 -0000 1.48 *************** *** 637,641 **** raise SMTPSenderRefused(code, resp, from_addr) senderrs={} ! if type(to_addrs) == types.StringType: to_addrs = [to_addrs] for each in to_addrs: --- 637,641 ---- raise SMTPSenderRefused(code, resp, from_addr) senderrs={} ! if isinstance(to_addrs, types.StringTypes): to_addrs = [to_addrs] for each in to_addrs: From loewis@users.sourceforge.net Sun Feb 24 16:05:07 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 24 Feb 2002 08:05:07 -0800 Subject: [Python-checkins] CVS: python/dist/src configure,1.282,1.283 configure.in,1.291,1.292 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv7829 Modified Files: configure configure.in Log Message: Patch #510825: PTHREAD_SCOPE_SYSTEM support for HP-UX (pass non-null argument to pthread_create). 2.2.1 candidate. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.282 retrieving revision 1.283 diff -C2 -d -r1.282 -r1.283 *** configure 16 Feb 2002 23:33:22 -0000 1.282 --- configure 24 Feb 2002 16:05:04 -0000 1.283 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.290 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.291 [...2510 lines suppressed...] if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < *************** *** 7594,7598 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7597: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7595,7599 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7598: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.291 retrieving revision 1.292 diff -C2 -d -r1.291 -r1.292 *** configure.in 16 Feb 2002 23:33:23 -0000 1.291 --- configure.in 24 Feb 2002 16:05:05 -0000 1.292 *************** *** 1110,1116 **** main() { pthread_attr_t attr; if (pthread_attr_init(&attr)) exit(-1); if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1); ! if (pthread_create(NULL, &attr, foo, NULL)) exit(-1); exit(0); }], --- 1110,1117 ---- main() { pthread_attr_t attr; + pthread_t id; if (pthread_attr_init(&attr)) exit(-1); if (pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM)) exit(-1); ! if (pthread_create(&id, &attr, foo, NULL)) exit(-1); exit(0); }], From loewis@users.sourceforge.net Sun Feb 24 16:51:47 2002 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 24 Feb 2002 08:51:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk FixTk.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv21430 Modified Files: FixTk.py Log Message: Set TCL_LIBRARY before import _tkinter. Suggested by Kirill Simonov. Fixes #418173 and #219960. 2.2.1 candidate. Index: FixTk.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/FixTk.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** FixTk.py 12 Oct 2001 15:34:29 -0000 1.5 --- FixTk.py 24 Feb 2002 16:51:45 -0000 1.6 *************** *** 1,11 **** ! import sys, os, _tkinter ! ver = str(_tkinter.TCL_VERSION) ! for t in "tcl", "tk", "tix": ! key = t.upper() + "_LIBRARY" ! try: ! v = os.environ[key] ! except KeyError: ! v = os.path.join(sys.prefix, "tcl", t+ver) ! if os.path.exists(os.path.join(v, "tclIndex")): ! os.environ[key] = v --- 1,32 ---- ! import sys, os ! # Delay import _tkinter until we have set TCL_LIBRARY, ! # so that Tcl_FindExecutable has a chance to locate its ! # encoding directory. ! ! # Unfortunately, we cannot know the TCL_LIBRARY directory ! # if we don't know the tcl version, which we cannot find out ! # without import Tcl. Fortunately, Tcl will itself look in ! # \..\tcl, so anything close to ! # the real Tcl library will do. ! ! prefix = os.path.join(sys.prefix,"tcl") ! # if this does not exist, no further search is needed ! if os.path.exists(prefix): ! if not os.environ.has_key("TCL_LIBRARY"): ! for name in os.listdir(prefix): ! if name.startswith("tcl"): ! tcldir = os.path.join(prefix,name) ! if os.path.isdir(tcldir): ! os.environ["TCL_LIBRARY"] = tcldir ! # Now set the other variables accordingly ! import _tkinter ! ver = str(_tkinter.TCL_VERSION) ! for t in "tk", "tix": ! key = t.upper() + "_LIBRARY" ! try: ! v = os.environ[key] ! except KeyError: ! v = os.path.join(sys.prefix, "tcl", t+ver) ! if os.path.exists(os.path.join(v, "tclIndex")): ! os.environ[key] = v From jackjansen@users.sourceforge.net Sun Feb 24 22:44:02 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 24 Feb 2002 14:44:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Demo applescript.html,1.8,1.8.20.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Demo In directory usw-pr-cvs1:/tmp/cvs-serv16652 Modified Files: Tag: release22-maint applescript.html Log Message: Backport of 1.9 and 1.10: Rewritten, clarified, corrected and cleaned up by Michael J. Barber. Some modifications and clarifications (by me) to Michael's mods. Index: applescript.html =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Demo/applescript.html,v retrieving revision 1.8 retrieving revision 1.8.20.1 diff -C2 -d -r1.8 -r1.8.20.1 *** applescript.html 27 Mar 2001 21:34:31 -0000 1.8 --- applescript.html 24 Feb 2002 22:44:00 -0000 1.8.20.1 *************** *** 1,207 **** ! Using Open Scripting Extension from Python ! !

Using Open Scripting Extension from Python

!
! OSA support in Python is still not 100% complete, but there is already enough in place to allow you to do some nifty things ! to other programs from your python program.

- - Actually, when we say "AppleScript" in this document we actually mean - "the Open Scripting Architecture", there is nothing - AppleScript-specific in the Python implementation.

- In this example, we will look at a scriptable application, extract its ! "AppleScript Dictionary" and generate a Python interface module from ! that and use that module to control the application. Because we want ! to concentrate on the OSA details we don't bother with a real ! user-interface for our application.

! The application we are going to script is Disk Copy, Apple's standard utility for making copies of floppies, creating files that are mountable ! as disk images, etc.

-

Python OSA architecture

! Open Scripting suites and inheritance can be modelled rather nicely with ! with Python packages, so for each application we want to script we generate ! a package. Each suite defined in the application becomes a module in the package, and the package main module imports everything from all the ! submodules and glues all the classes (Python terminology, OSA terminology is ! events, AppleScript terminology is verbs) together.

A suite in an OSA application can extend the functionality of a standard ! suite, and this is implemented in Python by importing everything from the ! module that implements the standard suite and overriding anything that has ! been extended. The standard suites live in the StdSuite package.

! This all sounds complicated, and you can do strange and wondrous things ! with it once you fully understand it, but the good news is that simple ! scripting is actually pretty simple.

!

Creating the Python interface module

- There is a tool in the standard distribution that looks through a file - for an 'AETE' or 'AEUT' resource, the internal representation of the - AppleScript dictionary. This tool is called - gensuitemodule.py, and lives in Mac:scripts. - When we start it, it asks us for an input file and we point it to the - Disk Copy executable.

! Next it wants a folder where it will store the package it is going to generate. Note that this is the package folder, not the parent folder, so we navigate to Python:Mac:Demo:applescript, create a folder ! Disk_Copy and select that.

! Next it wants the folder from which it should import the standard suites. Here ! you always select Python:Mac:Lib:lib-scriptpackages. (There is one exception to this rule: when you are generating StdSuites itself ! you select cancel, for obvious reasons).

It starts parsing the AETE resource, and for ! each AppleEvent suite it finds it prompts us for the filename of the resulting python module. Remember to change folders for the first ! module, you don't want to clutter up the Eudora folder with your python ! interfaces. If you want to skip a suite you press cancel and the process ! continues with the next suite.

! Gensuitemodule may ask you questions like "Where is enum 'xyz ' declared?". ! This is either due to a misunderstanding on my part or (rather too common) bugs in the AETE resources. Pressing cancel is usually the ! right option, it will cause the specific enum not to be treated as an enum ! but as a "normal" type. As things like fsspecs and TEXT strings clearly are ! not enumerators this is correct. If someone understands what is really going on ! here please let me know.

!

! Time for a sidebar. If you want to re-create the StdSuite modules ! you should look in one of two places. On older systems you will find the ! AEUT resources in System Folder:Extensions:Scripting ! Additions:Dialects:English Dialect. On newer systems you will ! find them in System Folder:Extensions:Applescript.

!

! Let's glance at the Disk_Copy package just created. You ! may want to open Script Editor alongside, and have a look at how it ! interprets the dictionary. The main package module is in __init__.py ! and the only interesting bit is the Disk_Copy class, which includes the event handling classes from the individual suites. It also inherits aetools.TalkTo, which is a base class that handles all details on how to start the program and talk to it, and a class variable _signature which is the default application this class will talk ! to (you can override this in various when you instantiate your class, see aetools.py for details). !

!

! Let us do another sidebar. Since MacPython 2.0 this new structure, with packages ! per application and submodules per suite, is used. Older MacPythons had a ! single level of modules, with uncertain semantics. With the new structure ! it is possible for programs to override standard suites, as programs often do. ! It is a good idea to convert your own old programs to the new scheme, but if you ! really want the old standard suites are still available in ! :Mac:Lib:lib-scripting. !
The Special_Events module is a nice example of a suite module. ! The Special_Events_Events class is the bulk of the code ! generated. For each verb it contains a method. Each method knows what ! arguments the verb expects, and it makes handy use of keyword arguments to present a palatable ! interface to the python programmer. You will see that each method ! calls some routines from aetools, an auxiliary module ! living in Lib:toolbox which contains some other nifty ! AppleEvent tools as well. Have a look at it sometime, there is (of ! course) no documentation yet.

! The other thing you notice is that each method calls ! self.send, this comes from the aetools.TalkTo baseclass.

! After the big class we get a number of little class declarations. These ! declarations are for the (appleevent) classes and properties in the suite. They allow you to create object IDs, which can then be passed to the verbs. ! For instance, to get the name of the sender of the first message in mailbox ! inbox you would use mailbox("inbox").message(1).sender. It is also possible to specify this as sender(message(1, mailbox("inbox"))), ! which is sometimes needed because these classes don't always inherit correctly ! from baseclasses, so you may have to use a class or property from another suite.

! !

! There are also some older object specifiers for standard objects in aetools. ! You use these in the form aetools.Word(10, ! aetools.Document(1)) where the corresponding AppleScript ! terminology would be word 10 of the first ! document. Examine the two modules mentioned above along with ! the comments at the end of your suite module if you need to create ! more than the standard object specifiers. !
Next we get the enumeration dictionaries, which allow you to pass english names as arguments to verbs, so you don't have to bother with the 4-letter type code. So, you can say !
  	diskcopy.create(..., filesystem="Mac OS Standard")
! 
! as it is called in Script Editor, in stead of the cryptic lowlevel !
  	diskcopy.create(..., filesystem="Fhfs")
! 

- Finally, we get the "table of contents" of the module, listing all classes and such - by code, which is used by gensuitemodule.

-

Using a Python suite module

- Now that we have created the suite module we can use it in a Python script. In older MacPython distributions this used to be a rather complicated affair, but with the package scheme and with the application signature known by the package it is very simple: you import the package and instantiate ! the class, as !
  	talker = Disk_Copy.Disk_Copy(start=1)
! 
! You will usually specify the start=1: it will run the application if it is ! not already running. You may want to omit it if you want to talk to the application ! only if it is already running, or if the application is something like the Finder.

! Looking at the sourcefile makedisk.py we see that it starts ! with some imports. ! The main program itself is a wonder of simplicity. We create the ! object that talks to Disk Copy, creates a disk and mounts it.

! The exception handling does need a few comments, though. Since ! AppleScript is basically a connectionless RPC protocol nothing happens ! when we create to talker object. Hence, if the destination application ! is not running we will not notice until we send our first ! command. There is another thing to note about errors returned by ! AppleScript calls: MacOS.Error is raised for ! all of the errors that are known to be OSErr-type errors, ! server generated errors raise aetools.Error.

!

Scripting Additions

If you want to use any of the scripting additions (or OSAXen, in ! everyday speech) from a Python program you can use the same method ! as for applications, i.e. run gensuitemodule on the ! OSAX (commonly found in System Folder:Extensions:Scripting Additions or something similar). There is one minor gotcha: the application ! signature to use is 'MACS'.

! There are two minor points to watch out for when using gensuitemodule ! on OSAXen: they appear all to define the class System_Object_Suite, and a lot of them have the command set in multiple dialects. You have to ! watch out for name conflicts, so, and make sure you select a reasonable dialect ! (some of the non-english dialects cause gensuitemodule to generate incorrect ! Python code).

!

Further Reading

! If you want to look at more involved examples of applescripting look at the standard modules findertools and nsremote, or (possibly better, as it ! is more involved) fullbuild from the Mac:scripts folder. --- 1,358 ---- ! ! Using the Open Scripting Architecture from Python ! !

Using the Open Scripting Architecture from Python

!
!

OSA support in Python is still not 100% complete, but there is already enough in place to allow you to do some nifty things ! with other programs from your python program.

+

In this example, we will look at a scriptable application, extract its ! “AppleScript Dictionary,” generate a Python interface package from ! the dictionary, and use that package to control the application. The application we are going to script is Disk Copy, Apple's standard utility for making copies of floppies, creating files that are mountable ! as disk images, etc. ! Because we want ! to concentrate on the OSA details, we won’t bother with a real ! user-interface for our application.

!

! When we say “AppleScript” in this document we actually mean ! “the Open Scripting Architecture.” There is nothing ! AppleScript-specific in the Python implementation. Most of this document ! focuses on the classic Mac OS; Mac OS X users have some ! additional tools. !

! !

Python OSA architecture

! !

Open Scripting suites and inheritance can be modelled rather nicely ! with Python packages, so we generate ! a package for each application we want to script. Each suite defined in ! the application becomes a module in the package, and the package main module imports everything from all the ! submodules and glues together all the classes (in Python terminology— ! events in OSA terminology or verbs in AppleScript terminology).

+

A suite in an OSA application can extend the functionality of a standard ! suite. This is implemented in Python by importing everything from the ! module that implements the standard suites and overriding anything that has ! been extended. The standard suites live in the StdSuite package.

!

! This all sounds complicated, but the good news is that basic ! scripting is actually pretty simple. You can do strange and wondrous things ! with OSA scripting once you fully understand it.

!

Creating the Python interface package

!

There is a tool in the standard distribution that can automatically ! generate the interface packages. This tool is called ! gensuitemodule.py, and lives in Mac:scripts. ! It looks through a file ! for an ‘AETE’ or ‘AEUT’ resource, ! the internal representation of the ! AppleScript dictionary, and parses the resource to generate the suite ! modules. ! When we start gensuitemodule, it asks us for an input file; ! for our example, ! we point it to the Disk Copy executable.

! !

! Next, gensuitemodule wants a folder where it will store the ! package it is going to generate. Note that this is the package folder, not the parent folder, so we navigate to Python:Mac:Demo:applescript, create a folder ! Disk_Copy, and select that.

!

! We next specify the folder from which gensuitemodule ! should import the standard suites. Here, ! we always select Python:Mac:Lib:lib-scriptpackages:StdSuites. (There is one exception to this rule: when you are generating StdSuites itself ! you select _builtinSuites.) !

+

It starts parsing the AETE resource, and for ! each AppleEvent suite it finds, gensuitemodule.py ! prompts us for the filename of the resulting python module. Remember to change folders for the first ! module—you don't want to clutter up, say, the ! Disk Copy folder ! with your python ! interfaces. If you want to skip a suite, press cancel and the process ! continues with the next suite.

!

Summary

! !
    ! !
  1. Run gensuitemodule.
  2. ! !
  3. Select the application (or OSAX) for which you would like a Python interface.
  4. ! !
  5. Select the package folder where the interface modules should be ! stored.
  6. ! !
  7. Specify the folder Python:Mac:Lib:lib-scriptpackages:StdSuites ! to import the standard suites (or _builtinSuites if you are ! generating StdSuites itself).
  8. ! !
  9. Save the generated suites (use cancel to skip a suite).
  10. ! ! !
! ! !

Notes

! ! !
    ! !
  • The interface package may occasionally need some editing by hand. For example, ! gensuitemodule does not handle all Python reserved words, so ! if ! one of the AppleScript verbs is a Python reserved word, a SyntaxError ! may be raised when the package is imported. ! Simply rename the class into something acceptable, if this happens; ! take a look at how the ! print verb is handled (automatically by gensuitemodule) ! in the standard suites. But: f you need to edit your package this should be considered a ! bug in gensuitemodule, so please report it so it can be fixed in future releases. !
  • ! ! !
  • If you want to re-create the StdSuite modules, ! you should look in one of two places. With versions of AppleScript older than 1.4.0 ! (which first shipped with OS 9.0), you will find the ! AEUT resources in System Folder:Extensions:Scripting ! Additions:Dialects:English Dialect. For newer versions, you will ! find them in System Folder:Extensions:Applescript. !
  • ! !
  • Since MacPython 2.0, this new structure, with packages ! per application and submodules per suite, is used. Older MacPythons had a ! single level of modules, with uncertain semantics. With the new structure, ! it is possible for programs to override standard suites, as programs often do. ! !
  • ! !
  • Gensuitemodule.py may ask you questions ! like “Where is enum 'xyz ' declared?”. ! This is either due to a misunderstanding on my part or (rather too commonly) bugs in the AETE resources. Pressing cancel is usually the ! right choice: it will cause the specific enum not to be treated as an enum ! but as a “normal” type. As things like fsspecs and TEXT strings clearly are ! not enumerators, this is correct. If someone understands what is really going on ! here, please let me know.
  • !
! ! !

The Python interface package contents

! !

! Let’s glance at the ! Disk_Copy package just created. You ! may want to open Script Editor alongside to see how it ! interprets the dictionary. !

! ! !

! The main package module is in __init__.py. ! The only interesting bit is the Disk_Copy class, which includes the event handling classes from the individual suites. It also inherits aetools.TalkTo, which is a base class that handles all details on how to start the program and talk to it, and a class variable _signature which is the default application this class will talk ! to (you can override this in various ways when you instantiate your class, see aetools.py for details). !

+

The Special_Events module is a nice example of a suite module. ! The Special_Events_Events class is the bulk of the code ! generated. For each verb, it contains a method. Each method knows what ! arguments the verb expects, and it makes use of keyword arguments to present a palatable ! interface to the python programmer. ! Notice that each method ! calls some routines from aetools, an auxiliary module ! living in Mac:Lib. ! The other thing to notice is that each method calls ! self.send. This comes from the aetools.TalkTo ! baseclass.

! !

! After the big class, there are a number of little class declarations. These ! declarations are for the (AppleEvent) classes and properties in the suite. They allow you to create object IDs, which can then be passed to the verbs. ! For instance, ! when scripting the popular email program Eudora, ! you would use mailbox("inbox").message(1).sender ! to get the name of the sender of the first message in mailbox ! inbox. It is also possible to specify this as sender(message(1, mailbox("inbox"))), ! which is sometimes needed because these classes don’t always inherit correctly ! from baseclasses, so you may have to use a class or property from another ! suite.

+

Next we get the enumeration dictionaries, which allow you to pass english names as arguments to verbs, so you don't have to bother with the 4-letter type code. So, you can say ! diskcopy.create(..., filesystem="Mac OS Standard") ! ! as it is called in Script Editor, instead of the cryptic lowlevel ! diskcopy.create(..., filesystem="Fhfs") !

! !

! Finally, we get the “table of contents” of the module, listing all ! classes and such ! by code, which is used by gensuitemodule itself: if you use this ! suite as a base package in a later run this is how it knows what is defined in this ! suite, and what the Python names are. !

! !

Notes

! !
    ! !
  • The aetools module contains some other nifty ! AppleEvent tools as well. Have a look at it sometime, there is (of ! course) no documentation yet. !
  • ! !
  • There are also some older object specifiers for standard objects in aetools. ! You use these in the form aetools.Word(10, ! aetools.Document(1)), where the corresponding AppleScript ! terminology would be word 10 of the first ! document. Examine ! aetools and aetools.TalkTo ! along with ! the comments at the end of your suite module if you need to create ! more than the standard object specifiers. !
  • ! !
+

Using a Python suite module

+ +

+ Now that we have created the suite module, we can use it in a Python script. In older MacPython distributions this used to be a rather complicated affair, but with the package scheme and with the application signature known by the package it is very simple: you import the package and instantiate ! the class, e.g. ! talker = Disk_Copy.Disk_Copy(start=1) ! ! You will usually specify the start=1: it will run the application if it is ! not already running. ! You may want to omit it if you want to talk to the application ! only if it is already running, or if the application is something like the Finder. ! Another way to ensure that the application is running is to call talker._start(). !

!

! Looking at the sourcefile makedisk.py, we see that it starts ! with some imports. Naturally, one of these is the Python interface to Disk ! Copy.

!

! The main program itself is a wonder of simplicity: we create the ! object (talker) that talks to Disk Copy, ! create a disk, and mount it. The bulk of ! the work is done by talker and the Python interface package we ! just created.

!

! The exception handling does warrant a few comments, though. Since ! AppleScript is basically a connectionless RPC protocol, ! nothing happens ! when we create the talker object. Hence, if the destination application ! is not running, we will not notice until we send our first ! command (avoid this as described above). There is another thing to note about errors returned by ! AppleScript calls: MacOS.Error is raised for ! all of the errors that are known to be OSErr-type errors, ! while ! server generated errors raise aetools.Error.

!

Scripting Additions

+

If you want to use any of the scripting additions (or OSAXen, in ! everyday speech) from a Python program, you can use the same method ! as for applications, i.e. run gensuitemodule on the ! OSAX (commonly found in System Folder:Scripting Additions or something similar). There is one minor gotcha: the application ! signature to use is MACS. You will need to edit the main class ! in the __init__.py file of the created package and change the value ! of _signature to MACS, or use a subclass to the ! same effect. !

!

! There are two minor points to watch out for when using gensuitemodule ! on OSAXen: they appear all to define the class System_Object_Suite, and a lot of them have the command set in multiple dialects. You have to ! watch out for name conflicts and make sure you select a reasonable dialect ! (some of the non-English dialects cause gensuitemodule to generate incorrect ! Python code).

! Despite these difficulties, OSAXen offer a lot of possibilities. Take a ! look at some of the OSAXen in the Scripting Additions folder, or ! download some from the net. !

Further Reading

! !

! If you want to look at more involved examples of applescripting, look at the standard modules findertools and nsremote, or (possibly better, as it ! is more involved) fullbuild from the Mac:scripts folder. !

! !

Alternatives

! !

Mac OS X

! !

! Under Mac OS X, the above still works, but with some new difficulties. ! The application package structure can hide the ‘AETE’ or ! ‘AEUT’ resource from gensuitemodule, so that, ! for example, it cannot generate an OSA interface to iTunes. Script ! Editor gets at the dictionary of such programs using a ‘Get ! AETE’ AppleEvent, if someone wants to donate code to use the same ! method for gensuitemodule: by all means! !

! !

! One alternative is available through the Unix command line version of python. ! Apple has provided the osacompile and osascript tools, ! which can be used to compile and execute scripts written in OSA languages. See the ! man pages for more details. !

! ! ! ! \ No newline at end of file From jackjansen@users.sourceforge.net Sun Feb 24 22:46:30 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 24 Feb 2002 14:46:30 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib FrameWork.py,1.47,1.47.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17244 Modified Files: Tag: release22-maint FrameWork.py Log Message: Backport of 1.47, 1.48 and 1.49: - Added minimal support for floating windows. - Changes by Donovan Preston (and a few minor ones by me) to make IDE run under MachoPython. Mainly making sure we don't call routines that don't exist. - Don't barf when an AppleEvent was not handled. It's ok to ignore. Index: FrameWork.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/FrameWork.py,v retrieving revision 1.47 retrieving revision 1.47.6.1 diff -C2 -d -r1.47 -r1.47.6.1 *** FrameWork.py 13 Dec 2001 12:57:11 -0000 1.47 --- FrameWork.py 24 Feb 2002 22:46:28 -0000 1.47.6.1 *************** *** 28,31 **** --- 28,36 ---- import EasyDialogs + try: + MyFrontWindow = FrontNonFloatingWindow + except NameError: + MyFrontWindow = FrontWindow + kHighLevelEvent = 23 # Don't know what header file this should come from SCROLLBARWIDTH = 16 # Again, not a clue... *************** *** 154,158 **** def mainloop(self, mask = everyEvent, wait = None): self.quitting = 0 ! saveparams = apply(MacOS.SchedParams, self.schedparams) try: while not self.quitting: --- 159,164 ---- def mainloop(self, mask = everyEvent, wait = None): self.quitting = 0 ! if hasattr(MacOS, 'SchedParams'): ! saveparams = apply(MacOS.SchedParams, self.schedparams) try: while not self.quitting: *************** *** 165,169 **** break finally: ! apply(MacOS.SchedParams, saveparams) def dopendingevents(self, mask = everyEvent): --- 171,176 ---- break finally: ! if hasattr(MacOS, 'SchedParams'): ! apply(MacOS.SchedParams, saveparams) def dopendingevents(self, mask = everyEvent): *************** *** 215,218 **** --- 222,227 ---- def asyncevents(self, onoff): """asyncevents - Set asynchronous event handling on or off""" + if MacOS.runtimemodel == 'macho': + raise 'Unsupported in MachoPython' old = self._doing_asyncevents if old: *************** *** 258,262 **** # Not menubar or something, so assume someone # else's window ! MacOS.HandleEvent(event) return elif self._windows.has_key(wid): --- 267,272 ---- # Not menubar or something, so assume someone # else's window ! if hasattr(MacOS, 'HandleEvent'): ! MacOS.HandleEvent(event) return elif self._windows.has_key(wid): *************** *** 273,284 **** def do_inSysWindow(self, partcode, window, event): ! MacOS.HandleEvent(event) def do_inDesk(self, partcode, window, event): ! MacOS.HandleEvent(event) def do_inMenuBar(self, partcode, window, event): if not self.menubar: ! MacOS.HandleEvent(event) return (what, message, when, where, modifiers) = event --- 283,297 ---- def do_inSysWindow(self, partcode, window, event): ! if hasattr(MacOS, 'HandleEvent'): ! MacOS.HandleEvent(event) def do_inDesk(self, partcode, window, event): ! if hasattr(MacOS, 'HandleEvent'): ! MacOS.HandleEvent(event) def do_inMenuBar(self, partcode, window, event): if not self.menubar: ! if hasattr(MacOS, 'HandleEvent'): ! MacOS.HandleEvent(event) return (what, message, when, where, modifiers) = event *************** *** 295,299 **** def do_menu(self, id, item, window, event): ! MacOS.OutputSeen() self.menubar.dispatch(id, item, window, event) --- 308,313 ---- def do_menu(self, id, item, window, event): ! if hasattr(MacOS, 'OutputSeen'): ! MacOS.OutputSeen() self.menubar.dispatch(id, item, window, event) *************** *** 304,312 **** if DEBUG: print "\tUnknown part code:", partcode if DEBUG: print "\tEvent:", self.printevent(event) ! MacOS.HandleEvent(event) def do_unknownwindow(self, partcode, window, event): if DEBUG: print 'Unknown window:', window ! MacOS.HandleEvent(event) def do_keyDown(self, event): --- 318,328 ---- if DEBUG: print "\tUnknown part code:", partcode if DEBUG: print "\tEvent:", self.printevent(event) ! if hasattr(MacOS, 'HandleEvent'): ! MacOS.HandleEvent(event) def do_unknownwindow(self, partcode, window, event): if DEBUG: print 'Unknown window:', window ! if hasattr(MacOS, 'HandleEvent'): ! MacOS.HandleEvent(event) def do_keyDown(self, event): *************** *** 333,341 **** else: if not self.menubar: ! MacOS.HandleEvent(event) return else: # See whether the front window wants it ! w = FrontWindow() if w and self._windows.has_key(w): window = self._windows[w] --- 349,358 ---- else: if not self.menubar: ! if hasattr(MacOS, 'HandleEvent'): ! MacOS.HandleEvent(event) return else: # See whether the front window wants it ! w = MyFrontWindow() if w and self._windows.has_key(w): window = self._windows[w] *************** *** 357,361 **** window.do_rawupdate(wid, event) else: ! MacOS.HandleEvent(event) def do_activateEvt(self, event): --- 374,379 ---- window.do_rawupdate(wid, event) else: ! if hasattr(MacOS, 'HandleEvent'): ! MacOS.HandleEvent(event) def do_activateEvt(self, event): *************** *** 366,370 **** window.do_activate(modifiers & 1, event) else: ! MacOS.HandleEvent(event) def do_osEvt(self, event): --- 384,389 ---- window.do_activate(modifiers & 1, event) else: ! if hasattr(MacOS, 'HandleEvent'): ! MacOS.HandleEvent(event) def do_osEvt(self, event): *************** *** 380,384 **** def do_suspendresume(self, event): (what, message, when, where, modifiers) = event ! wid = FrontWindow() if wid and self._windows.has_key(wid): window = self._windows[wid] --- 399,403 ---- def do_suspendresume(self, event): (what, message, when, where, modifiers) = event ! wid = MyFrontWindow() if wid and self._windows.has_key(wid): window = self._windows[wid] *************** *** 484,488 **** label, shortcut, callback, kind = menu.items[i] if type(callback) == types.StringType: ! wid = Win.FrontWindow() if wid and self.parent._windows.has_key(wid): window = self.parent._windows[wid] --- 503,507 ---- label, shortcut, callback, kind = menu.items[i] if type(callback) == types.StringType: ! wid = MyFrontWindow() if wid and self.parent._windows.has_key(wid): window = self.parent._windows[wid] *************** *** 576,580 **** else: # callback is string ! wid = Win.FrontWindow() if wid and self.bar.parent._windows.has_key(wid): window = self.bar.parent._windows[wid] --- 595,599 ---- else: # callback is string ! wid = MyFrontWindow() if wid and self.bar.parent._windows.has_key(wid): window = self.bar.parent._windows[wid] *************** *** 621,625 **** item = reply & 0xffff if not window: ! wid = Win.FrontWindow() try: window = self.bar.parent._windows[wid] --- 640,644 ---- item = reply & 0xffff if not window: ! wid = MyFrontWindow() try: window = self.bar.parent._windows[wid] *************** *** 784,788 **** # the activate event. # ! if FrontWindow() <> window: window.SelectWindow() return --- 803,807 ---- # the activate event. # ! if MyFrontWindow() <> window: window.SelectWindow() return *************** *** 833,837 **** def do_inContent(self, partcode, window, event): ! if FrontWindow() <> window: window.SelectWindow() return --- 852,856 ---- def do_inContent(self, partcode, window, event): ! if MyFrontWindow() <> window: window.SelectWindow() return From jackjansen@users.sourceforge.net Sun Feb 24 22:47:45 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 24 Feb 2002 14:47:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib aepack.py,1.2,1.2.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17797 Modified Files: Tag: release22-maint aepack.py Log Message: Backport of 1.3: Added support for unicode strings (utxt). Index: aepack.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/aepack.py,v retrieving revision 1.2 retrieving revision 1.2.14.1 diff -C2 -d -r1.2 -r1.2.14.1 *** aepack.py 25 Aug 2001 12:00:49 -0000 1.2 --- aepack.py 24 Feb 2002 22:47:43 -0000 1.2.14.1 *************** *** 89,92 **** --- 89,97 ---- if t == StringType: return AE.AECreateDesc('TEXT', x) + if t == UnicodeType: + data = t.encode('utf16') + if data[:2] == '\xfe\xff': + data = data[2:] + return AE.AECreateDesc('utxt', data) if t == ListType: list = AE.AECreateList('', 0) *************** *** 133,136 **** --- 138,143 ---- if t == typeChar: return desc.data + if t == typeUnicodeText: + return unicode(desc.data, 'utf16') # typeColorTable coerced to typeAEList # typeComp coerced to extended From jackjansen@users.sourceforge.net Sun Feb 24 22:48:53 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 24 Feb 2002 14:48:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib aetools.py,1.2,1.2.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18056 Modified Files: Tag: release22-maint aetools.py Log Message: Backport of 1.3: Rename the routine to start the target running _start(), with a compatibility routine start() calling it. Some suites declare an event start(), which obscures this method, which causes the class initializer to fail when called with start=1. Based on bug report and fix suggestion by Jacob Kaplan-Moss. Index: aetools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/aetools.py,v retrieving revision 1.2 retrieving revision 1.2.14.1 diff -C2 -d -r1.2 -r1.2.14.1 *** aetools.py 25 Aug 2001 12:01:07 -0000 1.2 --- aetools.py 24 Feb 2002 22:48:51 -0000 1.2.14.1 *************** *** 158,164 **** self.send_timeout = AppleEvents.kAEDefaultTimeout if start: ! self.start() ! def start(self): """Start the application, if it is not running yet""" try: --- 158,164 ---- self.send_timeout = AppleEvents.kAEDefaultTimeout if start: ! self._start() ! def _start(self): """Start the application, if it is not running yet""" try: *************** *** 166,169 **** --- 166,173 ---- except AE.Error: _launch(self.target_signature) + + def start(self): + """Deprecated, used _start()""" + self._start() def newevent(self, code, subcode, parameters = {}, attributes = {}): From jackjansen@users.sourceforge.net Sun Feb 24 22:50:05 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 24 Feb 2002 14:50:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib macostools.py,1.12,1.12.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18425 Modified Files: Tag: release22-maint macostools.py Log Message: backport of 1.13: Get rid of fsspec type initializer, it wasn't used anyway. Index: macostools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/macostools.py,v retrieving revision 1.12 retrieving revision 1.12.14.1 diff -C2 -d -r1.12 -r1.12.14.1 *** macostools.py 25 Aug 2001 12:06:52 -0000 1.12 --- macostools.py 24 Feb 2002 22:50:03 -0000 1.12.14.1 *************** *** 19,24 **** Error = 'macostools.Error' - FSSpecType = type(macfs.FSSpec(':')) - BUFSIZ=0x80000 # Copy in 0.5Mb chunks --- 19,22 ---- From jackjansen@users.sourceforge.net Sun Feb 24 22:51:28 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 24 Feb 2002 14:51:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib macresource.py,1.3,1.3.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib In directory usw-pr-cvs1:/tmp/cvs-serv18830 Modified Files: Tag: release22-maint macresource.py Log Message: backport of 1.13: Fixed to work under MachoPython, doing the expected unpacking for applesingle files. Index: macresource.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/macresource.py,v retrieving revision 1.3 retrieving revision 1.3.14.1 diff -C2 -d -r1.3 -r1.3.14.1 *** macresource.py 30 Aug 2001 21:19:42 -0000 1.3 --- macresource.py 24 Feb 2002 22:51:26 -0000 1.3.14.1 *************** *** 62,66 **** raise ResourceFileNotFoundError, filename ! refno = Res.FSpOpenResFile(pathname, 1) # And check that the resource exists now --- 62,77 ---- raise ResourceFileNotFoundError, filename ! try: ! refno = Res.FSpOpenResFile(pathname, 1) ! except Res.Error, arg: ! if arg[0] in (-37, -39): ! # No resource fork. We may be on OSX, try to decode ! # the applesingle file. ! pathname = _decode(pathname) ! if pathname: ! refno = Res.FSOpenResourceFile(pathname, u'', 1) ! else: ! raise ! # And check that the resource exists now *************** *** 69,71 **** else: h = Res.GetNamedResource(restype, resid) ! return refno \ No newline at end of file --- 80,93 ---- else: h = Res.GetNamedResource(restype, resid) ! return refno ! ! def _decode(pathname): ! # Decode an AppleSingle resource file, return the new pathname. ! newpathname = pathname + '.df.rsrc' ! if os.path.exists(newpathname): ! return newpathname ! import applesingle ! applesingle.decode(pathname, newpathname, resonly=1) ! return newpathname ! ! \ No newline at end of file From jackjansen@users.sourceforge.net Sun Feb 24 22:55:36 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 24 Feb 2002 14:55:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macfsmodule.c,1.51,1.51.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv19764 Modified Files: Tag: release22-maint macfsmodule.c Log Message: backport of 1.52 and 1.53: - Added as_pathname() method to FSRef objects. - In MachoPython expect Unix-style pathnames for both FSSpec and FSRef initializers. Index: macfsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macfsmodule.c,v retrieving revision 1.51 retrieving revision 1.51.6.1 diff -C2 -d -r1.51 -r1.51.6.1 *** macfsmodule.c 11 Dec 2001 14:04:12 -0000 1.51 --- macfsmodule.c 24 Feb 2002 22:55:34 -0000 1.51.6.1 *************** *** 774,781 **** } static struct PyMethodDef mfsr_methods[] = { {"as_fsspec", (PyCFunction)mfsr_as_fsspec, 1}, #if 0 - {"as_pathname", (PyCFunction)mfss_as_pathname, 1}, {"as_tuple", (PyCFunction)mfss_as_tuple, 1}, {"NewAlias", (PyCFunction)mfss_NewAlias, 1}, --- 774,797 ---- } + static PyObject * + mfsr_as_pathname(mfsrobject *self, PyObject *args) + { + char strbuf[PATHNAMELEN]; + OSStatus err; + + if (!PyArg_ParseTuple(args, "")) + return NULL; + err = FSRefMakePath(&self->fsref, strbuf, PATHNAMELEN); + if ( err ) { + PyErr_Mac(ErrorObject, err); + return NULL; + } + return PyString_FromString(strbuf); + } + static struct PyMethodDef mfsr_methods[] = { {"as_fsspec", (PyCFunction)mfsr_as_fsspec, 1}, + {"as_pathname", (PyCFunction)mfsr_as_pathname, 1}, #if 0 {"as_tuple", (PyCFunction)mfss_as_tuple, 1}, {"NewAlias", (PyCFunction)mfss_NewAlias, 1}, *************** *** 1190,1193 **** --- 1206,1218 ---- return 1; if ( PyString_Check(v) ) { + #if TARGET_API_MAC_OSX + FSRef fsr; + + if ( !PyMac_GetFSRef(v, &fsr) ) + return 0; + if ( FSGetCatalogInfo(&fsr, kFSCatInfoNone, NULL, NULL, fs, NULL) == noErr ) + return 1; + return 0; + #else /* It's a pathname */ if( !PyArg_Parse(v, "O&", PyMac_GetStr255, &path) ) *************** *** 1195,1198 **** --- 1220,1224 ---- refnum = 0; /* XXXX Should get CurWD here?? */ parid = 0; + #endif } else { if( !PyArg_Parse(v, "(hlO&); FSSpec should be FSSpec, FSRef, fullpath or (vrefnum,dirid,path)", From jackjansen@users.sourceforge.net Sun Feb 24 22:57:50 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 24 Feb 2002 14:57:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ae _AEmodule.c,1.8,1.8.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ae In directory usw-pr-cvs1:/tmp/cvs-serv20420 Modified Files: Tag: release22-maint _AEmodule.c Log Message: Backport of 1.9: Ugh, by all means, _do_ report exceptions somehow ;-) Index: _AEmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ae/_AEmodule.c,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -C2 -d -r1.8 -r1.8.4.1 *** _AEmodule.c 17 Dec 2001 11:47:20 -0000 1.8 --- _AEmodule.c 24 Feb 2002 22:57:48 -0000 1.8.4.1 *************** *** 1243,1248 **** replyObject->ob_itself.dataHandle = NULL; Py_DECREF(args); ! if (res == NULL) return -1; Py_DECREF(res); return noErr; --- 1243,1251 ---- replyObject->ob_itself.dataHandle = NULL; Py_DECREF(args); ! if (res == NULL) { ! PySys_WriteStderr("Exception in AE event handler function\n"); ! PyErr_Print(); return -1; + } Py_DECREF(res); return noErr; From jackjansen@users.sourceforge.net Sun Feb 24 23:03:49 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 24 Feb 2002 15:03:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/OSX Makefile,1.4,1.4.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/OSX In directory usw-pr-cvs1:/tmp/cvs-serv21981 Modified Files: Tag: release22-maint Makefile Log Message: Backport of 1.5 thru 1.8: - Use full paths for Rez and DeRez, which may not be on $PATH. Fixes bug #509074. - Also install the Tools directory on "make installmacsubtree". - Added a note that you have to add Mac/Lib to sys.path after doing a "make installmacsubtree". - Include errors.rsrc in the Python.app resource file, so the error strings are available in MacOS API exceptions. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/OSX/Makefile,v retrieving revision 1.4 retrieving revision 1.4.12.1 diff -C2 -d -r1.4 -r1.4.12.1 *** Makefile 11 Sep 2001 13:00:16 -0000 1.4 --- Makefile 24 Feb 2002 23:03:47 -0000 1.4.12.1 *************** *** 19,22 **** --- 19,24 ---- CC=cc LD=cc + REZ=/Developer/Tools/Rez + DEREZ=/Developer/Tools/DeRez OBJECTS=$(PYTHONBUILDDIR)/Mac/Python/macmain.o \ *************** *** 29,33 **** APPTEMPLATE=$(PYTHONBUILDDIR)/Mac/OSXResources/app APPSUBDIRS=MacOS Resources Resources/English.lproj ! RESOURCEFILE_ASINGLE=$(PYTHONBUILDDIR)/Mac/Resources/dialogs.rsrc RESOURCEFILE=python.rsrc RFCONVERTER=$(PYTHONBUILDDIR)/Mac/Lib/applesingle.py --- 31,35 ---- APPTEMPLATE=$(PYTHONBUILDDIR)/Mac/OSXResources/app APPSUBDIRS=MacOS Resources Resources/English.lproj ! RESOURCEDIR=$(PYTHONBUILDDIR)/Mac/Resources RESOURCEFILE=python.rsrc RFCONVERTER=$(PYTHONBUILDDIR)/Mac/Lib/applesingle.py *************** *** 72,76 **** $(INSTALL_PROGRAM) pythonforbundle $(APPINSTALLDIR)/Contents/MacOS/python # Create a temporary version of the resources here ! $(PYTHON) $(RFCONVERTER) -r $(RESOURCEFILE_ASINGLE) $(RESOURCEFILE) $(INSTALL_DATA) $(RESOURCEFILE) $(APPINSTALLDIR)/Contents/Resources/$(RESOURCEFILE) --- 74,82 ---- $(INSTALL_PROGRAM) pythonforbundle $(APPINSTALLDIR)/Contents/MacOS/python # Create a temporary version of the resources here ! $(PYTHON) $(RFCONVERTER) -r $(RESOURCEDIR)/dialogs.rsrc dialogs.rsrc ! $(PYTHON) $(RFCONVERTER) -r $(RESOURCEDIR)/errors.rsrc errors.rsrc ! $(DEREZ) -useDF -skip ckid dialogs.rsrc > dialogs.r ! $(DEREZ) -useDF -skip ckid errors.rsrc > errors.r ! $(REZ) -useDF -o $(RESOURCEFILE) dialogs.r errors.r $(INSTALL_DATA) $(RESOURCEFILE) $(APPINSTALLDIR)/Contents/Resources/$(RESOURCEFILE) *************** *** 80,85 **** lib-scriptpackages/Finder lib-scriptpackages/Netscape lib-scriptpackages/StdSuites \ mkcwproject mkcwproject/template mkcwproject/template-carbon mkcwproject/template-ppc installmacsubtree: ! @for i in $(LIBDEST); \ do \ if test ! -d $$i; then \ --- 86,94 ---- lib-scriptpackages/Finder lib-scriptpackages/Netscape lib-scriptpackages/StdSuites \ mkcwproject mkcwproject/template mkcwproject/template-carbon mkcwproject/template-ppc + TOOLSDEST=$(INSTALLDIR)/Mac/Tools + TOOLSSRC=$(PYTHONBUILDDIR)/Mac/Tools + TOOLSSUBDIRS=IDE installmacsubtree: ! @for i in $(LIBDEST) $(TOOLSDEST); \ do \ if test ! -d $$i; then \ *************** *** 134,135 **** --- 143,183 ---- done; \ done + @for d in $(TOOLSSUBDIRS); \ + do \ + a=$(TOOLSSRC)/$$d; \ + if test ! -d $$a; then continue; else true; fi; \ + b=$(TOOLSDEST)/$$d; \ + if test ! -d $$b; then \ + echo "Creating directory $$b"; \ + $(INSTALL) -d -m $(DIRMODE) $$b; \ + else true; \ + fi; \ + done + @for d in $(TOOLSSUBDIRS); \ + do \ + a=$(TOOLSSRC)/$$d; \ + if test ! -d $$a; then continue; else true; fi; \ + b=$(TOOLSDEST)/$$d; \ + for i in $$a/*; \ + do \ + case $$i in \ + *CVS) ;; \ + *.py[co]) ;; \ + *.orig) ;; \ + *~) ;; \ + *) \ + if test -d $$i; then continue; fi; \ + if test -x $$i; then \ + echo $(INSTALL_SCRIPT) $$i $$b; \ + $(INSTALL_SCRIPT) $$i $$b; \ + else \ + echo $(INSTALL_DATA) $$i $$b; \ + $(INSTALL_DATA) $$i $$b; \ + fi;; \ + esac; \ + done; \ + done + + @echo '** Copy the contents of sample_sitecustomize.py (or similar code) into' + @echo '**' $(INSTALLDIR)/lib/python2.2/sitecustomize.py + From jackjansen@users.sourceforge.net Sun Feb 24 23:07:07 2002 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sun, 24 Feb 2002 15:07:07 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macmain.c,1.72,1.72.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv22904 Modified Files: Tag: release22-maint macmain.c Log Message: bqackport of 1.73: In MachoPython, don't simulate argc/argv unless we have argc=1 and argv[1] starts with "-psn_". This means the drag-and-drop continues to work as expected, but we can now also do /Applications/Python.app/Contents/MacOS/python script.py from the command line, which is a lot easier with debugging. Pressing