From gvanrossum at users.sourceforge.net Thu Jan 1 00:35:22 2004 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu Jan 1 00:35:25 2004 Subject: [Python-checkins] python/nondist/sandbox/parrotbench README.txt, 1.5, 1.6 b.py, 1.6, 1.7 b0.py, 1.8, 1.9 b1.py, 1.3, 1.4 b4.py, 1.3, 1.4 out0, 1.6, 1.7 out4, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/parrotbench In directory sc8-pr-cvs1:/tmp/cvs-serv2882 Modified Files: README.txt b.py b0.py b1.py b4.py out0 out4 Log Message: Version 1.0.2. Should standardize the repr of dicts. Also give b.py a main() -- and reduce the stack limit test correspondingly. Index: README.txt =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/README.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** README.txt 31 Dec 2003 21:53:11 -0000 1.5 --- README.txt 1 Jan 2004 05:35:19 -0000 1.6 *************** *** 1,7 **** ! Parrot benchmark 1.0.1 ====================== ! [This is version 1.0.1, with a hopeful bugfix for the Mac OSX issue ! Dan reported.] This is a benchmark to be run in front of a live audience at OSCON --- 1,8 ---- ! Parrot benchmark 1.0.2 ====================== ! [This is version 1.0.2, with a bugfix for the Mac OSX issue that Dan ! reported, and a further bugfix for the dict ordering problem noted by ! Samuele Pedroni.] This is a benchmark to be run in front of a live audience at OSCON Index: b.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/b.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** b.py 31 Dec 2003 09:04:57 -0000 1.6 --- b.py 1 Jan 2004 05:35:19 -0000 1.7 *************** *** 7,25 **** import b6 ! for i in range(2): ! print "--> iteration", i ! print "--> b0" ! b0.main() ! print "--> b1" ! b1.main() ! print "--> b2" ! b2.main() ! print "--> b3" ! b3.main() ! print "--> b4" ! b4.main() ! print "--> b5" ! b5.main() ! print "--> b6" ! b6.main() ! print "--> All done." --- 7,29 ---- import b6 ! def main(): ! for i in range(2): ! print "--> iteration", i ! print "--> b0" ! b0.main() ! print "--> b1" ! b1.main() ! print "--> b2" ! b2.main() ! print "--> b3" ! b3.main() ! print "--> b4" ! b4.main() ! print "--> b5" ! b5.main() ! print "--> b6" ! b6.main() ! print "--> All done." ! ! if __name__ == '__main__': ! main() Index: b0.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/b0.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** b0.py 31 Dec 2003 21:53:11 -0000 1.8 --- b0.py 1 Jan 2004 05:35:19 -0000 1.9 *************** *** 836,839 **** --- 836,849 ---- unInstrumentTree(cls) + class Dict(dict): + + def __repr__(self): + keys = self.keys() + keys.sort() + L = [] + for key in keys: + L.append(repr(key) + ": " + repr(self[key])) + return "{" + ", ".join(L) + "}" + def main(): output.reset() *************** *** 855,859 **** checkoutput(1413352820) ! env = {} eval(root, env, env) g = env['pi']() --- 865,869 ---- checkoutput(1413352820) ! env = Dict() eval(root, env, env) g = env['pi']() *************** *** 875,879 **** root = parser.parse() checkoutput(1308798191) ! env = {} eval(root, env, env) g = env['pi']() --- 885,889 ---- root = parser.parse() checkoutput(1308798191) ! env = Dict() eval(root, env, env) g = env['pi']() *************** *** 889,893 **** root = parser.parse() checkoutput(3257889492) ! env = {} eval(root, env, env) g = env['pi']() --- 899,903 ---- root = parser.parse() checkoutput(3257889492) ! env = Dict() eval(root, env, env) g = env['pi']() *************** *** 895,899 **** for i in range(10): digits.append(g.next()) ! checkoutput(1177172576) print "".join(map(str, digits)) --- 905,909 ---- for i in range(10): digits.append(g.next()) ! checkoutput(2832206487) print "".join(map(str, digits)) *************** *** 903,907 **** root = parser.parse() checkoutput(0) ! env = {} eval(root, env, env) g = env['pi']() --- 913,917 ---- root = parser.parse() checkoutput(0) ! env = Dict() eval(root, env, env) g = env['pi']() *************** *** 913,917 **** checkoutput(0) ! class TrackingDict(dict): def __setitem__(self, *args): writeln("%s = %.50r" % args) --- 923,927 ---- checkoutput(0) ! class TrackingDict(Dict): def __setitem__(self, *args): writeln("%s = %.50r" % args) Index: b1.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/b1.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** b1.py 31 Dec 2003 09:04:58 -0000 1.3 --- b1.py 1 Jan 2004 05:35:19 -0000 1.4 *************** *** 17,24 **** def main(): ! print depth0(0) >= 997 pea = [] base, p = depth1(0, pea) ! print base >= 997 pea.append(p) while p[1] is not pea: --- 17,24 ---- def main(): ! print depth0(0) >= 996 pea = [] base, p = depth1(0, pea) ! print base >= 996 pea.append(p) while p[1] is not pea: Index: b4.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/b4.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** b4.py 31 Dec 2003 21:53:11 -0000 1.3 --- b4.py 1 Jan 2004 05:35:19 -0000 1.4 *************** *** 59,63 **** ''' ! from b0 import Parser, Scanner, getcFromString, Node, eval from b0 import instrumentTree, unInstrumentTree, output, checkoutput --- 59,63 ---- ''' ! from b0 import Parser, Scanner, getcFromString, Node, eval, Dict from b0 import instrumentTree, unInstrumentTree, output, checkoutput *************** *** 68,72 **** root = parser.parse() instrumentTree(Node) ! env = {} eval(root, env, env) heappush = env['heappush'] --- 68,72 ---- root = parser.parse() instrumentTree(Node) ! env = Dict() eval(root, env, env) heappush = env['heappush'] *************** *** 82,86 **** print sort unInstrumentTree(Node) ! checkoutput(2403574442) if __name__ == '__main__': --- 82,86 ---- print sort unInstrumentTree(Node) ! checkoutput(2713552348) if __name__ == '__main__': Index: out0 =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/out0,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** out0 31 Dec 2003 21:53:11 -0000 1.6 --- out0 1 Jan 2004 05:35:19 -0000 1.7 *************** *** 7011,9175 **** return False return ! Node.geneval("{u'strhash': }, {}") return ! Assign.eval("{u'strhash': }, {}") ! Exprs.eval("{u'strhash': }, {}") ! Literal.eval("{u'strhash': }, {}") return 2 ! Literal.eval("{u'strhash': }, {}") return 4 [...4301 lines suppressed...] ! Exprs.assign("(3L, 3L), {u'pi': }, {u'a': 9576126383040...1552000L, u'd1': 3L}") ! Name.assign("3L, {u'pi': }, {u'a': 9576126383040...1552000L, u'd1': 3L}") return ! Name.assign("3L, {u'pi': }, {u'a': 9576126383040...1552000L, u'd1': 3L}") return return return ! While.geneval("{u'pi': }, {u'a': 9576126383040...1552000L, u'd1': 3L}") return ! Binop.eval("{u'pi': }, {u'a': 9576126383040...1552000L, u'd1': 3L}") ! Name.eval("{u'pi': }, {u'a': 9576126383040...1552000L, u'd1': 3L}") return 3L ! Name.eval("{u'pi': }, {u'a': 9576126383040...1552000L, u'd1': 3L}") return 3L return True ! Yield.geneval("{u'pi': }, {u'a': 9576126383040...1552000L, u'd1': 3L}") return ! Name.eval("{u'pi': }, {u'a': 9576126383040...1552000L, u'd1': 3L}") return 3L 3141592653 Index: out4 =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/out4,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** out4 31 Dec 2003 21:53:12 -0000 1.4 --- out4 1 Jan 2004 05:35:19 -0000 1.5 *************** *** 37,41 **** return False return ! Define.eval("{'heappop': }, {'heappop': }") Node.isgenerator('') return False --- 37,41 ---- return False return ! Define.eval("{'heapify': }, {'heapify': }") Node.isgenerator('') [...7237 lines suppressed...] return [9] return return 9 ! Name.assign("9, {'_siftdown': }, {'heap': []}") return return ! If.eval("{'_siftdown': }, {'lastelt': 9, 'heap': []}") ! Name.eval("{'_siftdown': }, {'lastelt': 9, 'heap': []}") return [] ! Assign.eval("{'_siftdown': }, {'lastelt': 9, 'heap': []}") ! Name.eval("{'_siftdown': }, {'lastelt': 9, 'heap': []}") return 9 ! Name.assign("9, {'_siftdown': }, {'lastelt': 9, 'heap': []}") return return return ! Return.eval("{'_siftdown': }, {'lastelt': 9, 'returnitem': 9, 'heap': []}") ! Name.eval("{'_siftdown': }, {'lastelt': 9, 'returnitem': 9, 'heap': []}") return 9 raise From fdrake at users.sourceforge.net Thu Jan 1 00:43:55 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 1 00:44:00 2004 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex,1.36,1.37 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv3731/api Modified Files: concrete.tex Log Message: clean up indexing for None, NotImplemented closes SF bug #820344 Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** concrete.tex 26 Dec 2003 00:07:51 -0000 1.36 --- concrete.tex 1 Jan 2004 05:43:53 -0000 1.37 *************** *** 86,90 **** \subsection{The None Object \label{noneObject}} ! \obindex{None@\texttt{None}} Note that the \ctype{PyTypeObject} for \code{None} is not directly exposed in the Python/C API. Since \code{None} is a singleton, --- 86,90 ---- \subsection{The None Object \label{noneObject}} ! \obindex{None} Note that the \ctype{PyTypeObject} for \code{None} is not directly exposed in the Python/C API. Since \code{None} is a singleton, From fdrake at users.sourceforge.net Thu Jan 1 00:43:55 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 1 00:44:01 2004 Subject: [Python-checkins] python/dist/src/Doc/ref ref3.tex, 1.117, 1.118 ref6.tex, 1.69, 1.70 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1:/tmp/cvs-serv3731/ref Modified Files: ref3.tex ref6.tex Log Message: clean up indexing for None, NotImplemented closes SF bug #820344 Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** ref3.tex 19 Oct 2003 07:32:24 -0000 1.117 --- ref3.tex 1 Jan 2004 05:43:53 -0000 1.118 *************** *** 135,140 **** it is returned from functions that don't explicitly return anything. Its truth value is false. ! \ttindex{None} ! \obindex{None@{\texttt{None}}} \item[NotImplemented] --- 135,139 ---- it is returned from functions that don't explicitly return anything. Its truth value is false. ! \obindex{None} \item[NotImplemented] *************** *** 145,150 **** interpreter will then try the reflected operation, or some other fallback, depending on the operator.) Its truth value is true. ! \ttindex{NotImplemented} ! \obindex{NotImplemented@{\texttt{NotImplemented}}} \item[Ellipsis] --- 144,148 ---- interpreter will then try the reflected operation, or some other fallback, depending on the operator.) Its truth value is true. ! \obindex{NotImplemented} \item[Ellipsis] Index: ref6.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref6.tex,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** ref6.tex 20 Oct 2003 14:01:47 -0000 1.69 --- ref6.tex 1 Jan 2004 05:43:53 -0000 1.70 *************** *** 49,53 **** yielding \code{None} are not written, so that procedure calls do not cause any output.) ! \ttindex{None} \indexii{string}{conversion} \index{output} --- 49,53 ---- yielding \code{None} are not written, so that procedure calls do not cause any output.) ! \obindex{None} \indexii{string}{conversion} \index{output} From fdrake at users.sourceforge.net Thu Jan 1 00:46:32 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 1 00:46:35 2004 Subject: [Python-checkins] python/dist/src/Doc/api concrete.tex, 1.25.10.3, 1.25.10.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv4033/api Modified Files: Tag: release23-maint concrete.tex Log Message: clean up indexing for None, NotImplemented closes SF bug #820344 Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.25.10.3 retrieving revision 1.25.10.4 diff -C2 -d -r1.25.10.3 -r1.25.10.4 *** concrete.tex 26 Oct 2003 17:21:56 -0000 1.25.10.3 --- concrete.tex 1 Jan 2004 05:46:29 -0000 1.25.10.4 *************** *** 86,90 **** \subsection{The None Object \label{noneObject}} ! \obindex{None@\texttt{None}} Note that the \ctype{PyTypeObject} for \code{None} is not directly exposed in the Python/C API. Since \code{None} is a singleton, --- 86,90 ---- \subsection{The None Object \label{noneObject}} ! \obindex{None} Note that the \ctype{PyTypeObject} for \code{None} is not directly exposed in the Python/C API. Since \code{None} is a singleton, From fdrake at users.sourceforge.net Thu Jan 1 00:46:32 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 1 00:46:37 2004 Subject: [Python-checkins] python/dist/src/Doc/ref ref3.tex, 1.114.4.3, 1.114.4.4 ref6.tex, 1.68.8.1, 1.68.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory sc8-pr-cvs1:/tmp/cvs-serv4033/ref Modified Files: Tag: release23-maint ref3.tex ref6.tex Log Message: clean up indexing for None, NotImplemented closes SF bug #820344 Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.114.4.3 retrieving revision 1.114.4.4 diff -C2 -d -r1.114.4.3 -r1.114.4.4 *** ref3.tex 19 Oct 2003 07:31:14 -0000 1.114.4.3 --- ref3.tex 1 Jan 2004 05:46:30 -0000 1.114.4.4 *************** *** 135,140 **** it is returned from functions that don't explicitly return anything. Its truth value is false. ! \ttindex{None} ! \obindex{None@{\texttt{None}}} \item[NotImplemented] --- 135,139 ---- it is returned from functions that don't explicitly return anything. Its truth value is false. ! \obindex{None} \item[NotImplemented] *************** *** 145,150 **** interpreter will then try the reflected operation, or some other fallback, depending on the operator.) Its truth value is true. ! \ttindex{NotImplemented} ! \obindex{NotImplemented@{\texttt{NotImplemented}}} \item[Ellipsis] --- 144,148 ---- interpreter will then try the reflected operation, or some other fallback, depending on the operator.) Its truth value is true. ! \obindex{NotImplemented} \item[Ellipsis] Index: ref6.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref6.tex,v retrieving revision 1.68.8.1 retrieving revision 1.68.8.2 diff -C2 -d -r1.68.8.1 -r1.68.8.2 *** ref6.tex 20 Oct 2003 14:34:44 -0000 1.68.8.1 --- ref6.tex 1 Jan 2004 05:46:30 -0000 1.68.8.2 *************** *** 49,53 **** yielding \code{None} are not written, so that procedure calls do not cause any output.) ! \ttindex{None} \indexii{string}{conversion} \index{output} --- 49,53 ---- yielding \code{None} are not written, so that procedure calls do not cause any output.) ! \obindex{None} \indexii{string}{conversion} \index{output} From rhettinger at users.sourceforge.net Thu Jan 1 00:53:53 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Thu Jan 1 00:53:56 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libpickle.tex,1.45,1.46 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv4751 Modified Files: libpickle.tex Log Message: Add sets to list of picklable objects. Index: libpickle.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpickle.tex,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** libpickle.tex 10 Sep 2003 20:47:43 -0000 1.45 --- libpickle.tex 1 Jan 2004 05:53:51 -0000 1.46 *************** *** 379,383 **** \item normal and Unicode strings ! \item tuples, lists, and dictionaries containing only picklable objects \item functions defined at the top level of a module --- 379,383 ---- \item normal and Unicode strings ! \item tuples, lists, sets, and dictionaries containing only picklable objects \item functions defined at the top level of a module From fdrake at users.sourceforge.net Thu Jan 1 02:21:16 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 1 02:21:19 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libinspect.tex,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv14509 Modified Files: libinspect.tex Log Message: in the section "The interpreter stack": - rearranged a bit to avoid duplicated information - provide more complete (and hopefully less confusing) descriptions of the return values for most of these functions (close SF bug #563298) Index: libinspect.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libinspect.tex,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** libinspect.tex 31 Oct 2003 15:34:40 -0000 1.14 --- libinspect.tex 1 Jan 2004 07:21:14 -0000 1.15 *************** *** 305,312 **** lines of context from the source code, and the index of the current line within that list. - The optional \var{context} argument specifies the number of lines of - context to return, which are centered around the current line. ! \warning{Keeping references to frame objects, as found in the first element of the frame records these functions return, can cause your program to create reference cycles. Once a reference cycle --- 305,311 ---- lines of context from the source code, and the index of the current line within that list. ! \begin{notice}[warning] ! Keeping references to frame objects, as found in the first element of the frame records these functions return, can cause your program to create reference cycles. Once a reference cycle *************** *** 316,336 **** created, it is important to ensure they are explicitly broken to avoid the delayed destruction of objects and increased memory consumption ! which occurs.} \begin{funcdesc}{getframeinfo}{frame\optional{, context}} Get information about a frame or traceback object. A 5-tuple is returned, the last five elements of the frame's frame record. - The optional second argument specifies the number of lines of context - to return, which are centered around the current line. \end{funcdesc} \begin{funcdesc}{getouterframes}{frame\optional{, context}} ! Get a list of frame records for a frame and all higher (calling) ! frames. \end{funcdesc} \begin{funcdesc}{getinnerframes}{traceback\optional{, context}} ! Get a list of frame records for a traceback's frame and all lower ! frames. \end{funcdesc} --- 315,358 ---- created, it is important to ensure they are explicitly broken to avoid the delayed destruction of objects and increased memory consumption ! which occurs. ! ! Though the cycle detector will catch these, destruction of the frames ! (and local variables) can be made deterministic by removing the cycle ! in a \keyword{finally} clause. This is also important if the cycle ! detector was disabled when Python was compiled or using ! \function{\refmodule{gc}.disable()}. For example: ! ! \begin{verbatim} ! def handle_stackframe_without_leak(): ! frame = inspect.currentframe() ! try: ! # do something with the frame ! finally: ! del frame ! \end{verbatim} ! \end{notice} ! ! The optional \var{context} argument supported by most of these ! functions specifies the number of lines of context to return, which ! are centered around the current line. \begin{funcdesc}{getframeinfo}{frame\optional{, context}} Get information about a frame or traceback object. A 5-tuple is returned, the last five elements of the frame's frame record. \end{funcdesc} \begin{funcdesc}{getouterframes}{frame\optional{, context}} ! Get a list of frame records for a frame and all outer frames. These ! frames represent the calls that lead to the creation of \var{frame}. ! The first entry in the returned list represents \var{frame}; the ! last entry represents the outermost call on \var{frame}'s stack. \end{funcdesc} \begin{funcdesc}{getinnerframes}{traceback\optional{, context}} ! Get a list of frame records for a traceback's frame and all inner ! frames. These frames represent calls made as a consequence of ! \var{frame}. The first entry in the list represents ! \var{traceback}; the last entry represents where the exception was ! raised. \end{funcdesc} *************** *** 340,365 **** \begin{funcdesc}{stack}{\optional{context}} ! Return a list of frame records for the stack above the caller's ! frame. \end{funcdesc} \begin{funcdesc}{trace}{\optional{context}} ! Return a list of frame records for the stack below the current ! exception. \end{funcdesc} - - Stackframes stored directly or indirectly in local variables can - easily cause reference cycles. Though the cycle detector will catch - these, destruction of the frames (and local variables) can be made - deterministic by removing the cycle in a \keyword{finally} clause. - This is also important if the cycle detector was disabled when Python - was compiled or using \function{gc.disable()}. For example: - - \begin{verbatim} - def handle_stackframe_without_leak(): - frame = inspect.currentframe() - try: - # do something with the frame - finally: - del frame - \end{verbatim} --- 362,374 ---- \begin{funcdesc}{stack}{\optional{context}} ! Return a list of frame records for the caller's stack. The first ! entry in the returned list represents the caller; the last entry ! represents the outermost call on the stack. \end{funcdesc} \begin{funcdesc}{trace}{\optional{context}} ! Return a list of frame records for the stack between the current ! frame and the frame in which an exception currently being handled ! was raised in. The first entry in the list represents the caller; ! the last entry represents where the exception was raised. \end{funcdesc} From fdrake at users.sourceforge.net Thu Jan 1 02:22:48 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 1 02:22:51 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libinspect.tex, 1.13.10.1, 1.13.10.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv14635 Modified Files: Tag: release23-maint libinspect.tex Log Message: in the section "The interpreter stack": - rearranged a bit to avoid duplicated information - provide more complete (and hopefully less confusing) descriptions of the return values for most of these functions (close SF bug #563298) Index: libinspect.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libinspect.tex,v retrieving revision 1.13.10.1 retrieving revision 1.13.10.2 diff -C2 -d -r1.13.10.1 -r1.13.10.2 *** libinspect.tex 31 Oct 2003 15:34:16 -0000 1.13.10.1 --- libinspect.tex 1 Jan 2004 07:22:46 -0000 1.13.10.2 *************** *** 305,312 **** lines of context from the source code, and the index of the current line within that list. - The optional \var{context} argument specifies the number of lines of - context to return, which are centered around the current line. ! \warning{Keeping references to frame objects, as found in the first element of the frame records these functions return, can cause your program to create reference cycles. Once a reference cycle --- 305,311 ---- lines of context from the source code, and the index of the current line within that list. ! \begin{notice}[warning] ! Keeping references to frame objects, as found in the first element of the frame records these functions return, can cause your program to create reference cycles. Once a reference cycle *************** *** 316,336 **** created, it is important to ensure they are explicitly broken to avoid the delayed destruction of objects and increased memory consumption ! which occurs.} \begin{funcdesc}{getframeinfo}{frame\optional{, context}} Get information about a frame or traceback object. A 5-tuple is returned, the last five elements of the frame's frame record. - The optional second argument specifies the number of lines of context - to return, which are centered around the current line. \end{funcdesc} \begin{funcdesc}{getouterframes}{frame\optional{, context}} ! Get a list of frame records for a frame and all higher (calling) ! frames. \end{funcdesc} \begin{funcdesc}{getinnerframes}{traceback\optional{, context}} ! Get a list of frame records for a traceback's frame and all lower ! frames. \end{funcdesc} --- 315,358 ---- created, it is important to ensure they are explicitly broken to avoid the delayed destruction of objects and increased memory consumption ! which occurs. ! ! Though the cycle detector will catch these, destruction of the frames ! (and local variables) can be made deterministic by removing the cycle ! in a \keyword{finally} clause. This is also important if the cycle ! detector was disabled when Python was compiled or using ! \function{\refmodule{gc}.disable()}. For example: ! ! \begin{verbatim} ! def handle_stackframe_without_leak(): ! frame = inspect.currentframe() ! try: ! # do something with the frame ! finally: ! del frame ! \end{verbatim} ! \end{notice} ! ! The optional \var{context} argument supported by most of these ! functions specifies the number of lines of context to return, which ! are centered around the current line. \begin{funcdesc}{getframeinfo}{frame\optional{, context}} Get information about a frame or traceback object. A 5-tuple is returned, the last five elements of the frame's frame record. \end{funcdesc} \begin{funcdesc}{getouterframes}{frame\optional{, context}} ! Get a list of frame records for a frame and all outer frames. These ! frames represent the calls that lead to the creation of \var{frame}. ! The first entry in the returned list represents \var{frame}; the ! last entry represents the outermost call on \var{frame}'s stack. \end{funcdesc} \begin{funcdesc}{getinnerframes}{traceback\optional{, context}} ! Get a list of frame records for a traceback's frame and all inner ! frames. These frames represent calls made as a consequence of ! \var{frame}. The first entry in the list represents ! \var{traceback}; the last entry represents where the exception was ! raised. \end{funcdesc} *************** *** 340,365 **** \begin{funcdesc}{stack}{\optional{context}} ! Return a list of frame records for the stack above the caller's ! frame. \end{funcdesc} \begin{funcdesc}{trace}{\optional{context}} ! Return a list of frame records for the stack below the current ! exception. \end{funcdesc} - - Stackframes stored directly or indirectly in local variables can - easily cause reference cycles. Though the cycle detector will catch - these, destruction of the frames (and local variables) can be made - deterministic by removing the cycle in a \keyword{finally} clause. - This is also important if the cycle detector was disabled when Python - was compiled or using \function{gc.disable()}. For example: - - \begin{verbatim} - def handle_stackframe_without_leak(): - frame = inspect.currentframe() - try: - # do something with the frame - finally: - del frame - \end{verbatim} --- 362,374 ---- \begin{funcdesc}{stack}{\optional{context}} ! Return a list of frame records for the caller's stack. The first ! entry in the returned list represents the caller; the last entry ! represents the outermost call on the stack. \end{funcdesc} \begin{funcdesc}{trace}{\optional{context}} ! Return a list of frame records for the stack between the current ! frame and the frame in which an exception currently being handled ! was raised in. The first entry in the list represents the caller; ! the last entry represents where the exception was raised. \end{funcdesc} From loewis at users.sourceforge.net Thu Jan 1 10:41:09 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Thu Jan 1 10:41:15 2004 Subject: [Python-checkins] python/nondist/sandbox/msi README.txt, 1.1.1.1, 1.2 msi.py, 1.2, 1.3 exclamic.bin, 1.1.1.1, NONE info.bin, 1.1.1.1, NONE Message-ID: Update of /cvsroot/python/python/nondist/sandbox/msi In directory sc8-pr-cvs1:/tmp/cvs-serv18046 Modified Files: README.txt msi.py Removed Files: exclamic.bin info.bin Log Message: Replace Microsoft icons with py.ico. Index: README.txt =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/README.txt,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** README.txt 29 Dec 2003 14:04:36 -0000 1.1.1.1 --- README.txt 1 Jan 2004 15:41:06 -0000 1.2 *************** *** 30,35 **** platform SDK. In particular, the files - exclamic.bin - info.bin New.bin Up.bin --- 30,33 ---- Index: msi.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** msi.py 30 Dec 2003 15:02:42 -0000 1.2 --- msi.py 1 Jan 2004 15:41:06 -0000 1.3 *************** *** 133,138 **** ("Up",msilib.Binary("Up.bin")), ("New",msilib.Binary("New.bin")), ! ("InfoIcon",msilib.Binary("info.bin")), ! ("ExclamationIcon",msilib.Binary("exclamic.bin")), ]) --- 133,137 ---- ("Up",msilib.Binary("Up.bin")), ("New",msilib.Binary("New.bin")), ! ("py.ico",msilib.Binary(srcdir+r"\PC\py.ico")), ]) *************** *** 229,233 **** "ErrorText", None, None) error.text("ErrorText", 50,9,280,48,3, "") ! error.control("ErrorIcon", "Icon", 15, 9, 24, 24, 5242881, None, "InfoIcon", None, None) error.pushbutton("N",120,72,81,21,3,"No",None).event("EndDialog","ErrorNo") error.pushbutton("Y",240,72,81,21,3,"Yes",None).event("EndDialog","ErrorYes") --- 228,232 ---- "ErrorText", None, None) error.text("ErrorText", 50,9,280,48,3, "") ! error.control("ErrorIcon", "Icon", 15, 9, 24, 24, 5242881, None, "py.ico", None, None) error.pushbutton("N",120,72,81,21,3,"No",None).event("EndDialog","ErrorNo") error.pushbutton("Y",240,72,81,21,3,"Yes",None).event("EndDialog","ErrorYes") *************** *** 244,248 **** "Are you sure you want to cancel [ProductName] installation?") cancel.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None, ! "InfoIcon", None, None) c=cancel.pushbutton("Yes", 72, 57, 56, 17, 3, "Yes", "No") c.event("EndDialog", "Exit") --- 243,247 ---- "Are you sure you want to cancel [ProductName] installation?") cancel.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None, ! "py.ico", None, None) c=cancel.pushbutton("Yes", 72, 57, 56, 17, 3, "Yes", "No") c.event("EndDialog", "Exit") *************** *** 257,261 **** "Please wait while the installer finishes determining your disk space requirements.") costing.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None, ! "ExclamationIcon", None, None) c = costing.pushbutton("Return", 102, 57, 56, 17, 3, "Return", None) c.event("EndDialog", "Exit") --- 256,260 ---- "Please wait while the installer finishes determining your disk space requirements.") costing.control("Icon", "Icon", 15, 15, 24, 24, 5242881, None, ! "py.ico", None, None) c = costing.pushbutton("Return", 102, 57, 56, 17, 3, "Return", None) c.event("EndDialog", "Exit") --- exclamic.bin DELETED --- --- info.bin DELETED --- From gvanrossum at users.sourceforge.net Thu Jan 1 11:48:14 2004 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu Jan 1 11:48:18 2004 Subject: [Python-checkins] python/nondist/sandbox/parrotbench Makefile, 1.3, 1.4 README.txt, 1.6, 1.7 b0.py, 1.9, 1.10 b4.py, 1.4, 1.5 out0, 1.7, 1.8 out4, 1.5, 1.6 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/parrotbench In directory sc8-pr-cvs1:/tmp/cvs-serv29473 Modified Files: Makefile README.txt b0.py b4.py out0 out4 Log Message: Version 1.0.3 adds one more Dict usage. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 31 Dec 2003 16:25:28 -0000 1.3 --- Makefile 1 Jan 2004 16:48:11 -0000 1.4 *************** *** 1,16 **** time: ! time python -O b.py >@out ! cmp @out out cmp: ! python -O b.py >@out ! cmp @out out diff: ! python -O b.py >@out ! diff @out out dist: ! tar czf parrotbench.tgz README.txt Makefile b.py b?.py out out[0-9] clean: --- 1,22 ---- + PYTHON=python2.3 + DIFF=diff + CMP=cmp + + FILES=README.txt Makefile b.py b[0-9].py t.py out out[0-9] + time: ! time $(PYTHON) -O b.py >@out ! $(CMP) @out out cmp: ! $(PYTHON) -O b.py >@out ! $(CMP) @out out diff: ! $(PYTHON) -O b.py >@out ! $(DIFF) @out out dist: ! tar czf parrotbench.tgz $(FILES) clean: *************** *** 20,25 **** for i in 0 1 2 3 4 5 6; do \ echo b$$i.py; \ ! time python b$$i.py >@out$$i; \ ! cmp @out$$i out$$i; \ done --- 26,31 ---- for i in 0 1 2 3 4 5 6; do \ echo b$$i.py; \ ! time $(PYTHON) b$$i.py >@out$$i; \ ! $(CMP) @out$$i out$$i; \ done *************** *** 27,32 **** for i in 0 1 2 3 4 5 6; do \ echo b$$i.py; \ ! python b$$i.py >@out$$i; \ ! cmp @out$$i out$$i; \ done --- 33,38 ---- for i in 0 1 2 3 4 5 6; do \ echo b$$i.py; \ ! $(PYTHON) b$$i.py >@out$$i; \ ! $(CMP) @out$$i out$$i; \ done *************** *** 34,39 **** for i in 0 1 2 3 4 5 6; do \ echo b$$i.py; \ ! python b$$i.py >@out$$i; \ ! diff @out$$i out$$i; \ done --- 40,45 ---- for i in 0 1 2 3 4 5 6; do \ echo b$$i.py; \ ! $(PYTHON) b$$i.py >@out$$i; \ ! $(DIFF) @out$$i out$$i; \ done *************** *** 41,64 **** out: b.py b?.py ! python -O b.py >out out0: b0.py ! python b0.py >out0 out1: b1.py ! python b1.py >out1 out2: b2.py ! python b2.py >out2 out3: b3.py ! python b3.py >out3 ! out4: b4.py ! python b4.py >out4 out5: b5.py ! python b5.py >out5 out6: b6.py ! python b6.py >out6 --- 47,70 ---- out: b.py b?.py ! $(PYTHON) -O b.py >out out0: b0.py ! $(PYTHON) b0.py >out0 out1: b1.py ! $(PYTHON) b1.py >out1 out2: b2.py ! $(PYTHON) b2.py >out2 out3: b3.py ! $(PYTHON) b3.py >out3 ! out4: b4.py b0.py ! $(PYTHON) b4.py >out4 out5: b5.py ! $(PYTHON) b5.py >out5 out6: b6.py ! $(PYTHON) b6.py >out6 Index: README.txt =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/README.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** README.txt 1 Jan 2004 05:35:19 -0000 1.6 --- README.txt 1 Jan 2004 16:48:11 -0000 1.7 *************** *** 1,8 **** ! Parrot benchmark 1.0.2 ====================== ! [This is version 1.0.2, with a bugfix for the Mac OSX issue that Dan ! reported, and a further bugfix for the dict ordering problem noted by ! Samuele Pedroni.] This is a benchmark to be run in front of a live audience at OSCON --- 1,8 ---- ! Parrot benchmark 1.0.3 ====================== ! [This is version 1.0.3, with a bugfix for the Mac OSX issue that Dan ! reported, and two further bugfixes for the dict ordering problem noted ! by Samuele Pedroni.] This is a benchmark to be run in front of a live audience at OSCON Index: b0.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/b0.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** b0.py 1 Jan 2004 05:35:19 -0000 1.9 --- b0.py 1 Jan 2004 16:48:11 -0000 1.10 *************** *** 251,256 **** return False class Function(object): ! makeLocals = dict def __init__(self, name, args, body, globals): self.name = name --- 251,266 ---- return False + class Dict(dict): + + def __repr__(self): + keys = self.keys() + keys.sort() + L = [] + for key in keys: + L.append(repr(key) + ": " + repr(self[key])) + return "{" + ", ".join(L) + "}" + class Function(object): ! makeLocals = Dict def __init__(self, name, args, body, globals): self.name = name *************** *** 836,849 **** unInstrumentTree(cls) - class Dict(dict): - - def __repr__(self): - keys = self.keys() - keys.sort() - L = [] - for key in keys: - L.append(repr(key) + ": " + repr(self[key])) - return "{" + ", ".join(L) + "}" - def main(): output.reset() --- 846,849 ---- *************** *** 905,909 **** for i in range(10): digits.append(g.next()) ! checkoutput(2832206487) print "".join(map(str, digits)) --- 905,909 ---- for i in range(10): digits.append(g.next()) ! checkoutput(3259608361) print "".join(map(str, digits)) *************** *** 933,937 **** digits.append(g.next()) checkoutput(902386495) ! Function.makeLocals = dict if __name__ == '__main__': --- 933,937 ---- digits.append(g.next()) checkoutput(902386495) ! Function.makeLocals = Dict if __name__ == '__main__': Index: b4.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/b4.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** b4.py 1 Jan 2004 05:35:19 -0000 1.4 --- b4.py 1 Jan 2004 16:48:11 -0000 1.5 *************** *** 82,86 **** print sort unInstrumentTree(Node) ! checkoutput(2713552348) if __name__ == '__main__': --- 82,86 ---- print sort unInstrumentTree(Node) ! checkoutput(2055134175) if __name__ == '__main__': Index: out0 =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/out0,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** out0 1 Jan 2004 05:35:19 -0000 1.7 --- out0 1 Jan 2004 16:48:11 -0000 1.8 *************** *** 7033,9175 **** Name.assign("1, {u'pi': }, {u'a': 4, u'k': 2}") return ! Name.assign("12, {u'pi': }, {u'a': 4, u'k': 2, u'b': 1}") return ! Name.assign("4, {u'pi': }, {u'a': 4, u'a1': 12, u'k': 2, u'b': 1}") return return return ! While.geneval("{u'pi': }, {u'a': 4, u'a1': 12,..., u'b': 1, u'b1': 4}") return [...4257 lines suppressed...] ! Exprs.assign("(3L, 3L), {u'pi': }, {u'a': 9576126383040...u'p': 196, u'q': 29}") ! Name.assign("3L, {u'pi': }, {u'a': 9576126383040...u'p': 196, u'q': 29}") return ! Name.assign("3L, {u'pi': }, {u'a': 9576126383040...u'p': 196, u'q': 29}") return return return ! While.geneval("{u'pi': }, {u'a': 9576126383040...u'p': 196, u'q': 29}") return ! Binop.eval("{u'pi': }, {u'a': 9576126383040...u'p': 196, u'q': 29}") ! Name.eval("{u'pi': }, {u'a': 9576126383040...u'p': 196, u'q': 29}") return 3L ! Name.eval("{u'pi': }, {u'a': 9576126383040...u'p': 196, u'q': 29}") return 3L return True ! Yield.geneval("{u'pi': }, {u'a': 9576126383040...u'p': 196, u'q': 29}") return ! Name.eval("{u'pi': }, {u'a': 9576126383040...u'p': 196, u'q': 29}") return 3L 3141592653 Index: out4 =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/out4,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** out4 1 Jan 2004 05:35:19 -0000 1.5 --- out4 1 Jan 2004 16:48:11 -0000 1.6 *************** *** 87,1168 **** return False return ! Call.eval("{'_siftdown': }, {'item': 1, 'heap': []}") ! Attribute.eval("{'_siftdown': }, {'item': 1, 'heap': []}") ! Name.eval("{'_siftdown': }, {'item': 1, 'heap': []}") return [] return ! Name.eval("{'_siftdown': }, {'item': 1, 'heap': []}") return 1 return [...7077 lines suppressed...] ! Name.eval("{'_siftdown': }, {'lastelt': 9, 'returnitem': 9, 'heap': []}") return 9 raise --- 3693,3708 ---- return return ! If.eval("{'_siftdown': }, {'heap': [], 'lastelt': 9}") ! Name.eval("{'_siftdown': }, {'heap': [], 'lastelt': 9}") return [] ! Assign.eval("{'_siftdown': }, {'heap': [], 'lastelt': 9}") ! Name.eval("{'_siftdown': }, {'heap': [], 'lastelt': 9}") return 9 ! Name.assign("9, {'_siftdown': }, {'heap': [], 'lastelt': 9}") return return return ! Return.eval("{'_siftdown': }, {'heap': [], 'lastelt': 9, 'returnitem': 9}") ! Name.eval("{'_siftdown': }, {'heap': [], 'lastelt': 9, 'returnitem': 9}") return 9 raise From gvanrossum at users.sourceforge.net Thu Jan 1 12:32:43 2004 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Thu Jan 1 12:32:50 2004 Subject: [Python-checkins] python/nondist/sandbox/parrotbench Makefile, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/parrotbench In directory sc8-pr-cvs1:/tmp/cvs-serv3974 Modified Files: Makefile Log Message: More parameterizable Makefile. Added upload target for ultra convenience. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 1 Jan 2004 16:48:11 -0000 1.4 --- Makefile 1 Jan 2004 17:32:36 -0000 1.5 *************** *** 1,10 **** ! PYTHON=python2.3 ! DIFF=diff ! CMP=cmp ! FILES=README.txt Makefile b.py b[0-9].py t.py out out[0-9] time: ! time $(PYTHON) -O b.py >@out $(CMP) @out out --- 1,16 ---- ! PYTHON= python2.3 ! DIFF= diff ! ECHO= echo ! TIME= time ! CMP= cmp ! SCP= scp ! RM= rm ! FILES= README.txt Makefile b.py b[0-9].py t.py out out[0-9] ! TARFILE=parrotbench.tgz ! TARGET= python.org:~ftp/pub/python/parrotbench/parrotbench.tgz time: ! $(TIME) $(PYTHON) -O b.py >@out $(CMP) @out out *************** *** 17,30 **** $(DIFF) @out out ! dist: ! tar czf parrotbench.tgz $(FILES) clean: ! -rm -f @* *~ *.pyc *.pyo parrotbench.tgz times: for i in 0 1 2 3 4 5 6; do \ ! echo b$$i.py; \ ! time $(PYTHON) b$$i.py >@out$$i; \ $(CMP) @out$$i out$$i; \ done --- 23,41 ---- $(DIFF) @out out ! dist: $(TARFILE) ! ! $(TARFILE): $(FILES) ! tar czf $(TARFILE) $(FILES) ! ! upload: dist ! $(SCP) $(TARFILE) $(TARGET) clean: ! -$(RM) -f @* *~ *.pyc *.pyo $(TARFILE) times: for i in 0 1 2 3 4 5 6; do \ ! $(ECHO) b$$i.py; \ ! $(TIME) $(PYTHON) b$$i.py >@out$$i; \ $(CMP) @out$$i out$$i; \ done *************** *** 32,36 **** cmps: for i in 0 1 2 3 4 5 6; do \ ! echo b$$i.py; \ $(PYTHON) b$$i.py >@out$$i; \ $(CMP) @out$$i out$$i; \ --- 43,47 ---- cmps: for i in 0 1 2 3 4 5 6; do \ ! $(ECHO) b$$i.py; \ $(PYTHON) b$$i.py >@out$$i; \ $(CMP) @out$$i out$$i; \ *************** *** 39,43 **** diffs: for i in 0 1 2 3 4 5 6; do \ ! echo b$$i.py; \ $(PYTHON) b$$i.py >@out$$i; \ $(DIFF) @out$$i out$$i; \ --- 50,54 ---- diffs: for i in 0 1 2 3 4 5 6; do \ ! $(ECHO) b$$i.py; \ $(PYTHON) b$$i.py >@out$$i; \ $(DIFF) @out$$i out$$i; \ From akuchling at users.sourceforge.net Thu Jan 1 13:33:37 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Thu Jan 1 13:33:41 2004 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.22, 1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv14149 Modified Files: whatsnew24.tex Log Message: Use 'input' as variable name, even though it shadows a built-in Remove applications of rsplit() and random numbers Typo fixes; minor tweaks Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** whatsnew24.tex 31 Dec 2003 01:59:18 -0000 1.22 --- whatsnew24.tex 1 Jan 2004 18:33:34 -0000 1.23 *************** *** 110,115 **** \begin{verbatim} ! >>> data = open('/etc/passwd', 'r') ! >>> for line in reversed(list(data)): ... print line ... --- 110,115 ---- \begin{verbatim} ! >>> input= open('/etc/passwd', 'r') ! >>> for line in reversed(list(input)): ... print line ... *************** *** 138,143 **** \item Strings also gained an \method{rsplit()} method that works like the \method{split()} method but splits from the end of ! the string. Possible applications include splitting a filename ! from a path or a domain name from URL. \begin{verbatim} --- 138,142 ---- \item Strings also gained an \method{rsplit()} method that works like the \method{split()} method but splits from the end of ! the string. \begin{verbatim} *************** *** 237,241 **** \item The \function{zip()} built-in function and \function{itertools.izip()} now return an empty list instead of raising a \exception{TypeError} ! exception if called with no arguments. This makes the function more suitable for use with variable length argument lists: --- 236,240 ---- \item The \function{zip()} built-in function and \function{itertools.izip()} now return an empty list instead of raising a \exception{TypeError} ! exception if called with no arguments. This makes them more suitable for use with variable length argument lists: *************** *** 355,361 **** Note that \function{tee()} has to keep copies of the values returned by the iterator; in the worst case, it may need to keep all of them. ! This should therefore be used carefully if there the leading iterator can run far ahead of the trailing iterator in a long stream of inputs. ! If the separation is large, then it becomes preferrable to use \function{list()} instead. When the iterators track closely with one another, \function{tee()} is ideal. Possible applications include --- 354,360 ---- Note that \function{tee()} has to keep copies of the values returned by the iterator; in the worst case, it may need to keep all of them. ! This should therefore be used carefully if the leading iterator can run far ahead of the trailing iterator in a long stream of inputs. ! If the separation is large, then it becomes preferable to use \function{list()} instead. When the iterators track closely with one another, \function{tee()} is ideal. Possible applications include *************** *** 386,391 **** which returns an N-bit long integer. This method supports the existing \method{randrange()} method, making it possible to efficiently generate ! arbitrarily large random numbers (suitable for prime number generation in ! RSA applications for example). \item The regular expression language accepted by the \module{re} module --- 385,389 ---- which returns an N-bit long integer. This method supports the existing \method{randrange()} method, making it possible to efficiently generate ! arbitrarily large random numbers. \item The regular expression language accepted by the \module{re} module From kbk at users.sourceforge.net Thu Jan 1 23:04:06 2004 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Thu Jan 1 23:04:10 2004 Subject: [Python-checkins] python/dist/src/Lib/idlelib NEWS.txt, 1.27, 1.28 run.py, 1.26, 1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv18778 Modified Files: NEWS.txt run.py Log Message: - Print correct exception even if source file changed since shell was restarted. IDLEfork Patch 869012 Noam Raphael Modified Files: NEWS.txt run.py Index: NEWS.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** NEWS.txt 24 Nov 2003 05:26:16 -0000 1.27 --- NEWS.txt 2 Jan 2004 04:04:04 -0000 1.28 *************** *** 1,6 **** ! What's New in IDLE 1.0+? =================================== ! *Release date: XX-XXX-2003* - Keybindings with the Shift modifier now work correctly. So do bindings which --- 1,9 ---- ! What's New in IDLE 1.1a0? =================================== ! *Release date: XX-XXX-2004* ! ! - Print correct exception even if source file changed since shell was ! restarted. IDLEfork Patch 869012 Noam Raphael - Keybindings with the Shift modifier now work correctly. So do bindings which Index: run.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/run.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** run.py 19 Nov 2003 04:52:32 -0000 1.26 --- run.py 2 Jan 2004 04:04:04 -0000 1.27 *************** *** 110,113 **** --- 110,115 ---- def print_exception(): + import linecache + linecache.checkcache() flush_stdout() efile = sys.stderr From fdrake at users.sourceforge.net Fri Jan 2 01:52:09 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Jan 2 01:52:13 2004 Subject: [Python-checkins] python/dist/src/Doc/commontex boilerplate.tex, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/commontex In directory sc8-pr-cvs1:/tmp/cvs-serv10202 Modified Files: boilerplate.tex Log Message: PythonLabs --> Python Software Foundation Index: boilerplate.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/commontex/boilerplate.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** boilerplate.tex 27 Sep 2003 22:07:05 -0000 1.2 --- boilerplate.tex 2 Jan 2004 06:52:06 -0000 1.3 *************** *** 2,6 **** Fred L. Drake, Jr., editor} \authoraddress{ ! \strong{PythonLabs}\\ Email: \email{docs@python.org} } --- 2,6 ---- Fred L. Drake, Jr., editor} \authoraddress{ ! \strong{Python Software Foundation}\\ Email: \email{docs@python.org} } From fdrake at users.sourceforge.net Fri Jan 2 01:57:51 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Jan 2 01:57:55 2004 Subject: [Python-checkins] python/dist/src/Doc/inst inst.tex,1.51,1.52 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/inst In directory sc8-pr-cvs1:/tmp/cvs-serv10936/inst Modified Files: inst.tex Log Message: list the Python Software Foundation on all the documents Index: inst.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/inst/inst.tex,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** inst.tex 19 Oct 2003 07:32:23 -0000 1.51 --- inst.tex 2 Jan 2004 06:57:49 -0000 1.52 *************** *** 18,22 **** \author{Greg Ward} ! \authoraddress{Email: \email{distutils-sig@python.org}} \makeindex --- 18,25 ---- \author{Greg Ward} ! \authoraddress{ ! \strong{Python Software Foundation}\\ ! Email: \email{distutils-sig@python.org} ! } \makeindex From fdrake at users.sourceforge.net Fri Jan 2 01:57:51 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Jan 2 01:57:56 2004 Subject: [Python-checkins] python/dist/src/Doc/dist dist.tex,1.60,1.61 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory sc8-pr-cvs1:/tmp/cvs-serv10936/dist Modified Files: dist.tex Log Message: list the Python Software Foundation on all the documents Index: dist.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** dist.tex 19 Oct 2003 07:32:23 -0000 1.60 --- dist.tex 2 Jan 2004 06:57:49 -0000 1.61 *************** *** 12,16 **** \author{Greg Ward} ! \authoraddress{Email: \email{distutils-sig@python.org}} \makeindex --- 12,19 ---- \author{Greg Ward} ! \authoraddress{ ! \strong{Python Software Foundation}\\ ! Email: \email{distutils-sig@python.org} ! } \makeindex From fdrake at users.sourceforge.net Fri Jan 2 01:57:52 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Jan 2 01:58:00 2004 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew20.tex, 1.50, 1.51 whatsnew21.tex, 1.31, 1.32 whatsnew22.tex, 1.63, 1.64 whatsnew23.tex, 1.164, 1.165 whatsnew24.tex, 1.23, 1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv10936/whatsnew Modified Files: whatsnew20.tex whatsnew21.tex whatsnew22.tex whatsnew23.tex whatsnew24.tex Log Message: list the Python Software Foundation on all the documents Index: whatsnew20.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew20.tex,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** whatsnew20.tex 30 Dec 2003 17:16:41 -0000 1.50 --- whatsnew20.tex 2 Jan 2004 06:57:49 -0000 1.51 *************** *** 6,10 **** \release{1.02} \author{A.M. Kuchling and Moshe Zadka} ! \authoraddress{\email{amk@amk.ca}, \email{moshez@twistedmatrix.com} } \begin{document} \maketitle\tableofcontents --- 6,13 ---- \release{1.02} \author{A.M. Kuchling and Moshe Zadka} ! \authoraddress{ ! \strong{Python Software Foundation}\\ ! Email: \email{amk@amk.ca}, \email{moshez@twistedmatrix.com} ! } \begin{document} \maketitle\tableofcontents Index: whatsnew21.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew21.tex,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** whatsnew21.tex 22 Jul 2003 00:52:42 -0000 1.31 --- whatsnew21.tex 2 Jan 2004 06:57:50 -0000 1.32 *************** *** 8,12 **** \release{1.00} \author{A.M. Kuchling} ! \authoraddress{\email{amk@amk.ca}} \begin{document} \maketitle\tableofcontents --- 8,15 ---- \release{1.00} \author{A.M. Kuchling} ! \authoraddress{ ! \strong{Python Software Foundation}\\ ! Email: \email{amk@amk.ca} ! } \begin{document} \maketitle\tableofcontents Index: whatsnew22.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew22.tex,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** whatsnew22.tex 29 Aug 2003 17:49:26 -0000 1.63 --- whatsnew22.tex 2 Jan 2004 06:57:50 -0000 1.64 *************** *** 6,10 **** \release{1.02} \author{A.M. Kuchling} ! \authoraddress{\email{amk@amk.ca}} \begin{document} \maketitle\tableofcontents --- 6,13 ---- \release{1.02} \author{A.M. Kuchling} ! \authoraddress{ ! \strong{Python Software Foundation}\\ ! Email: \email{amk@amk.ca} ! } \begin{document} \maketitle\tableofcontents Index: whatsnew23.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew23.tex,v retrieving revision 1.164 retrieving revision 1.165 diff -C2 -d -r1.164 -r1.165 *** whatsnew23.tex 23 Dec 2003 16:46:41 -0000 1.164 --- whatsnew23.tex 2 Jan 2004 06:57:50 -0000 1.165 *************** *** 6,10 **** \release{1.01} \author{A.M.\ Kuchling} ! \authoraddress{\email{amk@amk.ca}} \begin{document} --- 6,13 ---- \release{1.01} \author{A.M.\ Kuchling} ! \authoraddress{ ! \strong{Python Software Foundation}\\ ! Email: \email{amk@amk.ca} ! } \begin{document} Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** whatsnew24.tex 1 Jan 2004 18:33:34 -0000 1.23 --- whatsnew24.tex 2 Jan 2004 06:57:50 -0000 1.24 *************** *** 6,10 **** \release{0.0} \author{A.M.\ Kuchling} ! \authoraddress{\email{amk@amk.ca}} \begin{document} --- 6,13 ---- \release{0.0} \author{A.M.\ Kuchling} ! \authoraddress{ ! \strong{Python Software Foundation}\\ ! Email: \email{amk@amk.ca} ! } \begin{document} From aleax at users.sourceforge.net Fri Jan 2 04:15:59 2004 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Fri Jan 2 04:16:11 2004 Subject: [Python-checkins] python/nondist/peps pep-0323.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv30291 Modified Files: pep-0323.txt Log Message: fixed 2 typos in example code kindly pointed out by Tom Jenkins. Index: pep-0323.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0323.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0323.txt 29 Oct 2003 13:39:51 -0000 1.2 --- pep-0323.txt 2 Jan 2004 09:15:55 -0000 1.3 *************** *** 144,148 **** def __copy__(self): ! result = self.__class__(sequence) result.index = self.index return result --- 144,148 ---- def __copy__(self): ! result = self.__class__(self.sequence) result.index = self.index return result *************** *** 331,335 **** def __copy__(self): ! result = self.__class__.new() result.it = self.it.__copy__() result.i = self.i --- 331,335 ---- def __copy__(self): ! result = self.__class__.__new__() result.it = self.it.__copy__() result.i = self.i From akuchling at users.sourceforge.net Fri Jan 2 10:44:32 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Jan 2 10:44:35 2004 Subject: [Python-checkins] python/dist/src/Lib tarfile.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv26203 Modified Files: tarfile.py Log Message: [Bug #812325 ] tarfile.close() can write out more bytes to the output than are specified by the buffer size. The patch calls .__write() to ensure that any full blocks are written out. Index: tarfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/tarfile.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tarfile.py 24 Oct 2003 17:38:34 -0000 1.9 --- tarfile.py 2 Jan 2004 15:44:29 -0000 1.10 *************** *** 354,357 **** --- 354,358 ---- if self.type != "tar": self.buf += self.cmp.flush() + self.__write("") # Write remaining blocks to output self.fileobj.write(self.buf) self.buf = "" From aleax at users.sourceforge.net Fri Jan 2 12:11:56 2004 From: aleax at users.sourceforge.net (aleax@users.sourceforge.net) Date: Fri Jan 2 12:12:00 2004 Subject: [Python-checkins] python/dist/src/Lib/test pystone.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv11491 Modified Files: pystone.py Log Message: The script now takes an optional command-line argument to specify how many loops to run (default remains 50,000 if no argument is specified). Index: pystone.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/pystone.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pystone.py 6 Aug 2002 17:21:20 -0000 1.7 --- pystone.py 2 Jan 2004 17:11:54 -0000 1.8 *************** *** 58,65 **** FALSE = 0 ! def main(): ! benchtime, stones = pystones() print "Pystone(%s) time for %d passes = %g" % \ ! (__version__, LOOPS, benchtime) print "This machine benchmarks at %g pystones/second" % stones --- 58,65 ---- FALSE = 0 ! def main(loops=LOOPS): ! benchtime, stones = pystones(loops) print "Pystone(%s) time for %d passes = %g" % \ ! (__version__, loops, benchtime) print "This machine benchmarks at %g pystones/second" % stones *************** *** 250,252 **** if __name__ == '__main__': ! main() --- 250,267 ---- if __name__ == '__main__': ! import sys ! def error(msg): ! print >>sys.stderr, msg, ! print >>sys.stderr, "usage: %s [number_of_loops]" % sys.argv[0] ! sys.exit(100) ! nargs = len(sys.argv) - 1 ! if nargs > 1: ! error("%d arguments are too many;" % nargs) ! elif nargs == 1: ! try: loops = int(sys.argv[1]) ! except ValueError: ! error("Invalid argument %r;" % sys.argv[1]) ! else: ! loops = LOOPS ! main(loops) ! From gvanrossum at users.sourceforge.net Fri Jan 2 14:36:49 2004 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri Jan 2 14:36:53 2004 Subject: [Python-checkins] python/nondist/sandbox/parrotbench t.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/parrotbench In directory sc8-pr-cvs1:/tmp/cvs-serv5400 Modified Files: t.py Log Message: Fix the timing driver now that b.py has a main() of itself. Index: t.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/t.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** t.py 31 Dec 2003 21:51:48 -0000 1.2 --- t.py 2 Jan 2004 19:36:46 -0000 1.3 *************** *** 3,7 **** import time t0 = time.clock() ! import b t1 = time.clock() print >>sys.stderr, "%.3f seconds" % (t1-t0) --- 3,7 ---- import time t0 = time.clock() ! import b; b.main() t1 = time.clock() print >>sys.stderr, "%.3f seconds" % (t1-t0) From gvanrossum at users.sourceforge.net Fri Jan 2 14:37:58 2004 From: gvanrossum at users.sourceforge.net (gvanrossum@users.sourceforge.net) Date: Fri Jan 2 14:38:02 2004 Subject: [Python-checkins] python/nondist/sandbox/parrotbench README.txt, 1.7, 1.8 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/parrotbench In directory sc8-pr-cvs1:/tmp/cvs-serv5581 Modified Files: README.txt Log Message: Release 1.0.4. No changes in benchmark this time, just in t.py and Makefile. Index: README.txt =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/parrotbench/README.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** README.txt 1 Jan 2004 16:48:11 -0000 1.7 --- README.txt 2 Jan 2004 19:37:56 -0000 1.8 *************** *** 1,8 **** ! Parrot benchmark 1.0.3 ====================== ! [This is version 1.0.3, with a bugfix for the Mac OSX issue that Dan ! reported, and two further bugfixes for the dict ordering problem noted ! by Samuele Pedroni.] This is a benchmark to be run in front of a live audience at OSCON --- 1,8 ---- ! Parrot benchmark 1.0.4 ====================== ! [This is version 1.0.4, with a bugfix for the Mac OSX issue that Dan ! reported, two further bugfixes for the dict ordering problem noted by ! Samuele Pedroni, and an updated Makefile and t.py driver for Windows.] This is a benchmark to be run in front of a live audience at OSCON From loewis at users.sourceforge.net Fri Jan 2 15:42:26 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Jan 2 15:42:29 2004 Subject: [Python-checkins] python/nondist/sandbox/msi msilib.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/msi In directory sc8-pr-cvs1:/tmp/cvs-serv17402 Modified Files: msilib.py Log Message: Locate cabarc in registry. Add value= to radiobuttons. Support control conditions. Index: msilib.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/msilib.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** msilib.py 30 Dec 2003 15:02:42 -0000 1.2 --- msilib.py 2 Jan 2004 20:42:24 -0000 1.3 *************** *** 6,10 **** import pythoncom from win32com.client import constants ! import re, string, os, sets, glob, popen2, sys Win64 = 0 --- 6,10 ---- import pythoncom from win32com.client import constants ! import re, string, os, sets, glob, popen2, sys, _winreg Win64 = 0 *************** *** 357,361 **** except OSError: pass ! f = popen2.popen4(r"cabarc.exe n %s.cab @%s.txt" % (self.name, self.name))[0] for line in f: if line.startswith(" -- adding "): --- 357,374 ---- except OSError: pass ! for k, v in [(r"Software\Microsoft\VisualStudio\7.1\Setup\VS", "VS7CommonBinDir"), ! (r"Software\Microsoft\Win32SDK\Directories", "Install Dir")]: ! try: ! key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, k) ! except WindowsError: ! continue ! cabarc = os.path.join(_winreg.QueryValueEx(key, v)[0], r"Bin", "cabarc.exe") ! _winreg.CloseKey(key) ! assert os.path.exists(cabarc), cabarc ! break ! else: ! print "WARNING: cabarc.exe not found in registry" ! cabarc = "cabarc.exe" ! f = popen2.popen4(r'"%s" n %s.cab @%s.txt' % (cabarc, self.name, self.name))[0] for line in f: if line.startswith(" -- adding "): *************** *** 526,529 **** --- 539,546 ---- [(self.dlg.name, self.name, ev, attr)]) + def condition(self, action, condition): + add_data(self.dlg.db, "ControlCondition", + [(self.dlg.name, self.name, action, condition)]) + class RadioButtonGroup(Control): def __init__(self, dlg, name, property): *************** *** 533,539 **** self.index = 1 ! def add(self, name, x, y, w, h, text): add_data(self.dlg.db, "RadioButton", ! [(self.property, self.index, name, x, y, w, h, text, None)]) self.index += 1 --- 550,558 ---- self.index = 1 ! def add(self, name, x, y, w, h, text, value = None): ! if value is None: ! value = name add_data(self.dlg.db, "RadioButton", ! [(self.property, self.index, value, x, y, w, h, text, None)]) self.index += 1 From loewis at users.sourceforge.net Fri Jan 2 15:43:26 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Jan 2 15:43:30 2004 Subject: [Python-checkins] python/nondist/sandbox/msi msi.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/msi In directory sc8-pr-cvs1:/tmp/cvs-serv17550 Modified Files: msi.py Log Message: Add advanced options dialog (default python, all users install). Delete Verb/ProgId/Extension tables, as they cannot be conditionalized. Index: msi.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** msi.py 1 Jan 2004 15:41:06 -0000 1.3 --- msi.py 2 Jan 2004 20:43:24 -0000 1.4 *************** *** 73,77 **** msilib.add_tables(db, sequence) add_data(db, "Property", [("UpgradeCode", upgrade_code), ! ("ALLUSERS", "2")]) db.Commit() return db --- 73,78 ---- msilib.add_tables(db, sequence) add_data(db, "Property", [("UpgradeCode", upgrade_code), ! ("DEFAULTPYTHON", "1"), ! ("WhichUsers", "ALL")]) db.Commit() return db *************** *** 156,160 **** # msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty ("InitialTargetDir", 307, "TARGETDIR", ! "[WindowsVolume]Python%s%s" % (major, minor)) ]) --- 157,161 ---- # msidbCustomActionTypeFirstSequence + msidbCustomActionTypeTextData + msidbCustomActionTypeProperty ("InitialTargetDir", 307, "TARGETDIR", ! "[WindowsVolume]Python%s%s" % (major, minor)), ]) *************** *** 171,174 **** --- 172,176 ---- [("InitialTargetDir", 'TARGETDIR=""', 750)]) + ##################################################################### # Standard dialogs: FatalError, UserExit, ExitDialog fatal=PyDialog(db, "FatalError", x, y, w, h, modal, title, *************** *** 207,210 **** --- 209,213 ---- c.event("EndDialog", "Return") + ##################################################################### # Required dialog: FilesInUse, ErrorDlg inuse = PyDialog(db, "FilesInUse", x, y, w, h, 19, title, *************** *** 237,240 **** --- 240,244 ---- error.pushbutton("R",198,72,81,21,3,"Retry",None).event("EndDialog","ErrorRetry") + ##################################################################### # Global "Query Cancel" dialog cancel = Dialog(db, "CancelDlg", 50, 10, 260, 85, 3, title, *************** *** 250,253 **** --- 254,258 ---- c.event("EndDialog", "Return") + ##################################################################### # Global "Wait for costing" dialog costing = Dialog(db, "WaitForCostingDlg", 50, 10, 260, 85, modal, title, *************** *** 260,263 **** --- 265,269 ---- c.event("EndDialog", "Exit") + ##################################################################### # Preparation dialog: no user input except cancellation prep = PyDialog(db, "PrepareDlg", x, y, w, h, modeless, title, *************** *** 301,304 **** --- 307,311 ---- c.event("DirectoryListNew", "0") + ##################################################################### # SelectFeaturesDlg features = PyDialog(db, "SelectFeaturesDlg", x, y, w, h, modal|track_disk_space, *************** *** 311,319 **** c=features.back("< Back", "Next") ! c.event("NewDialog", "SelectDirectoryDlg") # XXX InstallMode="" c=features.next("Next >", "Cancel") c.mapping("SelectionNoItems", "Enabled") ! c.event("EndDialog", "Return") c=features.cancel("Cancel", "Tree") --- 318,328 ---- c=features.back("< Back", "Next") ! c.event("NewDialog", "SelectDirectoryDlg") c=features.next("Next >", "Cancel") c.mapping("SelectionNoItems", "Enabled") ! c.event("[ALLUSERS]", "2", 'VersionNT and WhichUsers="ALL"', order=1) ! c.event("SpawnDialog", "DiskCostDlg", "OutOfDiskSpace=1", order=2) ! c.event("EndDialog", "Return", "OutOfDiskSpace<>1", order=3) c=features.cancel("Cancel", "Tree") *************** *** 334,337 **** --- 343,349 ---- c.event("SpawnDialog", "DiskCostDlg") + c=features.xbutton("Advanced", "Advanced", None, 0.30) + c.event("SpawnDialog", "AdvancedDlg") + c=features.text("ItemDescription", 140, 180, 210, 50, 3, "Multiline description of the currently selected item.") *************** *** 342,345 **** --- 354,358 ---- c.mapping("SelectionSize", "Text") + ##################################################################### # Disk cost cost = PyDialog(db, "DiskCostDlg", x, y, w, h, modal, title, *************** *** 358,363 **** None, "{120}{70}{70}{70}{70}", None, None) cost.xbutton("OK", "Ok", None, 0.5).event("EndDialog", "Return") - # Installation Progress dialog (modeless) progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title, --- 371,403 ---- None, "{120}{70}{70}{70}{70}", None, None) cost.xbutton("OK", "Ok", None, 0.5).event("EndDialog", "Return") + ##################################################################### + # Advanced Options + advanced = PyDialog(db, "AdvancedDlg", x, y, w, h, modal, title, + "OK", "OK", "OK") + advanced.title("Advanced Options") + #0x10: Numeric property + advanced.control("Default", "CheckBox", 135, 60, 160, 20, 19, + "DEFAULTPYTHON", "Install as Default Python Installation", + "AdminInstall", None) + g = advanced.radiogroup("AdminInstall", 135, 90, 160, 50, 3, + "WhichUsers", "", "OK") + # ALLUSERS should not be tempered with on W9x + g.condition("Hide", "Windows9x or NOT Privileged") + g.add("ALL", 0, 5, 150, 20, "Install for all users") + g.add("JUSTME", 0, 25, 150, 20, "Install just for me") + + # Alternative texts if AdminInstall is not available + c=advanced.text("Unprivileged", 135, 90, 160, 50, 3, + "Installing Python for all users is not possible, because you lack privileges.") + c.condition("Hide", "Privileged") + c=advanced.text("W9X", 135, 80, 160, 90, 3, + "Installing Python for all users is not possible on Windows 9x.") + c.condition("Hide", "NOT Windows9x") + + advanced.cancel("Ok", "Default", name="OK").event("EndDialog", "Return") + + + ##################################################################### # Installation Progress dialog (modeless) progress = PyDialog(db, "ProgressDlg", x, y, w, h, modeless, title, *************** *** 454,469 **** cab = CAB("python") tmpfiles = [] root = Directory(db, cab, None, srcdir, "TARGETDIR", "SourceDir") ! # Create separate components for python.exe and pythonw.exe so we can ! # create advertised shortcuts ! root.start_component("python.exe", default_feature, "python.exe") root.add_file("PCBuild/python.exe") - root.start_component("pythonw.exe", default_feature, "pythonw.exe") root.add_file("PCBuild/pythonw.exe") - # Add all other root files into the TARGETDIR component - root.start_component("TARGETDIR", default_feature) - root.add_file("PCBuild/w9xpopen.exe") # XXX: separate component to only install on W9x - root.add_file("PCBuild/python%s%s.dll" % (major, minor)) # XXX separate component for system32 # XXX determine dependencies --- 494,509 ---- cab = CAB("python") tmpfiles = [] + # Add all executables, icons, text files into the TARGETDIR component root = Directory(db, cab, None, srcdir, "TARGETDIR", "SourceDir") ! default_feature.set_current() root.add_file("PCBuild/python.exe") root.add_file("PCBuild/pythonw.exe") + root.add_file("PCBuild/w9xpopen.exe") + root.add_file("PC/py.ico") + root.add_file("PC/pyc.ico") + root.add_file("README.txt", src="README") + root.add_file("NEWS.txt", src="Misc/NEWS") + root.add_file("LICENSE.txt", src="LICENSE") root.add_file("PCBuild/python%s%s.dll" % (major, minor)) # XXX separate component for system32 # XXX determine dependencies *************** *** 473,481 **** tmpfiles.append("msvcr71.dll") - root.add_file("README.txt", src="README") - root.add_file("NEWS.txt", src="Misc/NEWS") - root.add_file("LICENSE.txt", src="LICENSE") - dirs={} # Add all .py files in Lib, except lib-tk, test pydirs = [(root,"Lib")] while pydirs: --- 513,518 ---- tmpfiles.append("msvcr71.dll") # Add all .py files in Lib, except lib-tk, test + dirs={} pydirs = [(root,"Lib")] while pydirs: *************** *** 506,509 **** --- 543,556 ---- lib.glob("*.gif") lib.add_file("idle.icns") + if dir=="command": + lib.add_file("wininst.exe") + if dir=="data" and parent.physical=="test" and parent.basedir.physical=="email": + # This should contain all non-CVS files listed in CVS + for f in os.listdir(lib.absolute): + if f.endswith(".txt") or f=="CVS":continue + if f.endswith(".au") or f.endswith(".gif"): + lib.add_file(f) + else: + print "WARNING: New file %s in email/test/data" % f for f in os.listdir(lib.absolute): if os.path.isdir(os.path.join(lib.absolute, f)): *************** *** 541,544 **** --- 588,592 ---- lib = Directory(db, cab, root, "include", "include", "INCLUDE|include") lib.glob("*.h") + lib.add_file("pyconfig.h", src="../PC/pyconfig.h") # Add import libraries lib = Directory(db, cab, root, "PCBuild", "libs", "LIBS|libs") *************** *** 582,632 **** def add_registry(db): ! # File extensions, associated with the REGISTRY component # msidbComponentAttributesRegistryKeyPath = 4 add_data(db, "Component", [("REGISTRY", msilib.gen_uuid(), "TARGETDIR", 4, None, ! "InstallPath")]) add_data(db, "FeatureComponents", ! [(default_feature.id, "REGISTRY")]) ! add_data(db, "Extension", ! # Apparently, the key file of the component is used as the command; ! # the verb table only contributes the arguments. As the result, all ! # verbs for an extension must use the same command. ! # (Verb.Command is just the localized UI label of the verb) ! [(ext, 'python.exe', testprefix+'Python.File', None, default_feature.id), ! (ext+'w', 'pythonw.exe', testprefix+'Python.NoConFile', None, default_feature.id), ! (ext+'c', 'python.exe', testprefix+'Python.CompiledFile', None, default_feature.id), ! ]) ! add_data(db, "ProgId", ! [(testprefix+'Python.File', None, None, 'Python File', 'py.ico', None), ! (testprefix+'Python.NoConFile', None, None, ! 'Python File (no console)', 'py.ico', None), ! (testprefix+'Python.CompiledFile', None, None, ! 'Compiled Python File', 'pyc.ico', None)]) ! add_data(db, "Icon", ! [('py.ico', Binary(srcdir+r"\PC\py.ico")), ! ('pyc.ico', Binary(srcdir+r"\PC\pyc.ico"))]) ! add_data(db, "Verb", ! [(ext, 'open', 1, None, '"%1" %*'), ! (ext+'w', 'open', 1, None, '"%1" %*'), ! (ext+'c', 'open', 1, None, '"%1" %*'), ! ]) ! # IDLE verbs depend on the tcltk feature. ! # For several reasons (see above) we cannot author them into the Verb table ! add_data(db, "Component", ! [("REGISTRY.tcl", msilib.gen_uuid(), "TARGETDIR", 4, None, ! None)]) ! add_data(db, "FeatureComponents", [(tcltk.id, "REGISTRY.tcl")]) ! pat = r"Software\Classes\%sPython.%sFile\shell\Edit with IDLE\command" add_data(db, "Registry", ! [("IDLE.py", -1, pat % (testprefix, ""), "", r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"', "REGISTRY.tcl"), ! ("IDLE.pyw", -1, pat % (testprefix, "NoCon"), "", r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"', ! "REGISTRY.tcl") ]) # Registry keys - # -1 for Root specifies "dependent on ALLUSERS property" prefix = r"Software\%sPython\PythonCore\%s" % (testprefix, short_version) add_data(db, "Registry", --- 630,698 ---- def add_registry(db): ! # File extensions, associated with the REGISTRY.def component ! # IDLE verbs depend on the tcltk feature. # msidbComponentAttributesRegistryKeyPath = 4 + # -1 for Root specifies "dependent on ALLUSERS property" add_data(db, "Component", [("REGISTRY", msilib.gen_uuid(), "TARGETDIR", 4, None, ! "InstallPath"), ! ("REGISTRY.def", msilib.gen_uuid(), "TARGETDIR", 4, ! "DEFAULTPYTHON=1", None), ! ("REGISTRY.tcl", msilib.gen_uuid(), "TARGETDIR", 4, ! "DEFAULTPYTHON=1", None)]) add_data(db, "FeatureComponents", ! [(default_feature.id, "REGISTRY"), ! (default_feature.id, "REGISTRY.def"), ! (tcltk.id, "REGISTRY.tcl")]) ! ! pat = r"Software\Classes\%sPython.%sFile\shell\%s\command" ! ewi = "Edit with IDLE" ! pat2 = r"Software\Classes\%sPython.%sFile\DefaultIcon" ! pat3 = r"Software\Classes\%sPython.%sFile" add_data(db, "Registry", ! [# Extensions ! ("py.ext", -1, r"Software\Classes\."+ext, "", ! "Python.File", "REGISTRY.def"), ! ("pyw.ext", -1, r"Software\Classes\."+ext+'w', "", ! "Python.NoConFile", "REGISTRY.def"), ! ("pyc.ext", -1, r"Software\Classes\."+ext+'c', "", ! "Python.CompiledFile", "REGISTRY.def"), ! ("pyo.ext", -1, r"Software\Classes\."+ext+'o', "", ! "Python.CompiledFile", "REGISTRY.def"), ! # MIME types ! ("py.mime", -1, r"Software\Classes\."+ext, "Content Type", ! "text/plain", "REGISTRY.def"), ! ("pyw.mime", -1, r"Software\Classes\."+ext+'w', "Content Type", ! "text/plain", "REGISTRY.def"), ! #Verbs ! ("py.open", -1, pat % (testprefix, "", "open"), "", ! r'"[TARGETDIR]python.exe" "%1" %*', "REGISTRY.def"), ! ("pyw.open", -1, pat % (testprefix, "NoCon", "open"), "", ! r'"[TARGETDIR]pythonw.exe" "%1" %*', "REGISTRY.def"), ! ("pyc.open", -1, pat % (testprefix, "Compiled", "open"), "", ! r'"[TARGETDIR]python.exe" "%1" %*', "REGISTRY.def"), ! ("py.IDLE", -1, pat % (testprefix, "", ewi), "", r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"', "REGISTRY.tcl"), ! ("pyw.IDLE", -1, pat % (testprefix, "NoCon", ewi), "", r'"[TARGETDIR]pythonw.exe" "[TARGETDIR]Lib\idlelib\idle.pyw" -n -e "%1"', ! "REGISTRY.tcl"), ! #Icons ! ("py.icon", -1, pat2 % (testprefix, ""), "", ! r'[TARGETDIR]py.ico', "REGISTRY.def"), ! ("pyw.icon", -1, pat2 % (testprefix, "NoCon"), "", ! r'[TARGETDIR]py.ico', "REGISTRY.def"), ! ("pyc.icon", -1, pat2 % (testprefix, "Compiled"), "", ! r'[TARGETDIR]pyc.ico', "REGISTRY.def"), ! # Descriptions ! ("py.txt", -1, pat3 % (testprefix, ""), "", ! "Python File", "REGISTRY.def"), ! ("pyw.txt", -1, pat3 % (testprefix, "NoCon"), "", ! "Python File (no console)", "REGISTRY.def"), ! ("pyc.txt", -1, pat3 % (testprefix, "Compiled"), "", ! "Compiled Python File", "REGISTRY.def"), ]) + # Registry keys prefix = r"Software\%sPython\PythonCore\%s" % (testprefix, short_version) add_data(db, "Registry", *************** *** 640,644 **** ("Modules", -1, prefix+r"\Modules", "+", None, "REGISTRY"), ("AppPaths", -1, r"Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe", ! "", r"[TARGETDIR]Python.exe", "REGISTRY") ]) # Shortcuts --- 706,710 ---- ("Modules", -1, prefix+r"\Modules", "+", None, "REGISTRY"), ("AppPaths", -1, r"Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe", ! "", r"[TARGETDIR]Python.exe", "REGISTRY.def") ]) # Shortcuts From goodger at users.sourceforge.net Fri Jan 2 15:53:04 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Fri Jan 2 15:53:07 2004 Subject: [Python-checkins] python/nondist/peps pep-0324.txt, NONE, 1.1 pep-0000.txt, 1.258, 1.259 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv19377 Modified Files: pep-0000.txt Added Files: pep-0324.txt Log Message: added PEP 324, popen5 - New POSIX process module, by Peter Astrand --- NEW FILE: pep-0324.txt --- PEP: 324 Title: popen5 - New POSIX process module Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/01/02 20:53:01 $ Author: Peter Astrand Status: Draft Type: Standards Track (library) Created: 19-Nov-2003 Content-Type: text/plain Python-Version: 2.4 Abstract This PEP describes a new module for starting and communicating with processes on POSIX systems. Motivation Starting new processes is a common task in any programming language, and very common in a high-level language like Python. Good support for this task is needed, because: - Inappropriate functions for starting processes could mean a security risk: If the program is started through the shell, and the arguments contain shell meta characters, the result can be disastrous. [1] - It makes Python an even better replacement language for over-complicated shell scripts. Currently, Python has a large number of different functions for process creation. This makes it hard for developers to choose. The popen5 modules provides the following enhancements over previous functions: - One "unified" module provides all functionality from previous functions. - Cross-process exceptions: Exceptions happening in the child before the new process has started to execute are re-raised in the parent. This means that it's easy to handle exec() failures, for example. With popen2, for example, it's impossible to detect if the execution failed. - A hook for executing custom code between fork and exec. This can be used for, for example, changing uid. - No implicit call of /bin/sh. This means that there is no need for escaping dangerous shell meta characters. - All combinations of file descriptor redirection is possible. For example, the "python-dialog" [2] needs to spawn a process and redirect stderr, but not stdout. This is not possible with current functions, without using temporary files. - With popen5, it's possible to control if all open file descriptors should be closed before the new program is executed. - Support for connecting several subprocesses (shell "pipe"). - Universal newline support. - A communicate() method, which makes it easy to send stdin data and read stdout and stderr data, without risking deadlocks. Most people are aware of the flow control issues involved with child process communication, but not all have the patience or skills to write a fully correct and deadlock-free select loop. This means that many Python applications contain race conditions. A communicate() method in the standard library solves this problem. Rationale The following points summarizes the design: - popen5 was based on popen2, which is tried-and-tested. - The factory functions in popen2 have been removed, because I consider the class constructor equally easy to work with. - popen2 contains several factory functions and classes for different combinations of redirection. popen5, however, contains one single class. Since popen5 supports 12 different combinations of redirection, providing a class or function for each of them would be cumbersome and not very intuitive. Even with popen2, this is a readability problem. For example, many people cannot tell the difference between popen2.popen2 and popen2.popen4 without using the documentation. - One small utility function is provided: popen5.run(). It aims to be an enhancement over os.system(), while still very easy to use: - It does not use the Standard C function system(), which has limitations. - It does not call the shell implicitly. - No need for quoting; using a variable argument list. - The return value is easier to work with. - The "preexec" functionality makes it possible to run arbitrary code between fork and exec. One might ask why there are special arguments for setting the environment and current directory, but not for, for example, setting the uid. The answer is: - Changing environment and working directory is considered fairly common. - Old functions like spawn() has support for an "env"-argument. - env and cwd are considered quite cross-platform: They make sense even on Windows. - No MS Windows support is available, currently. To be able to provide more functionality than what is already available from the popen2 module, help from C modules is required. Specification This module defines one class called Popen: class Popen(args, bufsize=0, argv0=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, preexec_args=(), close_fds=0, cwd=None, env=None, universal_newlines=0) Arguments are: - args should be a sequence of program arguments. The program to execute is normally the first item in the args sequence, but can be explicitly set by using the argv0 argument. The Popen class uses os.execvp() to execute the child program. - bufsize, if given, has the same meaning as the corresponding argument to the built-in open() function: 0 means unbuffered, 1 means line buffered, any other positive value means use a buffer of (approximately) that size. A negative bufsize means to use the system default, which usually means fully buffered. The default value for bufsize is 0 (unbuffered). - stdin, stdout and stderr specify the executed programs' standard input, standard output and standard error file handles, respectively. Valid values are PIPE, an existing file descriptor (a positive integer), an existing file object, and None. PIPE indicates that a new pipe to the child should be created. With None, no redirection will occur; the child's file handles will be inherited from the parent. Additionally, stderr can be STDOUT, which indicates that the stderr data from the applications should be captured into the same file handle as for stdout. - If preexec_fn is set to a callable object, this object will be called in the child process just before the child is executed, with arguments preexec_args. - If close_fds is true, all file descriptors except 0, 1 and 2 will be closed before the child process is executed. - If cwd is not None, the current directory will be changed to cwd before the child is executed. - If env is not None, it defines the environment variables for the new process. - If universal_newlines is true, the file objects fromchild and childerr are opened as a text files, but lines may be terminated by any of '\n', the Unix end-of-line convention, '\r', the Macintosh convention or '\r\n', the Windows convention. All of these external representations are seen as '\n' by the Python program. Note: This feature is only available if Python is built with universal newline support (the default). Also, the newlines attribute of the file objects fromchild, tochild and childerr are not updated by the communicate() method. The module also defines one shortcut function: run(*args): Run command with arguments. Wait for command to complete, then return the returncode attribute. Example: retcode = popen5.run("stty", "sane") Exceptions ---------- Exceptions raised in the child process, before the new program has started to execute, will be re-raised in the parent. Additionally, the exception object will have one extra attribute called 'child_traceback', which is a string containing traceback information from the child's point of view. The most common exception raised is OSError. This occurs, for example, when trying to execute a non-existent file. Applications should prepare for OSErrors. A PopenException will also be raised if Popen is called with invalid arguments. Security -------- popen5 will never call /bin/sh implicitly. This means that all characters, including shell metacharacters, can safely be passed to child processes. Popen objects ------------- Instances of the Popen class have the following methods: poll() Returns -1 if child process hasn't completed yet, or its exit status otherwise. See below for a description of how the exit status is encoded. wait() Waits for and returns the exit status of the child process. The exit status encodes both the return code of the process and information about whether it exited using the exit() system call or died due to a signal. Functions to help interpret the status code are defined in the os module (the W*() family of functions). communicate(input=None) Interact with process: Send data to stdin. Read data from stdout and stderr, until end-of-file is reached. Wait for process to terminate. The optional stdin argument should be a string to be sent to the child process, or None, if no data should be sent to the child. communicate() returns a tuple (stdout, stderr). Note: The data read is buffered in memory, so do not use this method if the data size is large or unlimited. The following attributes are also available: fromchild A file object that provides output from the child process. tochild A file object that provides input to the child process. childerr A file object that provides error output from the child process. pid The process ID of the child process. returncode The child return code. A None value indicates that the process hasn't terminated yet. A negative value means that the process was terminated by a signal with number -returncode. Open Issues Perhaps the module should be called something like "process", instead of "popen5". Reference Implementation A reference implementation is available from http://www.lysator.liu.se/~astrand/popen5/. References [1] Secure Programming for Linux and Unix HOWTO, section 8.3. http://www.dwheeler.com/secure-programs/ [2] Python Dialog http://pythondialog.sourceforge.net/ Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End: Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.258 retrieving revision 1.259 diff -C2 -d -r1.258 -r1.259 *** pep-0000.txt 6 Nov 2003 14:07:17 -0000 1.258 --- pep-0000.txt 2 Jan 2004 20:53:01 -0000 1.259 *************** *** 120,123 **** --- 120,124 ---- S 321 Date/Time Parsing and Formatting Kuchling S 323 Copyable Iterators Martelli + S 324 popen5 - New POSIX process module Astrand S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 339,342 **** --- 340,345 ---- S 321 Date/Time Parsing and Formatting Kuchling SF 322 Reverse Iteration Hettinger + S 323 Copyable Iterators Martelli + S 324 popen5 - New POSIX process module Astrand SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 362,365 **** --- 365,369 ---- Altis, Kevin altis@semi-retired.com Ascher, David davida@activestate.com + Astrand, Peter astrand@lysator.liu.se Barrett, Paul barrett@stsci.edu Baxter, Anthony anthony@interlink.com.au From loewis at users.sourceforge.net Fri Jan 2 15:55:23 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Jan 2 15:55:26 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 - New directory Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv19848/VC6 Log Message: Directory /cvsroot/python/python/dist/src/PC/VC6 added to the repository From loewis at users.sourceforge.net Fri Jan 2 16:13:30 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Jan 2 16:13:34 2004 Subject: [Python-checkins] python/dist/src/PCbuild readme.txt,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv23202 Modified Files: readme.txt Log Message: Update build procedure to VC 7.1 and newer versions of several packages. Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** readme.txt 20 Aug 2003 18:22:48 -0000 1.44 --- readme.txt 2 Jan 2004 21:13:28 -0000 1.45 *************** *** 1,11 **** ! Building Python using VC++ 6.0 or 5.0 ------------------------------------- This directory is used to build Python for Win32 platforms, e.g. Windows ! 95, 98 and NT. It requires Microsoft Visual C++ 6.x or 5.x. (For other Windows platforms and compilers, see ../PC/readme.txt.) ! All you need to do is open the workspace "pcbuild.dsw" in MSVC++, select ! the Debug or Release setting (using Build -> Set Active Configuration...), ! and build the projects. The proper order to build subprojects: --- 1,12 ---- ! Building Python using VC++ 7.1 ------------------------------------- This directory is used to build Python for Win32 platforms, e.g. Windows ! 95, 98 and NT. It requires Microsoft Visual C++ 7.1 ! (a.k.a. Visual Studio .NET 2003). (For other Windows platforms and compilers, see ../PC/readme.txt.) ! All you need to do is open the workspace "pcbuild.sln" in MSVC++, select ! the Debug or Release setting (using "Solution Configuration" from ! the "Standard" toolbar"), and build the projects. The proper order to build subprojects: *************** *** 25,29 **** When using the Debug setting, the output files have a _d added to ! their name: python21_d.dll, python_d.exe, parser_d.pyd, and so on. SUBPROJECTS --- 26,30 ---- When using the Debug setting, the output files have a _d added to ! their name: python24_d.dll, python_d.exe, parser_d.pyd, and so on. SUBPROJECTS *************** *** 84,97 **** http://prdownloads.sourceforge.net/tcl/ and download ! tcl843-src.zip ! tk843-src.zip Unzip into ! dist\tcl8.4.3\ ! dist\tk8.4.3\ respectively. Build Tcl first (done here w/ MSVC 6 on Win98SE) --------------- ! cd dist\tcl8.4.3\win run vcvars32.bat [necessary even on Win2K] nmake -f makefile.vc --- 85,98 ---- http://prdownloads.sourceforge.net/tcl/ and download ! tcl845-src.zip ! tk845-src.zip Unzip into ! dist\tcl8.4.5\ ! dist\tk8.4.5\ respectively. Build Tcl first (done here w/ MSVC 6 on Win98SE) --------------- ! cd dist\tcl8.4.5\win run vcvars32.bat [necessary even on Win2K] nmake -f makefile.vc *************** *** 108,114 **** Build Tk -------- ! cd dist\tk8.4.3\win ! nmake -f makefile.vc TCLDIR=..\..\tcl8.4.3 ! nmake -f makefile.vc TCLDIR=..\..\tcl8.4.3 INSTALLDIR=..\..\tcl84 install XXX Should we compile with OPTS=threads? --- 109,115 ---- Build Tk -------- ! cd dist\tk8.4.5\win ! nmake -f makefile.vc TCLDIR=..\..\tcl8.4.5 ! nmake -f makefile.vc TCLDIR=..\..\tcl8.4.5 INSTALLDIR=..\..\tcl84 install XXX Should we compile with OPTS=threads? *************** *** 161,164 **** --- 162,167 ---- If FC finds differences, see the warning abou WinZip above (when I first tried it, sample3.ref failed due to CRLF conversion). + + # XXX: it fails with vc 7.1, so the tests are skipped for now. All of this managed to build bzip2-1.0.2\libbz2.lib, which the Python *************** *** 170,185 **** http://www.sleepycat.com/download/ ! and download version 4.1.25. The file name is db-4.1.25.NC.zip. XXX with or without strong cryptography? I picked "without". Unpack into ! dist\db-4.1.25 ! [If using WinZip to unpack the db-4.1.25.NC distro, that requires renaming the directory (to remove ".NC") after unpacking. ] Open ! dist\db-4.1.25\docs\index.html and follow the Windows instructions for building the Sleepycat --- 173,188 ---- http://www.sleepycat.com/download/ ! and download version 4.2.42. The file name is db-4.2.52.NC.zip. XXX with or without strong cryptography? I picked "without". Unpack into ! dist\db-4.2.52 ! [If using WinZip to unpack the db-4.2.52.NC distro, that requires renaming the directory (to remove ".NC") after unpacking. ] Open ! dist\db-4.2.52\docs\index.html and follow the Windows instructions for building the Sleepycat *************** *** 187,191 **** Build the Release version ("build_all -- Win32 Release"). ! XXX We're actually linking against Release_static\libdb41s.lib. XXX This yields the following warnings: """ --- 190,194 ---- Build the Release version ("build_all -- Win32 Release"). ! XXX We're actually linking against Release_static\libdb42s.lib. XXX This yields the following warnings: """ *************** *** 194,202 **** Linking... Creating library ./_bsddb.lib and object ./_bsddb.exp ! LINK : warning LNK4049: locally defined symbol "_malloc" imported ! LINK : warning LNK4049: locally defined symbol "_free" imported ! LINK : warning LNK4049: locally defined symbol "_fclose" imported ! LINK : warning LNK4049: locally defined symbol "_fopen" imported ! _bsddb.pyd - 0 error(s), 4 warning(s) """ XXX This isn't encouraging, but I don't know what to do about it. --- 197,206 ---- Linking... Creating library ./_bsddb.lib and object ./_bsddb.exp ! _bsddb.obj : warning LNK4217: locally defined symbol _malloc imported in function __db_associateCallback ! _bsddb.obj : warning LNK4217: locally defined symbol _free imported in function __DB_consume ! _bsddb.obj : warning LNK4217: locally defined symbol _fclose imported in function _DB_verify ! _bsddb.obj : warning LNK4217: locally defined symbol _fopen imported in function _DB_verify ! _bsddb.obj : warning LNK4217: locally defined symbol _strncpy imported in function _init_pybsddb ! __bsddb - 0 error(s), 5 warning(s) """ XXX This isn't encouraging, but I don't know what to do about it. *************** *** 239,245 **** You (probably) don't want the "engine" code. For example, get ! openssl-0.9.6g.tar.gz not ! openssl-engine-0.9.6g.tar.gz Unpack into the "dist" directory, retaining the folder name from --- 243,249 ---- You (probably) don't want the "engine" code. For example, get ! openssl-0.9.7c.tar.gz not ! openssl-engine-0.9.7c.tar.gz Unpack into the "dist" directory, retaining the folder name from *************** *** 274,278 **** something like ! C:\Code\openssl-0.9.6g>set OPTS=no-asm Out of environment space --- 278,282 ---- something like ! C:\Code\openssl-0.9.7c>set OPTS=no-asm Out of environment space From loewis at users.sourceforge.net Fri Jan 2 16:14:02 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Jan 2 16:14:08 2004 Subject: [Python-checkins] python/dist/src/PCbuild _bsddb.vcproj, NONE, 1.1 _socket.vcproj, NONE, 1.1 _ssl.vcproj, NONE, 1.1 _testcapi.vcproj, NONE, 1.1 _tkinter.vcproj, NONE, 1.1 bz2.vcproj, NONE, 1.1 make_versioninfo.vcproj, NONE, 1.1 pcbuild.sln, NONE, 1.1 pyexpat.vcproj, NONE, 1.1 python.vcproj, NONE, 1.1 pythoncore.vcproj, NONE, 1.1 pythonw.vcproj, NONE, 1.1 select.vcproj, NONE, 1.1 unicodedata.vcproj, NONE, 1.1 w9xpopen.vcproj, NONE, 1.1 winsound.vcproj, NONE, 1.1 zlib.vcproj, NONE, 1.1 _bsddb.dsp, 1.4, NONE _csv.dsp, 1.3, NONE _socket.dsp, 1.5, NONE _sre.dsp, 1.8, NONE _ssl.dsp, 1.3, NONE _symtable.dsp, 1.4, NONE _testcapi.dsp, 1.3, NONE _tkinter.dsp, 1.21, NONE bz2.dsp, 1.3, NONE datetime.dsp, 1.2, NONE make_versioninfo.dsp, 1.2, NONE mmap.dsp, 1.9, NONE parser.dsp, 1.14, NONE pcbuild.dsw, 1.35, NONE pyexpat.dsp, 1.13, NONE python.dsp, 1.16, NONE pythoncore.dsp, 1.51, NONE pythonw.dsp, 1.13, NONE select.dsp, 1.5, NONE unicodedata.dsp, 1.8, NONE w9xpopen.dsp, 1.1, NONE winreg.dsp, 1.7, NONE winsound.dsp, 1.9, NONE zlib.dsp, 1.17, NONE Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv23283 Added Files: _bsddb.vcproj _socket.vcproj _ssl.vcproj _testcapi.vcproj _tkinter.vcproj bz2.vcproj make_versioninfo.vcproj pcbuild.sln pyexpat.vcproj python.vcproj pythoncore.vcproj pythonw.vcproj select.vcproj unicodedata.vcproj w9xpopen.vcproj winsound.vcproj zlib.vcproj Removed Files: _bsddb.dsp _csv.dsp _socket.dsp _sre.dsp _ssl.dsp _symtable.dsp _testcapi.dsp _tkinter.dsp bz2.dsp datetime.dsp make_versioninfo.dsp mmap.dsp parser.dsp pcbuild.dsw pyexpat.dsp python.dsp pythoncore.dsp pythonw.dsp select.dsp unicodedata.dsp w9xpopen.dsp winreg.dsp winsound.dsp zlib.dsp Log Message: Update build procedure to VC 7.1. --- NEW FILE: _bsddb.vcproj --- --- NEW FILE: _socket.vcproj --- --- NEW FILE: _ssl.vcproj --- --- NEW FILE: _testcapi.vcproj --- --- NEW FILE: _tkinter.vcproj --- --- NEW FILE: bz2.vcproj --- --- NEW FILE: make_versioninfo.vcproj --- --- NEW FILE: pcbuild.sln --- Microsoft Visual Studio Solution File, Format Version 8.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_bsddb", "_bsddb.vcproj", "{E1DBB220-D64B-423D-A545-539A55AA7FE2}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_socket", "_socket.vcproj", "{324F66C2-44D0-4D50-B979-F9DAE7FD36DB}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcproj", "{8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}" ProjectSection(ProjectDependencies) = postProject {B11D750F-CD1F-4A96-85CE-E69A5C5259F9} = {B11D750F-CD1F-4A96-85CE-E69A5C5259F9} {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058} = {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcproj", "{59CBF474-9E06-4C50-9142-C44A118BB447}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_tkinter", "_tkinter.vcproj", "{5B51DFF7-5DC0-41F8-8791-A4AB7114A151}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bz2", "bz2.vcproj", "{AC557788-6354-43F7-BE05-C9C8C59A344A}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_versioninfo", "make_versioninfo.vcproj", "{F0E0541E-F17D-430B-97C4-93ADF0DD284E}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyexpat", "pyexpat.vcproj", "{7E551393-3C43-47F8-9F3F-5BC368A6C487}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python", "python.vcproj", "{B11D750F-CD1F-4A96-85CE-E69A5C5259F9}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythoncore", "pythoncore.vcproj", "{CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}" ProjectSection(ProjectDependencies) = postProject {F0E0541E-F17D-430B-97C4-93ADF0DD284E} = {F0E0541E-F17D-430B-97C4-93ADF0DD284E} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonw", "pythonw.vcproj", "{F4229CC3-873C-49AE-9729-DD308ED4CD4A}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "select", "select.vcproj", "{97239A56-DBC0-41D2-BC14-C87D9B97D63B}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "unicodedata", "unicodedata.vcproj", "{FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "w9xpopen", "w9xpopen.vcproj", "{E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}" ProjectSection(ProjectDependencies) = postProject EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winsound", "winsound.vcproj", "{51F35FAE-FB92-4B2C-9187-1542C065AD77}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcproj", "{680CDC79-9CCA-4282-9A8D-927CB0DB55B2}" ProjectSection(ProjectDependencies) = postProject {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} = {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26} EndProjectSection EndProject Global GlobalSection(SolutionConfiguration) = preSolution Debug = Debug Release = Release EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {E1DBB220-D64B-423D-A545-539A55AA7FE2}.Debug.ActiveCfg = Debug|Win32 {E1DBB220-D64B-423D-A545-539A55AA7FE2}.Debug.Build.0 = Debug|Win32 {E1DBB220-D64B-423D-A545-539A55AA7FE2}.Release.ActiveCfg = Release|Win32 {E1DBB220-D64B-423D-A545-539A55AA7FE2}.Release.Build.0 = Release|Win32 {324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.Debug.ActiveCfg = Debug|Win32 {324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.Debug.Build.0 = Debug|Win32 {324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.Release.ActiveCfg = Release|Win32 {324F66C2-44D0-4D50-B979-F9DAE7FD36DB}.Release.Build.0 = Release|Win32 {8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.Debug.ActiveCfg = Debug|Win32 {8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.Debug.Build.0 = Debug|Win32 {8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.Release.ActiveCfg = Release|Win32 {8E85BA54-8A47-4C8B-B72E-8E17579CC6D7}.Release.Build.0 = Release|Win32 {59CBF474-9E06-4C50-9142-C44A118BB447}.Debug.ActiveCfg = Debug|Win32 {59CBF474-9E06-4C50-9142-C44A118BB447}.Debug.Build.0 = Debug|Win32 {59CBF474-9E06-4C50-9142-C44A118BB447}.Release.ActiveCfg = Release|Win32 {59CBF474-9E06-4C50-9142-C44A118BB447}.Release.Build.0 = Release|Win32 {5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.Debug.ActiveCfg = Debug|Win32 {5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.Debug.Build.0 = Debug|Win32 {5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.Release.ActiveCfg = Release|Win32 {5B51DFF7-5DC0-41F8-8791-A4AB7114A151}.Release.Build.0 = Release|Win32 {AC557788-6354-43F7-BE05-C9C8C59A344A}.Debug.ActiveCfg = Debug|Win32 {AC557788-6354-43F7-BE05-C9C8C59A344A}.Debug.Build.0 = Debug|Win32 {AC557788-6354-43F7-BE05-C9C8C59A344A}.Release.ActiveCfg = Release|Win32 {AC557788-6354-43F7-BE05-C9C8C59A344A}.Release.Build.0 = Release|Win32 {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug.ActiveCfg = Debug|Win32 {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Debug.Build.0 = Debug|Win32 {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release.ActiveCfg = Release|Win32 {F0E0541E-F17D-430B-97C4-93ADF0DD284E}.Release.Build.0 = Release|Win32 {7E551393-3C43-47F8-9F3F-5BC368A6C487}.Debug.ActiveCfg = Debug|Win32 {7E551393-3C43-47F8-9F3F-5BC368A6C487}.Debug.Build.0 = Debug|Win32 {7E551393-3C43-47F8-9F3F-5BC368A6C487}.Release.ActiveCfg = Release|Win32 {7E551393-3C43-47F8-9F3F-5BC368A6C487}.Release.Build.0 = Release|Win32 {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug.ActiveCfg = Debug|Win32 {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Debug.Build.0 = Debug|Win32 {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release.ActiveCfg = Release|Win32 {B11D750F-CD1F-4A96-85CE-E69A5C5259F9}.Release.Build.0 = Release|Win32 {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug.ActiveCfg = Debug|Win32 {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Debug.Build.0 = Debug|Win32 {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release.ActiveCfg = Release|Win32 {CF7AC3D1-E2DF-41D2-BEA6-1E2556CDEA26}.Release.Build.0 = Release|Win32 {F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug.ActiveCfg = Debug|Win32 {F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Debug.Build.0 = Debug|Win32 {F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release.ActiveCfg = Release|Win32 {F4229CC3-873C-49AE-9729-DD308ED4CD4A}.Release.Build.0 = Release|Win32 {97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Debug.ActiveCfg = Debug|Win32 {97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Debug.Build.0 = Debug|Win32 {97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Release.ActiveCfg = Release|Win32 {97239A56-DBC0-41D2-BC14-C87D9B97D63B}.Release.Build.0 = Release|Win32 {FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Debug.ActiveCfg = Debug|Win32 {FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Debug.Build.0 = Debug|Win32 {FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Release.ActiveCfg = Release|Win32 {FA5FC7EB-C72F-415F-AE42-91DD605ABDDA}.Release.Build.0 = Release|Win32 {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug.ActiveCfg = Debug|Win32 {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Debug.Build.0 = Debug|Win32 {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release.ActiveCfg = Release|Win32 {E9E0A1F6-0009-4E8C-B8F8-1B8F5D49A058}.Release.Build.0 = Release|Win32 {51F35FAE-FB92-4B2C-9187-1542C065AD77}.Debug.ActiveCfg = Debug|Win32 {51F35FAE-FB92-4B2C-9187-1542C065AD77}.Debug.Build.0 = Debug|Win32 {51F35FAE-FB92-4B2C-9187-1542C065AD77}.Release.ActiveCfg = Release|Win32 {51F35FAE-FB92-4B2C-9187-1542C065AD77}.Release.Build.0 = Release|Win32 {680CDC79-9CCA-4282-9A8D-927CB0DB55B2}.Debug.ActiveCfg = Debug|Win32 {680CDC79-9CCA-4282-9A8D-927CB0DB55B2}.Debug.Build.0 = Debug|Win32 {680CDC79-9CCA-4282-9A8D-927CB0DB55B2}.Release.ActiveCfg = Release|Win32 {680CDC79-9CCA-4282-9A8D-927CB0DB55B2}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution EndGlobalSection GlobalSection(ExtensibilityAddIns) = postSolution EndGlobalSection EndGlobal --- NEW FILE: pyexpat.vcproj --- --- NEW FILE: python.vcproj --- --- NEW FILE: pythoncore.vcproj --- [...2381 lines suppressed...] Name="Release|Win32"> --- NEW FILE: pythonw.vcproj --- --- NEW FILE: select.vcproj --- --- NEW FILE: unicodedata.vcproj --- --- NEW FILE: w9xpopen.vcproj --- --- NEW FILE: winsound.vcproj --- --- NEW FILE: zlib.vcproj --- --- _bsddb.dsp DELETED --- --- _csv.dsp DELETED --- --- _socket.dsp DELETED --- --- _sre.dsp DELETED --- --- _ssl.dsp DELETED --- --- _symtable.dsp DELETED --- --- _testcapi.dsp DELETED --- --- _tkinter.dsp DELETED --- --- bz2.dsp DELETED --- --- datetime.dsp DELETED --- --- make_versioninfo.dsp DELETED --- --- mmap.dsp DELETED --- --- parser.dsp DELETED --- --- pcbuild.dsw DELETED --- --- pyexpat.dsp DELETED --- --- python.dsp DELETED --- --- pythoncore.dsp DELETED --- --- pythonw.dsp DELETED --- --- select.dsp DELETED --- --- unicodedata.dsp DELETED --- --- w9xpopen.dsp DELETED --- --- winreg.dsp DELETED --- --- winsound.dsp DELETED --- --- zlib.dsp DELETED --- From loewis at users.sourceforge.net Fri Jan 2 16:14:40 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Jan 2 16:14:43 2004 Subject: [Python-checkins] python/dist/src/PC config.c,1.40,1.41 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv23447 Modified Files: config.c Log Message: Update build procedure to VC 7.1; make more modules builtin. Index: config.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/config.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** config.c 8 Nov 2003 10:24:38 -0000 1.40 --- config.c 2 Jan 2004 21:14:37 -0000 1.41 *************** *** 48,51 **** --- 48,58 ---- extern void inititertools(void); extern void initheapq(void); + extern void init_symtable(void); + extern void initmmap(void); + extern void init_csv(void); + extern void init_sre(void); + extern void initparser(void); + extern void init_winreg(void); + extern void initdatetime(void); /* tools/freeze/makeconfig.py marker for additional "extern" */ *************** *** 102,105 **** --- 109,119 ---- {"heapq", initheapq}, {"itertools", inititertools}, + {"_symtable", init_symtable}, + {"mmap", initmmap}, + {"_csv", init_csv}, + {"_sre", init_sre}, + {"parser", initparser}, + {"_winreg", init_winreg}, + {"datetime", initdatetime}, {"xxsubtype", initxxsubtype}, From loewis at users.sourceforge.net Fri Jan 2 16:15:09 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Jan 2 16:15:11 2004 Subject: [Python-checkins] python/dist/src/PC readme.txt,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv23592 Modified Files: readme.txt Log Message: Move VC6 project files here. Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/readme.txt,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** readme.txt 26 Jul 2001 21:34:59 -0000 1.24 --- readme.txt 2 Jan 2004 21:15:07 -0000 1.25 *************** *** 2,6 **** *********************************************************** ! *** Note: the project files for MS VC++ 6.0 are now in the *** PCbuild directory. See the file readme.txt there for build *** instructions. There is some information below that might --- 2,6 ---- *********************************************************** ! *** Note: the project files for MS VC++ 7.1 are now in the *** PCbuild directory. See the file readme.txt there for build *** instructions. There is some information below that might *************** *** 79,82 **** --- 79,88 ---- example_nt A subdirectory showing how to build an extension as a DLL. + + Visual Studio 6.0 + ================= + The subdirectory VC6 contains Visual Studio 6 project files. These + were originally located in the PCBuild directory, but are no longer + maintained. From loewis at users.sourceforge.net Fri Jan 2 16:15:09 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Fri Jan 2 16:15:15 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 _bsddb.dsp, NONE, 1.1 _csv.dsp, NONE, 1.1 _socket.dsp, NONE, 1.1 _sre.dsp, NONE, 1.1 _ssl.dsp, NONE, 1.1 _symtable.dsp, NONE, 1.1 _testcapi.dsp, NONE, 1.1 _tkinter.dsp, NONE, 1.1 bz2.dsp, NONE, 1.1 datetime.dsp, NONE, 1.1 make_versioninfo.dsp, NONE, 1.1 mmap.dsp, NONE, 1.1 parser.dsp, NONE, 1.1 pcbuild.dsw, NONE, 1.1 pyexpat.dsp, NONE, 1.1 python.dsp, NONE, 1.1 pythoncore.dsp, NONE, 1.1 pythonw.dsp, NONE, 1.1 select.dsp, NONE, 1.1 unicodedata.dsp, NONE, 1.1 w9xpopen.dsp, NONE, 1.1 winreg.dsp, NONE, 1.1 winsound.dsp, NONE, 1.1 zlib.dsp, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv23592/VC6 Added Files: _bsddb.dsp _csv.dsp _socket.dsp _sre.dsp _ssl.dsp _symtable.dsp _testcapi.dsp _tkinter.dsp bz2.dsp datetime.dsp make_versioninfo.dsp mmap.dsp parser.dsp pcbuild.dsw pyexpat.dsp python.dsp pythoncore.dsp pythonw.dsp select.dsp unicodedata.dsp w9xpopen.dsp winreg.dsp winsound.dsp zlib.dsp Log Message: Move VC6 project files here. --- NEW FILE: _bsddb.dsp --- # Microsoft Developer Studio Project File - Name="_bsddb" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=_bsddb - Win32 Release !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 "_bsddb.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 "_bsddb.mak" CFG="_bsddb - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "_bsddb - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "_bsddb - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "_bsddb" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "_bsddb - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\_bsddb" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "..\..\db-4.1.25\build_win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\db-4.1.25\build_win32\Release_static\libdb41s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"./_bsddb.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_bsddb - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\_bsddb" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "..\..\db-4.1.25\build_win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\db-4.1.25\build_win32\Release_static\libdb41s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd" /out:"./_bsddb_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "_bsddb - Win32 Release" # Name "_bsddb - Win32 Debug" # Begin Source File SOURCE=..\Modules\_bsddb.c # End Source File # End Target # End Project --- NEW FILE: _csv.dsp --- # Microsoft Developer Studio Project File - Name="_csv" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=_csv - Win32 Release !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 "_csv.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 "_csv.mak" CFG="_csv - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "_csv - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "_csv - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "_csv" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "_csv - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\_csv" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1d190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_csv.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_csv - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\_csv" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1d190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_csv_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "_csv - Win32 Release" # Name "_csv - Win32 Debug" # Begin Source File SOURCE=..\Modules\_csv.c # End Source File # End Target # End Project --- NEW FILE: _socket.dsp --- # Microsoft Developer Studio Project File - Name="_socket" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=_socket - Win32 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 "_socket.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 "_socket.mak" CFG="_socket - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "_socket - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "_socket - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "_socket" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "_socket - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\_socket" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_socket.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_socket - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\_socket" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /base:"0x1e1D0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_socket_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "_socket - Win32 Release" # Name "_socket - Win32 Debug" # Begin Source File SOURCE=..\Modules\socketmodule.c # End Source File # End Target # End Project --- NEW FILE: _sre.dsp --- # Microsoft Developer Studio Project File - Name="_sre" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=_sre - Win32 Release !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 "_sre.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 "_sre.mak" CFG="_sre - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "_sre - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "_sre - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "_sre" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "_sre - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\_sre" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1e0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_sre.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_sre - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\_sre" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1e0000" /subsystem:windows /dll /debug /machine:I386 /out:"./_sre_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "_sre - Win32 Release" # Name "_sre - Win32 Debug" # Begin Source File SOURCE=..\Modules\_sre.c # End Source File # End Target # End Project --- NEW FILE: _ssl.dsp --- # Microsoft Developer Studio Project File - Name="_ssl" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) External Target" 0x0106 CFG=_ssl - Win32 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 "_ssl.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 "_ssl.mak" CFG="_ssl - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "_ssl - Win32 Release" (based on "Win32 (x86) External Target") !MESSAGE "_ssl - Win32 Debug" (based on "Win32 (x86) External Target") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" !IF "$(CFG)" == "_ssl - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Cmd_Line "NMAKE /f _ssl.mak" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "_ssl.exe" # PROP BASE Bsc_Name "_ssl.bsc" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\_ssl" # PROP Cmd_Line "python build_ssl.py" # PROP Rebuild_Opt "-a" # PROP Target_File "_ssl.pyd" # PROP Bsc_Name "" # PROP Target_Dir "" !ELSEIF "$(CFG)" == "_ssl - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "x86-temp-debug\_ssl" # PROP BASE Intermediate_Dir "x86-temp-debug\_ssl" # PROP BASE Cmd_Line "NMAKE /f _ssl.mak" # PROP BASE Rebuild_Opt "/a" # PROP BASE Target_File "_ssl_d.pyd" # PROP BASE Bsc_Name "_ssl_d.bsc" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\_ssl" # PROP Cmd_Line "python_d -u build_ssl.py -d" # PROP Rebuild_Opt "-a" # PROP Target_File "_ssl_d.pyd" # PROP Bsc_Name "" # PROP Target_Dir "" !ENDIF # Begin Target # Name "_ssl - Win32 Release" # Name "_ssl - Win32 Debug" !IF "$(CFG)" == "_ssl - Win32 Release" !ELSEIF "$(CFG)" == "_ssl - Win32 Debug" !ENDIF # Begin Source File SOURCE=..\Modules\_ssl.c # End Source File # End Target # End Project --- NEW FILE: _symtable.dsp --- # Microsoft Developer Studio Project File - Name="_symtable" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=_symtable - Win32 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 "_symtable.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 "_symtable.mak" CFG="_symtable - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "_symtable - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "_symtable - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "_symtable" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "_symtable - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\_symtable" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e100000" /dll /machine:I386 /out:"./_symtable.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_symtable - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\_symtable" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e100000" /dll /debug /machine:I386 /out:"./_symtable_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "_symtable - Win32 Release" # Name "_symtable - Win32 Debug" # Begin Source File SOURCE=..\Modules\symtablemodule.c # End Source File # End Target # End Project --- NEW FILE: _testcapi.dsp --- # Microsoft Developer Studio Project File - Name="_testcapi" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=_testcapi - Win32 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 "_testcapi.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 "_testcapi.mak" CFG="_testcapi - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "_testcapi - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "_testcapi - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "_testcapi" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "_testcapi - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\_testcapi" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1F0000" /dll /machine:I386 /out:"./_testcapi.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_testcapi - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\_testcapi" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1F0000" /dll /debug /machine:I386 /out:"./_testcapi_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "_testcapi - Win32 Release" # Name "_testcapi - Win32 Debug" # Begin Source File SOURCE=..\Modules\_testcapimodule.c # End Source File # End Target # End Project --- NEW FILE: _tkinter.dsp --- # Microsoft Developer Studio Project File - Name="_tkinter" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=_tkinter - Win32 Release !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 "_tkinter.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 "_tkinter.mak" CFG="_tkinter - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "_tkinter - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "_tkinter - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "_tkinter" # PROP Scc_LocalPath "..\..\.." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "_tkinter - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\_tkinter" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "..\..\tcl84\include" /I "..\Include" /I "..\PC" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "WITH_APPINIT" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 ..\..\tcl84\lib\tk84.lib ..\..\tcl84\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept /libpath:"C:\Program Files\Tcl\lib" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "_tkinter - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\_tkinter" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "..\..\tcl84\include" /I "..\Include" /I "..\PC" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "WITH_APPINIT" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 ..\..\tcl84\lib\tk84.lib ..\..\tcl84\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" /libpath:"C:\Program Files\Tcl\lib" # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "_tkinter - Win32 Debug" # Name "_tkinter - Win32 Release" # Begin Source File SOURCE=..\Modules\_tkinter.c # End Source File # Begin Source File SOURCE=..\Modules\tkappinit.c # End Source File # End Target # End Project --- NEW FILE: bz2.dsp --- # Microsoft Developer Studio Project File - Name="bz2" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=bz2 - Win32 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 "bz2.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 "bz2.mak" CFG="bz2 - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "bz2 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "bz2 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "bz2" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "bz2 - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\bz2" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "..\..\bzip2-1.0.2" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 ..\..\bzip2-1.0.2\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" # SUBTRACT LINK32 /pdb:none /nodefaultlib # Begin Special Build Tool SOURCE="$(InputPath)" PreLink_Cmds=cd ..\..\bzip2-1.0.2 nmake /nologo /f makefile.msc # End Special Build Tool !ELSEIF "$(CFG)" == "bz2 - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\bz2" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "..\..\bzip2-1.0.2" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 ..\..\bzip2-1.0.2\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" PreLink_Cmds=cd ..\..\bzip2-1.0.2 nmake /nologo /f makefile.msc # End Special Build Tool !ENDIF # Begin Target # Name "bz2 - Win32 Release" # Name "bz2 - Win32 Debug" # Begin Source File SOURCE=..\Modules\bz2module.c # End Source File # End Target # End Project --- NEW FILE: datetime.dsp --- # Microsoft Developer Studio Project File - Name="datetime" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=datetime - Win32 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 "datetime.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 "datetime.mak" CFG="datetime - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "datetime - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "datetime - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "datetime" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "datetime - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\datetime" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /base:"0x1D180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./datetime.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "datetime - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\datetime" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /base:"0x1D180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /nodefaultlib:"msvcrt" /out:"./datetime_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "datetime - Win32 Release" # Name "datetime - Win32 Debug" # Begin Source File SOURCE=..\Modules\datetimemodule.c # End Source File # End Target # End Project --- NEW FILE: make_versioninfo.dsp --- # Microsoft Developer Studio Project File - Name="make_versioninfo" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=make_versioninfo - Win32 Release !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 "make_versioninfo.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 "make_versioninfo.mak" CFG="make_versioninfo - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "make_versioninfo - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "make_versioninfo - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "make_versioninfo" # PROP Scc_LocalPath ".." CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "make_versioninfo - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\make_versioninfo" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386 # SUBTRACT LINK32 /pdb:none # Begin Custom Build InputPath=.\make_versioninfo.exe SOURCE="$(InputPath)" "..\PC\pythonnt_rc.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" .\make_versioninfo.exe >..\PC\pythonnt_rc.h # End Custom Build !ELSEIF "$(CFG)" == "make_versioninfo - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\make_versioninfo" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /i "..\Include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386 /out:"./make_versioninfo_d.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none # Begin Custom Build InputPath=.\make_versioninfo_d.exe SOURCE="$(InputPath)" "..\PC\pythonnt_rc_d.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" .\make_versioninfo_d.exe >..\PC\pythonnt_rc_d.h # End Custom Build !ENDIF # Begin Target # Name "make_versioninfo - Win32 Release" # Name "make_versioninfo - Win32 Debug" # Begin Source File SOURCE=..\PC\make_versioninfo.c # End Source File # End Target # End Project --- NEW FILE: mmap.dsp --- # Microsoft Developer Studio Project File - Name="mmap" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=mmap - Win32 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 "mmap.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 "mmap.mak" CFG="mmap - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "mmap - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "mmap - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "mmap" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "mmap - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\mmap" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1F0000" /dll /machine:I386 /out:"./mmap.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "mmap - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\mmap" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1F0000" /dll /debug /machine:I386 /out:"./mmap_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "mmap - Win32 Release" # Name "mmap - Win32 Debug" # Begin Source File SOURCE=..\Modules\mmapmodule.c # End Source File # End Target # End Project --- NEW FILE: parser.dsp --- # Microsoft Developer Studio Project File - Name="parser" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=parser - Win32 Release !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 "parser.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 "parser.mak" CFG="parser - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "parser - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "parser - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "parser" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "parser - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\parser" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1A0000" /subsystem:windows /dll /debug /machine:I386 /out:"./parser.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "parser - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\parser" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1A0000" /subsystem:windows /dll /debug /machine:I386 /out:"./parser_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "parser - Win32 Release" # Name "parser - Win32 Debug" # Begin Source File SOURCE=..\Modules\parsermodule.c # End Source File # End Target # End Project --- NEW FILE: pcbuild.dsw --- Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### Project: "_bsddb"=.\_bsddb.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "_csv"=.\_csv.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "_socket"=.\_socket.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "_sre"=.\_sre.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "_ssl"=.\_ssl.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency Begin Project Dependency Project_Dep_Name _sre End Project Dependency Begin Project Dependency Project_Dep_Name python End Project Dependency Begin Project Dependency Project_Dep_Name w9xpopen End Project Dependency }}} ############################################################################### Project: "_symtable"=.\_symtable.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "_testcapi"=.\_testcapi.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "_tkinter"=.\_tkinter.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "bz2"=.\bz2.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "datetime"=.\datetime.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "make_versioninfo"=.\make_versioninfo.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "mmap"=.\mmap.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "parser"=.\parser.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "pyexpat"=.\pyexpat.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "python"=.\python.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "pythoncore"=.\pythoncore.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name make_versioninfo End Project Dependency }}} ############################################################################### Project: "pythonw"=.\pythonw.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "select"=.\select.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "unicodedata"=.\unicodedata.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "w9xpopen"=.\w9xpopen.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### Project: "winreg"=.\winreg.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "winsound"=.\winsound.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Project: "zlib"=.\zlib.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ Begin Project Dependency Project_Dep_Name pythoncore End Project Dependency }}} ############################################################################### Global: Package=<5> {{{ }}} Package=<3> {{{ }}} ############################################################################### --- NEW FILE: pyexpat.dsp --- # 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 CFG=pyexpat - Win32 Release !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 Release" !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 # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "pyexpat" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "pyexpat - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\pyexpat" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "XML_NS" /D "XML_DTD" /D BYTEORDER=1234 /D XML_CONTEXT_BYTES=1024 /D "XML_STATIC" /D "HAVE_MEMMOVE" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1D100000" /subsystem:windows /dll /debug /machine:I386 /out:"./pyexpat.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "pyexpat - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\pyexpat" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "HAVE_EXPAT_H" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /D "XML_DTD" /D BYTEORDER=1234 /D XML_CONTEXT_BYTES=1024 /D "XML_STATIC" /D "HAVE_MEMMOVE" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1D100000" /subsystem:windows /dll /debug /machine:I386 /out:"./pyexpat_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "pyexpat - Win32 Release" # Name "pyexpat - Win32 Debug" # Begin Source File SOURCE=..\Modules\pyexpat.c # End Source File # Begin Source File SOURCE=..\Modules\expat\xmlparse.c # End Source File # Begin Source File SOURCE=..\Modules\expat\xmlrole.c # End Source File # Begin Source File SOURCE=..\Modules\expat\xmltok.c # End Source File # End Target # End Project --- NEW FILE: python.dsp --- # Microsoft Developer Studio Project File - Name="python" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 CFG=python - Win32 Release !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 "python.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 "python.mak" CFG="python - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "python - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "python - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "python" # PROP Scc_LocalPath ".." CPP=cl.exe RSC=rc.exe !IF "$(CFG)" == "python - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\python" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "python - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\python" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /i "..\Include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1d000000" /subsystem:console /debug /machine:I386 /out:"./python_d.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "python - Win32 Release" # Name "python - Win32 Debug" # Begin Source File SOURCE=..\PC\pycon.ico # End Source File # Begin Source File SOURCE=..\Modules\python.c # End Source File # Begin Source File SOURCE=..\PC\python_exe.rc # End Source File # End Target # End Project --- NEW FILE: pythoncore.dsp --- # Microsoft Developer Studio Project File - Name="pythoncore" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=pythoncore - Win32 Release !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 "pythoncore.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 "pythoncore.mak" CFG="pythoncore - Win32 Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "pythoncore - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "pythoncore - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "pythoncore" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "pythoncore - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\pythoncore" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_DL_EXPORT" /YX /FD /Zm200 /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /i "..\Include" /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python24.dll" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\pythoncore" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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" /D "_DEBUG" /D "USE_DL_EXPORT" /D "WIN32" /D "_WINDOWS" /YX /FD /Zm200 /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /i "..\Include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 largeint.lib kernel32.lib user32.lib advapi32.lib shell32.lib /nologo /base:"0x1e000000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./python24_d.dll" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "pythoncore - Win32 Release" # Name "pythoncore - Win32 Debug" # Begin Source File SOURCE=..\Modules\_codecsmodule.c # End Source File # Begin Source File SOURCE=..\Modules\_hotshot.c # End Source File # Begin Source File SOURCE=..\Modules\_localemodule.c # End Source File # Begin Source File SOURCE=..\Modules\_randommodule.c # End Source File # Begin Source File SOURCE=..\Modules\_weakref.c # End Source File # Begin Source File SOURCE=..\Objects\abstract.c # End Source File # Begin Source File SOURCE=..\Parser\acceler.c # End Source File # Begin Source File SOURCE=..\Modules\arraymodule.c # End Source File # Begin Source File SOURCE=..\Modules\audioop.c # End Source File # Begin Source File SOURCE=..\Modules\binascii.c # End Source File # Begin Source File SOURCE=..\Parser\bitset.c # End Source File # Begin Source File SOURCE=..\Python\bltinmodule.c # End Source File # Begin Source File SOURCE=..\Objects\boolobject.c # End Source File # Begin Source File SOURCE=..\Objects\bufferobject.c # End Source File # Begin Source File SOURCE=..\Objects\cellobject.c # End Source File # Begin Source File SOURCE=..\Python\ceval.c # End Source File # Begin Source File SOURCE=..\Objects\classobject.c # End Source File # Begin Source File SOURCE=..\Modules\cmathmodule.c # End Source File # Begin Source File SOURCE=..\Objects\cobject.c # End Source File # Begin Source File SOURCE=..\Python\codecs.c # End Source File # Begin Source File SOURCE=..\Python\compile.c # End Source File # Begin Source File SOURCE=..\Objects\complexobject.c # End Source File # Begin Source File SOURCE=..\PC\config.c # End Source File # Begin Source File SOURCE=..\Modules\cPickle.c # End Source File # Begin Source File SOURCE=..\Modules\cStringIO.c # End Source File # Begin Source File SOURCE=..\Objects\descrobject.c # End Source File # Begin Source File SOURCE=..\Objects\dictobject.c # End Source File # Begin Source File SOURCE=..\PC\dl_nt.c # End Source File # Begin Source File SOURCE=..\Python\dynload_win.c # End Source File # Begin Source File SOURCE=..\Objects\enumobject.c # End Source File # Begin Source File SOURCE=..\Modules\errnomodule.c # End Source File # Begin Source File SOURCE=..\Python\errors.c # End Source File # Begin Source File SOURCE=..\Python\exceptions.c # End Source File # Begin Source File SOURCE=..\Objects\fileobject.c # End Source File # Begin Source File SOURCE=..\Objects\floatobject.c # End Source File # Begin Source File SOURCE=..\Objects\frameobject.c # End Source File # Begin Source File SOURCE=..\Python\frozen.c # End Source File # Begin Source File SOURCE=..\Objects\funcobject.c # End Source File # Begin Source File SOURCE=..\Python\future.c # End Source File # Begin Source File SOURCE=..\Modules\gcmodule.c # End Source File # Begin Source File SOURCE=..\Python\getargs.c # End Source File # Begin Source File SOURCE=..\Modules\getbuildinfo.c # ADD CPP /D BUILD=46 # End Source File # Begin Source File SOURCE=..\Python\getcompiler.c # End Source File # Begin Source File SOURCE=..\Python\getcopyright.c # End Source File # Begin Source File SOURCE=..\Python\getmtime.c # End Source File # Begin Source File SOURCE=..\Python\getopt.c # End Source File # Begin Source File SOURCE=..\PC\getpathp.c # End Source File # Begin Source File SOURCE=..\Python\getplatform.c # End Source File # Begin Source File SOURCE=..\Python\getversion.c # End Source File # Begin Source File SOURCE=..\Python\graminit.c # End Source File # Begin Source File SOURCE=..\Parser\grammar1.c # End Source File # Begin Source File SOURCE=..\Modules\heapqmodule.c # End Source File # Begin Source File SOURCE=..\Modules\imageop.c # End Source File # Begin Source File SOURCE=..\Python\import.c # End Source File # Begin Source File SOURCE=..\PC\import_nt.c # ADD CPP /I "..\Python" # End Source File # Begin Source File SOURCE=..\Python\importdl.c # End Source File # Begin Source File SOURCE=..\Objects\intobject.c # End Source File # Begin Source File SOURCE=..\Objects\iterobject.c # End Source File # Begin Source File SOURCE=..\Modules\itertoolsmodule.c # End Source File # Begin Source File SOURCE=..\Parser\listnode.c # End Source File # Begin Source File SOURCE=..\Objects\listobject.c # End Source File # Begin Source File SOURCE=..\Objects\longobject.c # End Source File # Begin Source File SOURCE=..\Modules\main.c # End Source File # Begin Source File SOURCE=..\Python\marshal.c # End Source File # Begin Source File SOURCE=..\Modules\mathmodule.c # End Source File # Begin Source File SOURCE=..\Modules\md5c.c # End Source File # Begin Source File SOURCE=..\Modules\md5module.c # End Source File # Begin Source File SOURCE=..\Parser\metagrammar.c # End Source File # Begin Source File SOURCE=..\Objects\methodobject.c # End Source File # Begin Source File SOURCE=..\Python\modsupport.c # End Source File # Begin Source File SOURCE=..\Objects\moduleobject.c # End Source File # Begin Source File SOURCE=..\PC\msvcrtmodule.c # End Source File # Begin Source File SOURCE=..\Parser\myreadline.c # End Source File # Begin Source File SOURCE=..\Python\mysnprintf.c # End Source File # Begin Source File SOURCE=..\Python\mystrtoul.c # End Source File # Begin Source File SOURCE=..\Parser\node.c # End Source File # Begin Source File SOURCE=..\Objects\object.c # End Source File # Begin Source File SOURCE=..\Objects\obmalloc.c # End Source File # Begin Source File SOURCE=..\Modules\operator.c # End Source File # Begin Source File SOURCE=..\Parser\parser.c # End Source File # Begin Source File SOURCE=..\Parser\parsetok.c # End Source File # Begin Source File SOURCE=..\Modules\pcremodule.c # End Source File # Begin Source File SOURCE=..\Modules\posixmodule.c # End Source File # Begin Source File SOURCE=..\Python\pyfpe.c # End Source File # Begin Source File SOURCE=..\Modules\pypcre.c # End Source File # Begin Source File SOURCE=..\Python\pystate.c # End Source File # Begin Source File SOURCE=..\PC\python_nt.rc # End Source File # Begin Source File SOURCE=..\Python\pythonrun.c # End Source File # Begin Source File SOURCE=..\Objects\rangeobject.c # End Source File # Begin Source File SOURCE=..\Modules\regexmodule.c # End Source File # Begin Source File SOURCE=..\Modules\regexpr.c # End Source File # Begin Source File SOURCE=..\Modules\rgbimgmodule.c # End Source File # Begin Source File SOURCE=..\Modules\rotormodule.c # End Source File # Begin Source File SOURCE=..\Objects\setobject.c # End Source File # Begin Source File SOURCE=..\Modules\shamodule.c # End Source File # Begin Source File SOURCE=..\Modules\signalmodule.c # End Source File # Begin Source File SOURCE=..\Objects\sliceobject.c # End Source File # Begin Source File SOURCE=..\Objects\stringobject.c # End Source File # Begin Source File SOURCE=..\Modules\stropmodule.c # End Source File # Begin Source File SOURCE=..\Python\structmember.c # End Source File # Begin Source File SOURCE=..\Modules\structmodule.c # End Source File # Begin Source File SOURCE=..\Objects\structseq.c # End Source File # Begin Source File SOURCE=..\Python\symtable.c # End Source File # Begin Source File SOURCE=..\Python\sysmodule.c # End Source File # Begin Source File SOURCE=..\Python\thread.c # End Source File # Begin Source File SOURCE=..\Modules\threadmodule.c # End Source File # Begin Source File SOURCE=..\Modules\timemodule.c # End Source File # Begin Source File SOURCE=..\Parser\tokenizer.c # End Source File # Begin Source File SOURCE=..\Python\traceback.c # End Source File # Begin Source File SOURCE=..\Objects\tupleobject.c # End Source File # Begin Source File SOURCE=..\Objects\typeobject.c # End Source File # Begin Source File SOURCE=..\Objects\unicodectype.c # End Source File # Begin Source File SOURCE=..\Objects\unicodeobject.c # End Source File # Begin Source File SOURCE=..\Objects\weakrefobject.c # End Source File # Begin Source File SOURCE=..\Modules\xreadlinesmodule.c # End Source File # Begin Source File SOURCE=..\Modules\xxsubtype.c # End Source File # Begin Source File SOURCE=..\Modules\yuvconvert.c # End Source File # Begin Source File SOURCE=..\Modules\zipimport.c # End Source File # End Target # End Project --- NEW FILE: pythonw.dsp --- # Microsoft Developer Studio Project File - Name="pythonw" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=pythonw - Win32 Alpha Release !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 "pythonw.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 "pythonw.mak" CFG="pythonw - Win32 Alpha Release" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "pythonw - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "pythonw - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "pythonw" # PROP Scc_LocalPath "..\pc" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "pythonw - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\pythonw" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1d000000" /subsystem:windows /debug /machine:I386 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "pythonw - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\pythonw" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /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" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1d000000" /subsystem:windows /debug /machine:I386 /out:"./pythonw_d.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "pythonw - Win32 Release" # Name "pythonw - Win32 Debug" # Begin Source File SOURCE=..\PC\python_exe.rc # End Source File # Begin Source File SOURCE=..\PC\WinMain.c # End Source File # End Target # End Project --- NEW FILE: select.dsp --- # Microsoft Developer Studio Project File - Name="select" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=select - Win32 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 "select.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 "select.mak" CFG="select - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "select - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "select - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "select" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "select - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\select" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "..\..\select113" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /base:"0x1D110000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./select.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "select - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\select" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "..\..\select113" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib /nologo /base:"0x1D110000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /nodefaultlib:"msvcrt" /out:"./select_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "select - Win32 Release" # Name "select - Win32 Debug" # Begin Source File SOURCE=..\Modules\selectmodule.c # End Source File # End Target # End Project --- NEW FILE: unicodedata.dsp --- # Microsoft Developer Studio Project File - Name="unicodedata" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=unicodedata - Win32 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 "unicodedata.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 "unicodedata.mak" CFG="unicodedata - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "unicodedata - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "unicodedata - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "unicodedata" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "unicodedata - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\unicodedata" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1D120000" /dll /machine:I386 /out:"./unicodedata.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "unicodedata - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\unicodedata" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1D120000" /dll /debug /machine:I386 /out:"./unicodedata_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "unicodedata - Win32 Release" # Name "unicodedata - Win32 Debug" # Begin Source File SOURCE=..\Modules\unicodedata.c # End Source File # End Target # End Project --- NEW FILE: w9xpopen.dsp --- # Microsoft Developer Studio Project File - Name="w9xpopen" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 CFG=w9xpopen - Win32 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 "w9xpopen.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 "w9xpopen.mak" CFG="w9xpopen - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "w9xpopen - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "w9xpopen - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "w9xpopen - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\w9xpopen" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 user32.lib /nologo /machine:I386 # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "w9xpopen - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\w9xpopen" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib /nologo /debug /machine:I386 /out:"./w9xpopen_d.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "w9xpopen - Win32 Release" # Name "w9xpopen - Win32 Debug" # Begin Source File SOURCE=..\PC\w9xpopen.c # End Source File # End Target # End Project --- NEW FILE: winreg.dsp --- # Microsoft Developer Studio Project File - Name="winreg" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=winreg - Win32 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 "winreg.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 "winreg.mak" CFG="winreg - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "winreg - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "winreg - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "winreg" # PROP Scc_LocalPath "..\pc" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "winreg - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\winreg" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "winreg_EXPORTS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1C0000" /dll /machine:I386 /out:"_winreg.pyd" !ELSEIF "$(CFG)" == "winreg - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\winreg" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "winreg_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\Include" /I "..\PC" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x1e1C0000" /dll /debug /machine:I386 /out:"_winreg_d.pyd" /pdbtype:sept !ENDIF # Begin Target # Name "winreg - Win32 Release" # Name "winreg - Win32 Debug" # Begin Source File SOURCE=..\PC\_winreg.c !IF "$(CFG)" == "winreg - Win32 Release" # ADD CPP /MD !ELSEIF "$(CFG)" == "winreg - Win32 Debug" # ADD CPP /MDd !ENDIF # End Source File # End Target # End Project --- NEW FILE: winsound.dsp --- # Microsoft Developer Studio Project File - Name="winsound" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=winsound - Win32 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 "winsound.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 "winsound.mak" CFG="winsound - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "winsound - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "winsound - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "winsound" # PROP Scc_LocalPath "..\pc" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "winsound - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\winsound" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "NDEBUG" # ADD RSC /l 0xc09 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib winmm.lib user32.lib /nologo /base:"0x1D160000" /dll /machine:I386 /out:"./winsound.pyd" # SUBTRACT LINK32 /pdb:none !ELSEIF "$(CFG)" == "winsound - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\winsound" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /GZ /c # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0xc09 /d "_DEBUG" # ADD RSC /l 0xc09 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 user32.lib kernel32.lib winmm.lib /nologo /base:"0x1D160000" /dll /debug /machine:I386 /out:"./winsound_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none !ENDIF # Begin Target # Name "winsound - Win32 Release" # Name "winsound - Win32 Debug" # Begin Source File SOURCE=..\PC\winsound.c # End Source File # End Target # End Project --- NEW FILE: zlib.dsp --- # Microsoft Developer Studio Project File - Name="zlib" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=zlib - Win32 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 "zlib.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 "zlib.mak" CFG="zlib - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "zlib - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "zlib - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "zlib" # PROP Scc_LocalPath ".." CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "zlib - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-release\zlib" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "..\..\zlib-1.1.4" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 # ADD LINK32 ..\..\zlib-1.1.4\zlib.lib /nologo /base:"0x1e1B0000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./zlib.pyd" # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" PreLink_Desc=Checking static zlib has been built PreLink_Cmds=cd ..\..\zlib-1.1.4 nmake -nologo -f msdos\makefile.w32 zlib.lib # End Special Build Tool !ELSEIF "$(CFG)" == "zlib - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "." # PROP Intermediate_Dir "x86-temp-debug\zlib" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" F90=df.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 "..\..\zlib-1.1.4" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 ..\..\zlib-1.1.4\zlib.lib /nologo /base:"0x1e1B0000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./zlib_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" PreLink_Desc=Checking static zlib has been built PreLink_Cmds=cd ..\..\zlib-1.1.4 nmake -nologo -f msdos\makefile.w32 zlib.lib # End Special Build Tool !ENDIF # Begin Target # Name "zlib - Win32 Release" # Name "zlib - Win32 Debug" # Begin Source File SOURCE=..\Modules\zlibmodule.c # End Source File # End Target # End Project From jhylton at users.sourceforge.net Fri Jan 2 18:25:43 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Jan 2 18:25:45 2004 Subject: [Python-checkins] python/dist/src/Python import.c,2.225,2.226 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv18074 Modified Files: import.c Log Message: Add comment to mollify Tim. Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.225 retrieving revision 2.226 diff -C2 -d -r2.225 -r2.226 *** import.c 20 Nov 2003 01:44:58 -0000 2.225 --- import.c 2 Jan 2004 23:25:32 -0000 2.226 *************** *** 595,598 **** --- 595,600 ---- if (m == NULL) return NULL; + /* If the module is being reloaded, we get the old module back + and re-use its dict to exec the new code. */ d = PyModule_GetDict(m); if (PyDict_GetItemString(d, "__builtins__") == NULL) { From jackjansen at users.sourceforge.net Fri Jan 2 18:27:44 2004 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Fri Jan 2 18:27:47 2004 Subject: [Python-checkins] python/dist/src/Mac/Modules/qt _Qtmodule.c, 1.17, 1.18 qtscan.py, 1.22, 1.23 qtsupport.py, 1.22, 1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory sc8-pr-cvs1:/tmp/cvs-serv18235 Modified Files: _Qtmodule.c qtscan.py qtsupport.py Log Message: Updated for QuickTime 6.0, Universal Header 3.4.2. Index: _Qtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** _Qtmodule.c 20 Nov 2003 13:30:58 -0000 1.17 --- _Qtmodule.c 2 Jan 2004 23:27:42 -0000 1.18 *************** *** 84,87 **** --- 84,205 ---- static PyObject *Qt_Error; + /* -------------------- Object type IdleManager --------------------- */ + + PyTypeObject IdleManager_Type; + + #define IdleManagerObj_Check(x) ((x)->ob_type == &IdleManager_Type || PyObject_TypeCheck((x), &IdleManager_Type)) + + typedef struct IdleManagerObject { [...1029 lines suppressed...] + {"SpriteMediaImageIndexToID", (PyCFunction)Qt_SpriteMediaImageIndexToID, 1, + PyDoc_STR("(MediaHandler mh, short imageIndex) -> (ComponentResult _rv, QTAtomID imageID)")}, + {"SpriteMediaImageIDToIndex", (PyCFunction)Qt_SpriteMediaImageIDToIndex, 1, + PyDoc_STR("(MediaHandler mh, QTAtomID imageID) -> (ComponentResult _rv, short imageIndex)")}, {"FlashMediaSetPan", (PyCFunction)Qt_FlashMediaSetPan, 1, PyDoc_STR("(MediaHandler mh, short xPercent, short yPercent) -> (ComponentResult _rv)")}, *************** *** 9732,9735 **** --- 10523,10533 ---- PyDict_SetItemString(d, "Error", Qt_Error) != 0) return; + IdleManager_Type.ob_type = &PyType_Type; + if (PyType_Ready(&IdleManager_Type) < 0) return; + Py_INCREF(&IdleManager_Type); + PyModule_AddObject(m, "IdleManager", (PyObject *)&IdleManager_Type); + /* Backward-compatible name */ + Py_INCREF(&IdleManager_Type); + PyModule_AddObject(m, "IdleManagerType", (PyObject *)&IdleManager_Type); MovieController_Type.ob_type = &PyType_Type; if (PyType_Ready(&MovieController_Type) < 0) return; Index: qtscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtscan.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** qtscan.py 4 Feb 2003 15:35:07 -0000 1.22 --- qtscan.py 2 Jan 2004 23:27:42 -0000 1.23 *************** *** 9,13 **** LONG = "QuickTime" SHORT = "qt" ! OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController") def main(): --- 9,13 ---- LONG = "QuickTime" SHORT = "qt" ! OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", "IdleManager") def main(): *************** *** 92,95 **** --- 92,99 ---- "SampleReferencePtr", "QTTweener", + "QTErrorReplacementPtr", + "QTRestrictionSet", + "QTUUID", + "QTUUID_ptr", # Routine pointers, not yet. *************** *** 110,113 **** --- 114,118 ---- "QTBandwidthNotificationUPP", "DoMCActionUPP", + "QTNextTaskNeededSoonerCallbackUPP", "SampleReference64Ptr", # Don't know what this does, yet Index: qtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtsupport.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** qtsupport.py 19 Nov 2003 16:13:33 -0000 1.22 --- qtsupport.py 2 Jan 2004 23:27:42 -0000 1.23 *************** *** 116,119 **** --- 116,120 ---- TimeBase = OpaqueByValueType('TimeBase', 'TimeBaseObj') MovieController = OpaqueByValueType('MovieController', 'MovieCtlObj') + IdleManager = OpaqueByValueType('IdleManager', 'IdleManagerObj') # Other opaque objects *************** *** 231,234 **** --- 232,242 ---- Output("DisposeMovieController(%s);", itselfname) + class IdleManagerObjectDefinition(PEP253Mixin, GlobalObjectDefinition): + def outputCheckNewArg(self): + Output("""if (itself == NULL) { + PyErr_SetString(Qt_Error,"Cannot create null IdleManager"); + return NULL; + }""") + # From here on it's basically all boiler plate... *************** *** 241,245 **** --- 249,255 ---- TimeBase_object = TimeBaseObjectDefinition('TimeBase', 'TimeBaseObj', 'TimeBase') MovieController_object = MovieCtlObjectDefinition('MovieController', 'MovieCtlObj', 'MovieController') + IdleManager_object = IdleManagerObjectDefinition('IdleManager', 'IdleManagerObj', 'IdleManager') + module.addobject(IdleManager_object) module.addobject(MovieController_object) module.addobject(TimeBase_object) *************** *** 255,258 **** --- 265,269 ---- # Create and populate the lists functions = [] + IdleManager_methods = [] MovieController_methods = [] TimeBase_methods = [] From jackjansen at users.sourceforge.net Fri Jan 2 18:51:24 2004 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Fri Jan 2 18:51:28 2004 Subject: [Python-checkins] python/dist/src/Mac/Modules/qt _Qtmodule.c, 1.18, 1.19 qtscan.py, 1.23, 1.24 qtsupport.py, 1.23, 1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory sc8-pr-cvs1:/tmp/cvs-serv22491 Modified Files: _Qtmodule.c qtscan.py qtsupport.py Log Message: Added support for ImageCompression.h APIs. Index: _Qtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** _Qtmodule.c 2 Jan 2004 23:27:42 -0000 1.18 --- _Qtmodule.c 2 Jan 2004 23:51:22 -0000 1.19 *************** *** 10183,10186 **** --- 10183,14092 ---- } + static PyObject *Qt_CodecManagerVersion(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + OSErr _err; + long version; + #ifndef CodecManagerVersion + PyMac_PRECHECK(CodecManagerVersion); [...4248 lines suppressed...] + {"GraphicsExportGetOutputMark", (PyCFunction)Qt_GraphicsExportGetOutputMark, 1, + PyDoc_STR("(GraphicsExportComponent ci) -> (ComponentResult _rv, unsigned long mark)")}, + {"GraphicsExportReadOutputData", (PyCFunction)Qt_GraphicsExportReadOutputData, 1, + PyDoc_STR("(GraphicsExportComponent ci, void * dataPtr, unsigned long dataOffset, unsigned long dataSize) -> (ComponentResult _rv)")}, + {"GraphicsExportSetThumbnailEnabled", (PyCFunction)Qt_GraphicsExportSetThumbnailEnabled, 1, + PyDoc_STR("(GraphicsExportComponent ci, Boolean enableThumbnail, long maxThumbnailWidth, long maxThumbnailHeight) -> (ComponentResult _rv)")}, + {"GraphicsExportGetThumbnailEnabled", (PyCFunction)Qt_GraphicsExportGetThumbnailEnabled, 1, + PyDoc_STR("(GraphicsExportComponent ci) -> (ComponentResult _rv, Boolean thumbnailEnabled, long maxThumbnailWidth, long maxThumbnailHeight)")}, + {"GraphicsExportSetExifEnabled", (PyCFunction)Qt_GraphicsExportSetExifEnabled, 1, + PyDoc_STR("(GraphicsExportComponent ci, Boolean enableExif) -> (ComponentResult _rv)")}, + {"GraphicsExportGetExifEnabled", (PyCFunction)Qt_GraphicsExportGetExifEnabled, 1, + PyDoc_STR("(GraphicsExportComponent ci) -> (ComponentResult _rv, Boolean exifEnabled)")}, + {"ImageTranscoderBeginSequence", (PyCFunction)Qt_ImageTranscoderBeginSequence, 1, + PyDoc_STR("(ImageTranscoderComponent itc, ImageDescriptionHandle srcDesc, void * data, long dataSize) -> (ComponentResult _rv, ImageDescriptionHandle dstDesc)")}, + {"ImageTranscoderDisposeData", (PyCFunction)Qt_ImageTranscoderDisposeData, 1, + PyDoc_STR("(ImageTranscoderComponent itc, void * dstData) -> (ComponentResult _rv)")}, + {"ImageTranscoderEndSequence", (PyCFunction)Qt_ImageTranscoderEndSequence, 1, + PyDoc_STR("(ImageTranscoderComponent itc) -> (ComponentResult _rv)")}, {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1, PyDoc_STR("(WindowPtr wp, Boolean front) -> None")}, Index: qtscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtscan.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** qtscan.py 2 Jan 2004 23:27:42 -0000 1.23 --- qtscan.py 2 Jan 2004 23:51:22 -0000 1.24 *************** *** 12,16 **** def main(): ! input = "Movies.h" output = SHORT + "gen.py" defsoutput = TOOLBOXDIR + LONG + ".py" --- 12,16 ---- def main(): ! input = ("Movies.h", "ImageCompression.h") output = SHORT + "gen.py" defsoutput = TOOLBOXDIR + LONG + ".py" *************** *** 77,80 **** --- 77,82 ---- 'Media3DGetViewObject', + # these are ImageCompression blacklists + "GraphicsExportGetInputPtr", ] *************** *** 123,126 **** --- 125,160 ---- "SpriteWorld", "Sprite", + + # these are ImageCompression blacklists + "ICMDataUPP", + "ICMFlushUPP", + "ICMCompletionUPP", + "ICMProgressUPP", + "StdPixUPP", + "QDPixUPP", + "ICMAlignmentUPP", + "ICMCursorShieldedUPP", + "ICMMemoryDisposedUPP", + "ICMConvertDataFormatUPP", + "ModalFilterYDUPP", + "FileFilterUPP", + + "CodecNameSpecListPtr", + "CodecInfo", + "ImageSequence", + "MatrixRecordPtr", + "ICMDataProcRecordPtr", + "OpenCPicParams", + "ICMProgressProcRecordPtr", + "ICMAlignmentProcRecordPtr", + "ICMPixelFormatInfoPtr", + "ImageSequenceDataSource", + "ConstStrFileNameParam", + "ImageTranscodeSequence", + "ImageFieldSequence", + "Fract", + "PixMapPtr", + "GWorldFlags", + "void_ptr", # XXX Being lazy, this one is doable. ] Index: qtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtsupport.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** qtsupport.py 2 Jan 2004 23:27:42 -0000 1.23 --- qtsupport.py 2 Jan 2004 23:51:22 -0000 1.24 *************** *** 122,125 **** --- 122,132 ---- MediaHandlerComponent = OpaqueByValueType('MediaHandlerComponent', 'CmpObj') DataHandlerComponent = OpaqueByValueType('DataHandlerComponent', 'CmpObj') + CompressorComponent = OpaqueByValueType('CompressorComponent', 'CmpObj') + DecompressorComponent = OpaqueByValueType('DecompressorComponent', 'CmpObj') + CodecComponent = OpaqueByValueType('CodecComponent', 'CmpObj') + GraphicsImportComponent = OpaqueByValueType('GraphicsImportComponent', 'CmpObj') + GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', 'CmpObj') + ImageTranscoderComponent = OpaqueByValueType('ImageTranscoderComponent', 'CmpObj') + ComponentInstance = OpaqueByValueType('ComponentInstance', 'CmpInstObj') *************** *** 173,176 **** --- 180,184 ---- GWorldPtr = OpaqueByValueType("GWorldPtr", "GWorldObj") QTFloatSingle = Type("QTFloatSingle", "f") + CodecQ = Type("CodecQ", "l") # Could-not-be-bothered-types (NewMovieFromFile) From tim_one at users.sourceforge.net Sat Jan 3 00:46:02 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat Jan 3 00:46:08 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 readme.txt, NONE, 1.1 _bsddb.dsp, 1.1, 1.2 _csv.dsp, 1.1, 1.2 _socket.dsp, 1.1, 1.2 _sre.dsp, 1.1, 1.2 _ssl.dsp, 1.1, 1.2 _symtable.dsp, 1.1, 1.2 _testcapi.dsp, 1.1, 1.2 _tkinter.dsp, 1.1, 1.2 bz2.dsp, 1.1, 1.2 datetime.dsp, 1.1, 1.2 make_versioninfo.dsp, 1.1, 1.2 mmap.dsp, 1.1, 1.2 parser.dsp, 1.1, 1.2 pyexpat.dsp, 1.1, 1.2 python.dsp, 1.1, 1.2 pythoncore.dsp, 1.1, 1.2 pythonw.dsp, 1.1, 1.2 select.dsp, 1.1, 1.2 unicodedata.dsp, 1.1, 1.2 w9xpopen.dsp, 1.1, 1.2 winreg.dsp, 1.1, 1.2 winsound.dsp, 1.1, 1.2 zlib.dsp, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv10373 Modified Files: _bsddb.dsp _csv.dsp _socket.dsp _sre.dsp _ssl.dsp _symtable.dsp _testcapi.dsp _tkinter.dsp bz2.dsp datetime.dsp make_versioninfo.dsp mmap.dsp parser.dsp pyexpat.dsp python.dsp pythoncore.dsp pythonw.dsp select.dsp unicodedata.dsp w9xpopen.dsp winreg.dsp winsound.dsp zlib.dsp Added Files: readme.txt Log Message: Tons of changes to get this closer to being buildable from this directory; still far away, but a lot closer than it was. --- NEW FILE: readme.txt --- Building Python using VC++ 6.0 or 5.0 ------------------------------------- This directory is used to build Python for Win32 platforms, e.g. Windows 95, 98 and NT. It requires Microsoft Visual C++ 6.x or 5.x. (For other Windows platforms and compilers, see ../readme.txt.) All you need to do is open the workspace "pcbuild.dsw" in MSVC++, select the Debug or Release setting (using Build -> Set Active Configuration...), and build the projects. The proper order to build subprojects: 1) pythoncore (this builds the main Python DLL and library files, python21.{dll, lib} in Release mode) NOTE: in previous releases, this subproject was named after the release number, e.g. python20. 2) python (this builds the main Python executable, python.exe in Release mode) 3) the other subprojects, as desired or needed (note: you probably don't want to build most of the other subprojects, unless you're building an entire Python distribution from scratch, or specifically making changes to the subsystems they implement; see SUBPROJECTS below) When using the Debug setting, the output files have a _d added to their name: python21_d.dll, python_d.exe, parser_d.pyd, and so on. SUBPROJECTS ----------- These subprojects should build out of the box. Subprojects other than the main ones (pythoncore, python, pythonw) generally build a DLL (renamed to .pyd) from a specific module so that users don't have to load the code supporting that module unless they import the module. pythoncore .dll and .lib python .exe pythonw pythonw.exe, a variant of python.exe that doesn't pop up a DOS box _csv C support for the comma-separated values module _socket socketmodule.c _sre Unicode-aware regular expression engine _symtable the _symtable module, symtablemodule.c _testcapi tests of the Python C API, run via Lib/test/test_capi.py, and implemented by module Modules/_testcapimodule.c datetime datetimemodule.c mmap mmapmodule.c 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 unicodedata large tables of Unicode data winreg Windows registry API winsound play sounds (typically .wav files) under Windows The following subprojects will generally NOT build out of the box. They wrap code Python doesn't control, and you'll need to download the base packages first and unpack them into siblings of PCbuilds's parent directory; for example, if your PCbuild is .......\dist\src\PCbuild\, unpack into new subdirectories of dist\. _tkinter Python wrapper for the Tk windowing system. Requires building Tcl/Tk first. Following are instructions for Tcl/Tk 8.4.3: Get source ---------- Go to http://prdownloads.sourceforge.net/tcl/ and download tcl843-src.zip tk843-src.zip Unzip into dist\tcl8.4.3\ dist\tk8.4.3\ respectively. Build Tcl first (done here w/ MSVC 6 on Win98SE) --------------- cd dist\tcl8.4.3\win run vcvars32.bat [necessary even on Win2K] nmake -f makefile.vc nmake -f makefile.vc INSTALLDIR=..\..\tcl84 install XXX Should we compile with OPTS=threads? XXX Some tests failed in "nmake -f makefile.vc test". XXX all.tcl: Total 10480 Passed 9743 Skipped 719 Failed 18 XXX XXX That was on Win98SE. On Win2K: XXX all.tcl Total 10480 Passed 9781 Skipped 698 Failed 1 Build Tk -------- cd dist\tk8.4.3\win nmake -f makefile.vc TCLDIR=..\..\tcl8.4.3 nmake -f makefile.vc TCLDIR=..\..\tcl8.4.3 INSTALLDIR=..\..\tcl84 install XXX Should we compile with OPTS=threads? XXX I have no idea whether "nmake -f makefile.vc test" passed or XXX failed. It popped up tons of little windows, and did lots of XXX stuff, and nothing blew up. XXX Our installer copies a lot of stuff out of the Tcl/Tk install XXX directory. Is all of that really needed for Python use of Tcl/Tk? Make sure the installer matches ------------------------------- Ensure that the Wise compiler vrbl _TCLDIR_ is set to the name of the common Tcl/Tk installation directory (tcl84 for the instructions above). This is needed so the installer can copy various Tcl/Tk files into the Python distribution. zlib Python wrapper for the zlib compression library. Get the source code for version 1.1.4 from a convenient mirror at: http://www.gzip.org/zlib/ Unpack into dist\zlib-1.1.4. A custom pre-link step in the zlib project settings should manage to build zlib-1.1.4\zlib.lib by magic before zlib.pyd (or zlib_d.pyd) is linked in PCbuild\. However, the zlib project is not smart enough to remove anything under zlib-1.1.4\ when you do a clean, so if you want to rebuild zlib.lib you need to clean up zlib-1.1.4\ by hand. bz2 Python wrapper for the libbz2 compression library. Homepage http://sources.redhat.com/bzip2/ Download the source tarball, bzip2-1.0.2.tar.gz. Unpack into dist\bzip2-1.0.2. WARNING: If you're using WinZip, you must disable its "TAR file smart CR/LF conversion" feature (under Options -> Configuration -> Miscellaneous -> Other) for the duration. A custom pre-link step in the bz2 project settings should manage to build bzip2-1.0.2\libbz2.lib by magic before bz2.pyd (or bz2_d.pyd) is linked in PCbuild\. However, the bz2 project is not smart enough to remove anything under bzip2-1.0.2\ when you do a clean, so if you want to rebuild bzip2.lib you need to clean up bzip2-1.0.2\ by hand. The build step shouldn't yield any warnings or errors, and should end by displaying 6 blocks each terminated with FC: no differences encountered If FC finds differences, see the warning abou WinZip above (when I first tried it, sample3.ref failed due to CRLF conversion). All of this managed to build bzip2-1.0.2\libbz2.lib, which the Python project links in. _bsddb Go to Sleepycat's download page: http://www.sleepycat.com/download/ and download version 4.1.25. The file name is db-4.1.25.NC.zip. XXX with or without strong cryptography? I picked "without". Unpack into dist\db-4.1.25 [If using WinZip to unpack the db-4.1.25.NC distro, that requires renaming the directory (to remove ".NC") after unpacking. ] Open dist\db-4.1.25\docs\index.html and follow the Windows instructions for building the Sleepycat software. Note that Berkeley_DB.dsw is in the build_win32 subdirectory. Build the Release version ("build_all -- Win32 Release"). XXX We're actually linking against Release_static\libdb41s.lib. XXX This yields the following warnings: """ Compiling... _bsddb.c Linking... Creating library ./_bsddb.lib and object ./_bsddb.exp LINK : warning LNK4049: locally defined symbol "_malloc" imported LINK : warning LNK4049: locally defined symbol "_free" imported LINK : warning LNK4049: locally defined symbol "_fclose" imported LINK : warning LNK4049: locally defined symbol "_fopen" imported _bsddb.pyd - 0 error(s), 4 warning(s) """ XXX This isn't encouraging, but I don't know what to do about it. To run extensive tests, pass "-u bsddb" to regrtest.py. test_bsddb3.py is then enabled. Running in verbose mode may be helpful. XXX The test_bsddb3 tests don't always pass, on Windows (according to XXX me) or on Linux (according to Barry). I had much better luck XXX on Win2K than on Win98SE. The common failure mode across platforms XXX is XXX DBAgainError: (11, 'Resource temporarily unavailable -- unable XXX to join the environment') XXX XXX and it appears timing-dependent. On Win2K I also saw this once: XXX XXX test02_SimpleLocks (bsddb.test.test_thread.HashSimpleThreaded) ... XXX Exception in thread reader 1: XXX Traceback (most recent call last): XXX File "C:\Code\python\lib\threading.py", line 411, in __bootstrap XXX self.run() XXX File "C:\Code\python\lib\threading.py", line 399, in run XXX apply(self.__target, self.__args, self.__kwargs) XXX File "C:\Code\python\lib\bsddb\test\test_thread.py", line 268, in XXX readerThread XXX rec = c.next() XXX DBLockDeadlockError: (-30996, 'DB_LOCK_DEADLOCK: Locker killed XXX to resolve a deadlock') XXX XXX I'm told that DBLockDeadlockError is expected at times. It XXX doesn't cause a test to fail when it happens (exceptions in XXX threads are invisible to unittest). _ssl Python wrapper for the secure sockets library. Get the latest source code for OpenSSL from http://www.openssl.org You (probably) don't want the "engine" code. For example, get openssl-0.9.6g.tar.gz not openssl-engine-0.9.6g.tar.gz Unpack into the "dist" directory, retaining the folder name from the archive - for example, the latest stable OpenSSL will install as dist/openssl-0.9.6g You can (theoretically) use any version of OpenSSL you like - the build process will automatically select the latest version. You must also install ActivePerl from http://www.activestate.com/Products/ActivePerl/ as this is used by the OpenSSL build process. Complain to them . The MSVC project simply invokes PCBuild/build_ssl.py to perform the build. This Python script locates and builds your OpenSSL installation, then invokes a simple makefile to build the final .pyd. Win9x users: see "Win9x note" below. build_ssl.py attempts to catch the most common errors (such as not being able to find OpenSSL sources, or not being able to find a Perl that works with OpenSSL) and give a reasonable error message. If you have a problem that doesn't seem to be handled correctly (eg, you know you have ActivePerl but we can't find it), please take a peek at build_ssl.py and suggest patches. Note that build_ssl.py should be able to be run directly from the command-line. build_ssl.py/MSVC isn't clever enough to clean OpenSSL - you must do this by hand. Win9x note: If, near the start of the build process, you see something like C:\Code\openssl-0.9.6g>set OPTS=no-asm Out of environment space then you're in trouble, and will probably also see these errors near the end of the process: NMAKE : fatal error U1073: don't know how to make 'crypto\md5\asm\m5_win32.asm' Stop. NMAKE : fatal error U1073: don't know how to make 'C:\Code\openssl-0.9.6g/out32/libeay32.lib' Stop. You need more environment space. Win9x only has room for 256 bytes by default, and especially after installing ActivePerl (which fiddles the PATH envar), you're likely to run out. KB Q230205 http://support.microsoft.com/default.aspx?scid=KB;en-us;q230205 explains how to edit CONFIG.SYS to cure this. YOUR OWN EXTENSION DLLs ----------------------- If you want to create your own extension module DLL, there's an example with easy-to-follow instructions in ../PC/example/; read the file readme.txt there first. Index: _bsddb.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/_bsddb.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _bsddb.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- _bsddb.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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 "..\..\db-4.1.25\build_win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 ".." /I "..\..\..\db-4.1.25\build_win32" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 73,77 **** F90=df.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 "..\..\db-4.1.25\build_win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 73,77 ---- F90=df.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 ".." /I "..\..\..\db-4.1.25\build_win32" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\_bsddb.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\_bsddb.c # End Source File # End Target Index: _csv.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/_csv.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _csv.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- _csv.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 ".." /I "C:\Program Files\Tcl\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 73,77 **** F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 73,77 ---- F90=df.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 ".." /I "C:\Program Files\Tcl\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\_csv.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\_csv.c # End Source File # End Target Index: _socket.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/_socket.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _socket.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- _socket.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 73,77 **** F90=df.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" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 73,77 ---- F90=df.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 ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\socketmodule.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\socketmodule.c # End Source File # End Target Index: _sre.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/_sre.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _sre.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- _sre.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 73,77 **** F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 73,77 ---- F90=df.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 ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\_sre.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\_sre.c # End Source File # End Target Index: _ssl.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/_ssl.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _ssl.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- _ssl.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 84,88 **** # Begin Source File ! SOURCE=..\Modules\_ssl.c # End Source File # End Target --- 84,88 ---- # Begin Source File ! SOURCE=..\..\Modules\_ssl.c # End Source File # End Target Index: _symtable.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/_symtable.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _symtable.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- _symtable.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 45,49 ---- F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 73,77 **** F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 73,77 ---- F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\symtablemodule.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\symtablemodule.c # End Source File # End Target Index: _testcapi.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/_testcapi.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _testcapi.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- _testcapi.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 45,49 ---- F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 73,77 **** F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 73,77 ---- F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\_testcapimodule.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\_testcapimodule.c # End Source File # End Target Index: _tkinter.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/_tkinter.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** _tkinter.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- _tkinter.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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 "..\..\tcl84\include" /I "..\Include" /I "..\PC" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "WITH_APPINIT" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 "..\..\..\tcl84\include" /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "WITH_APPINIT" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 73,77 **** F90=df.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 "..\..\tcl84\include" /I "..\Include" /I "..\PC" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "WITH_APPINIT" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 73,77 ---- F90=df.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 "..\..\..\tcl84\include" /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "WITH_APPINIT" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 94,102 **** # Begin Source File ! SOURCE=..\Modules\_tkinter.c # End Source File # Begin Source File ! SOURCE=..\Modules\tkappinit.c # End Source File # End Target --- 94,102 ---- # Begin Source File ! SOURCE=..\..\Modules\_tkinter.c # End Source File # Begin Source File ! SOURCE=..\..\Modules\tkappinit.c # End Source File # End Target Index: bz2.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/bz2.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bz2.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- bz2.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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 "..\..\bzip2-1.0.2" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 ".." /I "..\..\..\bzip2-1.0.2" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 77,81 **** F90=df.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 "..\..\bzip2-1.0.2" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 77,81 ---- F90=df.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 ".." /I "..\..\..\bzip2-1.0.2" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 102,106 **** # Begin Source File ! SOURCE=..\Modules\bz2module.c # End Source File # End Target --- 102,106 ---- # Begin Source File ! SOURCE=..\..\Modules\bz2module.c # End Source File # End Target Index: datetime.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/datetime.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** datetime.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- datetime.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 73,77 **** F90=df.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" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 73,77 ---- F90=df.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 ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\datetimemodule.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\datetimemodule.c # End Source File # End Target Index: make_versioninfo.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/make_versioninfo.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** make_versioninfo.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- make_versioninfo.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 43,47 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" --- 43,47 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" *************** *** 57,62 **** SOURCE="$(InputPath)" ! "..\PC\pythonnt_rc.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" ! .\make_versioninfo.exe >..\PC\pythonnt_rc.h # End Custom Build --- 57,62 ---- SOURCE="$(InputPath)" ! "..\pythonnt_rc.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" ! .\make_versioninfo.exe >..\pythonnt_rc.h # End Custom Build *************** *** 76,82 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" ! # ADD RSC /l 0x409 /i "..\Include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo --- 76,82 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" ! # ADD RSC /l 0x409 /i "..\..\Include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo *************** *** 90,95 **** SOURCE="$(InputPath)" ! "..\PC\pythonnt_rc_d.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" ! .\make_versioninfo_d.exe >..\PC\pythonnt_rc_d.h # End Custom Build --- 90,95 ---- SOURCE="$(InputPath)" ! "..\pythonnt_rc_d.h" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)" ! .\make_versioninfo_d.exe >..\pythonnt_rc_d.h # End Custom Build *************** *** 103,107 **** # Begin Source File ! SOURCE=..\PC\make_versioninfo.c # End Source File # End Target --- 103,107 ---- # Begin Source File ! SOURCE=..\..\make_versioninfo.c # End Source File # End Target Index: mmap.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/mmap.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mmap.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- mmap.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 45,49 ---- F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 73,77 **** F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 73,77 ---- F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\mmapmodule.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\mmapmodule.c # End Source File # End Target Index: parser.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/parser.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** parser.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- parser.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 ".." /I "C:\Program Files\Tcl\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 73,77 **** F90=df.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 "C:\Program Files\Tcl\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 73,77 ---- F90=df.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 ".." /I "C:\Program Files\Tcl\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\parsermodule.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\parsermodule.c # End Source File # End Target Index: pyexpat.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/pyexpat.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pyexpat.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- pyexpat.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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 "XML_NS" /D "XML_DTD" /D BYTEORDER=1234 /D XML_CONTEXT_BYTES=1024 /D "XML_STATIC" /D "HAVE_MEMMOVE" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 ".." /I "..\..\Modules\expat" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /D "XML_DTD" /D BYTEORDER=1234 /D XML_CONTEXT_BYTES=1024 /D "XML_STATIC" /D "HAVE_MEMMOVE" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 73,77 **** F90=df.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 "HAVE_EXPAT_H" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /D "XML_DTD" /D BYTEORDER=1234 /D XML_CONTEXT_BYTES=1024 /D "XML_STATIC" /D "HAVE_MEMMOVE" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 73,77 ---- F90=df.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 ".." /I "..\..\Modules\expat" /D "_DEBUG" /D "HAVE_EXPAT_H" /D "WIN32" /D "_WINDOWS" /D "XML_NS" /D "XML_DTD" /D BYTEORDER=1234 /D XML_CONTEXT_BYTES=1024 /D "XML_STATIC" /D "HAVE_MEMMOVE" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 94,110 **** # Begin Source File ! SOURCE=..\Modules\pyexpat.c # End Source File # Begin Source File ! SOURCE=..\Modules\expat\xmlparse.c # End Source File # Begin Source File ! SOURCE=..\Modules\expat\xmlrole.c # End Source File # Begin Source File ! SOURCE=..\Modules\expat\xmltok.c # End Source File # End Target --- 94,110 ---- # Begin Source File ! SOURCE=..\..\Modules\pyexpat.c # End Source File # Begin Source File ! SOURCE=..\..\Modules\expat\xmlparse.c # End Source File # Begin Source File ! SOURCE=..\..\Modules\expat\xmlrole.c # End Source File # Begin Source File ! SOURCE=..\..\Modules\expat\xmltok.c # End Source File # End Target Index: python.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/python.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** python.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- python.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 43,47 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" --- 43,47 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" *************** *** 68,74 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" ! # ADD RSC /l 0x409 /i "..\Include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo --- 68,74 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c # ADD BASE RSC /l 0x409 /d "_DEBUG" ! # ADD RSC /l 0x409 /i "....\\Include" /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo *************** *** 87,99 **** # Begin Source File ! SOURCE=..\PC\pycon.ico # End Source File # Begin Source File ! SOURCE=..\Modules\python.c # End Source File # Begin Source File ! SOURCE=..\PC\python_exe.rc # End Source File # End Target --- 87,99 ---- # Begin Source File ! SOURCE=..\pycon.ico # End Source File # Begin Source File ! SOURCE=..\..\Modules\python.c # End Source File # Begin Source File ! SOURCE=..\python_exe.rc # End Source File # End Target Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/pythoncore.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pythoncore.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- pythoncore.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,53 **** F90=df.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" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "USE_DL_EXPORT" /YX /FD /Zm200 /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o /win32 "NUL" # ADD BASE RSC /l 0x409 /d "NDEBUG" ! # ADD RSC /l 0x409 /i "..\Include" /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo --- 45,53 ---- [...963 lines suppressed...] ! SOURCE=..\..\Objects\weakrefobject.c # End Source File # Begin Source File ! SOURCE=..\..\Modules\xreadlinesmodule.c # End Source File # Begin Source File ! SOURCE=..\..\Modules\xxsubtype.c # End Source File # Begin Source File ! SOURCE=..\..\Modules\yuvconvert.c # End Source File # Begin Source File ! SOURCE=..\..\Modules\zipimport.c # End Source File # End Target Index: pythonw.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/pythonw.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pythonw.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- pythonw.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 44,48 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 44,48 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /Zi /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 71,75 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /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" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 71,75 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /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 ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 92,100 **** # Begin Source File ! SOURCE=..\PC\python_exe.rc # End Source File # Begin Source File ! SOURCE=..\PC\WinMain.c # End Source File # End Target --- 92,100 ---- # Begin Source File ! SOURCE=..\python_exe.rc # End Source File # Begin Source File ! SOURCE=..\WinMain.c # End Source File # End Target Index: select.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/select.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** select.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- select.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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 "..\..\select113" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 ".." /I "..\..\..\select113" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 73,77 **** F90=df.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 "..\..\select113" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 73,77 ---- F90=df.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 ".." /I "..\..\..\select113" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\selectmodule.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\selectmodule.c # End Source File # End Target Index: unicodedata.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/unicodedata.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** unicodedata.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- unicodedata.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 45,49 ---- F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 73,77 **** F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 73,77 ---- F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MMAP_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\Modules\unicodedata.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\..\Modules\unicodedata.c # End Source File # End Target Index: w9xpopen.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/w9xpopen.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** w9xpopen.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- w9xpopen.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 92,96 **** # Begin Source File ! SOURCE=..\PC\w9xpopen.c # End Source File # End Target --- 92,96 ---- # Begin Source File ! SOURCE=..\w9xpopen.c # End Source File # End Target Index: winreg.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/winreg.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** winreg.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- winreg.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "winreg_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 45,49 ---- F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "winreg_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\Include" /I ".." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 72,76 **** F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "winreg_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\Include" /I "..\PC" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 72,76 ---- F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "winreg_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "..\..\Include" /I ".." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 92,96 **** # Begin Source File ! SOURCE=..\PC\_winreg.c !IF "$(CFG)" == "winreg - Win32 Release" --- 92,96 ---- # Begin Source File ! SOURCE=..\_winreg.c !IF "$(CFG)" == "winreg - Win32 Release" Index: winsound.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/winsound.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** winsound.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- winsound.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\Include" /I "..\PC" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 45,49 ---- F90=df.exe # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\Include" /I ".." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 73,77 **** F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\Include" /I "..\PC" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 73,77 ---- F90=df.exe # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /GZ /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "..\..\Include" /I ".." /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINSOUND_EXPORTS" /YX /FD /GZ /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 94,98 **** # Begin Source File ! SOURCE=..\PC\winsound.c # End Source File # End Target --- 94,98 ---- # Begin Source File ! SOURCE=..\winsound.c # End Source File # End Target Index: zlib.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/zlib.dsp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** zlib.dsp 2 Jan 2004 21:15:07 -0000 1.1 --- zlib.dsp 3 Jan 2004 05:45:59 -0000 1.2 *************** *** 45,49 **** F90=df.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 "..\..\zlib-1.1.4" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 --- 45,49 ---- F90=df.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 ".." /I "..\..\..\zlib-1.1.4" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 55,64 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 ! # ADD LINK32 ..\..\zlib-1.1.4\zlib.lib /nologo /base:"0x1e1B0000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./zlib.pyd" # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" PreLink_Desc=Checking static zlib has been built ! PreLink_Cmds=cd ..\..\zlib-1.1.4 nmake -nologo -f msdos\makefile.w32 zlib.lib # End Special Build Tool --- 55,64 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 ! # ADD LINK32 ..\..\..\zlib-1.1.4\zlib.lib /nologo /base:"0x1e1B0000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./zlib.pyd" # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" PreLink_Desc=Checking static zlib has been built ! PreLink_Cmds=cd ..\..\..\zlib-1.1.4 nmake -nologo -f msdos\makefile.w32 zlib.lib # End Special Build Tool *************** *** 78,82 **** F90=df.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 "..\..\zlib-1.1.4" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 --- 78,82 ---- F90=df.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 ".." /I "..\..\..\zlib-1.1.4" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /YX /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 *************** *** 88,97 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 ..\..\zlib-1.1.4\zlib.lib /nologo /base:"0x1e1B0000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./zlib_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" PreLink_Desc=Checking static zlib has been built ! PreLink_Cmds=cd ..\..\zlib-1.1.4 nmake -nologo -f msdos\makefile.w32 zlib.lib # End Special Build Tool --- 88,97 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 ..\..\..\zlib-1.1.4\zlib.lib /nologo /base:"0x1e1B0000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./zlib_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" PreLink_Desc=Checking static zlib has been built ! PreLink_Cmds=cd ..\..\..\zlib-1.1.4 nmake -nologo -f msdos\makefile.w32 zlib.lib # End Special Build Tool *************** *** 104,108 **** # Begin Source File ! SOURCE=..\Modules\zlibmodule.c # End Source File # End Target --- 104,108 ---- # Begin Source File ! SOURCE=..\..\Modules\zlibmodule.c # End Source File # End Target From goodger at users.sourceforge.net Sat Jan 3 11:18:13 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Sat Jan 3 11:18:17 2004 Subject: [Python-checkins] python/nondist/peps pep-0325.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv31787 Added Files: pep-0325.txt Log Message: added PEP 325, Resource-Release Support for Generators, by Samuele Pedroni --- NEW FILE: pep-0325.txt --- PEP: 325 Title: Resource-Release Support for Generators Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/01/03 16:18:11 $ Author: Samuele Pedroni Status: Draft Type: Standards Track Content-Type: text/plain Created: 25-Aug-2003 Python-Version: 2.4 Post-History: Abstract Generators allow for natural coding and abstraction of traversal over data. Currently if external resources needing proper timely release are involved, generators are unfortunately not adequate. The typical idiom for timely release is not supported, a yield statement is not allowed in the try clause of a try-finally statement inside a generator. The finally clause execution can be neither guaranteed nor enforced. This PEP proposes that the built-in generator type implement a close method and destruction semantics, such that the restriction on yield placement can be lifted, expanding the applicability of generators. Rationale Python generators allow for natural coding of many data traversal scenarios. Their instantiation produces iterators, i.e. first-class objects abstracting traversal (with all the advantages of first- classness). In this respect they match in power and offer some advantages over the approach using iterator methods taking a (smalltalkish) block. On the other hand, given current limitations (no yield allowed in a try clause of a try-finally inside a generator) the latter approach seems better suited to encapsulating not only traversal but also exception handling and proper resource acquisition and release. Let's consider an example (for simplicity, files in read-mode are used): def all_lines(index_path): for path in file(index_path, "r"): for line in file(path.strip(), "r"): yield line this is short and to the point, but the try-finally for timely closing of the files cannot be added. (While instead of a path, a file, whose closing then would be responsibility of the caller, could be passed in as argument, the same is not applicable for the files opened depending on the contents of the index). If we want timely release, we have to sacrifice the simplicity and directness of the generator-only approach: (e.g.) class AllLines: def __init__(self,index_path): self.index_path = index_path self.index = None self.document = None def __iter__(self): self.index = file(self.index_path,"r") for path in self.index: self.document = file(path.strip(),"r") for line in self.document: yield line self.document.close() self.document = None def close(self): if self.index: self.index.close() if self.document: self.document.close() to be used as: all_lines = AllLines("index.txt") try: for line in all_lines: ... finally: all_lines.close() The more convoluted solution implementing timely release, seems to offer a precious hint. What we have done is encapsulate our traversal in an object (iterator) with a close method. This PEP proposes that generators should grow such a close method with such semantics that the example could be rewritten as: # Today this is not valid Python: yield is not allowed between # try and finally, and generator type instances support no # close method. def all_lines(index_path): index = file(index_path,"r") try: for path in index: document = file(path.strip(),"r") try: for line in document: yield line finally: document.close() finally: index.close() all = all_lines("index.txt") try: for line in all: ... finally: all.close() # close on generator Currently PEP 255 [1] disallows yield inside a try clause of a try-finally statement, because the execution of the finally clause cannot be guaranteed as required by try-finally semantics. The semantics of the proposed close method should be such that while the finally clause execution still cannot be guaranteed, it can be enforced when required. Specifically, the close method behavior should trigger the execution of the finally clauses inside the generator, either by forcing a return in the generator frame or by throwing an exception in it. In situations requiring timely resource release, close could then be explicitly invoked. The semantics of generator destruction on the other hand should be extended in order to implement a best-effort policy for the general case. Specifically, destruction should invoke close(). The best-effort limitation comes from the fact that the destructor's execution is not guaranteed in the first place. This seems to be a reasonable compromise, the resulting global behavior being similar to that of files and closing. Possible Semantics The built-in generator type should have a close method implemented, which can then be invoked as: gen.close() where gen is an instance of the built-in generator type. Generator destruction should also invoke close method behavior. If a generator is already terminated, close should be a no-op. Otherwise, there are two alternative solutions, Return or Exception Semantics: A - Return Semantics: The generator should be resumed, generator execution should continue as if the instruction at the re-entry point is a return. Consequently finally clauses surrounding the re-entry point would be executed, in the case of a then allowed try-yield-finally pattern. Issues: is it important to be able to distinguish forced termination by close, normal termination, exception propagation from generator or generator-called code? In the normal case it seems not, finally clauses should be there to work the same in all these cases, still this semantics could make such a distinction hard. Except-clauses, like by a normal return, are not executed, such clauses in legacy generators expect to be executed for exceptions raised by the generator or by code called from it. Not executing them in the close case seems correct. B - Exception Semantics: The generator should be resumed and execution should continue as if a special-purpose exception (e.g. CloseGenerator) has been raised at re-entry point. Close implementation should consume and not propagate further this exception. Issues: should StopIteration be reused for this purpose? Probably not. We would like close to be a harmless operation for legacy generators, which could contain code catching StopIteration to deal with other generators/iterators. In general, with exception semantics, it is unclear what to do if the generator does not terminate or we do not receive the special exception propagated back. Other different exceptions should probably be propagated, but consider this possible legacy generator code: try: ... yield ... ... except: # or except Exception:, etc raise Exception("boom") If close is invoked with the generator suspended after the yield, the except clause would catch our special purpose exception, so we would get a different exception propagated back, which in this case ought to be reasonably consumed and ignored but in general should be propagated, but separating these scenarios seems hard. The exception approach has the advantage to let the generator distinguish between termination cases and have more control. On the other hand clear-cut semantics seem harder to define. Remarks If this proposal is accepted, it should become common practice to document whether a generator acquires resources, so that its close method ought to be called. If a generator is no longer used, calling close should be harmless. On the other hand, in the typical scenario the code that instantiated the generator should call close if required by it. Generic code dealing with iterators/generators instantiated elsewhere should typically not be littered with close calls. The rare case of code that has acquired ownership of and need to properly deal with all of iterators, generators and generators acquiring resources that need timely release, is easily solved: if hasattr(iterator, 'close'): iterator.close() Open Issues Definitive semantics ought to be chosen. Currently Guido favors Exception Semantics. If the generator yields a value instead of terminating, or propagating back the special exception, a special exception should be raised again on the generator side. It is still unclear whether spuriously converted special exceptions (as discussed in Possible Semantics) are a problem and what to do about them. Implementation issues should be explored. Alternative Ideas The idea that the yield placement limitation should be removed and that generator destruction should trigger execution of finally clauses has been proposed more than once. Alone it cannot guarantee that timely release of resources acquired by a generator can be enforced. PEP 288 [2] proposes a more general solution, allowing custom exception passing to generators. The proposal in this PEP addresses more directly the problem of resource release. Were PEP 288 implemented, Exceptions Semantics for close could be layered on top of it, on the other hand PEP 288 should make a separate case for the more general functionality. References [1] PEP 255 Simple Generators http://www.python.org/peps/pep-0255.html [2] PEP 288 Generators Attributes and Exceptions http://www.python.org/peps/pep-0288.html Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End: From goodger at users.sourceforge.net Sat Jan 3 11:23:17 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Sat Jan 3 11:23:21 2004 Subject: [Python-checkins] python/nondist/peps pep-0000.txt,1.259,1.260 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv529 Modified Files: pep-0000.txt Log Message: added PEP 325 Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.259 retrieving revision 1.260 diff -C2 -d -r1.259 -r1.260 *** pep-0000.txt 2 Jan 2004 20:53:01 -0000 1.259 --- pep-0000.txt 3 Jan 2004 16:23:15 -0000 1.260 *************** *** 121,124 **** --- 121,125 ---- S 323 Copyable Iterators Martelli S 324 popen5 - New POSIX process module Astrand + S 325 Resource-Release Support for Generators Pedroni S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 342,345 **** --- 343,347 ---- S 323 Copyable Iterators Martelli S 324 popen5 - New POSIX process module Astrand + S 325 Resource-Release Support for Generators Pedroni SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 409,412 **** --- 411,415 ---- Norwitz, Neal neal@metaslash.com Oliphant, Travis oliphant@ee.byu.edu + Pedroni, Samuele pedronis@python.org Pelletier, Michel michel@users.sourceforge.net Peters, Tim tim@zope.com From jackjansen at users.sourceforge.net Sat Jan 3 12:23:30 2004 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Sat Jan 3 12:23:33 2004 Subject: [Python-checkins] python/dist/src/Mac/Modules/qt _Qtmodule.c, 1.19, 1.20 qtscan.py, 1.24, 1.25 qtsupport.py, 1.24, 1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory sc8-pr-cvs1:/tmp/cvs-serv10409 Modified Files: _Qtmodule.c qtscan.py qtsupport.py Log Message: Added interfaces for most of the stuff in QuickTimeComponents.h. Index: _Qtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** _Qtmodule.c 2 Jan 2004 23:51:22 -0000 1.19 --- _Qtmodule.c 3 Jan 2004 17:23:26 -0000 1.20 *************** *** 7294,7297 **** --- 7294,7415 ---- + /* ---------------------- Object type SGOutput ---------------------- */ + + PyTypeObject SGOutput_Type; + + #define SGOutputObj_Check(x) ((x)->ob_type == &SGOutput_Type || PyObject_TypeCheck((x), &SGOutput_Type)) + + typedef struct SGOutputObject { [...9708 lines suppressed...] + {"QTVideoOutputGetIndImageDecompressor", (PyCFunction)Qt_QTVideoOutputGetIndImageDecompressor, 1, + PyDoc_STR("(QTVideoOutputComponent vo, long index) -> (ComponentResult _rv, Component codec)")}, + {"QTVideoOutputBaseSetEchoPort", (PyCFunction)Qt_QTVideoOutputBaseSetEchoPort, 1, + PyDoc_STR("(QTVideoOutputComponent vo, CGrafPtr echoPort) -> (ComponentResult _rv)")}, {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1, PyDoc_STR("(WindowPtr wp, Boolean front) -> None")}, *************** *** 14838,14841 **** --- 24543,24553 ---- Py_INCREF(&Movie_Type); PyModule_AddObject(m, "MovieType", (PyObject *)&Movie_Type); + SGOutput_Type.ob_type = &PyType_Type; + if (PyType_Ready(&SGOutput_Type) < 0) return; + Py_INCREF(&SGOutput_Type); + PyModule_AddObject(m, "SGOutput", (PyObject *)&SGOutput_Type); + /* Backward-compatible name */ + Py_INCREF(&SGOutput_Type); + PyModule_AddObject(m, "SGOutputType", (PyObject *)&SGOutput_Type); } Index: qtscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtscan.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** qtscan.py 2 Jan 2004 23:51:22 -0000 1.24 --- qtscan.py 3 Jan 2004 17:23:27 -0000 1.25 *************** *** 9,16 **** LONG = "QuickTime" SHORT = "qt" ! OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", "IdleManager") def main(): ! input = ("Movies.h", "ImageCompression.h") output = SHORT + "gen.py" defsoutput = TOOLBOXDIR + LONG + ".py" --- 9,18 ---- LONG = "QuickTime" SHORT = "qt" ! HEADERFILES= ("Movies.h", "ImageCompression.h", "QuickTimeComponents.h") ! OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", ! "IdleManager", "SGOutput") def main(): ! input = HEADERFILES output = SHORT + "gen.py" defsoutput = TOOLBOXDIR + LONG + ".py" *************** *** 18,21 **** --- 20,24 ---- scanner.scan() scanner.close() + scanner.gentypetest(SHORT+"typetest.py") print "=== Testing definitions output code ===" execfile(defsoutput, {}, {}) *************** *** 38,44 **** --- 41,49 ---- def writeinitialdefs(self): self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n") + self.defsfile.write("xmlIdentifierUnrecognized = -1\n") def makeblacklistnames(self): return [ + "xmlIdentifierUnrecognized", # const with incompatible definition "DisposeMovie", # Done on python-object disposal "DisposeMovieTrack", # ditto *************** *** 79,82 **** --- 84,94 ---- # these are ImageCompression blacklists "GraphicsExportGetInputPtr", + + # QuickTimeComponents + # These two need some help: the first returns a point to a databuffer that + # the second disposes. Generate manually? + "VDCompressDone", + "VDReleaseCompressBuffer", + "QTVideoOutputGetGWorldParameters", # How useful is this? ] *************** *** 157,160 **** --- 169,209 ---- "GWorldFlags", "void_ptr", # XXX Being lazy, this one is doable. + + # These are from QuickTimeComponents + "CDataHandlerUPP", + "CharDataHandlerUPP", + "CommentHandlerUPP", + "DataHCompletionUPP", + "'MovieExportGetDataUPP", + "MovieExportGetPropertyUPP", + "PreprocessInstructionHandlerUPP", + "SGModalFilterUPP", + "StartDocumentHandlerUPP", + "StartElementHandlerUPP", + "VdigIntUPP", + "SGDataUPP", + "EndDocumentHandlerUPP", + "EndElementHandlerUPP", + "VideoBottles", # Record full of UPPs + + "SCParams", + "ICMCompletionProcRecordPtr", + "DataHVolumeList", + "DigitizerInfo", + "SGCompressInfo", + "SeqGrabExtendedFrameInfoPtr", + "SeqGrabFrameInfoPtr", + "TCTextOptionsPtr", + "SGCompressInfo_ptr", + "SGDeviceList", + "TextDisplayData", + "TimeCodeDef", + "TimeCodeRecord", + "TweenRecord", + "VDGamRecPtr", + "ToneDescription", # XXXX Just lazy: this one is easy. + "XMLDoc", + "UInt64", # XXXX lazy + "UInt64_ptr", # XXXX lazy ] Index: qtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtsupport.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** qtsupport.py 2 Jan 2004 23:51:22 -0000 1.24 --- qtsupport.py 3 Jan 2004 17:23:27 -0000 1.25 *************** *** 117,120 **** --- 117,121 ---- MovieController = OpaqueByValueType('MovieController', 'MovieCtlObj') IdleManager = OpaqueByValueType('IdleManager', 'IdleManagerObj') + SGOutput = OpaqueByValueType('SGOutput', 'SGOutputObj') # Other opaque objects *************** *** 128,136 **** GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', 'CmpObj') ImageTranscoderComponent = OpaqueByValueType('ImageTranscoderComponent', 'CmpObj') ! ComponentInstance = OpaqueByValueType('ComponentInstance', 'CmpInstObj') MediaHandler = OpaqueByValueType('MediaHandler', 'CmpInstObj') DataHandler = OpaqueByValueType('DataHandler', 'CmpInstObj') RgnHandle = OpaqueByValueType("RgnHandle", "ResObj") --- 129,151 ---- GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', 'CmpObj') ImageTranscoderComponent = OpaqueByValueType('ImageTranscoderComponent', 'CmpObj') ! DataCodecComponent = OpaqueByValueType('DataCodecComponent', 'CmpObj') ! GraphicImageMovieImportComponent = OpaqueByValueType('GraphicImageMovieImportComponent', 'CmpObj') ! MovieExportComponent = OpaqueByValueType('MovieExportComponent', 'CmpObj') ! MovieImportComponent = OpaqueByValueType('MovieImportComponent', 'CmpObj') ! QTVideoOutputComponent = OpaqueByValueType('QTVideoOutputComponent', 'CmpObj') ! SeqGrabComponent = OpaqueByValueType('SeqGrabComponent', 'CmpObj') ! TextExportComponent = OpaqueByValueType('TextExportComponent', 'CmpObj') ! TweenerComponent = OpaqueByValueType('TweenerComponent', 'CmpObj') ! pnotComponent = OpaqueByValueType('pnotComponent', 'CmpObj') ! VideoDigitizerComponent = OpaqueByValueType('VideoDigitizerComponent', 'CmpObj') ComponentInstance = OpaqueByValueType('ComponentInstance', 'CmpInstObj') MediaHandler = OpaqueByValueType('MediaHandler', 'CmpInstObj') DataHandler = OpaqueByValueType('DataHandler', 'CmpInstObj') + SGChannel = OpaqueByValueType('SGChannel', 'CmpInstObj') + + ConstFSSpecPtr = FSSpec_ptr + GrafPtr = OpaqueByValueType("GrafPtr", "GrafObj") + Byte = Boolean # XXXX For GetPaused and SetPaused RgnHandle = OpaqueByValueType("RgnHandle", "ResObj") *************** *** 146,149 **** --- 161,168 ---- AliasHandle = OpaqueByValueType("AliasHandle", "ResObj") SoundDescriptionHandle = OpaqueByValueType("SoundDescriptionHandle", "ResObj") + VdigBufferRecListHandle = OpaqueByValueType("VdigBufferRecListHandle", "ResObj") + VDCompressionListHandle = OpaqueByValueType("VDCompressionListHandle", "ResObj") + TimeCodeDescriptionHandle = OpaqueByValueType("TimeCodeDescriptionHandle", "ResObj") + DataHFileTypeOrderingHandle = OpaqueByValueType("DataHFileTypeOrderingHandle", "ResObj") # Silly Apple, passing an OStype by reference... OSType_ptr = OpaqueType("OSType", "PyMac_BuildOSType", "PyMac_GetOSType") *************** *** 170,173 **** --- 189,193 ---- mediaHandlerFlagsEnum = Type("mediaHandlerFlagsEnum", "l") ComponentResult = Type("ComponentResult", "l") + VideoDigitizerError = Type("ComponentResult", "l") HandlerError = Type("HandlerError", "l") Ptr = InputOnlyType("Ptr", "s") *************** *** 247,250 **** --- 267,284 ---- }""") + class SGOutputObjectDefinition(PEP253Mixin, GlobalObjectDefinition): + # XXXX I'm not sure I fully understand how SGOutput works. It seems it's always tied + # to a specific SeqGrabComponent, but I'm not 100% sure. Also, I'm not sure all the + # routines that return an SGOutput actually return a *new* SGOutput. Need to read up on + # this. + def outputCheckNewArg(self): + Output("""if (itself == NULL) { + PyErr_SetString(Qt_Error,"Cannot create null SGOutput"); + return NULL; + }""") + # def outputFreeIt(self, itselfname): + # Output("SGDisposeOutput(%s);", itselfname) + + # From here on it's basically all boiler plate... *************** *** 258,261 **** --- 292,296 ---- MovieController_object = MovieCtlObjectDefinition('MovieController', 'MovieCtlObj', 'MovieController') IdleManager_object = IdleManagerObjectDefinition('IdleManager', 'IdleManagerObj', 'IdleManager') + SGOutput_object = SGOutputObjectDefinition('SGOutput', 'SGOutputObj', 'SGOutput') module.addobject(IdleManager_object) *************** *** 266,269 **** --- 301,308 ---- module.addobject(Track_object) module.addobject(Movie_object) + module.addobject(SGOutput_object) + + # Test which types we are still missing. + execfile(string.lower(MODPREFIX) + 'typetest.py') # Create the generator classes used to populate the lists *************** *** 280,283 **** --- 319,323 ---- Track_methods = [] Movie_methods = [] + SGOutput_methods = [] execfile(INPUTFILE) From perky at users.sourceforge.net Sat Jan 3 14:35:45 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sat Jan 3 14:35:48 2004 Subject: [Python-checkins] python/dist/src/Objects unicodeobject.c, 2.208, 2.209 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv488 Modified Files: unicodeobject.c Log Message: Cosmetic fix for wrongly indented tabs with ts=4. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.208 retrieving revision 2.209 diff -C2 -d -r2.208 -r2.209 *** unicodeobject.c 23 Dec 2003 09:10:16 -0000 2.208 --- unicodeobject.c 3 Jan 2004 19:35:43 -0000 2.209 *************** *** 1005,1010 **** if (!inShift) { ! if (ch == '+') { ! *out++ = '+'; *out++ = '-'; } else if (SPECIAL(ch, encodeSetO, encodeWhiteSpace)) { --- 1005,1010 ---- if (!inShift) { ! if (ch == '+') { ! *out++ = '+'; *out++ = '-'; } else if (SPECIAL(ch, encodeSetO, encodeWhiteSpace)) { *************** *** 1012,1021 **** bitsleft = 16; *out++ = '+'; ! /* out, charsleft, bitsleft = */ ENCODE(out, charsleft, bitsleft); inShift = bitsleft > 0; ! } else { ! *out++ = (char) ch; ! } ! } else { if (!SPECIAL(ch, encodeSetO, encodeWhiteSpace)) { *out++ = B64(charsleft << (6-bitsleft)); --- 1012,1021 ---- bitsleft = 16; *out++ = '+'; ! /* out, charsleft, bitsleft = */ ENCODE(out, charsleft, bitsleft); inShift = bitsleft > 0; ! } else { ! *out++ = (char) ch; ! } ! } else { if (!SPECIAL(ch, encodeSetO, encodeWhiteSpace)) { *out++ = B64(charsleft << (6-bitsleft)); *************** *** 1060,1064 **** } } ! } if (bitsleft) { *out++= B64(charsleft << (6-bitsleft) ); --- 1060,1064 ---- } } ! } if (bitsleft) { *out++= B64(charsleft << (6-bitsleft) ); From bwarsaw at users.sourceforge.net Sat Jan 3 20:12:28 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Sat Jan 3 20:12:33 2004 Subject: [Python-checkins] python/dist/src/Lib base64.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv25840/Lib Modified Files: base64.py Log Message: Added more complete RFC 3548 support for Base64, Base32, and Base16 encoding and decoding, including optional case folding and optional alternative alphabets. Index: base64.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/base64.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** base64.py 4 Sep 2001 19:14:13 -0000 1.13 --- base64.py 4 Jan 2004 01:12:26 -0000 1.14 *************** *** 1,11 **** #! /usr/bin/env python ! """Conversions to/from base64 transport encoding as per RFC-1521.""" ! # Modified 04-Oct-95 by Jack to use binascii module import binascii ! __all__ = ["encode","decode","encodestring","decodestring"] MAXLINESIZE = 76 # Excluding the CRLF --- 1,279 ---- #! /usr/bin/env python ! """RFC 3548: Base16, Base32, Base64 Data Encodings""" ! # Modified 04-Oct-1995 by Jack Jansen to use binascii module ! # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support + import re + import struct import binascii ! ! __all__ = [ ! # Legacy interface exports traditional RFC 1521 Base64 encodings ! 'encode', 'decode', 'encodestring', 'decodestring', ! # Generalized interface for other encodings ! 'b64encode', 'b64decode', 'b32encode', 'b32decode', ! 'b16encode', 'b16decode', ! # Standard Base64 encoding ! 'standard_b64encode', 'standard_b64decode', ! # Some common Base64 alternatives. As referenced by RFC 3458, see thread ! # starting at: ! # ! # http://zgp.org/pipermail/p2p-hackers/2001-September/000316.html ! 'freenet_b64encode', 'freenet_b64decode', ! 'urlsafe_b64encode', 'urlsafe_b64decode', ! ] ! ! _translation = [chr(_x) for _x in range(256)] ! EMPTYSTRING = '' ! ! ! def _translate(s, altchars): ! translation = _translation[:] ! for k, v in altchars.items(): ! translation[ord(k)] = v ! return s.translate(''.join(translation)) ! ! ! ! # Base64 encoding/decoding uses binascii ! ! def b64encode(s, altchars=None): ! """Encode a string using Base64. ! ! s is the string to encode. Optional altchars must be a string of at least ! length 2 (additional characters are ignored) which specifies an ! alternative alphabet for the '+' and '/' characters. This allows an ! application to e.g. generate url or filesystem safe Base64 strings. ! ! The encoded string is returned. ! """ ! # Strip off the trailing newline ! encoded = binascii.b2a_base64(s)[:-1] ! if altchars is not None: ! return _translate(encoded, {'+': altchars[0], '/': altchars[1]}) ! return encoded ! ! ! def b64decode(s, altchars=None): ! """Decode a Base64 encoded string. ! ! s is the string to decode. Optional altchars must be a string of at least ! length 2 (additional characters are ignored) which specifies the ! alternative alphabet used instead of the '+' and '/' characters. ! ! The decoded string is returned. A TypeError is raised if s were ! incorrectly padded or if there are non-alphabet characters present in the ! string. ! """ ! if altchars is not None: ! s = _translate(s, {altchars[0]: '+', altchars[1]: '/'}) ! try: ! return binascii.a2b_base64(s) ! except binascii.Error, msg: ! # Transform this exception for consistency ! raise TypeError(msg) ! ! ! def standard_b64encode(s): ! """Encode a string using the standard Base64 alphabet. ! ! s is the string to encode. The encoded string is returned. ! """ ! return b64encode(s) ! ! def standard_b64decode(s): ! """Decode a string encoded with the standard Base64 alphabet. ! ! s is the string to decode. The decoded string is returned. A TypeError ! is raised if the string is incorrectly padded or if there are non-alphabet ! characters present in the string. ! """ ! return b64decode(s) ! ! def urlsafe_b64encode(s): ! """Encode a string using a url-safe Base64 alphabet. ! ! s is the string to encode. The encoded string is returned. The alphabet ! uses '-' instead of '+' and '_' instead of '/'. ! """ ! return b64encode(s, '-_') ! ! def urlsafe_b64decode(s): ! """Decode a string encoded with the standard Base64 alphabet. ! ! s is the string to decode. The decoded string is returned. A TypeError ! is raised if the string is incorrectly padded or if there are non-alphabet ! characters present in the string. ! ! The alphabet uses '-' instead of '+' and '_' instead of '/'. ! """ ! return b64decode(s, '-_') ! ! ! ! # Base32 encoding/decoding must be done in Python ! _b32alphabet = { ! 0: 'A', 9: 'J', 18: 'S', 27: '3', ! 1: 'B', 10: 'K', 19: 'T', 28: '4', ! 2: 'C', 11: 'L', 20: 'U', 29: '5', ! 3: 'D', 12: 'M', 21: 'V', 30: '6', ! 4: 'E', 13: 'N', 22: 'W', 31: '7', ! 5: 'F', 14: 'O', 23: 'X', ! 6: 'G', 15: 'P', 24: 'Y', ! 7: 'H', 16: 'Q', 25: 'Z', ! 8: 'I', 17: 'R', 26: '2', ! } ! ! _b32tab = [v for v in _b32alphabet.values()] ! _b32rev = dict([(v, long(k)) for k, v in _b32alphabet.items()]) ! ! ! def b32encode(s): ! """Encode a string using Base32. ! ! s is the string to encode. The encoded string is returned. ! """ ! parts = [] ! quanta, leftover = divmod(len(s), 5) ! # Pad the last quantum with zero bits if necessary ! if leftover: ! s += ('\0' * (5 - leftover)) ! quanta += 1 ! for i in range(quanta): ! # c1 and c2 are 16 bits wide, c3 is 8 bits wide. The intent of this ! # code is to process the 40 bits in units of 5 bits. So we take the 1 ! # leftover bit of c1 and tack it onto c2. Then we take the 2 leftover ! # bits of c2 and tack them onto c3. The shifts and masks are intended ! # to give us values of exactly 5 bits in width. ! c1, c2, c3 = struct.unpack('!HHB', s[i*5:(i+1)*5]) ! c2 += (c1 & 1) << 16 # 17 bits wide ! c3 += (c2 & 3) << 8 # 10 bits wide ! parts.extend([_b32tab[c1 >> 11], # bits 1 - 5 ! _b32tab[(c1 >> 6) & 0x1f], # bits 6 - 10 ! _b32tab[(c1 >> 1) & 0x1f], # bits 11 - 15 ! _b32tab[c2 >> 12], # bits 16 - 20 (1 - 5) ! _b32tab[(c2 >> 7) & 0x1f], # bits 21 - 25 (6 - 10) ! _b32tab[(c2 >> 2) & 0x1f], # bits 26 - 30 (11 - 15) ! _b32tab[c3 >> 5], # bits 31 - 35 (1 - 5) ! _b32tab[c3 & 0x1f], # bits 36 - 40 (1 - 5) ! ]) ! encoded = EMPTYSTRING.join(parts) ! # Adjust for any leftover partial quanta ! if leftover == 1: ! return encoded[:-6] + '======' ! elif leftover == 2: ! return encoded[:-4] + '====' ! elif leftover == 3: ! return encoded[:-3] + '===' ! elif leftover == 4: ! return encoded[:-1] + '=' ! return encoded ! ! ! def b32decode(s, casefold=False, map01=None): ! """Decode a Base32 encoded string. ! ! s is the string to decode. Optional casefold is a flag specifying whether ! a lowercase alphabet is acceptable as input. For security purposes, the ! default is False. ! ! RFC 3548 allows for optional mapping of the digit 0 (zero) to the letter O ! (oh), and for optional mapping of the digit 1 (one) to either the letter I ! (eye) or letter L (el). The optional argument map01 when not None, ! specifies which letter the digit 1 should be mapped to (when map01 is not ! None, the digit 0 is always mapped to the letter O). For security ! purposes the default is None, so that 0 and 1 are not allowed in the ! input. ! ! The decoded string is returned. A TypeError is raised if s were ! incorrectly padded or if there are non-alphabet characters present in the ! string. ! """ ! quanta, leftover = divmod(len(s), 8) ! if leftover: ! raise TypeError('Incorrect padding') ! # Handle section 2.4 zero and one mapping. The flag map01 will be either ! # False, or the character to map the digit 1 (one) to. It should be ! # either L (el) or I (eye). ! if map01: ! s = _translate(s, {'0': 'O', '1': map01}) ! if casefold: ! s = s.upper() ! # Strip off pad characters from the right. We need to count the pad ! # characters because this will tell us how many null bytes to remove from ! # the end of the decoded string. ! padchars = 0 ! mo = re.search('(?P[=]*)$', s) ! if mo: ! padchars = len(mo.group('pad')) ! if padchars > 0: ! s = s[:-padchars] ! # Now decode the full quanta ! parts = [] ! acc = 0 ! shift = 35 ! for c in s: ! val = _b32rev.get(c) ! if val is None: ! raise TypeError('Non-base32 digit found') ! acc += _b32rev[c] << shift ! shift -= 5 ! if shift < 0: ! parts.append(binascii.unhexlify(hex(acc)[2:-1])) ! acc = 0 ! shift = 35 ! # Process the last, partial quanta ! last = binascii.unhexlify(hex(acc)[2:-1]) ! if padchars == 1: ! last = last[:-1] ! elif padchars == 3: ! last = last[:-2] ! elif padchars == 4: ! last = last[:-3] ! elif padchars == 6: ! last = last[:-4] ! elif padchars <> 0: ! raise TypeError('Incorrect padding') ! parts.append(last) ! return EMPTYSTRING.join(parts) ! ! ! ! # RFC 3548, Base 16 Alphabet specifies uppercase, but hexlify() returns ! # lowercase. The RFC also recommends against accepting input case ! # insensitively. ! def b16encode(s): ! """Encode a string using Base16. ! ! s is the string to encode. The encoded string is returned. ! """ ! return binascii.hexlify(s).upper() ! ! ! def b16decode(s, casefold=False): ! """Decode a Base16 encoded string. ! ! s is the string to decode. Optional casefold is a flag specifying whether ! a lowercase alphabet is acceptable as input. For security purposes, the ! default is False. ! ! The decoded string is returned. A TypeError is raised if s were ! incorrectly padded or if there are non-alphabet characters present in the ! string. ! """ ! if casefold: ! s = s.upper() ! if re.search('[^0-9A-F]', s): ! raise TypeError('Non-base16 digit found') ! return binascii.unhexlify(s) ! ! ! ! # Legacy interface. This code could be cleaned up since I don't believe ! # binascii has any line length limitations. It just doesn't seem worth it ! # though. MAXLINESIZE = 76 # Excluding the CRLF *************** *** 14,35 **** def encode(input, output): """Encode a file.""" ! while 1: s = input.read(MAXBINSIZE) ! if not s: break while len(s) < MAXBINSIZE: ns = input.read(MAXBINSIZE-len(s)) ! if not ns: break ! s = s + ns line = binascii.b2a_base64(s) output.write(line) def decode(input, output): """Decode a file.""" ! while 1: line = input.readline() ! if not line: break s = binascii.a2b_base64(line) output.write(s) def encodestring(s): """Encode a string.""" --- 282,308 ---- def encode(input, output): """Encode a file.""" ! while True: s = input.read(MAXBINSIZE) ! if not s: ! break while len(s) < MAXBINSIZE: ns = input.read(MAXBINSIZE-len(s)) ! if not ns: ! break ! s += ns line = binascii.b2a_base64(s) output.write(line) + def decode(input, output): """Decode a file.""" ! while True: line = input.readline() ! if not line: ! break s = binascii.a2b_base64(line) output.write(s) + def encodestring(s): """Encode a string.""" *************** *** 40,47 **** --- 313,324 ---- return "".join(pieces) + def decodestring(s): """Decode a string.""" return binascii.a2b_base64(s) + + + # Useable as a script... def test(): """Small test program""" *************** *** 68,71 **** --- 345,349 ---- func(sys.stdin, sys.stdout) + def test1(): s0 = "Aladdin:open sesame" *************** *** 73,76 **** --- 351,355 ---- s2 = decodestring(s1) print s0, `s1`, s2 + if __name__ == '__main__': From bwarsaw at users.sourceforge.net Sat Jan 3 20:13:04 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Sat Jan 3 20:13:07 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_base64.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv25910/Lib/test Modified Files: test_base64.py Log Message: More complete code coverage, including testing the new RFC 3548 support. Index: test_base64.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_base64.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_base64.py 1 May 2003 17:45:31 -0000 1.6 --- test_base64.py 4 Jan 2004 01:13:02 -0000 1.7 *************** *** 3,37 **** import base64 - class Base64TestCase(unittest.TestCase): def test_encodestring(self): ! self.assertEqual(base64.encodestring("www.python.org"), "d3d3LnB5dGhvbi5vcmc=\n") ! self.assertEqual(base64.encodestring("a"), "YQ==\n") ! self.assertEqual(base64.encodestring("ab"), "YWI=\n") ! self.assertEqual(base64.encodestring("abc"), "YWJj\n") ! self.assertEqual(base64.encodestring(""), "") ! self.assertEqual(base64.encodestring("abcdefghijklmnopqrstuvwxyz" ! "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ! "0123456789!@#0^&*();:<>,. []{}"), ! "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" ! "RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT" ! "Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n") def test_decodestring(self): ! self.assertEqual(base64.decodestring("d3d3LnB5dGhvbi5vcmc=\n"), "www.python.org") ! self.assertEqual(base64.decodestring("YQ==\n"), "a") ! self.assertEqual(base64.decodestring("YWI=\n"), "ab") ! self.assertEqual(base64.decodestring("YWJj\n"), "abc") ! self.assertEqual(base64.decodestring("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" ! "RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT" ! "Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n"), ! "abcdefghijklmnopqrstuvwxyz" ! "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ! "0123456789!@#0^&*();:<>,. []{}") ! self.assertEqual(base64.decodestring(''), '') def test_main(): ! test_support.run_unittest(Base64TestCase) ! if __name__ == "__main__": ! test_main() --- 3,192 ---- import base64 + + class LegacyBase64TestCase(unittest.TestCase): def test_encodestring(self): ! eq = self.assertEqual ! eq(base64.encodestring("www.python.org"), "d3d3LnB5dGhvbi5vcmc=\n") ! eq(base64.encodestring("a"), "YQ==\n") ! eq(base64.encodestring("ab"), "YWI=\n") ! eq(base64.encodestring("abc"), "YWJj\n") ! eq(base64.encodestring(""), "") ! eq(base64.encodestring("abcdefghijklmnopqrstuvwxyz" ! "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ! "0123456789!@#0^&*();:<>,. []{}"), ! "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" ! "RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT" ! "Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n") def test_decodestring(self): ! eq = self.assertEqual ! eq(base64.decodestring("d3d3LnB5dGhvbi5vcmc=\n"), "www.python.org") ! eq(base64.decodestring("YQ==\n"), "a") ! eq(base64.decodestring("YWI=\n"), "ab") ! eq(base64.decodestring("YWJj\n"), "abc") ! eq(base64.decodestring("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" ! "RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT" ! "Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n"), ! "abcdefghijklmnopqrstuvwxyz" ! "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ! "0123456789!@#0^&*();:<>,. []{}") ! eq(base64.decodestring(''), '') ! ! def test_encode(self): ! eq = self.assertEqual ! from cStringIO import StringIO ! infp = StringIO('abcdefghijklmnopqrstuvwxyz' ! 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ! '0123456789!@#0^&*();:<>,. []{}') ! outfp = StringIO() ! base64.encode(infp, outfp) ! eq(outfp.getvalue(), ! 'YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE' ! 'RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT' ! 'Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n') ! ! def test_decode(self): ! from cStringIO import StringIO ! infp = StringIO('d3d3LnB5dGhvbi5vcmc=') ! outfp = StringIO() ! base64.decode(infp, outfp) ! self.assertEqual(outfp.getvalue(), 'www.python.org') ! ! ! ! class BaseXYTestCase(unittest.TestCase): ! def test_b64encode(self): ! eq = self.assertEqual ! # Test default alphabet ! eq(base64.b64encode("www.python.org"), "d3d3LnB5dGhvbi5vcmc=") ! eq(base64.b64encode("a"), "YQ==") ! eq(base64.b64encode("ab"), "YWI=") ! eq(base64.b64encode("abc"), "YWJj") ! eq(base64.b64encode(""), "") ! eq(base64.b64encode("abcdefghijklmnopqrstuvwxyz" ! "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ! "0123456789!@#0^&*();:<>,. []{}"), ! "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" ! "RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT" ! "Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==") ! # Test with arbitrary alternative characters ! eq(base64.b64encode('\xd3V\xbeo\xf7\x1d', altchars='*$'), '01a*b$cd') ! # Test standard alphabet ! eq(base64.standard_b64encode("www.python.org"), "d3d3LnB5dGhvbi5vcmc=") ! eq(base64.standard_b64encode("a"), "YQ==") ! eq(base64.standard_b64encode("ab"), "YWI=") ! eq(base64.standard_b64encode("abc"), "YWJj") ! eq(base64.standard_b64encode(""), "") ! eq(base64.standard_b64encode("abcdefghijklmnopqrstuvwxyz" ! "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ! "0123456789!@#0^&*();:<>,. []{}"), ! "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" ! "RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT" ! "Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==") ! # Test with 'URL safe' alternative characters ! eq(base64.urlsafe_b64encode('\xd3V\xbeo\xf7\x1d'), '01a-b_cd') ! ! def test_b64decode(self): ! eq = self.assertEqual ! eq(base64.b64decode("d3d3LnB5dGhvbi5vcmc="), "www.python.org") ! eq(base64.b64decode("YQ=="), "a") ! eq(base64.b64decode("YWI="), "ab") ! eq(base64.b64decode("YWJj"), "abc") ! eq(base64.b64decode("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" ! "RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNT" ! "Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ=="), ! "abcdefghijklmnopqrstuvwxyz" ! "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ! "0123456789!@#0^&*();:<>,. []{}") ! eq(base64.b64decode(''), '') ! # Test with arbitrary alternative characters ! eq(base64.b64decode('01a*b$cd', altchars='*$'), '\xd3V\xbeo\xf7\x1d') ! # Test standard alphabet ! eq(base64.standard_b64decode("d3d3LnB5dGhvbi5vcmc="), "www.python.org") ! eq(base64.standard_b64decode("YQ=="), "a") ! eq(base64.standard_b64decode("YWI="), "ab") ! eq(base64.standard_b64decode("YWJj"), "abc") ! eq(base64.standard_b64decode(""), "") ! eq(base64.standard_b64decode("YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNE" ! "RUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0NT" ! "Y3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ=="), ! "abcdefghijklmnopqrstuvwxyz" ! "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ! "0123456789!@#0^&*();:<>,. []{}") ! # Test with 'URL safe' alternative characters ! eq(base64.urlsafe_b64decode('01a-b_cd'), '\xd3V\xbeo\xf7\x1d') ! ! def test_b64decode_error(self): ! self.assertRaises(TypeError, base64.b64decode, 'abc') ! ! def test_b32encode(self): ! eq = self.assertEqual ! eq(base64.b32encode(''), '') ! eq(base64.b32encode('a'), 'ME======') ! eq(base64.b32encode('ab'), 'MFRA====') ! eq(base64.b32encode('abc'), 'MFRGG===') ! eq(base64.b32encode('abcd'), 'MFRGGZA=') ! eq(base64.b32encode('abcde'), 'MFRGGZDF') ! ! def test_b32decode(self): ! eq = self.assertEqual ! eq(base64.b32decode(''), '') ! eq(base64.b32decode('ME======'), 'a') ! eq(base64.b32decode('MFRA===='), 'ab') ! eq(base64.b32decode('MFRGG==='), 'abc') ! eq(base64.b32decode('MFRGGZA='), 'abcd') ! eq(base64.b32decode('MFRGGZDF'), 'abcde') ! ! def test_b32decode_casefold(self): ! eq = self.assertEqual ! eq(base64.b32decode('', True), '') ! eq(base64.b32decode('ME======', True), 'a') ! eq(base64.b32decode('MFRA====', True), 'ab') ! eq(base64.b32decode('MFRGG===', True), 'abc') ! eq(base64.b32decode('MFRGGZA=', True), 'abcd') ! eq(base64.b32decode('MFRGGZDF', True), 'abcde') ! # Lower cases ! eq(base64.b32decode('me======', True), 'a') ! eq(base64.b32decode('mfra====', True), 'ab') ! eq(base64.b32decode('mfrgg===', True), 'abc') ! eq(base64.b32decode('mfrggza=', True), 'abcd') ! eq(base64.b32decode('mfrggzdf', True), 'abcde') ! # Expected exceptions ! self.assertRaises(TypeError, base64.b32decode, 'me======') ! # Mapping zero and one ! eq(base64.b32decode('MLO23456'), 'b\xdd\xad\xf3\xbe') ! eq(base64.b32decode('M1023456', map01='L'), 'b\xdd\xad\xf3\xbe') ! eq(base64.b32decode('M1023456', map01='I'), 'b\x1d\xad\xf3\xbe') ! ! def test_b32decode_error(self): ! self.assertRaises(TypeError, base64.b32decode, 'abc') ! self.assertRaises(TypeError, base64.b32decode, 'ABCDEF==') ! ! def test_b16encode(self): ! eq = self.assertEqual ! eq(base64.b16encode('\x01\x02\xab\xcd\xef'), '0102ABCDEF') ! ! def test_b16decode(self): ! eq = self.assertEqual ! eq(base64.b16decode('0102ABCDEF'), '\x01\x02\xab\xcd\xef') ! # Lower case is not allowed without a flag ! self.assertRaises(TypeError, base64.b16decode, '0102abcdef') ! # Case fold ! eq(base64.b16decode('0102abcdef', True), '\x01\x02\xab\xcd\xef') ! ! ! ! def suite(): ! suite = unittest.TestSuite() ! suite.addTest(unittest.makeSuite(LegacyBase64TestCase)) ! suite.addTest(unittest.makeSuite(BaseXYTestCase)) ! return suite ! def test_main(): ! test_support.run_suite(suite()) ! ! if __name__ == '__main__': ! unittest.main(defaultTest='suite') From bwarsaw at users.sourceforge.net Sat Jan 3 20:13:45 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Sat Jan 3 20:13:48 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.917,1.918 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv26001/Misc Modified Files: NEWS Log Message: Add note about new base64.py module support for RFC 3548. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.917 retrieving revision 1.918 diff -C2 -d -r1.917 -r1.918 *** NEWS 28 Dec 2003 07:43:56 -0000 1.917 --- NEWS 4 Jan 2004 01:13:43 -0000 1.918 *************** *** 183,186 **** --- 183,189 ---- ------- + - base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and + decoding standards. + - urllib2 now supports processors. A processor is a handler that implements an xxx_request or xxx_response method. These methods are From bwarsaw at users.sourceforge.net Sat Jan 3 20:14:03 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Sat Jan 3 20:14:06 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libbase64.tex,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv26024/Doc/lib Modified Files: libbase64.tex Log Message: Documentation for new RFC 3548 functions. Index: libbase64.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libbase64.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libbase64.tex 16 May 2002 04:28:44 -0000 1.21 --- libbase64.tex 4 Jan 2004 01:14:01 -0000 1.22 *************** *** 1,7 **** \section{\module{base64} --- ! Encode and decode MIME base64 data} \declaremodule{standard}{base64} ! \modulesynopsis{Encode and decode files using the MIME base64 data.} --- 1,7 ---- \section{\module{base64} --- ! RFC 3548: Base16, Base32, Base64 Data Encodings} \declaremodule{standard}{base64} ! \modulesynopsis{RFC 3548: Base16, Base32, Base64 Data Encodings} *************** *** 9,24 **** \index{MIME!base64 encoding} ! This module performs base64 encoding and decoding of arbitrary binary ! strings into text strings that can be safely sent by email or included ! as part of an HTTP POST request. The ! encoding scheme is defined in \rfc{1521} (\emph{MIME ! (Multipurpose Internet Mail Extensions) Part One: Mechanisms for ! Specifying and Describing the Format of Internet Message Bodies}, ! section 5.2, ``Base64 Content-Transfer-Encoding'') and is used for ! MIME email and various other Internet-related applications; it is not ! the same as the output produced by the \program{uuencode} program. ! For example, the string \code{'www.python.org'} is encoded as the ! string \code{'d3d3LnB5dGhvbi5vcmc=\e n'}. \begin{funcdesc}{decode}{input, output} --- 9,117 ---- \index{MIME!base64 encoding} ! This module provides data encoding and decoding as specified in ! \rfc{3548}. This standard defines the Base16, Base32, and Base64 ! algorithms for encoding and decoding arbitrary binary strings into ! text strings that can be safely sent by email, used as parts of URLs, ! or included as part of an HTTP POST request. The encoding algorith is ! not the same as the \program{uuencode} program. ! ! There are two interfaces provided by this module. The modern ! interface supports encoding and decoding string objects using all ! three alphabets. The legacy interface provides for encoding and ! decoding to and from file-like objects as well as strings, but only ! using the Base64 standard alphabet. ! ! The modern interface provides: ! ! \begin{funcdesc}{b64encode}{s\optional{, altchars}} ! Encode a string use Base64. ! ! \var{s} is the string to encode. Optional \var{altchars} must be a ! string of at least length 2 (additional characters are ignored) which ! specifies an alternative alphabet for the \code{+} and \code{/} ! characters. This allows an application to e.g. generate URL or ! filesystem safe Base64 strings. The default is \code{None}, for which ! the standard Base64 alphabet is used. ! ! The encoded string is returned. ! \end{funcdesc} ! ! \begin{funcdesc}{b64decode}{s\optional{, altchars}} ! Decode a Base64 encoded string. + \var{s} is the string to decode. Optional \var{altchars} must be a + string of at least length 2 (additional characters are ignored) which + specifies the alternative alphabet used instead of the \code{+} and + \code{/} characters. + + The decoded string is returned. A \exception{TypeError} is raised if + \var{s} were incorrectly padded or if there are non-alphabet + characters present in the string. + \end{funcdesc} + + \begin{funcdesc}{standard_b64encode}{s} + Encode string \var{s} using the standard Base64 alphabet. + \end{funcdesc} + + \begin{funcdesc}{standard_b64decode}{s} + Decode string \var{s} using the standard Base64 alphabet. + \end{funcdesc} + + \begin{funcdesc}{urlsafe_b64encode}{s} + Encode string \var{s} using a URL-safe alphabet, which substitutes + \code{-} instead of \code{+} and \code{_} instead of \code{/} in the + standard Base64 alphabet. + \end{funcdesc} + + \begin{funcdesc}{urlsafe_b64decode}{s} + Decode string \var{s} using a URL-safe alphabet, which substitutes + \code{-} instead of \code{+} and \code{_} instead of \code{/} in the + standard Base64 alphabet. + \end{funcdesc} + + \begin{funcdesc}{b32encode}{s} + Encode a string using Base32. \var{s} is the string to encode. The + encoded string is returned. + \end{funcdesc} + + \begin{funcdesc}{b32decode}{s\optional{, casefold\optional{, map01}}} + Decode a Base32 encoded string. + + \var{s} is the string to decode. Optional \var{casefold} is a flag + specifying whether a lowercase alphabet is acceptable as input. For + security purposes, the default is \code{False}. + + \rfc{3548} allows for optional mapping of the digit 0 (zero) to the + letter O (oh), and for optional mapping of the digit 1 (one) to either + the letter I (eye) or letter L (el). The optional argument + \var{map01} when not \code{None}, specifies which letter the digit 1 should + be mapped to (when map01 is not \var{None}, the digit 0 is always + mapped to the letter O). For security purposes the default is + \code{None}, so that 0 and 1 are not allowed in the input. + + The decoded string is returned. A \exception{TypeError} is raised if + \var{s} were incorrectly padded or if there are non-alphabet characters + present in the string. + \end{funcdesc} + + \begin{funcdesc}{b16encode}{s} + Encode a string using Base16. + + \var{s} is the string to encode. The encoded string is returned. + \end{funcdesc} + + \begin{funcdesc}{b16decode}{s\optional{, casefold}} + Decode a Base16 encoded string. + + \var{s} is the string to decode. Optional \var{casefold} is a flag + specifying whether a lowercase alphabet is acceptable as input. For + security purposes, the default is \code{False}. + + The decoded string is returned. A \exception{TypeError} is raised if + \var{s} were incorrectly padded or if there are non-alphabet + characters present in the string. + \end{funcdesc} + + The legacy interface: \begin{funcdesc}{decode}{input, output} From tim_one at users.sourceforge.net Sat Jan 3 21:00:49 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat Jan 3 21:00:53 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 make_versioninfo.dsp, 1.2, 1.3 pcbuild.dsw, 1.1, 1.2 pythoncore.dsp, 1.2, 1.3 _csv.dsp, 1.2, NONE _sre.dsp, 1.2, NONE _symtable.dsp, 1.2, NONE datetime.dsp, 1.2, NONE mmap.dsp, 1.2, NONE parser.dsp, 1.2, NONE winreg.dsp, 1.2, NONE Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv32210 Modified Files: make_versioninfo.dsp pcbuild.dsw pythoncore.dsp Removed Files: _csv.dsp _sre.dsp _symtable.dsp datetime.dsp mmap.dsp parser.dsp winreg.dsp Log Message: Getting closer (but not yet there) to being able to compile under VC6 again. Removed the following subprojects and folded them into pythoncore, to match what's being done under VC7. We *can* build the core DLL under VC6 again after this: datetime.dsp winreg.dsp parser.dsp _sre.dsp _csv.dsp mmap.dsp _symtable.dsp Index: make_versioninfo.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/make_versioninfo.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** make_versioninfo.dsp 3 Jan 2004 05:45:59 -0000 1.2 --- make_versioninfo.dsp 4 Jan 2004 02:00:47 -0000 1.3 *************** *** 103,107 **** # Begin Source File ! SOURCE=..\..\make_versioninfo.c # End Source File # End Target --- 103,107 ---- # Begin Source File ! SOURCE=..\make_versioninfo.c # End Source File # End Target Index: pcbuild.dsw =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/pcbuild.dsw,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pcbuild.dsw 2 Jan 2004 21:15:07 -0000 1.1 --- pcbuild.dsw 4 Jan 2004 02:00:47 -0000 1.2 *************** *** 19,37 **** ############################################################################### - Project: "_csv"=.\_csv.dsp - Package Owner=<4> - - Package=<5> - {{{ - }}} - - Package=<4> - {{{ - Begin Project Dependency - Project_Dep_Name pythoncore - End Project Dependency - }}} - - ############################################################################### - Project: "_socket"=.\_socket.dsp - Package Owner=<4> --- 19,22 ---- *************** *** 49,67 **** ############################################################################### - Project: "_sre"=.\_sre.dsp - Package Owner=<4> - - Package=<5> - {{{ - }}} - - Package=<4> - {{{ - Begin Project Dependency - Project_Dep_Name pythoncore - End Project Dependency - }}} - - ############################################################################### - Project: "_ssl"=.\_ssl.dsp - Package Owner=<4> --- 34,37 ---- *************** *** 76,82 **** End Project Dependency Begin Project Dependency - Project_Dep_Name _sre - End Project Dependency - Begin Project Dependency Project_Dep_Name python End Project Dependency --- 46,49 ---- *************** *** 88,106 **** ############################################################################### - Project: "_symtable"=.\_symtable.dsp - Package Owner=<4> - - Package=<5> - {{{ - }}} - - Package=<4> - {{{ - Begin Project Dependency - Project_Dep_Name pythoncore - End Project Dependency - }}} - - ############################################################################### - Project: "_testcapi"=.\_testcapi.dsp - Package Owner=<4> --- 55,58 ---- *************** *** 145,163 **** ############################################################################### - Project: "datetime"=.\datetime.dsp - Package Owner=<4> - - Package=<5> - {{{ - }}} - - Package=<4> - {{{ - Begin Project Dependency - Project_Dep_Name pythoncore - End Project Dependency - }}} - - ############################################################################### - Project: "make_versioninfo"=.\make_versioninfo.dsp - Package Owner=<4> --- 97,100 ---- *************** *** 172,205 **** ############################################################################### - Project: "mmap"=.\mmap.dsp - Package Owner=<4> - - Package=<5> - {{{ - }}} - - Package=<4> - {{{ - Begin Project Dependency - Project_Dep_Name pythoncore - End Project Dependency - }}} - - ############################################################################### - - Project: "parser"=.\parser.dsp - Package Owner=<4> - - Package=<5> - {{{ - }}} - - Package=<4> - {{{ - Begin Project Dependency - Project_Dep_Name pythoncore - End Project Dependency - }}} - - ############################################################################### - Project: "pyexpat"=.\pyexpat.dsp - Package Owner=<4> --- 109,112 ---- *************** *** 300,318 **** Package=<4> {{{ - }}} - - ############################################################################### - - Project: "winreg"=.\winreg.dsp - Package Owner=<4> - - Package=<5> - {{{ - }}} - - Package=<4> - {{{ - Begin Project Dependency - Project_Dep_Name pythoncore - End Project Dependency }}} --- 207,210 ---- Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/pythoncore.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pythoncore.dsp 3 Jan 2004 05:45:59 -0000 1.2 --- pythoncore.dsp 4 Jan 2004 02:00:47 -0000 1.3 *************** *** 98,101 **** --- 98,105 ---- # Begin Source File + SOURCE=..\..\Modules\_csv.c + # End Source File + # Begin Source File + SOURCE=..\..\Modules\_hotshot.c # End Source File *************** *** 110,117 **** --- 114,129 ---- # Begin Source File + SOURCE=..\..\Modules\_sre.c + # End Source File + # Begin Source File + SOURCE=..\..\Modules\_weakref.c # End Source File # Begin Source File + SOURCE=..\_winreg.c + # End Source File + # Begin Source File + SOURCE=..\..\Objects\abstract.c # End Source File *************** *** 194,197 **** --- 206,213 ---- # Begin Source File + SOURCE=..\..\Modules\datetimemodule.c + # End Source File + # Begin Source File + SOURCE=..\..\Objects\descrobject.c # End Source File *************** *** 372,375 **** --- 388,395 ---- # Begin Source File + SOURCE=..\..\Modules\mmapmodule.c + # End Source File + # Begin Source File + SOURCE=..\..\Python\modsupport.c # End Source File *************** *** 416,419 **** --- 436,443 ---- # Begin Source File + SOURCE=..\..\Modules\parsermodule.c + # End Source File + # Begin Source File + SOURCE=..\..\Parser\parsetok.c # End Source File *************** *** 505,508 **** --- 529,536 ---- SOURCE=..\..\Python\symtable.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\symtablemodule.c # End Source File # Begin Source File --- _csv.dsp DELETED --- --- _sre.dsp DELETED --- --- _symtable.dsp DELETED --- --- datetime.dsp DELETED --- --- mmap.dsp DELETED --- --- parser.dsp DELETED --- --- winreg.dsp DELETED --- From tim_one at users.sourceforge.net Sat Jan 3 21:04:44 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat Jan 3 21:04:46 2004 Subject: [Python-checkins] python/dist/src/PCbuild readme.txt,1.45,1.46 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv795/PCbuild Modified Files: readme.txt Log Message: Removed dead text about MS subprojects that no longer exist. Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** readme.txt 2 Jan 2004 21:13:28 -0000 1.45 --- readme.txt 4 Jan 2004 02:04:35 -0000 1.46 *************** *** 41,61 **** pythonw pythonw.exe, a variant of python.exe that doesn't pop up a DOS box - _csv - C support for the comma-separated values module _socket socketmodule.c - _sre - Unicode-aware regular expression engine - _symtable - the _symtable module, symtablemodule.c _testcapi tests of the Python C API, run via Lib/test/test_capi.py, and implemented by module Modules/_testcapimodule.c - datetime - datetimemodule.c - mmap - mmapmodule.c - parser - the parser module pyexpat Python wrapper for accelerated XML parsing, which incorporates stable --- 41,49 ---- *************** *** 65,70 **** unicodedata large tables of Unicode data - winreg - Windows registry API winsound play sounds (typically .wav files) under Windows --- 53,56 ---- *************** *** 162,166 **** If FC finds differences, see the warning abou WinZip above (when I first tried it, sample3.ref failed due to CRLF conversion). ! # XXX: it fails with vc 7.1, so the tests are skipped for now. --- 148,152 ---- If FC finds differences, see the warning abou WinZip above (when I first tried it, sample3.ref failed due to CRLF conversion). ! # XXX: it fails with vc 7.1, so the tests are skipped for now. From tim_one at users.sourceforge.net Sat Jan 3 21:05:07 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat Jan 3 21:05:09 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 readme.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv795/PC/VC6 Modified Files: readme.txt Log Message: Removed dead text about MS subprojects that no longer exist. Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/readme.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** readme.txt 3 Jan 2004 05:45:59 -0000 1.1 --- readme.txt 4 Jan 2004 02:04:32 -0000 1.2 *************** *** 40,60 **** pythonw pythonw.exe, a variant of python.exe that doesn't pop up a DOS box - _csv - C support for the comma-separated values module _socket socketmodule.c - _sre - Unicode-aware regular expression engine - _symtable - the _symtable module, symtablemodule.c _testcapi tests of the Python C API, run via Lib/test/test_capi.py, and implemented by module Modules/_testcapimodule.c - datetime - datetimemodule.c - mmap - mmapmodule.c - parser - the parser module pyexpat Python wrapper for accelerated XML parsing, which incorporates stable --- 40,48 ---- *************** *** 64,69 **** unicodedata large tables of Unicode data - winreg - Windows registry API winsound play sounds (typically .wav files) under Windows --- 52,55 ---- From tim_one at users.sourceforge.net Sat Jan 3 21:12:57 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat Jan 3 21:13:01 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 _bsddb.dsp,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv1917/PC/VC6 Modified Files: _bsddb.dsp Log Message: The _bsddb subproject works again under VC6. Index: _bsddb.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/_bsddb.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _bsddb.dsp 3 Jan 2004 05:45:59 -0000 1.2 --- _bsddb.dsp 4 Jan 2004 02:12:55 -0000 1.3 *************** *** 55,59 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 ! # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\db-4.1.25\build_win32\Release_static\libdb41s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"./_bsddb.pyd" # SUBTRACT LINK32 /pdb:none --- 55,59 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 ! # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\db-4.1.25\build_win32\Release_static\libdb41s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /out:"./_bsddb.pyd" # SUBTRACT LINK32 /pdb:none *************** *** 83,87 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\db-4.1.25\build_win32\Release_static\libdb41s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd" /out:"./_bsddb_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none --- 83,87 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ..\..\..\db-4.1.25\build_win32\Release_static\libdb41s.lib /nologo /base:"0x1e180000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd" /out:"./_bsddb_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none From tim_one at users.sourceforge.net Sat Jan 3 21:27:36 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat Jan 3 21:27:43 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 _ssl.mak, NONE, 1.1 build_ssl.py, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv3985/PC/VC6 Added Files: _ssl.mak build_ssl.py Log Message: The _ssl subproject may be working w/ VC6 again. --- NEW FILE: _ssl.mak --- !IFDEF DEBUG MODULE=_ssl_d.pyd TEMP_DIR=x86-temp-debug/_ssl CFLAGS=/Od /Zi /MDd /LDd /DDEBUG /D_DEBUG SSL_LIB_DIR=$(SSL_DIR)/out32.dbg !ELSE MODULE=_ssl.pyd TEMP_DIR=x86-temp-release/_ssl CFLAGS=/Ox /MD /LD SSL_LIB_DIR=$(SSL_DIR)/out32 !ENDIF INCLUDES=-I ../../Include -I .. -I $(SSL_DIR)/inc32 LIBS=gdi32.lib wsock32.lib /libpath:$(SSL_LIB_DIR) libeay32.lib ssleay32.lib SOURCE=../../Modules/_ssl.c $(SSL_LIB_DIR)/libeay32.lib $(SSL_LIB_DIR)/ssleay32.lib $(MODULE): $(SOURCE) ../*.h ../../Include/*.h @if not exist "$(TEMP_DIR)/." mkdir "$(TEMP_DIR)" cl /nologo $(SOURCE) $(CFLAGS) /Fo$(TEMP_DIR)\$*.obj $(INCLUDES) /link /out:$(MODULE) $(LIBS) --- NEW FILE: build_ssl.py --- # Script for building the _ssl module for Windows. # Uses Perl to setup the OpenSSL environment correctly # and build OpenSSL, then invokes a simple nmake session # for _ssl.pyd itself. # THEORETICALLY, you can: # * Unpack the latest SSL release one level above your main Python source # directory. It is likely you will already find the zlib library and # any other external packages there. # * Install ActivePerl and ensure it is somewhere on your path. # * Run this script from the PCBuild directory. # # it should configure and build SSL, then build the ssl Python extension # without intervention. import os, sys, re # Find all "foo.exe" files on the PATH. def find_all_on_path(filename, extras = None): entries = os.environ["PATH"].split(os.pathsep) ret = [] for p in entries: fname = os.path.abspath(os.path.join(p, filename)) if os.path.isfile(fname) and fname not in ret: ret.append(fname) if extras: for p in extras: fname = os.path.abspath(os.path.join(p, filename)) if os.path.isfile(fname) and fname not in ret: ret.append(fname) return ret # Find a suitable Perl installation for OpenSSL. # cygwin perl does *not* work. ActivePerl does. # Being a Perl dummy, the simplest way I can check is if the "Win32" package # is available. def find_working_perl(perls): for perl in perls: fh = os.popen(perl + ' -e "use Win32;"') fh.read() rc = fh.close() if rc: continue return perl print "Can not find a suitable PERL:" if perls: print " the following perl interpreters were found:" for p in perls: print " ", p print " None of these versions appear suitable for building OpenSSL" else: print " NO perl interpreters were found on this machine at all!" print " Please install ActivePerl and ensure it appears on your path" print "The Python SSL module was not built" return None # Locate the best SSL directory given a few roots to look into. def find_best_ssl_dir(sources): candidates = [] for s in sources: try: s = os.path.abspath(s) fnames = os.listdir(s) except os.error: fnames = [] for fname in fnames: fqn = os.path.join(s, fname) if os.path.isdir(fqn) and fname.startswith("openssl-"): candidates.append(fqn) # Now we have all the candidates, locate the best. best_parts = [] best_name = None for c in candidates: parts = re.split("[.-]", os.path.basename(c))[1:] # eg - openssl-0.9.7-beta1 - ignore all "beta" or any other qualifiers if len(parts) >= 4: continue if parts > best_parts: best_parts = parts best_name = c if best_name is not None: print "Found an SSL directory at '%s'" % (best_name,) else: print "Could not find an SSL directory in '%s'" % (sources,) return best_name def main(): debug = "-d" in sys.argv build_all = "-a" in sys.argv make_flags = "" if build_all: make_flags = "-a" # perl should be on the path, but we also look in "\perl" and "c:\\perl" # as "well known" locations perls = find_all_on_path("perl.exe", ["\\perl\\bin", "C:\\perl\\bin"]) perl = find_working_perl(perls) if perl is None: sys.exit(1) print "Found a working perl at '%s'" % (perl,) # Look for SSL 3 levels up from pcbuild - ie, same place zlib etc all live. ssl_dir = find_best_ssl_dir(("../../..",)) if ssl_dir is None: sys.exit(1) old_cd = os.getcwd() try: os.chdir(ssl_dir) # If the ssl makefiles do not exist, we invoke Perl to generate them. if not os.path.isfile(os.path.join(ssl_dir, "32.mak")) or \ not os.path.isfile(os.path.join(ssl_dir, "d32.mak")): print "Creating the makefiles..." # Put our working Perl at the front of our path os.environ["PATH"] = os.path.split(perl)[0] + \ os.pathsep + \ os.environ["PATH"] # ms\32all.bat will reconfigure OpenSSL and then try to build # all outputs (debug/nondebug/dll/lib). So we filter the file # to exclude any "nmake" commands and then execute. tempname = "ms\\32all_py.bat" in_bat = open("ms\\32all.bat") temp_bat = open(tempname,"w") while 1: cmd = in_bat.readline() print 'cmd', repr(cmd) if not cmd: break if cmd.strip()[:5].lower() == "nmake": continue temp_bat.write(cmd) in_bat.close() temp_bat.close() os.system(tempname) try: os.remove(tempname) except: pass # Now run make. print "Executing nmake over the ssl makefiles..." if debug: rc = os.system("nmake /nologo -f d32.mak") if rc: print "Executing d32.mak failed" print rc sys.exit(rc) else: rc = os.system("nmake /nologo -f 32.mak") if rc: print "Executing 32.mak failed" print rc sys.exit(rc) finally: os.chdir(old_cd) # And finally, we can build the _ssl module itself for Python. defs = "SSL_DIR=%s" % (ssl_dir,) if debug: defs = defs + " " + "DEBUG=1" rc = os.system('nmake /nologo -f _ssl.mak ' + defs + " " + make_flags) sys.exit(rc) if __name__=='__main__': main() From tim_one at users.sourceforge.net Sat Jan 3 21:30:51 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat Jan 3 21:30:55 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 bz2.dsp,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv4410/PC/VC6 Modified Files: bz2.dsp Log Message: The bz2 subproject works with VC6 again. Index: bz2.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/bz2.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bz2.dsp 3 Jan 2004 05:45:59 -0000 1.2 --- bz2.dsp 4 Jan 2004 02:30:49 -0000 1.3 *************** *** 55,63 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 ! # ADD LINK32 ..\..\bzip2-1.0.2\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" # SUBTRACT LINK32 /pdb:none /nodefaultlib # Begin Special Build Tool SOURCE="$(InputPath)" ! PreLink_Cmds=cd ..\..\bzip2-1.0.2 nmake /nologo /f makefile.msc # End Special Build Tool --- 55,63 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 ! # ADD LINK32 ..\..\..\bzip2-1.0.2\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"libc" /out:"./bz2.pyd" # SUBTRACT LINK32 /pdb:none /nodefaultlib # Begin Special Build Tool SOURCE="$(InputPath)" ! PreLink_Cmds=cd ..\..\..\bzip2-1.0.2 nmake /nologo /f makefile.msc # End Special Build Tool *************** *** 87,95 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 ..\..\bzip2-1.0.2\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" ! PreLink_Cmds=cd ..\..\bzip2-1.0.2 nmake /nologo /f makefile.msc # End Special Build Tool --- 87,95 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 ..\..\..\bzip2-1.0.2\libbz2.lib /nologo /base:"0x1D170000" /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrt" /nodefaultlib:"libc" /out:"./bz2_d.pyd" /pdbtype:sept # SUBTRACT LINK32 /pdb:none # Begin Special Build Tool SOURCE="$(InputPath)" ! PreLink_Cmds=cd ..\..\..\bzip2-1.0.2 nmake /nologo /f makefile.msc # End Special Build Tool From tim_one at users.sourceforge.net Sat Jan 3 21:32:55 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat Jan 3 21:32:58 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 _tkinter.dsp,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv4925/PC/VC6 Modified Files: _tkinter.dsp Log Message: The _tkinter subproject works with VC6 again. Index: _tkinter.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/_tkinter.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _tkinter.dsp 3 Jan 2004 05:45:59 -0000 1.2 --- _tkinter.dsp 4 Jan 2004 02:32:53 -0000 1.3 *************** *** 55,59 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 ..\..\tcl84\lib\tk84.lib ..\..\tcl84\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept /libpath:"C:\Program Files\Tcl\lib" # SUBTRACT LINK32 /pdb:none --- 55,59 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept ! # ADD LINK32 ..\..\..\tcl84\lib\tk84.lib ..\..\..\tcl84\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter_d.pyd" /pdbtype:sept /libpath:"C:\Program Files\Tcl\lib" # SUBTRACT LINK32 /pdb:none *************** *** 83,87 **** LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 ! # ADD LINK32 ..\..\tcl84\lib\tk84.lib ..\..\tcl84\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" /libpath:"C:\Program Files\Tcl\lib" # SUBTRACT LINK32 /pdb:none --- 83,87 ---- LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 ! # ADD LINK32 ..\..\..\tcl84\lib\tk84.lib ..\..\..\tcl84\lib\tcl84.lib odbc32.lib odbccp32.lib user32.lib kernel32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1e190000" /subsystem:windows /dll /debug /machine:I386 /out:"./_tkinter.pyd" /libpath:"C:\Program Files\Tcl\lib" # SUBTRACT LINK32 /pdb:none From tim_one at users.sourceforge.net Sat Jan 3 21:51:39 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat Jan 3 21:51:43 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 rt.bat,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv7447 Added Files: rt.bat Log Message: That's it -- works as well under VC6 as it ever did now. --- NEW FILE: rt.bat --- @rem Run Tests. Run the regression test suite. @rem Usage: rt [-d] [-O] [-q] regrtest_args @rem -d Run Debug build (python_d.exe). Else release build. @rem -O Run python.exe or python_d.exe (see -d) with -O. @rem -q "quick" -- normally the tests are run twice, the first time @rem after deleting all the .py[co] files reachable from Lib/. @rem -q runs the tests just once, and without deleting .py[co] files. @rem All leading instances of these switches are shifted off, and @rem whatever remains is passed to regrtest.py. For example, @rem rt -O -d -x test_thread @rem runs @rem python_d -O ../../lib/test/regrtest.py -x test_thread @rem twice, and @rem rt -q -g test_binascii @rem runs @rem python_d ../../lib/test/regrtest.py -g test_binascii @rem to generate the expected-output file for binascii quickly. @set _exe=python @set _qmode=no @set _dashO= @goto CheckOpts :Again @shift :CheckOpts @if "%1"=="-O" set _dashO=-O @if "%1"=="-O" goto Again @if "%1"=="-q" set _qmode=yes @if "%1"=="-q" goto Again @if "%1"=="-d" set _exe=python_d @if "%1"=="-d" goto Again @if "%_qmode%"=="yes" goto Qmode @echo Deleting .pyc/.pyo files ... @%_exe% rmpyc.py %_exe% %_dashO% -E -tt ../../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9 @echo About to run again without deleting .pyc/.pyo first: @pause :Qmode %_exe% %_dashO% -E -tt ../../lib/test/regrtest.py %1 %2 %3 %4 %5 %6 %7 %8 %9 @set _exe= @set _qmode= @set _dashO= From tim_one at users.sourceforge.net Sat Jan 3 22:00:53 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sat Jan 3 22:00:56 2004 Subject: [Python-checkins] python/dist/src/PC dllbase_nt.txt,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv8534a/PC Modified Files: dllbase_nt.txt Log Message: Update to record .pyd files removed for Python 2.4. Index: dllbase_nt.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/dllbase_nt.txt,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dllbase_nt.txt 21 Mar 2003 02:02:02 -0000 1.8 --- dllbase_nt.txt 4 Jan 2004 03:00:51 -0000 1.9 *************** *** 16,28 **** Standard Extension Modules 1e100000 - 1e200000 "" ! - _symtable 1e100000 - 1e110000 ! - bsddb 1e180000 - 1e188000 "" - _tkinter 1e190000 - 1e1A0000 ! - parser 1e1A0000 - 1e1B0000 - zlib 1e1B0000 - 1e1C0000 ! - winreg 1e1C0000 - 1e1D0000 - _socket 1e1D0000 - 1e1E0000 ! - _sre 1e1E0000 - 1e1F0000 ! - mmap 1e1F0000 - 1e1FFFFF More standard extensions 1D100000 - 1e000000 --- 16,28 ---- Standard Extension Modules 1e100000 - 1e200000 "" ! - _symtable 1e100000 - 1e110000 pyd removed in 2.4 ! - bsddb 1e180000 - 1e188000 - _tkinter 1e190000 - 1e1A0000 ! - parser 1e1A0000 - 1e1B0000 pyd removed in 2.4 - zlib 1e1B0000 - 1e1C0000 ! - winreg 1e1C0000 - 1e1D0000 pyd removed in 2.4 - _socket 1e1D0000 - 1e1E0000 ! - _sre 1e1E0000 - 1e1F0000 pyd removed in 2.4 ! - mmap 1e1F0000 - 1e1FFFFF pyd removed in 2.4 More standard extensions 1D100000 - 1e000000 *************** *** 32,37 **** - winsound 1D160000 - 1D170000 - bZ2 1D170000 - 1D180000 ! - datetime 1D180000 - 1D190000 ! - _csv 1D190000 - 1D1A0000 Other extension modules --- 32,37 ---- - winsound 1D160000 - 1D170000 - bZ2 1D170000 - 1D180000 ! - datetime 1D180000 - 1D190000 pyd removed in 2.4 ! - _csv 1D190000 - 1D1A0000 pyd removed in 2.4 Other extension modules From rhettinger at users.sourceforge.net Sat Jan 3 22:11:48 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Jan 3 22:11:50 2004 Subject: [Python-checkins] python/dist/src/Doc/api abstract.tex,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv9989 Modified Files: abstract.tex Log Message: Fix small factual error. Index: abstract.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** abstract.tex 7 Dec 2003 11:40:16 -0000 1.29 --- abstract.tex 4 Jan 2004 03:11:45 -0000 1.30 *************** *** 343,347 **** \cfuncline{int}{PyObject_Size}{PyObject *o} Return the length of object \var{o}. If the object \var{o} provides ! both sequence and mapping protocols, the sequence length is returned. On error, \code{-1} is returned. This is the equivalent to the Python expression \samp{len(\var{o})}.\bifuncindex{len} --- 343,347 ---- \cfuncline{int}{PyObject_Size}{PyObject *o} Return the length of object \var{o}. If the object \var{o} provides ! either the sequence and mapping protocols, the sequence length is returned. On error, \code{-1} is returned. This is the equivalent to the Python expression \samp{len(\var{o})}.\bifuncindex{len} From rhettinger at users.sourceforge.net Sat Jan 3 22:12:48 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Jan 3 22:12:51 2004 Subject: [Python-checkins] python/dist/src/Doc/api abstract.tex, 1.26.12.3, 1.26.12.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory sc8-pr-cvs1:/tmp/cvs-serv10111 Modified Files: Tag: release23-maint abstract.tex Log Message: Fix small factual error. Index: abstract.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v retrieving revision 1.26.12.3 retrieving revision 1.26.12.4 diff -C2 -d -r1.26.12.3 -r1.26.12.4 *** abstract.tex 7 Dec 2003 11:43:56 -0000 1.26.12.3 --- abstract.tex 4 Jan 2004 03:12:46 -0000 1.26.12.4 *************** *** 343,347 **** \cfuncline{int}{PyObject_Size}{PyObject *o} Return the length of object \var{o}. If the object \var{o} provides ! both sequence and mapping protocols, the sequence length is returned. On error, \code{-1} is returned. This is the equivalent to the Python expression \samp{len(\var{o})}.\bifuncindex{len} --- 343,347 ---- \cfuncline{int}{PyObject_Size}{PyObject *o} Return the length of object \var{o}. If the object \var{o} provides ! either the sequence and mapping protocols, the sequence length is returned. On error, \code{-1} is returned. This is the equivalent to the Python expression \samp{len(\var{o})}.\bifuncindex{len} From rhettinger at users.sourceforge.net Sat Jan 3 22:47:54 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Jan 3 22:47:58 2004 Subject: [Python-checkins] python/dist/src/Lib timeit.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv14750 Modified Files: timeit.py Log Message: SF patch #868736: Disable GC for timeit Make timings more consistent by temporarily disabling GC. Index: timeit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/timeit.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** timeit.py 20 Oct 2003 23:38:28 -0000 1.15 --- timeit.py 4 Jan 2004 03:47:51 -0000 1.16 *************** *** 52,55 **** --- 52,56 ---- """ + import gc import sys import time *************** *** 156,160 **** else: it = [None] * number ! return self.inner(it, self.timer) def repeat(self, repeat=default_repeat, number=default_number): --- 157,166 ---- else: it = [None] * number ! gcold = gc.isenabled() ! gc.disable() ! timing = self.inner(it, self.timer) ! if gcold: ! gc.enable() ! return timing def repeat(self, repeat=default_repeat, number=default_number): From rhettinger at users.sourceforge.net Sat Jan 3 23:00:16 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Jan 3 23:00:18 2004 Subject: [Python-checkins] python/dist/src/Modules gcmodule.c,2.75,2.76 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv16691 Modified Files: gcmodule.c Log Message: Convert return value to boolean. Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.75 retrieving revision 2.76 diff -C2 -d -r2.75 -r2.76 *** gcmodule.c 24 Nov 2003 04:02:13 -0000 2.75 --- gcmodule.c 4 Jan 2004 04:00:13 -0000 2.76 *************** *** 846,850 **** gc_isenabled(PyObject *self, PyObject *noargs) { ! return Py_BuildValue("i", enabled); } --- 846,850 ---- gc_isenabled(PyObject *self, PyObject *noargs) { ! return PyBool_FromLong((long)enabled); } From guido at python.org Sat Jan 3 23:07:40 2004 From: guido at python.org (Guido van Rossum) Date: Sat Jan 3 23:07:47 2004 Subject: [Python-checkins] python/dist/src/Lib timeit.py,1.15,1.16 In-Reply-To: Your message of "Sat, 03 Jan 2004 19:47:54 PST." References: Message-ID: <200401040407.i0447es29897@c-24-5-183-134.client.comcast.net> > Make timings more consistent by temporarily disabling GC. Shouldn't this be an option at best? What if I want to time some code that expects GC to be on? --Guido van Rossum (home page: http://www.python.org/~guido/) From rhettinger at users.sourceforge.net Sun Jan 4 01:08:18 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Jan 4 01:08:21 2004 Subject: [Python-checkins] python/dist/src/Objects abstract.c, 2.120, 2.121 listobject.c, 2.174, 2.175 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv32531 Modified Files: abstract.c listobject.c Log Message: Apply tuple/list pre-sizing optimization to a broader class of objects. Formerly, length data fetched from sequence objects. Now, any object that reports its length can benefit from pre-sizing. On one sample timing, it gave a threefold speedup for list(s) where s was a set object. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.120 retrieving revision 2.121 diff -C2 -d -r2.120 -r2.121 *** abstract.c 27 Oct 2003 09:22:16 -0000 2.120 --- abstract.c 4 Jan 2004 06:08:16 -0000 2.121 *************** *** 1381,1385 **** /* Guess result size and allocate space. */ ! n = PySequence_Size(v); if (n < 0) { PyErr_Clear(); --- 1381,1385 ---- /* Guess result size and allocate space. */ ! n = PyObject_Size(v); if (n < 0) { PyErr_Clear(); Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.174 retrieving revision 2.175 diff -C2 -d -r2.174 -r2.175 *** listobject.c 28 Dec 2003 07:42:31 -0000 2.174 --- listobject.c 4 Jan 2004 06:08:16 -0000 2.175 *************** *** 2267,2279 **** /* Guess a result list size. */ ! n = -1; /* unknown */ ! if (PySequence_Check(v) && ! v->ob_type->tp_as_sequence->sq_length) { ! n = PySequence_Size(v); ! if (n < 0) ! PyErr_Clear(); ! } ! if (n < 0) n = 8; /* arbitrary */ NRESIZE(result->ob_item, PyObject*, n); if (result->ob_item == NULL) { --- 2267,2275 ---- /* Guess a result list size. */ ! n = PyObject_Size(v); ! if (n < 0) { ! PyErr_Clear(); n = 8; /* arbitrary */ + } NRESIZE(result->ob_item, PyObject*, n); if (result->ob_item == NULL) { From rhettinger at users.sourceforge.net Sun Jan 4 03:54:46 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Jan 4 03:54:49 2004 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.305,2.306 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv21864 Modified Files: bltinmodule.c Log Message: Apply map/zip pre-sizing optimization to a broader class of objects. Formerly, the length was only fetched from sequence objects. Now, any object that reports its length can benefit from pre-sizing. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.305 retrieving revision 2.306 diff -C2 -d -r2.305 -r2.306 *** bltinmodule.c 17 Dec 2003 20:43:33 -0000 2.305 --- bltinmodule.c 4 Jan 2004 08:54:44 -0000 2.306 *************** *** 792,806 **** /* Update len. */ ! curlen = -1; /* unknown */ ! if (PySequence_Check(curseq) && ! curseq->ob_type->tp_as_sequence->sq_length) { ! curlen = PySequence_Size(curseq); ! if (curlen < 0) ! PyErr_Clear(); ! } ! if (curlen < 0) curlen = 8; /* arbitrary */ ! if (curlen > len) ! len = curlen; } --- 792,802 ---- /* Update len. */ ! curlen = PyObject_Size(curseq); ! if (curlen < 0) { ! PyErr_Clear(); curlen = 8; /* arbitrary */ ! } ! if (curlen > len) ! len = curlen; } *************** *** 1969,1973 **** for (i = 0; i < itemsize; ++i) { PyObject *item = PyTuple_GET_ITEM(args, i); ! int thislen = PySequence_Length(item); if (thislen < 0) { PyErr_Clear(); --- 1965,1969 ---- for (i = 0; i < itemsize; ++i) { PyObject *item = PyTuple_GET_ITEM(args, i); ! int thislen = PyObject_Size(item); if (thislen < 0) { PyErr_Clear(); From loewis at users.sourceforge.net Sun Jan 4 04:58:35 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sun Jan 4 04:58:40 2004 Subject: [Python-checkins] python/dist/src/PCbuild pythoncore.vcproj, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv30100 Modified Files: pythoncore.vcproj Log Message: Bump build number Index: pythoncore.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pythoncore.vcproj 2 Jan 2004 21:13:59 -0000 1.1 --- pythoncore.vcproj 4 Jan 2004 09:58:33 -0000 1.2 *************** *** 953,957 **** Optimization="2" AdditionalIncludeDirectories="" ! PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;USE_DL_EXPORT;BUILD=46;$(NoInherit)"/> --- 961,965 ---- Optimization="0" AdditionalIncludeDirectories="" ! PreprocessorDefinitions="BUILD=47"/> From rhettinger at users.sourceforge.net Sun Jan 4 06:00:10 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Jan 4 06:00:14 2004 Subject: [Python-checkins] python/dist/src/Python bltinmodule.c,2.306,2.307 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv5064/Python Modified Files: bltinmodule.c Log Message: Apply pre-sizing optimization to a broader class of objects. Formerly, the length was only fetched from sequence objects. Now, any object that reports its length can benefit from pre-sizing. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.306 retrieving revision 2.307 diff -C2 -d -r2.306 -r2.307 *** bltinmodule.c 4 Jan 2004 08:54:44 -0000 2.306 --- bltinmodule.c 4 Jan 2004 11:00:07 -0000 2.307 *************** *** 154,166 **** /* Guess a result list size. */ ! len = -1; /* unknown */ ! if (PySequence_Check(seq) && ! seq->ob_type->tp_as_sequence->sq_length) { ! len = PySequence_Size(seq); ! if (len < 0) ! PyErr_Clear(); } - if (len < 0) - len = 8; /* arbitrary */ /* Pre-allocate argument list tuple. */ --- 154,162 ---- /* Guess a result list size. */ ! len = PyObject_Size(seq); ! if (len < 0) { ! PyErr_Clear(); ! len = 8; /* arbitrary */ } /* Pre-allocate argument list tuple. */ From rhettinger at users.sourceforge.net Sun Jan 4 06:00:10 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Jan 4 06:00:15 2004 Subject: [Python-checkins] python/dist/src/Objects abstract.c,2.121,2.122 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv5064/Objects Modified Files: abstract.c Log Message: Apply pre-sizing optimization to a broader class of objects. Formerly, the length was only fetched from sequence objects. Now, any object that reports its length can benefit from pre-sizing. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.121 retrieving revision 2.122 diff -C2 -d -r2.121 -r2.122 *** abstract.c 4 Jan 2004 06:08:16 -0000 2.121 --- abstract.c 4 Jan 2004 11:00:08 -0000 2.122 *************** *** 1449,1461 **** /* Guess a result list size. */ ! n = -1; /* unknown */ ! if (PySequence_Check(v) && ! v->ob_type->tp_as_sequence->sq_length) { ! n = PySequence_Size(v); ! if (n < 0) ! PyErr_Clear(); ! } ! if (n < 0) n = 8; /* arbitrary */ result = PyList_New(n); if (result == NULL) { --- 1449,1457 ---- /* Guess a result list size. */ ! n = PyObject_Size(v); ! if (n < 0) { ! PyErr_Clear(); n = 8; /* arbitrary */ + } result = PyList_New(n); if (result == NULL) { From rhettinger at users.sourceforge.net Sun Jan 4 06:14:53 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Jan 4 06:14:56 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_cookie.py, 1.13, 1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv7411 Modified Files: test_cookie.py Log Message: Exercise sorted() where possible Index: test_cookie.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_cookie.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_cookie.py 29 Dec 2002 16:45:06 -0000 1.13 --- test_cookie.py 4 Jan 2004 11:14:51 -0000 1.14 *************** *** 24,30 **** print repr(C) print str(C) ! items = dict.items() ! items.sort() ! for k, v in items: print ' ', k, repr( C[k].value ), repr(v) verify(C[k].value == v) --- 24,28 ---- print repr(C) print str(C) ! for k, v in sorted(dict.iteritems()): print ' ', k, repr( C[k].value ), repr(v) verify(C[k].value == v) From perky at users.sourceforge.net Sun Jan 4 08:54:28 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sun Jan 4 08:54:31 2004 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.309, 2.310 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv667 Modified Files: posixmodule.c Log Message: FIx unicodefilename support of posix.uname(). This fixes test_unicode_file failure on FreeBSD. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.309 retrieving revision 2.310 diff -C2 -d -r2.309 -r2.310 *** posixmodule.c 3 Dec 2003 01:22:38 -0000 2.309 --- posixmodule.c 4 Jan 2004 13:54:25 -0000 2.310 *************** *** 1969,1973 **** if (!have_unicode_filename && \ ! !PyArg_ParseTuple(args, "sO:utime", &path, &arg)) return NULL; if (arg == Py_None) { --- 1969,1974 ---- if (!have_unicode_filename && \ ! !PyArg_ParseTuple(args, "etO:utime", ! Py_FileSystemDefaultEncoding, &path, &arg)) return NULL; if (arg == Py_None) { From goodger at users.sourceforge.net Sun Jan 4 12:30:49 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Sun Jan 4 12:30:54 2004 Subject: [Python-checkins] python/nondist/peps pep-0326.txt, NONE, 1.1 pep-0000.txt, 1.260, 1.261 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv9714 Modified Files: pep-0000.txt Added Files: pep-0326.txt Log Message: added PEP 326, A Case for All, by Josiah Carlson --- NEW FILE: pep-0326.txt --- PEP: 326 Title: A Case for All Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/01/04 17:30:47 $ Author: Josiah Carlson Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 20-Dec-2003 Python-Version: 2.4 Post-History: 20-Dec-2003, 03-Jan-2004 Abstract ======== This PEP proposes a new named constant or built-in: ``All``. Users of Python have had the constant None, which represents a lack of value, for quite some time (possibly from the beginning, this is unknown to the author at the current time). The author believes that ``All`` should be introduced in order to represent a functionally infinite value, with similar behavior corresponding to None. Rationale ========= While None can be used as an absolute minimum that any value can attain [1]_, there does not exist an equivalent absolute maximum. For example:: >>> print min(None, -2**1000) None All comparisons including None and another object results in None being the smaller of the two. However, there does not exist a value such that the comparison of any other object results in the constant being the larger of the two. What is commonly done to deal with such cases, is to set a value in a script that is larger than the author ever expects the input to reach, and hope that it isn't reached. Guido has brought up [2]_ the fact that there exists two constants that can be used in the interim: sys.maxint and floating point positive infinity (1e309 will evaluate to positive infinity). However, each has their drawbacks. On most architectures sys.maxint is arbitrarily small (2**31-1 or 2**63-1), and can be easily eclipsed by large 'long' integers or floating point numbers. Furthermore, comparing long integers larger than the largest floating point number representable against any float will result in an exception being raised:: >>> cmp(1.0, 10**309) Traceback (most recent call last): File "", line 1, in ? OverflowError: long int too large to convert to float Even when large integers are compared against positive infinity:: >>> cmp(1e309, 10**309) Traceback (most recent call last): File "", line 1, in ? OverflowError: long int too large to convert to float Introducing an ``All`` built-in that works as described does not take much effort. A sample Python implementation is included. Motivation ========== There are hundreds of algorithms that begin by initializing some set of values to a logical (or numeric) infinity. Python lacks a positive infinity that works consistently or really is the largest value that can be attained. By adding the ``All`` constant (or built-in), Python would have a real maximum value, and such algorithms can become clearer due to the reduction of special cases. Take for example, finding the minimum in a sequence:: def findmin_Num(seq): BIG = 0 cur = BIG for obj in seq: if cur == BIG: cur = obj BIG = max(cur, BIG) + 1 else: cur = min(cur, obj) return cur def findmin_None(seq): cur = None for obj in seq: if obj < cur or (cur is None): cur = obj if cur is None: return cur return cur def findmin_All(seq): cur = All for obj in seq: cur = min(obj, cur) return cur Guido brought up the idea of just negating everything and comparing [2]_. Certainly this does work when using numbers, but it does not remove the special case (actually adds one) and results in the code being less readable. :: #we have All available a = min(a, b) #we don't have All available if a is not None: if b is None: a = b else: a = -max(-a, -b) Implementation ============== :: class _AllType(object): def __cmp__(self, other): if isinstance(other, self.__class__): return 0 return 1 def __repr__(self): return 'All' import sys sys.modules['__builtin__'].All = _AllType() Results of Test Run in Python 2.3.3:: >>> max(All, 2**65536) All >>> min(All, 2**65536) 20035299304068464649790... (lines removed for brevity) ...72339445587895905719156736L >>> max(All, None) All >>> min(All, None) >>> print min(All, None) None >>> bool(All) True >>> not None 1 >>> not All 0 Open Issues =========== ``All`` seemed to be an awkward object to various Python developers on the python-dev mailing list. The author hopes that with this updated PEP, developers will no longer find ``All`` awkward. References ========== .. [1] RE: [Python-Dev] Re: Got None. Maybe Some?, Peters, Tim (http://mail.python.org/pipermail/python-dev/2003-December/041374.html) .. [2] Re: [Python-Dev] Got None. Maybe Some?, von Rossum, Guido (http://mail.python.org/pipermail/python-dev/2003-December/041352.html) .. [3] [Python-Dev] Re: Got None. Maybe Some?, Reedy, Terry (http://mail.python.org/pipermail/python-dev/2003-December/041337.html) Changes ======= Added this section. Renamed ``Some`` to ``All``: Some was an arbitrary name that suffered from being unclear. [3]_ Made ``All`` a subclass of object in order for it to become a new style class. Removed mathematical negation and casting to float in Open Issues. None is not a number and is not treated as one, ``All`` shouldn't be either. Added Motivation section. Changed markup to reStructuredText. Copyright ========= This document has been placed in the public domain. .. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 74 End: Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.260 retrieving revision 1.261 diff -C2 -d -r1.260 -r1.261 *** pep-0000.txt 3 Jan 2004 16:23:15 -0000 1.260 --- pep-0000.txt 4 Jan 2004 17:30:47 -0000 1.261 *************** *** 122,125 **** --- 122,126 ---- S 324 popen5 - New POSIX process module Astrand S 325 Resource-Release Support for Generators Pedroni + S 326 A Case for All Carlson S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 344,347 **** --- 345,349 ---- S 324 popen5 - New POSIX process module Astrand S 325 Resource-Release Support for Generators Pedroni + S 326 A Case for All Carlson SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 371,374 **** --- 373,377 ---- Baxter, Anthony anthony@interlink.com.au Bellman, Thomas bellman+pep-divmod@lysator.liu.se + Carlson, Josiah jcarlson@uci.edu Carroll, W Isaac icarroll@pobox.com Cole, Dave djc@object-craft.com.au From rhettinger at users.sourceforge.net Sun Jan 4 16:19:21 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Jan 4 16:19:24 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libtimeit.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv21312 Modified Files: libtimeit.tex Log Message: Show how to re-enable GC during timings. Index: libtimeit.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtimeit.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** libtimeit.tex 20 Sep 2003 11:09:28 -0000 1.6 --- libtimeit.tex 4 Jan 2004 21:19:18 -0000 1.7 *************** *** 83,86 **** --- 83,98 ---- statement, the setup statement and the timer function to be used are passed to the constructor. + + \begin{notice} + By default, \method{timeit()} temporarily turns off garbage collection + during the timing. The advantage of this approach is that it makes + independent timings more comparable. This disadvantage is that GC + may be an important component of the performance of the function being + measured. If so, GC can be re-enabled as the first statement in the + \var{setup} string. For example: + \begin{verbatim} + timeit.Timer('for i in xrange(10): oct(i)', 'gc.enable()').timeit() + \end{verbatim} + \end{notice} \end{methoddesc} From jackjansen at users.sourceforge.net Sun Jan 4 17:33:35 2004 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Sun Jan 4 17:33:40 2004 Subject: [Python-checkins] python/dist/src/Mac/Modules/qt _Qtmodule.c, 1.20, 1.21 qtsupport.py, 1.25, 1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory sc8-pr-cvs1:/tmp/cvs-serv4011 Modified Files: _Qtmodule.c qtsupport.py Log Message: Allow passing NULL pointers by passing None. This also works for the factory functions, so you can call quicktime functions that are implemented as methods on NULL too. Still don't allow quicktime functions to return NULL pointers, though: I think this always signals an error condition. Index: _Qtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** _Qtmodule.c 3 Jan 2004 17:23:26 -0000 1.20 --- _Qtmodule.c 4 Jan 2004 22:33:33 -0000 1.21 *************** *** 99,103 **** IdleManagerObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null IdleManager"); return NULL; } --- 99,103 ---- IdleManagerObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create IdleManager from NULL pointer"); return NULL; } *************** *** 109,112 **** --- 109,117 ---- int IdleManagerObj_Convert(PyObject *v, IdleManager *p_itself) { + if (v == Py_None) + { + *p_itself = NULL; + return 1; + } if (!IdleManagerObj_Check(v)) { *************** *** 217,221 **** MovieControllerObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null MovieController"); return NULL; } --- 222,226 ---- MovieControllerObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create MovieController from NULL pointer"); return NULL; } *************** *** 227,230 **** --- 232,240 ---- int MovieCtlObj_Convert(PyObject *v, MovieController *p_itself) { + if (v == Py_None) + { + *p_itself = NULL; + return 1; + } if (!MovieCtlObj_Check(v)) { *************** *** 238,242 **** static void MovieCtlObj_dealloc(MovieControllerObject *self) { ! DisposeMovieController(self->ob_itself); self->ob_type->tp_free((PyObject *)self); } --- 248,252 ---- static void MovieCtlObj_dealloc(MovieControllerObject *self) { ! if (self->ob_itself) DisposeMovieController(self->ob_itself); self->ob_type->tp_free((PyObject *)self); } *************** *** 1331,1335 **** TimeBaseObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null TimeBase"); return NULL; } --- 1341,1345 ---- TimeBaseObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create TimeBase from NULL pointer"); return NULL; } *************** *** 1341,1344 **** --- 1351,1359 ---- int TimeBaseObj_Convert(PyObject *v, TimeBase *p_itself) { + if (v == Py_None) + { + *p_itself = NULL; + return 1; + } if (!TimeBaseObj_Check(v)) { *************** *** 1819,1823 **** UserDataObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null UserData"); return NULL; } --- 1834,1838 ---- UserDataObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create UserData from NULL pointer"); return NULL; } *************** *** 1829,1832 **** --- 1844,1852 ---- int UserDataObj_Convert(PyObject *v, UserData *p_itself) { + if (v == Py_None) + { + *p_itself = NULL; + return 1; + } if (!UserDataObj_Check(v)) { *************** *** 1840,1844 **** static void UserDataObj_dealloc(UserDataObject *self) { ! DisposeUserData(self->ob_itself); self->ob_type->tp_free((PyObject *)self); } --- 1860,1864 ---- static void UserDataObj_dealloc(UserDataObject *self) { ! if (self->ob_itself) DisposeUserData(self->ob_itself); self->ob_type->tp_free((PyObject *)self); } *************** *** 2184,2188 **** MediaObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null Media"); return NULL; } --- 2204,2208 ---- MediaObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create Media from NULL pointer"); return NULL; } *************** *** 2194,2197 **** --- 2214,2222 ---- int MediaObj_Convert(PyObject *v, Media *p_itself) { + if (v == Py_None) + { + *p_itself = NULL; + return 1; + } if (!MediaObj_Check(v)) { *************** *** 2205,2209 **** static void MediaObj_dealloc(MediaObject *self) { ! DisposeTrackMedia(self->ob_itself); self->ob_type->tp_free((PyObject *)self); } --- 2230,2234 ---- static void MediaObj_dealloc(MediaObject *self) { ! if (self->ob_itself) DisposeTrackMedia(self->ob_itself); self->ob_type->tp_free((PyObject *)self); } *************** *** 3420,3424 **** TrackObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null Track"); return NULL; } --- 3445,3449 ---- TrackObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create Track from NULL pointer"); return NULL; } *************** *** 3430,3433 **** --- 3455,3463 ---- int TrackObj_Convert(PyObject *v, Track *p_itself) { + if (v == Py_None) + { + *p_itself = NULL; + return 1; + } if (!TrackObj_Check(v)) { *************** *** 3441,3445 **** static void TrackObj_dealloc(TrackObject *self) { ! DisposeMovieTrack(self->ob_itself); self->ob_type->tp_free((PyObject *)self); } --- 3471,3475 ---- static void TrackObj_dealloc(TrackObject *self) { ! if (self->ob_itself) DisposeMovieTrack(self->ob_itself); self->ob_type->tp_free((PyObject *)self); } *************** *** 4762,4766 **** MovieObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null Movie"); return NULL; } --- 4792,4796 ---- MovieObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create Movie from NULL pointer"); return NULL; } *************** *** 4772,4775 **** --- 4802,4810 ---- int MovieObj_Convert(PyObject *v, Movie *p_itself) { + if (v == Py_None) + { + *p_itself = NULL; + return 1; + } if (!MovieObj_Check(v)) { *************** *** 4783,4787 **** static void MovieObj_dealloc(MovieObject *self) { ! DisposeMovie(self->ob_itself); self->ob_type->tp_free((PyObject *)self); } --- 4818,4822 ---- static void MovieObj_dealloc(MovieObject *self) { ! if (self->ob_itself) DisposeMovie(self->ob_itself); self->ob_type->tp_free((PyObject *)self); } *************** *** 7309,7313 **** SGOutputObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null SGOutput"); return NULL; } --- 7344,7348 ---- SGOutputObject *it; if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create SGOutput from NULL pointer"); return NULL; } *************** *** 7319,7322 **** --- 7354,7362 ---- int SGOutputObj_Convert(PyObject *v, SGOutput *p_itself) { + if (v == Py_None) + { + *p_itself = NULL; + return 1; + } if (!SGOutputObj_Check(v)) { Index: qtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtsupport.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** qtsupport.py 3 Jan 2004 17:23:27 -0000 1.25 --- qtsupport.py 4 Jan 2004 22:33:33 -0000 1.26 *************** *** 206,282 **** dummyStringPtr = FakeType('(StringPtr)0') ! class MovieObjectDefinition(PEP253Mixin, GlobalObjectDefinition): def outputCheckNewArg(self): Output("""if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null Movie"); return NULL; ! }""") def outputFreeIt(self, itselfname): ! Output("DisposeMovie(%s);", itselfname) ! class TrackObjectDefinition(PEP253Mixin, GlobalObjectDefinition): ! def outputCheckNewArg(self): ! Output("""if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null Track"); ! return NULL; ! }""") def outputFreeIt(self, itselfname): ! Output("DisposeMovieTrack(%s);", itselfname) ! class MediaObjectDefinition(PEP253Mixin, GlobalObjectDefinition): ! def outputCheckNewArg(self): ! Output("""if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null Media"); ! return NULL; ! }""") def outputFreeIt(self, itselfname): ! Output("DisposeTrackMedia(%s);", itselfname) ! class UserDataObjectDefinition(PEP253Mixin, GlobalObjectDefinition): ! def outputCheckNewArg(self): ! Output("""if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null UserData"); ! return NULL; ! }""") def outputFreeIt(self, itselfname): ! Output("DisposeUserData(%s);", itselfname) ! ! class TimeBaseObjectDefinition(PEP253Mixin, GlobalObjectDefinition): ! def outputCheckNewArg(self): ! Output("""if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null TimeBase"); ! return NULL; ! }""") ! ## def outputFreeIt(self, itselfname): ! ## Output("DisposeTimeBase(%s);", itselfname) ! class MovieCtlObjectDefinition(PEP253Mixin, GlobalObjectDefinition): ! def outputCheckNewArg(self): ! Output("""if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null MovieController"); ! return NULL; ! }""") def outputFreeIt(self, itselfname): ! Output("DisposeMovieController(%s);", itselfname) ! ! class IdleManagerObjectDefinition(PEP253Mixin, GlobalObjectDefinition): ! def outputCheckNewArg(self): ! Output("""if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null IdleManager"); ! return NULL; ! }""") ! class SGOutputObjectDefinition(PEP253Mixin, GlobalObjectDefinition): # XXXX I'm not sure I fully understand how SGOutput works. It seems it's always tied # to a specific SeqGrabComponent, but I'm not 100% sure. Also, I'm not sure all the # routines that return an SGOutput actually return a *new* SGOutput. Need to read up on # this. ! def outputCheckNewArg(self): ! Output("""if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create null SGOutput"); ! return NULL; ! }""") ! # def outputFreeIt(self, itselfname): ! # Output("SGDisposeOutput(%s);", itselfname) --- 206,261 ---- dummyStringPtr = FakeType('(StringPtr)0') ! # XXXX Need to override output_tp_newBody() to allow for None initializer. ! class QtGlobalObjectDefinition(PEP253Mixin, GlobalObjectDefinition): def outputCheckNewArg(self): + # We don't allow NULL pointers to be returned by QuickTime API calls, + # in stead we raise an exception Output("""if (itself == NULL) { ! PyErr_SetString(Qt_Error,"Cannot create %s from NULL pointer"); return NULL; ! }""", self.name) ! ! def outputCheckConvertArg(self): ! # But what we do allow is passing None whereever a quicktime object is ! # expected, and pass this as NULL to the API routines. Note you can ! # call methods too by creating an object with None as the initializer. ! Output("if (v == Py_None)") ! OutLbrace() ! Output("*p_itself = NULL;") ! Output("return 1;") ! OutRbrace() ! ! class MovieObjectDefinition(QtGlobalObjectDefinition): def outputFreeIt(self, itselfname): ! Output("if (%s) DisposeMovie(%s);", itselfname, itselfname) ! class TrackObjectDefinition(QtGlobalObjectDefinition): def outputFreeIt(self, itselfname): ! Output("if (%s) DisposeMovieTrack(%s);", itselfname, itselfname) ! class MediaObjectDefinition(QtGlobalObjectDefinition): def outputFreeIt(self, itselfname): ! Output("if (%s) DisposeTrackMedia(%s);", itselfname, itselfname) ! class UserDataObjectDefinition(QtGlobalObjectDefinition): def outputFreeIt(self, itselfname): ! Output("if (%s) DisposeUserData(%s);", itselfname, itselfname) ! class TimeBaseObjectDefinition(QtGlobalObjectDefinition): ! pass ! ! class MovieCtlObjectDefinition(QtGlobalObjectDefinition): def outputFreeIt(self, itselfname): ! Output("if (%s) DisposeMovieController(%s);", itselfname, itselfname) ! class IdleManagerObjectDefinition(QtGlobalObjectDefinition): ! pass ! ! class SGOutputObjectDefinition(QtGlobalObjectDefinition): # XXXX I'm not sure I fully understand how SGOutput works. It seems it's always tied # to a specific SeqGrabComponent, but I'm not 100% sure. Also, I'm not sure all the # routines that return an SGOutput actually return a *new* SGOutput. Need to read up on # this. ! pass From perky at users.sourceforge.net Sun Jan 4 19:29:54 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sun Jan 4 19:29:57 2004 Subject: [Python-checkins] python/dist/src/Objects stringobject.c, 2.216, 2.217 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv24986/Objects Modified Files: stringobject.c Log Message: [SF #866875] Add a specialized routine for one character separaters on str.split() and str.rsplit(). Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.216 retrieving revision 2.217 diff -C2 -d -r2.216 -r2.217 *** stringobject.c 22 Dec 2003 16:31:41 -0000 2.216 --- stringobject.c 5 Jan 2004 00:29:51 -0000 2.217 *************** *** 1283,1292 **** #define STRIPNAME(i) (stripformat[i]+3) static PyObject * split_whitespace(const char *s, int len, int maxsplit) { ! int i, j, err; ! PyObject* item; PyObject *list = PyList_New(0); --- 1283,1315 ---- #define STRIPNAME(i) (stripformat[i]+3) + #define SPLIT_APPEND(data, left, right) \ + str = PyString_FromStringAndSize((data) + (left), \ + (right) - (left)); \ + if (str == NULL) \ + goto onError; \ + if (PyList_Append(list, str)) { \ + Py_DECREF(str); \ + goto onError; \ + } \ + else \ + Py_DECREF(str); + + #define SPLIT_INSERT(data, left, right) \ + str = PyString_FromStringAndSize((data) + (left), \ + (right) - (left)); \ + if (str == NULL) \ + goto onError; \ + if (PyList_Insert(list, 0, str)) { \ + Py_DECREF(str); \ + goto onError; \ + } \ + else \ + Py_DECREF(str); static PyObject * split_whitespace(const char *s, int len, int maxsplit) { ! int i, j; ! PyObject *str; PyObject *list = PyList_New(0); *************** *** 1303,1313 **** if (maxsplit-- <= 0) break; ! item = PyString_FromStringAndSize(s+j, (int)(i-j)); ! if (item == NULL) ! goto finally; ! err = PyList_Append(list, item); ! Py_DECREF(item); ! if (err < 0) ! goto finally; while (i < len && isspace(Py_CHARMASK(s[i]))) i++; --- 1326,1330 ---- if (maxsplit-- <= 0) break; ! SPLIT_APPEND(s, j, i); while (i < len && isspace(Py_CHARMASK(s[i]))) i++; *************** *** 1316,1333 **** } if (j < len) { ! item = PyString_FromStringAndSize(s+j, (int)(len - j)); ! if (item == NULL) ! goto finally; ! err = PyList_Append(list, item); ! Py_DECREF(item); ! if (err < 0) ! goto finally; } return list; ! finally: Py_DECREF(list); return NULL; } PyDoc_STRVAR(split__doc__, --- 1333,1372 ---- } if (j < len) { ! SPLIT_APPEND(s, j, len); } return list; ! onError: Py_DECREF(list); return NULL; } + static PyObject * + split_char(const char *s, int len, char ch, int maxcount) + { + register int i, j; + PyObject *str; + PyObject *list = PyList_New(0); + + if (list == NULL) + return NULL; + + for (i = j = 0; i < len; ) { + if (s[i] == ch) { + if (maxcount-- <= 0) + break; + SPLIT_APPEND(s, j, i); + i = j = i + 1; + } else + i++; + } + if (j <= len) { + SPLIT_APPEND(s, j, len); + } + return list; + + onError: + Py_DECREF(list); + return NULL; + } PyDoc_STRVAR(split__doc__, *************** *** 1363,1370 **** --- 1402,1412 ---- else if (PyObject_AsCharBuffer(subobj, &sub, &n)) return NULL; + if (n == 0) { PyErr_SetString(PyExc_ValueError, "empty separator"); return NULL; } + else if (n == 1) + return split_char(s, len, sub[0], maxsplit); list = PyList_New(0); *************** *** 1407,1412 **** rsplit_whitespace(const char *s, int len, int maxsplit) { ! int i, j, err; ! PyObject* item; PyObject *list = PyList_New(0); --- 1449,1454 ---- rsplit_whitespace(const char *s, int len, int maxsplit) { ! int i, j; ! PyObject *str; PyObject *list = PyList_New(0); *************** *** 1423,1433 **** if (maxsplit-- <= 0) break; ! item = PyString_FromStringAndSize(s+i+1, (int)(j-i)); ! if (item == NULL) ! goto finally; ! err = PyList_Insert(list, 0, item); ! Py_DECREF(item); ! if (err < 0) ! goto finally; while (i >= 0 && isspace(Py_CHARMASK(s[i]))) i--; --- 1465,1469 ---- if (maxsplit-- <= 0) break; ! SPLIT_INSERT(s, i + 1, j + 1); while (i >= 0 && isspace(Py_CHARMASK(s[i]))) i--; *************** *** 1436,1453 **** } if (j >= 0) { ! item = PyString_FromStringAndSize(s, (int)(j + 1)); ! if (item == NULL) ! goto finally; ! err = PyList_Insert(list, 0, item); ! Py_DECREF(item); ! if (err < 0) ! goto finally; } return list; ! finally: Py_DECREF(list); return NULL; } PyDoc_STRVAR(rsplit__doc__, --- 1472,1511 ---- } if (j >= 0) { ! SPLIT_INSERT(s, 0, j + 1); } return list; ! onError: Py_DECREF(list); return NULL; } + static PyObject * + rsplit_char(const char *s, int len, char ch, int maxcount) + { + register int i, j; + PyObject *str; + PyObject *list = PyList_New(0); + + if (list == NULL) + return NULL; + + for (i = j = len - 1; i >= 0; ) { + if (s[i] == ch) { + if (maxcount-- <= 0) + break; + SPLIT_INSERT(s, i + 1, j + 1); + j = i = i - 1; + } else + i--; + } + if (j >= -1) { + SPLIT_INSERT(s, 0, j + 1); + } + return list; + + onError: + Py_DECREF(list); + return NULL; + } PyDoc_STRVAR(rsplit__doc__, *************** *** 1484,1491 **** --- 1542,1552 ---- else if (PyObject_AsCharBuffer(subobj, &sub, &n)) return NULL; + if (n == 0) { PyErr_SetString(PyExc_ValueError, "empty separator"); return NULL; } + else if (n == 1) + return rsplit_char(s, len, sub[0], maxsplit); list = PyList_New(0); *************** *** 3104,3118 **** Line breaks are not included in the resulting list unless keepends\n\ is given and true."); - - #define SPLIT_APPEND(data, left, right) \ - str = PyString_FromStringAndSize(data + left, right - left); \ - if (!str) \ - goto onError; \ - if (PyList_Append(list, str)) { \ - Py_DECREF(str); \ - goto onError; \ - } \ - else \ - Py_DECREF(str); static PyObject* --- 3165,3168 ---- From perky at users.sourceforge.net Sun Jan 4 19:29:53 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sun Jan 4 19:29:59 2004 Subject: [Python-checkins] python/dist/src/Lib/test string_tests.py, 1.36, 1.37 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv24986/Lib/test Modified Files: string_tests.py Log Message: [SF #866875] Add a specialized routine for one character separaters on str.split() and str.rsplit(). Index: string_tests.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/string_tests.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** string_tests.py 23 Dec 2003 09:10:16 -0000 1.36 --- string_tests.py 5 Jan 2004 00:29:51 -0000 1.37 *************** *** 176,181 **** self.checkequal(['this', 'is', 'the', 'split', 'function'], 'this is the split function', 'split') ! self.checkequal(['a', 'b', 'c', 'd'], 'a|b|c|d', 'split', '|') ! self.checkequal(['a', 'b', 'c|d'], 'a|b|c|d', 'split', '|', 2) self.checkequal(['a', 'b c d'], 'a b c d', 'split', None, 1) self.checkequal(['a', 'b', 'c d'], 'a b c d', 'split', None, 2) --- 176,182 ---- self.checkequal(['this', 'is', 'the', 'split', 'function'], 'this is the split function', 'split') ! ! # by whitespace ! self.checkequal(['a', 'b', 'c', 'd'], 'a b c d ', 'split') self.checkequal(['a', 'b c d'], 'a b c d', 'split', None, 1) self.checkequal(['a', 'b', 'c d'], 'a b c d', 'split', None, 2) *************** *** 184,191 **** self.checkequal(['a b c d'], 'a b c d', 'split', None, 0) self.checkequal(['a', 'b', 'c d'], 'a b c d', 'split', None, 2) ! self.checkequal(['a', 'b', 'c', 'd'], 'a b c d ', 'split') self.checkequal(['a', 'b', 'c', 'd'], 'a//b//c//d', 'split', '//') self.checkequal(['endcase ', ''], 'endcase test', 'split', 'test') self.checkraises(TypeError, 'hello', 'split', 42, 42, 42) --- 185,214 ---- self.checkequal(['a b c d'], 'a b c d', 'split', None, 0) self.checkequal(['a', 'b', 'c d'], 'a b c d', 'split', None, 2) ! ! # by a char ! self.checkequal(['a', 'b', 'c', 'd'], 'a|b|c|d', 'split', '|') ! self.checkequal(['a', 'b|c|d'], 'a|b|c|d', 'split', '|', 1) ! self.checkequal(['a', 'b', 'c|d'], 'a|b|c|d', 'split', '|', 2) ! self.checkequal(['a', 'b', 'c', 'd'], 'a|b|c|d', 'split', '|', 3) ! self.checkequal(['a', 'b', 'c', 'd'], 'a|b|c|d', 'split', '|', 4) ! self.checkequal(['a|b|c|d'], 'a|b|c|d', 'split', '|', 0) ! self.checkequal(['a', '', 'b||c||d'], 'a||b||c||d', 'split', '|', 2) ! self.checkequal(['endcase ', ''], 'endcase |', 'split', '|') ! self.checkequal(['a', '', 'b\x00c\x00d'], 'a\x00\x00b\x00c\x00d', 'split', '\x00', 2) ! ! # by string self.checkequal(['a', 'b', 'c', 'd'], 'a//b//c//d', 'split', '//') + self.checkequal(['a', 'b//c//d'], 'a//b//c//d', 'split', '//', 1) + self.checkequal(['a', 'b', 'c//d'], 'a//b//c//d', 'split', '//', 2) + self.checkequal(['a', 'b', 'c', 'd'], 'a//b//c//d', 'split', '//', 3) + self.checkequal(['a', 'b', 'c', 'd'], 'a//b//c//d', 'split', '//', 4) + self.checkequal(['a//b//c//d'], 'a//b//c//d', 'split', '//', 0) + self.checkequal(['a', '', 'b////c////d'], 'a////b////c////d', 'split', '//', 2) self.checkequal(['endcase ', ''], 'endcase test', 'split', 'test') + # mixed use of str and unicode + self.checkequal([u'a', u'b', u'c d'], 'a b c d', 'split', u' ', 2) + + # argument type self.checkraises(TypeError, 'hello', 'split', 42, 42, 42) *************** *** 193,198 **** self.checkequal(['this', 'is', 'the', 'rsplit', 'function'], 'this is the rsplit function', 'rsplit') ! self.checkequal(['a', 'b', 'c', 'd'], 'a|b|c|d', 'rsplit', '|') ! self.checkequal(['a|b', 'c', 'd'], 'a|b|c|d', 'rsplit', '|', 2) self.checkequal(['a b c', 'd'], 'a b c d', 'rsplit', None, 1) self.checkequal(['a b', 'c', 'd'], 'a b c d', 'rsplit', None, 2) --- 216,222 ---- self.checkequal(['this', 'is', 'the', 'rsplit', 'function'], 'this is the rsplit function', 'rsplit') ! ! # by whitespace ! self.checkequal(['a', 'b', 'c', 'd'], 'a b c d ', 'rsplit') self.checkequal(['a b c', 'd'], 'a b c d', 'rsplit', None, 1) self.checkequal(['a b', 'c', 'd'], 'a b c d', 'rsplit', None, 2) *************** *** 200,214 **** self.checkequal(['a', 'b', 'c', 'd'], 'a b c d', 'rsplit', None, 4) self.checkequal(['a b c d'], 'a b c d', 'rsplit', None, 0) - self.checkequal(['a, b, c', 'd'], 'a, b, c, d', 'rsplit', ', ', 1) - self.checkequal(['a, b', 'c', 'd'], 'a, b, c, d', 'rsplit', ', ', 2) - self.checkequal(['a', 'b', 'c', 'd'], 'a, b, c, d', 'rsplit', ', ', 3) - self.checkequal(['a', 'b', 'c', 'd'], 'a, b, c, d', 'rsplit', ', ', 4) - self.checkequal(['a, b, c, d'], 'a, b, c, d', 'rsplit', ', ', 0) self.checkequal(['a b', 'c', 'd'], 'a b c d', 'rsplit', None, 2) ! self.checkequal(['a\x00b', 'c'], 'a\x00b\x00c', 'rsplit', '\x00', 1) ! self.checkequal(['', ''], 'abcd', 'rsplit', 'abcd') self.checkequal([u'a b', u'c', u'd'], 'a b c d', 'rsplit', u' ', 2) ! self.checkequal(['', ' endcase'], '| endcase', 'rsplit', '|') ! self.checkequal(['', ' endcase'], 'test endcase', 'rsplit', 'test') def test_strip(self): --- 224,255 ---- self.checkequal(['a', 'b', 'c', 'd'], 'a b c d', 'rsplit', None, 4) self.checkequal(['a b c d'], 'a b c d', 'rsplit', None, 0) self.checkequal(['a b', 'c', 'd'], 'a b c d', 'rsplit', None, 2) ! ! # by a char ! self.checkequal(['a', 'b', 'c', 'd'], 'a|b|c|d', 'rsplit', '|') ! self.checkequal(['a|b|c', 'd'], 'a|b|c|d', 'rsplit', '|', 1) ! self.checkequal(['a|b', 'c', 'd'], 'a|b|c|d', 'rsplit', '|', 2) ! self.checkequal(['a', 'b', 'c', 'd'], 'a|b|c|d', 'rsplit', '|', 3) ! self.checkequal(['a', 'b', 'c', 'd'], 'a|b|c|d', 'rsplit', '|', 4) ! self.checkequal(['a|b|c|d'], 'a|b|c|d', 'rsplit', '|', 0) ! self.checkequal(['a||b||c', '', 'd'], 'a||b||c||d', 'rsplit', '|', 2) ! self.checkequal(['', ' begincase'], '| begincase', 'rsplit', '|') ! self.checkequal(['a\x00\x00b', 'c', 'd'], 'a\x00\x00b\x00c\x00d', 'rsplit', '\x00', 2) ! ! # by string ! self.checkequal(['a', 'b', 'c', 'd'], 'a//b//c//d', 'rsplit', '//') ! self.checkequal(['a//b//c', 'd'], 'a//b//c//d', 'rsplit', '//', 1) ! self.checkequal(['a//b', 'c', 'd'], 'a//b//c//d', 'rsplit', '//', 2) ! self.checkequal(['a', 'b', 'c', 'd'], 'a//b//c//d', 'rsplit', '//', 3) ! self.checkequal(['a', 'b', 'c', 'd'], 'a//b//c//d', 'rsplit', '//', 4) ! self.checkequal(['a//b//c//d'], 'a//b//c//d', 'rsplit', '//', 0) ! self.checkequal(['a////b////c', '', 'd'], 'a////b////c////d', 'rsplit', '//', 2) ! self.checkequal(['', ' begincase'], 'test begincase', 'rsplit', 'test') ! ! # mixed use of str and unicode self.checkequal([u'a b', u'c', u'd'], 'a b c d', 'rsplit', u' ', 2) ! ! # argument type ! self.checkraises(TypeError, 'hello', 'rsplit', 42, 42, 42) def test_strip(self): From rhettinger at users.sourceforge.net Sun Jan 4 19:29:59 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Jan 4 19:30:02 2004 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.24, 1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv25069 Modified Files: whatsnew24.tex Log Message: * Add various updates reflecting the last two weeks of checkins: timeit, base64, MSVC++ 7.1 build, METH_COEXISTS, and optimizations. * Put in a comment suggesting an improvement to the rsplit() example. Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** whatsnew24.tex 2 Jan 2004 06:57:50 -0000 1.24 --- whatsnew24.tex 5 Jan 2004 00:29:57 -0000 1.25 *************** *** 150,153 **** --- 150,161 ---- \end{verbatim} + % Consider replacing the above example with one that is less + % abstract and more suggestive of why the function is useful: + % + % >>> 'www.python.org'.split('.', 1) + % ['www', 'python.org'] + % >>> 'www.python.org'.rsplit('.', 1) + % ['www.python', 'org'] + \item The \method{sort()} method of lists gained three keyword arguments, \var{cmp}, \var{key}, and \var{reverse}. These arguments *************** *** 260,264 **** \begin{itemize} ! \item Optimizations should be described here. \end{itemize} --- 268,283 ---- \begin{itemize} ! \item \function{list()}, \function{tuple()}, \function{map()}, ! \function{filter()}, and \function{zip()} now run several times ! faster with non-sequence arguments that supply a \method{__len__()} ! method. Previously, the pre-sizing optimization only applied to ! sequence arguments. ! ! \item The unbound methods \method{list.__getitem__()}, ! \method{dict.__getitem__()}, and \method{dict.__contains__()} are ! are now implemented as \class{method_descriptor} objects rather ! than \class{wrapper_descriptor} objects. This form of optimized ! access doubles their performance and makes them more suitable for ! use as arguments to functionals: \samp{map(dict.__contains__, mydict)}. \end{itemize} *************** *** 424,427 **** --- 443,451 ---- look-up process. + \item A new method flag, \code{METH_COEXISTS}, allows a function + defined in slots to co-exist with a PyCFunction having the same name. + This can halve the access to time to a method such as + \method{set.__contains__()} + \end{itemize} *************** *** 430,434 **** \subsection{Port-Specific Changes} ! Platform-specific changes go here. --- 454,462 ---- \subsection{Port-Specific Changes} ! \begin{itemize} ! ! \item The Windows port now builds under MSVC++ 7.1 as well as version 6. ! ! \end{itemize} *************** *** 445,449 **** \begin{itemize} ! \item Details go here. \end{itemize} --- 473,484 ---- \begin{itemize} ! \item The \module{timeit} module now automatically disables periodic ! garbarge collection during the timing loop. This change makes ! consecutive timings more comparable. ! ! \item The \module{base64} module now has more complete RFC 3548 support ! for Base64, Base32, and Base16 encoding and decoding, including ! optional case folding and optional alternative alphabets. ! (Contributed by Barry Warsaw.) \end{itemize} From rhettinger at users.sourceforge.net Mon Jan 5 03:15:27 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Jan 5 03:15:31 2004 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.25, 1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv26530 Modified Files: whatsnew24.tex Log Message: Small correction to example Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** whatsnew24.tex 5 Jan 2004 00:29:57 -0000 1.25 --- whatsnew24.tex 5 Jan 2004 08:15:20 -0000 1.26 *************** *** 274,283 **** sequence arguments. ! \item The unbound methods \method{list.__getitem__()}, \method{dict.__getitem__()}, and \method{dict.__contains__()} are are now implemented as \class{method_descriptor} objects rather than \class{wrapper_descriptor} objects. This form of optimized access doubles their performance and makes them more suitable for ! use as arguments to functionals: \samp{map(dict.__contains__, mydict)}. \end{itemize} --- 274,284 ---- sequence arguments. ! \item The methods \method{list.__getitem__()}, \method{dict.__getitem__()}, and \method{dict.__contains__()} are are now implemented as \class{method_descriptor} objects rather than \class{wrapper_descriptor} objects. This form of optimized access doubles their performance and makes them more suitable for ! use as arguments to functionals: ! \samp{map(mydict.__getitem__, keylist)}. \end{itemize} From rhettinger at users.sourceforge.net Mon Jan 5 05:13:36 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Jan 5 05:13:39 2004 Subject: [Python-checkins] python/dist/src/Lib bisect.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv14923/Lib Modified Files: bisect.py Log Message: SF Patch #864863: Bisect C implementation (Contributed by Dmitry Vasiliev.) Index: bisect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bisect.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** bisect.py 4 Sep 2001 19:14:13 -0000 1.8 --- bisect.py 5 Jan 2004 10:13:34 -0000 1.9 *************** *** 77,78 **** --- 77,84 ---- else: hi = mid return lo + + # Overwrite above definitions with a fast C implementation + try: + from _bisect import bisect_right, bisect_left, insort_left, insort_right, insort, bisect + except ImportError: + pass From rhettinger at users.sourceforge.net Mon Jan 5 05:13:36 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Jan 5 05:13:44 2004 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.26, 1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv14923/Doc/whatsnew Modified Files: whatsnew24.tex Log Message: SF Patch #864863: Bisect C implementation (Contributed by Dmitry Vasiliev.) Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** whatsnew24.tex 5 Jan 2004 08:15:20 -0000 1.26 --- whatsnew24.tex 5 Jan 2004 10:13:34 -0000 1.27 *************** *** 306,309 **** --- 306,313 ---- (Contributed by J\"org Lehmann.) + \item The \module{bisect} module now has an underlying C implementation + for improved performance. + (Contributed by Dmitry Vasiliev.) + \item The \module{heapq} module has been converted to C. The resulting ten-fold improvement in speed makes the module suitable for handling From rhettinger at users.sourceforge.net Mon Jan 5 05:13:36 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Jan 5 05:13:45 2004 Subject: [Python-checkins] python/dist/src setup.py,1.179,1.180 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv14923 Modified Files: setup.py Log Message: SF Patch #864863: Bisect C implementation (Contributed by Dmitry Vasiliev.) Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.179 retrieving revision 1.180 diff -C2 -d -r1.179 -r1.180 *** setup.py 3 Dec 2003 22:34:19 -0000 1.179 --- setup.py 5 Jan 2004 10:13:33 -0000 1.180 *************** *** 323,326 **** --- 323,328 ---- # fast iterator tools implemented in C exts.append( Extension("itertools", ["itertoolsmodule.c"]) ) + # bisect + exts.append( Extension("_bisect", ["_bisectmodule.c"]) ) # heapq exts.append( Extension("heapq", ["heapqmodule.c"]) ) From rhettinger at users.sourceforge.net Mon Jan 5 05:13:37 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Jan 5 05:13:51 2004 Subject: [Python-checkins] python/dist/src/PC config.c,1.41,1.42 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv14923/PC Modified Files: config.c Log Message: SF Patch #864863: Bisect C implementation (Contributed by Dmitry Vasiliev.) Index: config.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/config.c,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** config.c 2 Jan 2004 21:14:37 -0000 1.41 --- config.c 5 Jan 2004 10:13:35 -0000 1.42 *************** *** 48,51 **** --- 48,52 ---- extern void inititertools(void); extern void initheapq(void); + extern void init_bisect(void); extern void init_symtable(void); extern void initmmap(void); *************** *** 107,110 **** --- 108,112 ---- {"_hotshot", init_hotshot}, {"_random", init_random}, + {"_bisect", init_bisect}, {"heapq", initheapq}, {"itertools", inititertools}, From rhettinger at users.sourceforge.net Mon Jan 5 05:13:37 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Jan 5 05:13:52 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 pythoncore.dsp,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1:/tmp/cvs-serv14923/PC/VC6 Modified Files: pythoncore.dsp Log Message: SF Patch #864863: Bisect C implementation (Contributed by Dmitry Vasiliev.) Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/pythoncore.dsp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pythoncore.dsp 4 Jan 2004 02:00:47 -0000 1.3 --- pythoncore.dsp 5 Jan 2004 10:13:35 -0000 1.4 *************** *** 94,97 **** --- 94,101 ---- # Begin Source File + SOURCE=..\..\Modules\_bisectmodule.c + # End Source File + # Begin Source File + SOURCE=..\..\Modules\_codecsmodule.c # End Source File From rhettinger at users.sourceforge.net Mon Jan 5 05:13:37 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Jan 5 05:13:54 2004 Subject: [Python-checkins] python/dist/src/Modules _bisectmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv14923/Modules Added Files: _bisectmodule.c Log Message: SF Patch #864863: Bisect C implementation (Contributed by Dmitry Vasiliev.) --- NEW FILE: _bisectmodule.c --- /* Bisection algorithms. Drop in replacement for bisect.py Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru). */ #include "Python.h" static int internal_bisect_right(PyObject *list, PyObject *item, int lo, int hi) { PyObject *litem; int mid, res; if (hi == -1) { hi = PySequence_Size(list); if (hi < 0) return -1; } while (lo < hi) { mid = (lo + hi) / 2; litem = PySequence_GetItem(list, mid); if (litem == NULL) return -1; res = PyObject_RichCompareBool(item, litem, Py_LT); Py_DECREF(litem); if (res < 0) return -1; if (res) hi = mid; else lo = mid + 1; } return lo; } static PyObject * bisect_right(PyObject *self, PyObject *args) { PyObject *list, *item; int lo = 0; int hi = -1; int index; if (!PyArg_ParseTuple(args, "OO|ii:bisect_right", &list, &item, &lo, &hi)) return NULL; index = internal_bisect_right(list, item, lo, hi); if (index < 0) return NULL; return PyInt_FromLong(index); } PyDoc_STRVAR(bisect_right_doc, "bisect_right(list, item[, lo[, hi]]) -> index\n\ \n\ Return the index where to insert item x in list a, assuming a is sorted.\n\ \n\ The return value i is such that all e in a[:i] have e <= x, and all e in\n\ a[i:] have e > x. So if x already appears in the list, i points just\n\ beyond the rightmost x already there\n\ \n\ Optional args lo (default 0) and hi (default len(a)) bound the\n\ slice of a to be searched.\n"); static PyObject * insort_right(PyObject *self, PyObject *args) { PyObject *list, *item; int lo = 0; int hi = -1; int index; if (!PyArg_ParseTuple(args, "OO|ii:insort_right", &list, &item, &lo, &hi)) return NULL; index = internal_bisect_right(list, item, lo, hi); if (index < 0) return NULL; if (PyList_Check(list)) { if (PyList_Insert(list, index, item) < 0) return NULL; } else { if (PyObject_CallMethod(list, "insert", "iO", index, item) == NULL) return NULL; } Py_RETURN_NONE; } PyDoc_STRVAR(insort_right_doc, "insort_right(list, item[, lo[, hi]])\n\ \n\ Insert item x in list a, and keep it sorted assuming a is sorted.\n\ \n\ If x is already in a, insert it to the right of the rightmost x.\n\ \n\ Optional args lo (default 0) and hi (default len(a)) bound the\n\ slice of a to be searched.\n"); static int internal_bisect_left(PyObject *list, PyObject *item, int lo, int hi) { PyObject *litem; int mid, res; if (hi == -1) { hi = PySequence_Size(list); if (hi < 0) return -1; } while (lo < hi) { mid = (lo + hi) / 2; litem = PySequence_GetItem(list, mid); if (litem == NULL) return -1; res = PyObject_RichCompareBool(litem, item, Py_LT); Py_DECREF(litem); if (res < 0) return -1; if (res) lo = mid + 1; else hi = mid; } return lo; } static PyObject * bisect_left(PyObject *self, PyObject *args) { PyObject *list, *item; int lo = 0; int hi = -1; int index; if (!PyArg_ParseTuple(args, "OO|ii:bisect_left", &list, &item, &lo, &hi)) return NULL; index = internal_bisect_left(list, item, lo, hi); if (index < 0) return NULL; return PyInt_FromLong(index); } PyDoc_STRVAR(bisect_left_doc, "bisect_left(list, item[, lo[, hi]]) -> index\n\ \n\ Return the index where to insert item x in list a, assuming a is sorted.\n\ \n\ The return value i is such that all e in a[:i] have e < x, and all e in\n\ a[i:] have e >= x. So if x already appears in the list, i points just\n\ before the leftmost x already there.\n\ \n\ Optional args lo (default 0) and hi (default len(a)) bound the\n\ slice of a to be searched.\n"); static PyObject * insort_left(PyObject *self, PyObject *args) { PyObject *list, *item; int lo = 0; int hi = -1; int index; if (!PyArg_ParseTuple(args, "OO|ii:insort_left", &list, &item, &lo, &hi)) return NULL; index = internal_bisect_left(list, item, lo, hi); if (index < 0) return NULL; if (PyList_Check(list)) { if (PyList_Insert(list, index, item) < 0) return NULL; } else { if (PyObject_CallMethod(list, "insert", "iO", index, item) == NULL) return NULL; } Py_RETURN_NONE; } PyDoc_STRVAR(insort_left_doc, "insort_left(list, item[, lo[, hi]])\n\ \n\ Insert item x in list a, and keep it sorted assuming a is sorted.\n\ \n\ If x is already in a, insert it to the left of the leftmost x.\n\ \n\ Optional args lo (default 0) and hi (default len(a)) bound the\n\ slice of a to be searched.\n"); PyDoc_STRVAR(bisect_doc, "Alias for bisect_right().\n"); PyDoc_STRVAR(insort_doc, "Alias for insort_right().\n"); static PyMethodDef bisect_methods[] = { {"bisect_right", (PyCFunction)bisect_right, METH_VARARGS, bisect_right_doc}, {"bisect", (PyCFunction)bisect_right, METH_VARARGS, bisect_doc}, {"insort_right", (PyCFunction)insort_right, METH_VARARGS, insort_right_doc}, {"insort", (PyCFunction)insort_right, METH_VARARGS, insort_doc}, {"bisect_left", (PyCFunction)bisect_left, METH_VARARGS, bisect_left_doc}, {"insort_left", (PyCFunction)insort_left, METH_VARARGS, insort_left_doc}, {NULL, NULL} /* sentinel */ }; PyDoc_STRVAR(module_doc, "Bisection algorithms.\n\ \n\ This module provides support for maintaining a list in sorted order without\n\ having to sort the list after each insertion. For long lists of items with\n\ expensive comparison operations, this can be an improvement over the more\n\ common approach.\n"); PyMODINIT_FUNC init_bisect(void) { PyObject *m; m = Py_InitModule3("_bisect", bisect_methods, module_doc); } From rhettinger at users.sourceforge.net Mon Jan 5 05:13:37 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Jan 5 05:13:56 2004 Subject: [Python-checkins] python/dist/src/Misc ACKS, 1.256, 1.257 NEWS, 1.918, 1.919 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv14923/Misc Modified Files: ACKS NEWS Log Message: SF Patch #864863: Bisect C implementation (Contributed by Dmitry Vasiliev.) Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.256 retrieving revision 1.257 diff -C2 -d -r1.256 -r1.257 *** ACKS 28 Dec 2003 07:43:56 -0000 1.256 --- ACKS 5 Jan 2004 10:13:34 -0000 1.257 *************** *** 566,569 **** --- 566,570 ---- Lionel Ulmer Hector Urtubia + Dmitry Vasiliev Frank Vercruesse Jaap Vermeulen Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.918 retrieving revision 1.919 diff -C2 -d -r1.918 -r1.919 *** NEWS 4 Jan 2004 01:13:43 -0000 1.918 --- NEWS 5 Jan 2004 10:13:34 -0000 1.919 *************** *** 211,215 **** os.path.exists(), switched to using os.lstat() directly if possible. ! - heapq.py has been converted to C for improved performance - traceback.format_exc has been added (similar to print_exc but it returns --- 211,216 ---- os.path.exists(), switched to using os.lstat() directly if possible. ! - bisect.py and heapq.py now have underlying C implementations ! for better performance - traceback.format_exc has been added (similar to print_exc but it returns From rhettinger at users.sourceforge.net Mon Jan 5 05:13:36 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Mon Jan 5 05:13:58 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_bisect.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv14923/Lib/test Modified Files: test_bisect.py Log Message: SF Patch #864863: Bisect C implementation (Contributed by Dmitry Vasiliev.) Index: test_bisect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bisect.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_bisect.py 1 May 2003 17:45:32 -0000 1.9 --- test_bisect.py 5 Jan 2004 10:13:34 -0000 1.10 *************** *** 2,5 **** --- 2,6 ---- from test import test_support from bisect import bisect_right, bisect_left, insort_left, insort_right, insort, bisect + from UserList import UserList class TestBisect(unittest.TestCase): *************** *** 90,93 **** --- 91,95 ---- for func, data, elem, expected in self.precomputedCases: self.assertEqual(func(data, elem), expected) + self.assertEqual(func(UserList(data), elem), expected) def test_random(self, n=25): *************** *** 133,152 **** class TestInsort(unittest.TestCase): ! def test_vsListSort(self, n=500): from random import choice ! digits = "0123456789" ! raw = [] ! insorted = [] ! for i in range(n): ! digit = choice(digits) ! raw.append(digit) ! if digit in "02468": ! f = insort_left ! else: ! f = insort_right ! f(insorted, digit) ! sorted = raw[:] ! sorted.sort() ! self.assertEqual(sorted, insorted) def test_backcompatibility(self): --- 135,149 ---- class TestInsort(unittest.TestCase): ! def test_vsBuiltinSort(self, n=500): from random import choice ! for insorted in (list(), UserList()): ! for i in xrange(n): ! digit = choice("0123456789") ! if digit in "02468": ! f = insort_left ! else: ! f = insort_right ! f(insorted, digit) ! self.assertEqual(sorted(insorted), insorted) def test_backcompatibility(self): From mhammond at users.sourceforge.net Mon Jan 5 23:04:03 2004 From: mhammond at users.sourceforge.net (mhammond@users.sourceforge.net) Date: Mon Jan 5 23:04:07 2004 Subject: [Python-checkins] python/dist/src/PCbuild readme.txt,1.46,1.47 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv29684 Modified Files: readme.txt Log Message: Update information about building bsddb, particularly re with and without strong crypto. Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** readme.txt 4 Jan 2004 02:04:35 -0000 1.46 --- readme.txt 6 Jan 2004 04:04:01 -0000 1.47 *************** *** 159,176 **** http://www.sleepycat.com/download/ ! and download version 4.2.42. The file name is db-4.2.52.NC.zip. ! XXX with or without strong cryptography? I picked "without". ! ! Unpack into ! dist\db-4.2.52 ! ! [If using WinZip to unpack the db-4.2.52.NC distro, that requires ! renaming the directory (to remove ".NC") after unpacking. ! ] ! Open dist\db-4.2.52\docs\index.html ! and follow the Windows instructions for building the Sleepycat software. Note that Berkeley_DB.dsw is in the build_win32 subdirectory. Build the Release version ("build_all -- Win32 Release"). --- 159,183 ---- http://www.sleepycat.com/download/ ! and download version 4.2.52. ! ! With or without strong cryptography? You can choose either with or ! without strong cryptography, as per the instructions below. By ! default, Python is built and distributed WITHOUT strong crypto ! XXX - is the above correct? ! ! Unpack into the dist\. directory, ensuring you expand with folder names. ! ! If you downloaded with strong crypto, this will create a dist\db-4.2.52 ! directory, and is ready to use. ! ! If you downloaded WITHOUT strong crypto, this will create a ! dist\db-4.2.52.NC directory - this directory should be renamed to ! dist\db-4.2.52 before use. ! Open dist\db-4.2.52\docs\index.html ! and follow the "Windows->Building Berkeley DB with Visual C++ .NET" ! instructions for building the Sleepycat software. Note that Berkeley_DB.dsw is in the build_win32 subdirectory. Build the Release version ("build_all -- Win32 Release"). From goodger at users.sourceforge.net Tue Jan 6 10:34:51 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Tue Jan 6 10:34:55 2004 Subject: [Python-checkins] python/nondist/peps pep-0326.txt, 1.1, 1.2 pep-0000.txt, 1.261, 1.262 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv24252 Modified Files: pep-0326.txt pep-0000.txt Log Message: updates from Josiah Carlson, edited Index: pep-0326.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0326.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0326.txt 4 Jan 2004 17:30:47 -0000 1.1 --- pep-0326.txt 6 Jan 2004 15:34:49 -0000 1.2 *************** *** 1,7 **** PEP: 326 ! Title: A Case for All Version: $Revision$ Last-Modified: $Date$ ! Author: Josiah Carlson Status: Draft Type: Standards Track --- 1,8 ---- PEP: 326 ! Title: A Case for Top and Bottom Values Version: $Revision$ Last-Modified: $Date$ ! Author: Josiah Carlson , ! Terry Reedy Status: Draft Type: Standards Track *************** *** 9,13 **** Created: 20-Dec-2003 Python-Version: 2.4 ! Post-History: 20-Dec-2003, 03-Jan-2004 --- 10,14 ---- Created: 20-Dec-2003 Python-Version: 2.4 ! Post-History: 20-Dec-2003, 03-Jan-2004, 05-Jan-2004 *************** *** 15,25 **** ======== ! This PEP proposes a new named constant or built-in: ``All``. ! Users of Python have had the constant None, which represents a lack of ! value, for quite some time (possibly from the beginning, this is ! unknown to the author at the current time). The author believes that ! ``All`` should be introduced in order to represent a functionally ! infinite value, with similar behavior corresponding to None. --- 16,28 ---- ======== ! This PEP proposes two new attributes to the ``cmp`` built-in that ! represent a top and bottom [4]_ value: ``high`` and ``low`` (or a pair ! of similarly named attributes [5]_). ! As suggested by their names, ``cmp.high`` and ``cmp.low`` would ! compare higher or lower than any other object (respectively). Such ! behavior results in easier to understand code and fewer special cases ! in which a temporary minimum or maximum is required, and an actual ! minimum or maximum numeric value is not limited. *************** *** 27,70 **** ========= ! While None can be used as an absolute minimum that any value can ! attain [1]_, there does not exist an equivalent absolute maximum. For ! example:: ! ! >>> print min(None, -2**1000) ! None ! All comparisons including None and another object results in None ! being the smaller of the two. ! However, there does not exist a value such that the comparison of any ! other object results in the constant being the larger of the two. ! What is commonly done to deal with such cases, is to set a value in a ! script that is larger than the author ever expects the input to reach, ! and hope that it isn't reached. Guido has brought up [2]_ the fact that there exists two constants ! that can be used in the interim: sys.maxint and floating point ! positive infinity (1e309 will evaluate to positive infinity). ! However, each has their drawbacks. On most architectures sys.maxint ! is arbitrarily small (2**31-1 or 2**63-1), and can be easily eclipsed ! by large 'long' integers or floating point numbers. Furthermore, ! comparing long integers larger than the largest floating point number ! representable against any float will result in an exception being ! raised:: ! >>> cmp(1.0, 10**309) ! Traceback (most recent call last): ! File "", line 1, in ? ! OverflowError: long int too large to convert to float ! Even when large integers are compared against positive infinity:: ! >>> cmp(1e309, 10**309) ! Traceback (most recent call last): ! File "", line 1, in ? ! OverflowError: long int too large to convert to float ! Introducing an ``All`` built-in that works as described does not take ! much effort. A sample Python implementation is included. --- 30,76 ---- ========= ! While ``None`` can be used as an absolute minimum that any value can ! attain [1]_, this may be depreciated [5]_ in Python 3.0, and shouldn't ! be relied upon. ! As a replacement for ``None`` being used as an absolute minimum, as ! well as the introduction of an absolute maximum, attaching ``low`` and ! ``high`` to ``cmp`` addresses concerns for namespace pollution and ! serves to make both self-documenting. ! What is commonly done to deal with absolute minimum or maximum values, ! is to set a value that is larger than the script author ever expects ! the input to reach, and hope that it isn't reached. Guido has brought up [2]_ the fact that there exists two constants ! that can be used in the interim for maximum values: sys.maxint and ! floating point positive infinity (1e309 will evaluate to positive ! infinity). However, each has their drawbacks. ! - On most architectures sys.maxint is arbitrarily small (2**31-1 or ! 2**63-1) and can be easily eclipsed by large 'long' integers or ! floating point numbers. ! - Comparing long integers larger than the largest floating point ! number representable against any float will result in an exception ! being raised:: ! >>> cmp(1.0, 10**309) ! Traceback (most recent call last): ! File "", line 1, in ? ! OverflowError: long int too large to convert to float ! Even when large integers are compared against positive infinity:: ! ! >>> cmp(1e309, 10**309) ! Traceback (most recent call last): ! File "", line 1, in ? ! OverflowError: long int too large to convert to float ! ! - These same drawbacks exist when numbers are small. ! ! Introducing ``high`` and ``low`` attributes to ``cmp`` that work as ! described does not take much effort. A sample Python `reference ! implementation`_ of both attributes is included. *************** *** 72,81 **** ========== There are hundreds of algorithms that begin by initializing some set ! of values to a logical (or numeric) infinity. Python lacks a positive ! infinity that works consistently or really is the largest value that ! can be attained. By adding the ``All`` constant (or built-in), Python ! would have a real maximum value, and such algorithms can become ! clearer due to the reduction of special cases. Take for example, finding the minimum in a sequence:: --- 78,91 ---- ========== + ``cmp.high`` Examples + --------------------- + There are hundreds of algorithms that begin by initializing some set ! of values to a logical (or numeric) infinity or negative infinity. ! Python lacks either infinity that works consistently or really is the ! most extreme value that can be attained. By adding the ``cmp.high`` ! and ``cmp.low`` attributes, Python would have a real maximum and ! minimum value, and such algorithms can become clearer due to the ! reduction of special cases. Take for example, finding the minimum in a sequence:: *************** *** 92,95 **** --- 102,107 ---- return cur + :: + def findmin_None(seq): cur = None *************** *** 100,110 **** return cur return cur ! ! def findmin_All(seq): ! cur = All for obj in seq: cur = min(obj, cur) return cur Guido brought up the idea of just negating everything and comparing [2]_. Certainly this does work when using numbers, but it does not --- 112,129 ---- return cur return cur ! ! :: ! ! def findmin_high(seq): ! cur = cmp.high for obj in seq: cur = min(obj, cur) return cur + Please note that there are an arbitrarily large number of ways to find + the minimum (or maximum) of a sequence, these seek to show a simple + example where using ``cmp.high`` makes the algorithm easier to + understand and results in simplification of code. + Guido brought up the idea of just negating everything and comparing [2]_. Certainly this does work when using numbers, but it does not *************** *** 112,119 **** being less readable. :: ! #we have All available a = min(a, b) ! #we don't have All available if a is not None: if b is None: --- 131,138 ---- being less readable. :: ! #we have cmp.high available a = min(a, b) ! #we don't have cmp.high available if a is not None: if b is None: *************** *** 122,132 **** a = -max(-a, -b) ! Implementation ! ============== :: ! class _AllType(object): def __cmp__(self, other): --- 141,321 ---- a = -max(-a, -b) + As another example, in Dijkstra's shortest path algorithm on a graph + with weighted edges (all positive). ! 1. Set distances to every node in the graph to infinity. ! 2. Set the distance to the start node to zero. ! 3. Set visited to be an empty mapping. ! 4. While shortest distance of a node that has not been visited is less ! than infinity and the destination has not been visited. ! ! a. Get the node with the shortest distance. ! b. Visit the node. ! c. Update neighbor distances and parent pointers if necessary for ! neighbors that have not been visited. ! ! 5. If the destination has been visited, step back through parent ! pointers to find the reverse of the path to be taken. ! ! To be complete, below are two versions of the algorithm, one using a ! table (a bit more understandable) and one using a heap (much faster):: ! ! def DijkstraSP_table(graph, S, T): ! #runs in O(N^2) time using a table ! #find the shortest path ! table = {} ! for node in graph.iterkeys(): ! #(visited, distance, node, parent) ! table[node] = (0, cmp.high, node, None) ! table[S] = (0, 0, S, None) ! cur = min(table.values()) ! while (not cur[0]) and cur[1] < cmp.high: ! (visited, distance, node, parent) = cur ! table[node] = (1, distance, node, parent) ! for cdist, child in graph[node]: ! ndist = distance+cdist ! if not table[child][0] and ndist < table[child][1]: ! table[child] = (0, ndist, child, node) ! cur = min(table.values()) ! #backtrace through results ! if not table[T][0]: ! return None ! cur = T ! path = [T] ! while table[cur][3] is not None: ! path.append(table[cur][3]) ! cur = path[-1] ! path.reverse() ! return path :: ! def DijkstraSP_heap(graph, S, T): ! #runs in O(NlgN) time using a minheap ! #find the shortest path ! import heapq ! Q = [(cmp.high, i, None) for i in graph.iterkeys()] ! heapq.heappush(Q, (0, S, None)) ! V = {} ! while Q[0][0] < cmp.high and T not in V: ! dist, node, parent = heapq.heappop(Q) ! if node in V: ! continue ! V[node] = (dist, parent) ! for next, dest in graph[node]: ! heapq.heappush(Q, (next+dist, dest, node)) ! #backtrace through results ! if T not in V: ! return None ! cur = T ! path = [T] ! while V[cur][1] is not None: ! path.append(V[cur][1]) ! cur = path[-1] ! path.reverse() ! return path ! ! Readers should note that replacing ``cmp.high`` in the above code with ! an arbitrarily large number does not guarantee that the actual ! distance to a node will never exceed that number. Well, with one ! caveat: one could certainly sum up the weights of every edge in the ! graph, and set the 'arbitrarily large number' to that total. However, ! doing so does not make the algorithm any easier to understand and has ! potential problems with various numeric overflows. ! ! ! A ``cmp.low`` Example ! --------------------- ! ! An example of usage for ``cmp.low`` is an algorithm that solves the ! following problem [7]_: ! ! Suppose you are given a directed graph, representing a ! communication network. The vertices are the nodes in the network, ! and each edge is a communication channel. Each edge ``(u, v)`` has ! an associated value ``r(u, v)``, with ``0 <= r(u, v) <= 1``, which ! represents the reliability of the channel from ``u`` to ``v`` ! (i.e., the probability that the channel from ``u`` to ``v`` will ! **not** fail). Assume that the reliability probabilities of the ! channels are independent. (This implies that the reliability of ! any path is the product of the reliability of the edges along the ! path.) Now suppose you are given two nodes in the graph, ``A`` ! and ``B``. ! ! Such an algorithm is a 7 line modification to the DijkstraSP_table ! algorithm given above:: ! ! #only showing the changed to lines with the proper indentation ! table[node] = (0, cmp.low, node, None) ! table[S] = (0, 1, S, None) ! cur = max(table.values()) ! while (not cur[0]) and cur[1] > cmp.low: ! ndist = distance*cdist ! if not table[child][0] and ndist > table[child][1]: ! cur = max(table.values()) ! ! Or a 6 line modification to the DijkstraSP_heap algorithm given above ! (if we assume that ``maxheapq`` exists and does what it is supposed ! to):: ! ! #only showing the changed to lines with the proper indentation ! import maxheapq ! Q = [(cmp.low, i, None) for i in graph.iterkeys()] ! maxheapq.heappush(Q, (1, S, None)) ! while Q[0][0] > cmp.low and T not in V: ! dist, node, parent = maxheapq.heappop(Q) ! maxheapq.heappush(Q, (next*dist, dest, node)) ! ! Note that there is an equivalent way of translating the graph to ! produce something that can be passed unchanged into the original ! Dijkstra shortest path algorithm. ! ! Further usage examples of both ``cmp.high`` and ``cmp.low`` are ! available in the realm of graph algorithms. ! ! ! Independent Implementations? ! ---------------------------- ! ! Independent implementations of the top/bottom concept by users ! desiring such functionality are not likely to be compatible, and ! certainly will be inconsistent. The following examples seek to show ! how inconsistent they can be. ! ! - Let us pretend we have created proper separate implementations of ! Myhigh, Mylow, Yourhigh and Yourlow with the same code as given in ! the sample implementation (with some minor renaming):: ! ! >>> lst = [Yourlow, Mylow, Mylow, Yourlow, Myhigh, Yourlow, ! Myhigh, Yourhigh, Myhigh] ! >>> lst.sort() ! >>> lst ! [Yourlow, Yourlow, Mylow, Mylow, Yourlow, Myhigh, Myhigh, ! Yourhigh, Myhigh] ! ! Notice that while all the "low"s are before the "high"s, there is no ! guarantee that all instances of Yourlow will come before Mylow, the ! reverse, or the equivalent Myhigh and Yourhigh. ! ! - The problem is evident even when using the heapq module:: ! ! >>> lst = [Yourlow, Mylow, Mylow, Yourlow, Myhigh, Yourlow, ! Myhigh, Yourhigh, Myhigh] ! >>> heapq.heapify(lst) #not needed, but it can't hurt ! >>> while lst: print heapq.heappop(lst), ! ... ! Yourlow Mylow Yourlow Yourlow Mylow Myhigh Myhigh Yourhigh Myhigh ! ! - Furthermore, the findmin_high code and both versions of Dijkstra ! could result in incorrect output by passing in secondary versions of ! high. ! ! ! Reference Implementation ! ======================== ! ! :: ! ! class _HighType(object): def __cmp__(self, other): *************** *** 136,163 **** def __repr__(self): ! return 'All' ! import sys ! sys.modules['__builtin__'].All = _AllType() ! Results of Test Run in Python 2.3.3:: ! >>> max(All, 2**65536) ! All ! >>> min(All, 2**65536) 20035299304068464649790... (lines removed for brevity) ...72339445587895905719156736L ! >>> max(All, None) ! All ! >>> min(All, None) ! >>> print min(All, None) ! None ! >>> bool(All) ! True ! >>> not None ! 1 ! >>> not All ! 0 --- 325,359 ---- def __repr__(self): ! return 'cmp.high' ! class _LowType(object): ! def __cmp__(self, other): ! if isinstance(other, self.__class__): ! return 0 ! return -1 ! def __repr__(self): ! return 'cmp.low' ! ! # please note that the following code doesn't ! # work due to built-ins being read-only ! cmp.high = _HighType() ! cmp.low = _LowType() ! ! Results of Test Run if we could set cmp.high and cmp.low:: ! ! >>> max(cmp.high, 2**65536) ! cmp.high ! >>> min(cmp.high, 2**65536) 20035299304068464649790... (lines removed for brevity) ...72339445587895905719156736L ! >>> min(cmp.low, -2**65536) ! cmp.low ! >>> max(cmp.low, -2**65536) ! -2003529930406846464979... ! (lines removed for brevity) ! ...072339445587895905719156736L *************** *** 165,171 **** =========== ! ``All`` seemed to be an awkward object to various Python developers on ! the python-dev mailing list. The author hopes that with this updated ! PEP, developers will no longer find ``All`` awkward. --- 361,424 ---- =========== ! - Previously, ``Some`` and ``All`` were names for the idea that ! ``cmp.high`` now represents. They have been subsumed by ! ``cmp.high`` due to the relative ambiguity of ``Some`` and ``All``. ! ! - Terry Reedy [5]_ and others have offered alternate names for the ! ``high/low`` objects: ``ObjHi/ObjLo``, ``NoneHi/NoneLo``, ! ``Highest/Lowest``, ``Infinity/NegativeInfinity``, ``hi/lo`` and ! ``High/Low``. ! ! - Terry Reedy has also offered possible default behaviors of ``min`` ! and ``max`` on empty lists using these values. Some have voiced ! that changing the behavior of min and max are not desirable due to ! the amount of code that actively uses min and max, which may rely on ! min and max raising exceptions on empty lists. ! ! - Choosing ``high`` and ``low`` to be the attributes of ``cmp`` is ! arbitrary, but meaningful. Other meaningful parent locations ! include, but are not limited to: ``math``, ``int`` and ``number`` ! (if such a numeric superclass existed). ``sys`` probably does not ! make sense, as such maximum and minimum values are not platform ! dependent. ! ! - The base class of the high and low objects do not necessarily have ! to be ``object``. ``object``, ``NoneType`` or even a new class ! called ``cmp.extreme`` have been suggested. ! ! - Various built-in names such as ``All`` and ``Some`` have been ! rejected by many users. Based on comments, it seems that regardless ! of name, any new built-in would be rejected. [6]_ ! ! - Should ``-cmp.high == cmp.low``? This seems to make logical sense. ! ! - Certainly ``bool(cmp.high) == True``, but should ``bool(cmp.low)`` ! be ``True`` or ``False``? Due to ``bool(1) == bool(-1) == True``, ! it seems to follow that ``bool(cmp.high) == bool(cmp.low) == True``. ! ! - Whatever name the concepts of a top and bottom value come to have, ! the question of whether or not math can be done on them may or may ! not make sense. If math were not allowed, it brings up a potential ! ambiguity that while ``-cmp.high == cmp.low``, ``-1 * cmp.high`` ! would produce an exception. ! ! ! Most-Preferred Options ! ====================== ! ! Through a non-rigorous method, the following behavior of the objects ! seem to be preferred by those who are generally in favor of this PEP ! in python-dev. ! ! - ``high`` and ``low`` objects should be attached to the ``cmp`` ! built-in as ``cmp.high`` and ``cmp.low`` (or ``cmp.High/cmp.Low``). ! ! - ``-cmp.high == cmp.low`` and equivalently ``-cmp.low == cmp.high``. ! ! - ``bool(cmp.high) == bool(cmp.low) == True`` ! ! - The base type seems to be a cosmetic issue and has not resulted in ! any real preference other than ``cmp.extreme`` making the most ! sense. *************** *** 182,204 **** (http://mail.python.org/pipermail/python-dev/2003-December/041337.html) Changes ======= ! Added this section. ! Renamed ``Some`` to ``All``: Some was an arbitrary name that suffered ! from being unclear. [3]_ ! Made ``All`` a subclass of object in order for it to become a new ! style class. ! Removed mathematical negation and casting to float in Open Issues. ! None is not a number and is not treated as one, ``All`` shouldn't be ! either. ! Added Motivation section. ! Changed markup to reStructuredText. --- 435,490 ---- (http://mail.python.org/pipermail/python-dev/2003-December/041337.html) + .. [4] RE: [Python-Dev] Got None. Maybe Some?, Peters, Tim + (http://mail.python.org/pipermail/python-dev/2003-December/041332.html) + + .. [5] [Python-Dev] Re: PEP 326 now online, Reedy, Terry + (http://mail.python.org/pipermail/python-dev/2004-January/041685.html) + + .. [6] [Python-Dev] PEP 326 now online, Chermside, Michael + (http://mail.python.org/pipermail/python-dev/2004-January/041704.html) + + .. [7] Homework 6, Problem 7, Dillencourt, Michael + (link may not be valid in the future) + (http://www.ics.uci.edu/~dillenco/ics161/hw/hw6.pdf) + Changes ======= ! - Added this section. ! - Renamed ``Some`` to ``All``: "Some" was an arbitrary name that ! suffered from being unclear. [3]_ ! - Made ``All`` a subclass of ``object`` in order for it to become a ! new-style class. ! - Removed mathematical negation and casting to float in Open Issues. ! ``None`` is not a number and is not treated as one, ``All`` ! shouldn't be either. ! - Added Motivation_ section. ! - Changed markup to reStructuredText. ! ! - Renamed ``All`` to ``cmp.hi`` to remove builtin requirement and to ! provide a better better name, as well as adding an equivalent ! future-proof bottom value ``cmp.lo``. [5]_ ! ! - Clarified Abstract_, Motivation_, `Reference Implementation`_ and ! `Open Issues`_ based on the simultaneous concepts of ``cmp.hi`` and ! ``cmp.lo``. ! ! - Added two implementations of Dijkstra's Shortest Path algorithm that ! show where ``cmp.hi`` can be used to remove special cases. ! ! - Renamed ``hi`` to ``high`` and ``lo`` to ``low`` to address concerns ! for non-native english speakers. ! ! - Added an example of use for ``cmp.low`` to Motivation_. ! ! - Added a couple `Open Issues`_ and clarified some others. ! ! - Added `Most-Preferred Options`_ section. *************** *** 214,217 **** indent-tabs-mode: nil sentence-end-double-space: t ! fill-column: 74 End: --- 500,503 ---- indent-tabs-mode: nil sentence-end-double-space: t ! fill-column: 70 End: Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.261 retrieving revision 1.262 diff -C2 -d -r1.261 -r1.262 *** pep-0000.txt 4 Jan 2004 17:30:47 -0000 1.261 --- pep-0000.txt 6 Jan 2004 15:34:49 -0000 1.262 *************** *** 122,126 **** S 324 popen5 - New POSIX process module Astrand S 325 Resource-Release Support for Generators Pedroni ! S 326 A Case for All Carlson S 754 IEEE 754 Floating Point Special Values Warnes --- 122,126 ---- S 324 popen5 - New POSIX process module Astrand S 325 Resource-Release Support for Generators Pedroni ! S 326 A Case for Top and Bottom Values Carlson S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 345,349 **** S 324 popen5 - New POSIX process module Astrand S 325 Resource-Release Support for Generators Pedroni ! S 326 A Case for All Carlson SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes --- 345,349 ---- S 324 popen5 - New POSIX process module Astrand S 325 Resource-Release Support for Generators Pedroni ! S 326 A Case for Top and Bottom Values Carlson SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes From theller at users.sourceforge.net Tue Jan 6 14:27:41 2004 From: theller at users.sourceforge.net (theller@users.sourceforge.net) Date: Tue Jan 6 14:27:45 2004 Subject: [Python-checkins] python/dist/src/PCbuild pythoncore.vcproj, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv11327 Modified Files: pythoncore.vcproj Log Message: Add the _bisectmodule.c source file to the pythoncore project - seems to have been forgotten. Index: pythoncore.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pythoncore.vcproj 4 Jan 2004 09:58:33 -0000 1.2 --- pythoncore.vcproj 6 Jan 2004 19:27:38 -0000 1.3 *************** *** 155,158 **** --- 155,161 ---- + + Update of /cvsroot/python/python/nondist/sandbox/msi In directory sc8-pr-cvs1:/tmp/cvs-serv31704/msi Modified Files: msilib.py Log Message: Patch #871896: Fix langids in Ensure*. Index: msilib.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/msilib.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** msilib.py 2 Jan 2004 20:42:24 -0000 1.3 --- msilib.py 7 Jan 2004 05:18:16 -0000 1.4 *************** *** 51,58 **** def EnsureMSI(): ! win32com.client.gencache.EnsureModule('{000C1092-0000-0000-C000-000000000046}', 0, 1, 0) def EnsureMSM(): ! win32com.client.gencache.EnsureModule('{0ADDA82F-2C26-11D2-AD65-00A0C9AF11A6}', 0, 1, 0) _Installer=None --- 51,58 ---- def EnsureMSI(): ! win32com.client.gencache.EnsureModule('{000C1092-0000-0000-C000-000000000046}', 1033, 1, 0) def EnsureMSM(): ! win32com.client.gencache.EnsureModule('{0ADDA82F-2C26-11D2-AD65-00A0C9AF11A6}', 1033, 1, 0) _Installer=None From loewis at users.sourceforge.net Wed Jan 7 00:23:47 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed Jan 7 00:23:50 2004 Subject: [Python-checkins] python/nondist/peps pep-0320.txt,1.3,1.4 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv32456 Modified Files: pep-0320.txt Log Message: Patch #870500: Correct description of sorted() feature. Fix typo. Index: pep-0320.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0320.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pep-0320.txt 8 Dec 2003 00:40:21 -0000 1.3 --- pep-0320.txt 7 Jan 2004 05:23:45 -0000 1.4 *************** *** 32,40 **** PEP 322 Reverse Iteration ! Encapsulate the decorate-sort-undecorate patten in a keyword for list.sort(). ! Added a classmethod called list.sorted() which may be used in ! expressions. The itertools module has two new functions, tee() and groupby(). --- 32,39 ---- PEP 322 Reverse Iteration ! Encapsulate the decorate-sort-undecorate pattern in a keyword for list.sort(). ! Added a builtin called sorted() which may be used in expressions. The itertools module has two new functions, tee() and groupby(). From loewis at users.sourceforge.net Wed Jan 7 15:02:28 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed Jan 7 15:02:31 2004 Subject: [Python-checkins] python/nondist/sandbox/msi msilib.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/msi In directory sc8-pr-cvs1:/tmp/cvs-serv1091 Modified Files: msilib.py Log Message: Revert language of the MSM object. Don't require cabarc.exe be part of VC++. Index: msilib.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/msilib.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** msilib.py 7 Jan 2004 05:18:16 -0000 1.4 --- msilib.py 7 Jan 2004 20:02:26 -0000 1.5 *************** *** 54,58 **** def EnsureMSM(): ! win32com.client.gencache.EnsureModule('{0ADDA82F-2C26-11D2-AD65-00A0C9AF11A6}', 1033, 1, 0) _Installer=None --- 54,58 ---- def EnsureMSM(): ! win32com.client.gencache.EnsureModule('{0ADDA82F-2C26-11D2-AD65-00A0C9AF11A6}', 0, 1, 0) _Installer=None *************** *** 365,369 **** cabarc = os.path.join(_winreg.QueryValueEx(key, v)[0], r"Bin", "cabarc.exe") _winreg.CloseKey(key) ! assert os.path.exists(cabarc), cabarc break else: --- 365,369 ---- cabarc = os.path.join(_winreg.QueryValueEx(key, v)[0], r"Bin", "cabarc.exe") _winreg.CloseKey(key) ! if not os.path.exists(cabarc):continue break else: From loewis at users.sourceforge.net Wed Jan 7 17:04:12 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed Jan 7 17:04:15 2004 Subject: [Python-checkins] python/nondist/sandbox/msi msi.py, 1.4, 1.5 msilib.py, 1.5, 1.6 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/msi In directory sc8-pr-cvs1:/tmp/cvs-serv31199 Modified Files: msi.py msilib.py Log Message: Add test files. Reduce title font size. Fix typos. Adjust control layout. Group features as subfeature of the default feature. Index: msi.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** msi.py 2 Jan 2004 20:43:24 -0000 1.4 --- msi.py 7 Jan 2004 22:04:10 -0000 1.5 *************** *** 88,93 **** def title(self, title): ! self.text("Title", 135, 20, 220, 60, 196611, ! r"{\VerdanaBold13}%s" % title) def back(self, title, next, name = "Back", active = 1): --- 88,93 ---- def title(self, title): ! self.text("Title", 135, 10, 220, 60, 196611, ! r"{\VerdanaBold10}%s" % title) def back(self, title, next, name = "Back", active = 1): *************** *** 150,154 **** [("DlgFont8", "Tahoma", 9, None, 0), ("DlgFontBold8", "Tahoma", 8, None, 1), #bold ! ("VerdanaBold13", "Verdana", 13, None, 1), ]) --- 150,154 ---- [("DlgFont8", "Tahoma", 9, None, 0), ("DlgFontBold8", "Tahoma", 8, None, 1), #bold ! ("VerdanaBold10", "Verdana", 10, None, 1), ]) *************** *** 179,185 **** fatal.back("< Back", "Finish", active = 0) fatal.cancel("Cancel", "Back", active = 0) ! fatal.text("Description1", 135, 70, 220, 60, 196611, "[ProductName] setup ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again.") ! fatal.text("Description2", 135, 135, 220, 20, 196611, "Click the Finish button to exit the Installer.") c=fatal.next("Finish", "Cancel", name="Finish") --- 179,185 ---- fatal.back("< Back", "Finish", active = 0) fatal.cancel("Cancel", "Back", active = 0) ! fatal.text("Description1", 135, 70, 220, 80, 196611, "[ProductName] setup ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again.") ! fatal.text("Description2", 135, 155, 220, 20, 196611, "Click the Finish button to exit the Installer.") c=fatal.next("Finish", "Cancel", name="Finish") *************** *** 191,198 **** user_exit.back("< Back", "Finish", active = 0) user_exit.cancel("Cancel", "Back", active = 0) ! user_exit.text("Description1", 135, 70, 220, 40, 196611, "[ProductName] setup was interrupted. Your system has not been modified. " "To install this program at a later time, please run the installation again.") ! user_exit.text("Description2", 135, 115, 220, 20, 196611, "Click the Finish button to exit the Installer.") c = user_exit.next("Finish", "Cancel", name="Finish") --- 191,198 ---- user_exit.back("< Back", "Finish", active = 0) user_exit.cancel("Cancel", "Back", active = 0) ! user_exit.text("Description1", 135, 70, 220, 80, 196611, "[ProductName] setup was interrupted. Your system has not been modified. " "To install this program at a later time, please run the installation again.") ! user_exit.text("Description2", 135, 155, 220, 20, 196611, "Click the Finish button to exit the Installer.") c = user_exit.next("Finish", "Cancel", name="Finish") *************** *** 273,277 **** prep.title("Welcome to the [ProductName] Installer") c=prep.text("ActionText", 135, 110, 220, 20, 196611, "Pondering...") ! c.mapping("AxtionText", "Text") c=prep.text("ActionData", 135, 135, 220, 30, 196611, None) c.mapping("ActionData", "Text") --- 273,277 ---- prep.title("Welcome to the [ProductName] Installer") c=prep.text("ActionText", 135, 110, 220, 20, 196611, "Pondering...") ! c.mapping("ActionText", "Text") c=prep.text("ActionData", 135, 135, 220, 30, 196611, None) c.mapping("ActionData", "Text") *************** *** 346,354 **** c.event("SpawnDialog", "AdvancedDlg") ! c=features.text("ItemDescription", 140, 180, 210, 50, 3, "Multiline description of the currently selected item.") c.mapping("SelectionDescription","Text") ! c=features.text("ItemSize", 140, 230, 220, 25, 3, "The size of the currently selected item.") c.mapping("SelectionSize", "Text") --- 346,354 ---- c.event("SpawnDialog", "AdvancedDlg") ! c=features.text("ItemDescription", 140, 180, 210, 30, 3, "Multiline description of the currently selected item.") c.mapping("SelectionDescription","Text") ! c=features.text("ItemSize", 140, 210, 220, 45, 3, "The size of the currently selected item.") c.mapping("SelectionSize", "Text") *************** *** 462,472 **** "Python Interpreter and Libraries", 1, directory = "TARGETDIR") ! tcltk = Feature(db, "TclTk", "Tcl/Tk", "Tkinter, IDLE, pydoc", 3) htmlfiles = Feature(db, "Documentation", "Documentation", ! "Python HTMLHelp File", 5) tools = Feature(db, "Tools", "Utility Scripts", ! "Python utility scripts (Tools/", 7) testsuite = Feature(db, "Testsuite", "Test suite", ! "Python test suite (Lib/test/)", 9) def extract_msvcr71(): --- 462,475 ---- "Python Interpreter and Libraries", 1, directory = "TARGETDIR") ! tcltk = Feature(db, "TclTk", "Tcl/Tk", "Tkinter, IDLE, pydoc", 3, ! parent = default_feature) htmlfiles = Feature(db, "Documentation", "Documentation", ! "Python HTMLHelp File", 5, parent = default_feature) tools = Feature(db, "Tools", "Utility Scripts", ! "Python utility scripts (Tools/", 7, ! parent = default_feature) testsuite = Feature(db, "Testsuite", "Test suite", ! "Python test suite (Lib/test/)", 9, ! parent = default_feature) def extract_msvcr71(): *************** *** 535,538 **** --- 538,549 ---- if files: lib.remove_pyc() + if dir=='test' and parent.physical=='Lib': + lib.add_file("audiotest.au") + lib.add_file("185test.db") + lib.add_file("test.xml.out") + lib.add_file("readme.txt", src="README") + lib.glob("*.uue") + lib.add_file("test.xml") + lib.add_file("testtar.tar") if dir=='output': lib.glob("test_*") Index: msilib.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/msilib.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** msilib.py 7 Jan 2004 20:02:26 -0000 1.5 --- msilib.py 7 Jan 2004 22:04:10 -0000 1.6 *************** *** 519,522 **** --- 519,523 ---- if parent: attributes |= 2 # follow parent + parent = parent.id add_data(db, "Feature", [(id, parent, title, desc, display, From bwarsaw at users.sourceforge.net Wed Jan 7 17:32:14 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Wed Jan 7 17:32:18 2004 Subject: [Python-checkins] python/dist/src/Lib base64.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv6924 Modified Files: base64.py Log Message: __all__: Remove freenet_b64encode and freenet_b64decode. Index: base64.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/base64.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** base64.py 4 Jan 2004 01:12:26 -0000 1.14 --- base64.py 7 Jan 2004 22:32:12 -0000 1.15 *************** *** 23,27 **** # # http://zgp.org/pipermail/p2p-hackers/2001-September/000316.html - 'freenet_b64encode', 'freenet_b64decode', 'urlsafe_b64encode', 'urlsafe_b64decode', ] --- 23,26 ---- From rhettinger at users.sourceforge.net Wed Jan 7 19:31:52 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Jan 7 19:31:55 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.149, 1.150 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv659 Modified Files: libstdtypes.tex Log Message: SF bug #872461: list.extend() described as experimental Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.149 retrieving revision 1.150 diff -C2 -d -r1.149 -r1.150 *** libstdtypes.tex 31 Dec 2003 06:32:38 -0000 1.149 --- libstdtypes.tex 8 Jan 2004 00:31:50 -0000 1.150 *************** *** 1014,1020 **** deprecated since Python 1.4. ! \item[(3)] Raises an exception when \var{x} is not a list object. The ! \method{extend()} method is experimental and not supported by ! mutable sequence types other than lists. \item[(4)] Raises \exception{ValueError} when \var{x} is not found in --- 1014,1018 ---- deprecated since Python 1.4. ! \item[(3)] Raises an exception when \var{x} is not a list object. \item[(4)] Raises \exception{ValueError} when \var{x} is not found in From rhettinger at users.sourceforge.net Wed Jan 7 19:33:06 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Jan 7 19:33:09 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.129.8.7, 1.129.8.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv962 Modified Files: Tag: release23-maint libstdtypes.tex Log Message: SF bug #872461: list.extend() described as experimental Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.129.8.7 retrieving revision 1.129.8.8 diff -C2 -d -r1.129.8.7 -r1.129.8.8 *** libstdtypes.tex 22 Oct 2003 02:57:23 -0000 1.129.8.7 --- libstdtypes.tex 8 Jan 2004 00:33:04 -0000 1.129.8.8 *************** *** 998,1004 **** deprecated since Python 1.4. ! \item[(3)] Raises an exception when \var{x} is not a list object. The ! \method{extend()} method is experimental and not supported by ! mutable sequence types other than lists. \item[(4)] Raises \exception{ValueError} when \var{x} is not found in --- 998,1002 ---- deprecated since Python 1.4. ! \item[(3)] Raises an exception when \var{x} is not a list object. \item[(4)] Raises \exception{ValueError} when \var{x} is not found in From montanaro at users.sourceforge.net Wed Jan 7 20:58:31 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Wed Jan 7 20:58:34 2004 Subject: [Python-checkins] python/nondist/peps pep-0042.txt,1.75,1.76 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv15493 Modified Files: pep-0042.txt Log Message: Add a note about configure file problems as raised on python-dev by Zack Weinberg. Index: pep-0042.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0042.txt,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** pep-0042.txt 23 Oct 2003 18:03:41 -0000 1.75 --- pep-0042.txt 8 Jan 2004 01:58:29 -0000 1.76 *************** *** 313,316 **** --- 313,322 ---- http://www.python.org/sf/219221 + - The configure script has probably grown a bit crufty with age and may + not track autoconf's more recent features very well. It should be + looked at and possibly cleaned up. + + http://mail.python.org/pipermail/python-dev/2004-January/041790.html + Local Variables: From fdrake at acm.org Thu Jan 8 09:44:37 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Thu Jan 8 09:44:56 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libstdtypes.tex, 1.149, 1.150 In-Reply-To: References: Message-ID: <16381.27861.673436.371082@sftp.fdrake.net> rhettinger@users.sourceforge.net writes: > Modified Files: > libstdtypes.tex > Log Message: > SF bug #872461: list.extend() described as experimental Thanks Raymond! -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fdrake at users.sourceforge.net Thu Jan 8 09:57:29 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 8 09:57:33 2004 Subject: [Python-checkins] python/dist/src/Doc/perl python.perl,1.145,1.146 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory sc8-pr-cvs1:/tmp/cvs-serv12448/perl Modified Files: python.perl Log Message: add new reference macro: \seelink Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** python.perl 30 Dec 2003 16:44:45 -0000 1.145 --- python.perl 8 Jan 2004 14:57:27 -0000 1.146 *************** *** 1951,1954 **** --- 1951,1967 ---- } + sub do_cmd_seelink{ + local($_) = @_; + my $url = next_argument(); + my $linktext = next_argument(); + my $text = next_argument(); + my $icon = get_link_icon($url); + return '
' + . "\n
$linktext$icon
" + . "\n
$text
\n
" + . $_; + } + sub do_cmd_seeurl{ local($_) = @_; From fdrake at users.sourceforge.net Thu Jan 8 09:57:29 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 8 09:57:35 2004 Subject: [Python-checkins] python/dist/src/Doc/texinputs python.sty, 1.104, 1.105 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory sc8-pr-cvs1:/tmp/cvs-serv12448/texinputs Modified Files: python.sty Log Message: add new reference macro: \seelink Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** python.sty 20 Oct 2003 14:01:48 -0000 1.104 --- python.sty 8 Jan 2004 14:57:27 -0000 1.105 *************** *** 1161,1164 **** --- 1161,1172 ---- \fi + % \seelink{url}{link text} + \newcommand{\py@seelink}[3]{% + \par + \begin{fulllineitems} + \item[\ulink{#2}{#1}] + #3 + \end{fulllineitems} + } % \seetitle[url]{title}{why it's interesting} \newcommand{\py@seetitle}[3][\py@modulebadkey]{% *************** *** 1205,1208 **** --- 1213,1217 ---- \let\seetitle=\py@seetitle \let\seeurl=\py@seeurl + \let\seelink=\py@seelink }{\par} \newenvironment{seealso}{ *************** *** 1216,1219 **** --- 1225,1229 ---- \let\seetitle=\py@seetitle \let\seeurl=\py@seeurl + \let\seelink=\py@seelink }{\par} From fdrake at users.sourceforge.net Thu Jan 8 09:57:29 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 8 09:57:37 2004 Subject: [Python-checkins] python/dist/src/Doc/doc doc.tex,1.79,1.80 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory sc8-pr-cvs1:/tmp/cvs-serv12448/doc Modified Files: doc.tex Log Message: add new reference macro: \seelink Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** doc.tex 11 Oct 2003 05:25:24 -0000 1.79 --- doc.tex 8 Jan 2004 14:57:27 -0000 1.80 *************** *** 1396,1403 **** complete sentences, starting with a capital letter (unless it starts with an identifier, which should not be modified), and ! ending with the apropriate punctuation. These macros are only defined within the content of the \env{seealso} and \env{seealso*} environments. \begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}} --- 1396,1412 ---- complete sentences, starting with a capital letter (unless it starts with an identifier, which should not be modified), and ! ending with the appropriate punctuation. These macros are only defined within the content of the \env{seealso} and \env{seealso*} environments. + + \begin{macrodesc}{seelink}{\p{url}\p{linktext}\p{why}} + References to specific on-line resources should be given using + the \macro{seelink} macro if they don't have a meaningful title + but there is some short description of what's at the end of the + link. Online documents which have identifiable titles should be + referenced using the \macro{seetitle} macro, using the optional + parameter to that macro to provide the URL. + \end{macrodesc} \begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}} From fdrake at users.sourceforge.net Thu Jan 8 09:59:05 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 8 09:59:08 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liblogging.tex,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv12853/lib Modified Files: liblogging.tex Log Message: add link to the red-dove.com page about the logging package Index: liblogging.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblogging.tex,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** liblogging.tex 26 Sep 2003 13:45:18 -0000 1.14 --- liblogging.tex 8 Jan 2004 14:59:02 -0000 1.15 *************** *** 240,243 **** --- 240,250 ---- {The proposal which described this feature for inclusion in the Python standard library.} + \seelink{http://www.red-dove.com/python_logging.html} + {Original Python \module{logging} package} + {This is the original source for the \module{logging} + package. The version of the package available from this + site is suitable for use with Python 2.1.x and 2.2.x, which + do not include the \module{logging} package in the standard + library.} \end{seealso} From fdrake at users.sourceforge.net Thu Jan 8 10:00:15 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 8 10:00:24 2004 Subject: [Python-checkins] python/dist/src/Doc/perl python.perl, 1.137, 1.137.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory sc8-pr-cvs1:/tmp/cvs-serv13253/perl Modified Files: Tag: release23-maint python.perl Log Message: add new reference macro: \seelink Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.137 retrieving revision 1.137.8.1 diff -C2 -d -r1.137 -r1.137.8.1 *** python.perl 16 Jul 2003 14:01:56 -0000 1.137 --- python.perl 8 Jan 2004 15:00:13 -0000 1.137.8.1 *************** *** 1909,1912 **** --- 1909,1925 ---- } + sub do_cmd_seelink{ + local($_) = @_; + my $url = next_argument(); + my $linktext = next_argument(); + my $text = next_argument(); + my $icon = get_link_icon($url); + return '
' + . "\n
$linktext$icon
" + . "\n
$text
\n
" + . $_; + } + sub do_cmd_seeurl{ local($_) = @_; From fdrake at users.sourceforge.net Thu Jan 8 10:00:15 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 8 10:00:25 2004 Subject: [Python-checkins] python/dist/src/Doc/doc doc.tex, 1.75.8.2, 1.75.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory sc8-pr-cvs1:/tmp/cvs-serv13253/doc Modified Files: Tag: release23-maint doc.tex Log Message: add new reference macro: \seelink Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.75.8.2 retrieving revision 1.75.8.3 diff -C2 -d -r1.75.8.2 -r1.75.8.3 *** doc.tex 27 Sep 2003 07:19:59 -0000 1.75.8.2 --- doc.tex 8 Jan 2004 15:00:13 -0000 1.75.8.3 *************** *** 1401,1404 **** --- 1401,1413 ---- \env{seealso} and \env{seealso*} environments. + \begin{macrodesc}{seelink}{\p{url}\p{linktext}\p{why}} + References to specific on-line resources should be given using + the \macro{seelink} macro if they don't have a meaningful title + but there is some short description of what's at the end of the + link. Online documents which have identifiable titles should be + referenced using the \macro{seetitle} macro, using the optional + parameter to that macro to provide the URL. + \end{macrodesc} + \begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}} Refer to another module. \var{why} should be a brief From fdrake at users.sourceforge.net Thu Jan 8 10:00:16 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 8 10:00:27 2004 Subject: [Python-checkins] python/dist/src/Doc/texinputs python.sty, 1.102.8.1, 1.102.8.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory sc8-pr-cvs1:/tmp/cvs-serv13253/texinputs Modified Files: Tag: release23-maint python.sty Log Message: add new reference macro: \seelink Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.102.8.1 retrieving revision 1.102.8.2 diff -C2 -d -r1.102.8.1 -r1.102.8.2 *** python.sty 20 Oct 2003 14:34:45 -0000 1.102.8.1 --- python.sty 8 Jan 2004 15:00:13 -0000 1.102.8.2 *************** *** 1160,1163 **** --- 1160,1171 ---- \fi + % \seelink{url}{link text} + \newcommand{\py@seelink}[3]{% + \par + \begin{fulllineitems} + \item[\ulink{#2}{#1}] + #3 + \end{fulllineitems} + } % \seetitle[url]{title}{why it's interesting} \newcommand{\py@seetitle}[3][\py@modulebadkey]{% *************** *** 1204,1207 **** --- 1212,1216 ---- \let\seetitle=\py@seetitle \let\seeurl=\py@seeurl + \let\seelink=\py@seelink }{\par} \newenvironment{seealso}{ *************** *** 1215,1218 **** --- 1224,1228 ---- \let\seetitle=\py@seetitle \let\seeurl=\py@seeurl + \let\seelink=\py@seelink }{\par} From fdrake at users.sourceforge.net Thu Jan 8 10:00:38 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Thu Jan 8 10:00:41 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liblogging.tex, 1.12.8.2, 1.12.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13402/lib Modified Files: Tag: release23-maint liblogging.tex Log Message: add link to the red-dove.com page about the logging package Index: liblogging.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liblogging.tex,v retrieving revision 1.12.8.2 retrieving revision 1.12.8.3 diff -C2 -d -r1.12.8.2 -r1.12.8.3 *** liblogging.tex 26 Sep 2003 16:46:22 -0000 1.12.8.2 --- liblogging.tex 8 Jan 2004 15:00:36 -0000 1.12.8.3 *************** *** 240,243 **** --- 240,250 ---- {The proposal which described this feature for inclusion in the Python standard library.} + \seelink{http://www.red-dove.com/python_logging.html} + {Original Python \module{logging} package} + {This is the original source for the \module{logging} + package. The version of the package available from this + site is suitable for use with Python 2.1.x and 2.2.x, which + do not include the \module{logging} package in the standard + library.} \end{seealso} From akuchling at users.sourceforge.net Thu Jan 8 10:01:10 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Thu Jan 8 10:01:13 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcfgparser.tex, 1.33, 1.34 libgettext.tex, 1.22, 1.23 libpickle.tex, 1.46, 1.47 libstringio.tex, 1.8, 1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13544 Modified Files: libcfgparser.tex libgettext.tex libpickle.tex libstringio.tex Log Message: Fix some digicool addresses I noticed Index: libcfgparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcfgparser.tex,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** libcfgparser.tex 31 Dec 2003 18:37:28 -0000 1.33 --- libcfgparser.tex 8 Jan 2004 15:01:08 -0000 1.34 *************** *** 4,8 **** \declaremodule{standard}{ConfigParser} \modulesynopsis{Configuration file parser.} ! \moduleauthor{Ken Manheimer}{klm@digicool.com} \moduleauthor{Barry Warsaw}{bwarsaw@python.org} \moduleauthor{Eric S. Raymond}{esr@thyrsus.com} --- 4,8 ---- \declaremodule{standard}{ConfigParser} \modulesynopsis{Configuration file parser.} ! \moduleauthor{Ken Manheimer}{klm@zope.com} \moduleauthor{Barry Warsaw}{bwarsaw@python.org} \moduleauthor{Eric S. Raymond}{esr@thyrsus.com} Index: libgettext.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgettext.tex,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** libgettext.tex 12 Aug 2003 00:01:15 -0000 1.22 --- libgettext.tex 8 Jan 2004 15:01:08 -0000 1.23 *************** *** 4,9 **** \declaremodule{standard}{gettext} \modulesynopsis{Multilingual internationalization services.} ! \moduleauthor{Barry A. Warsaw}{barry@digicool.com} ! \sectionauthor{Barry A. Warsaw}{barry@digicool.com} --- 4,9 ---- \declaremodule{standard}{gettext} \modulesynopsis{Multilingual internationalization services.} ! \moduleauthor{Barry A. Warsaw}{barry@zope.com} ! \sectionauthor{Barry A. Warsaw}{barry@zope.com} Index: libpickle.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpickle.tex,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** libpickle.tex 1 Jan 2004 05:53:51 -0000 1.46 --- libpickle.tex 8 Jan 2004 15:01:08 -0000 1.47 *************** *** 770,774 **** \declaremodule{builtin}{cPickle} \modulesynopsis{Faster version of \refmodule{pickle}, but not subclassable.} ! \moduleauthor{Jim Fulton}{jfulton@digicool.com} \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org} --- 770,774 ---- \declaremodule{builtin}{cPickle} \modulesynopsis{Faster version of \refmodule{pickle}, but not subclassable.} ! \moduleauthor{Jim Fulton}{jim@zope.com} \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org} Index: libstringio.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstringio.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** libstringio.tex 11 Aug 2003 15:06:07 -0000 1.8 --- libstringio.tex 8 Jan 2004 15:01:08 -0000 1.9 *************** *** 44,48 **** \modulesynopsis{Faster version of \module{StringIO}, but not subclassable.} ! \moduleauthor{Jim Fulton}{jfulton@digicool.com} \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org} --- 44,48 ---- \modulesynopsis{Faster version of \module{StringIO}, but not subclassable.} ! \moduleauthor{Jim Fulton}{jim@zope.com} \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org} From goodger at users.sourceforge.net Thu Jan 8 21:36:29 2004 From: goodger at users.sourceforge.net (goodger@users.sourceforge.net) Date: Thu Jan 8 21:36:33 2004 Subject: [Python-checkins] python/nondist/peps pep-0326.txt,1.2,1.3 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv3601 Modified Files: pep-0326.txt Log Message: update from Josiah Carlson Index: pep-0326.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0326.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pep-0326.txt 6 Jan 2004 15:34:49 -0000 1.2 --- pep-0326.txt 9 Jan 2004 02:36:27 -0000 1.3 *************** *** 10,14 **** Created: 20-Dec-2003 Python-Version: 2.4 ! Post-History: 20-Dec-2003, 03-Jan-2004, 05-Jan-2004 --- 10,14 ---- Created: 20-Dec-2003 Python-Version: 2.4 ! Post-History: 20-Dec-2003, 03-Jan-2004, 05-Jan-2004, 07-Jan-2004 *************** *** 16,28 **** ======== ! This PEP proposes two new attributes to the ``cmp`` built-in that ! represent a top and bottom [4]_ value: ``high`` and ``low`` (or a pair ! of similarly named attributes [5]_). ! As suggested by their names, ``cmp.high`` and ``cmp.low`` would ! compare higher or lower than any other object (respectively). Such ! behavior results in easier to understand code and fewer special cases ! in which a temporary minimum or maximum is required, and an actual ! minimum or maximum numeric value is not limited. --- 16,28 ---- ======== ! This PEP proposes two singleton constants that represent a top and ! bottom [3]_ value: ``Max`` and ``Min`` (or two similarly suggestive ! names [4]_; see `Open Issues`_). ! As suggested by their names, ``Max`` and ``Min`` would compare higher ! or lower than any other object (respectively). Such behavior results ! in easier to understand code and fewer special cases in which a ! temporary minimum or maximum value is required, and an actual minimum ! or maximum numeric value is not limited. *************** *** 31,41 **** While ``None`` can be used as an absolute minimum that any value can ! attain [1]_, this may be depreciated [5]_ in Python 3.0, and shouldn't be relied upon. As a replacement for ``None`` being used as an absolute minimum, as ! well as the introduction of an absolute maximum, attaching ``low`` and ! ``high`` to ``cmp`` addresses concerns for namespace pollution and ! serves to make both self-documenting. What is commonly done to deal with absolute minimum or maximum values, --- 31,41 ---- While ``None`` can be used as an absolute minimum that any value can ! attain [1]_, this may be depreciated [4]_ in Python 3.0, and shouldn't be relied upon. As a replacement for ``None`` being used as an absolute minimum, as ! well as the introduction of an absolute maximum, the introduction of ! two singleton constants ``Max`` and ``Min`` address concerns for the ! constants to be self-documenting. What is commonly done to deal with absolute minimum or maximum values, *************** *** 70,76 **** - These same drawbacks exist when numbers are small. ! Introducing ``high`` and ``low`` attributes to ``cmp`` that work as ! described does not take much effort. A sample Python `reference ! implementation`_ of both attributes is included. --- 70,76 ---- - These same drawbacks exist when numbers are small. ! Introducing ``Max`` and ``Min`` that work as described above does not ! take much effort. A sample Python `reference implementation`_ of both ! is included. *************** *** 78,91 **** ========== - ``cmp.high`` Examples - --------------------- - There are hundreds of algorithms that begin by initializing some set of values to a logical (or numeric) infinity or negative infinity. Python lacks either infinity that works consistently or really is the ! most extreme value that can be attained. By adding the ``cmp.high`` ! and ``cmp.low`` attributes, Python would have a real maximum and ! minimum value, and such algorithms can become clearer due to the ! reduction of special cases. Take for example, finding the minimum in a sequence:: --- 78,90 ---- ========== There are hundreds of algorithms that begin by initializing some set of values to a logical (or numeric) infinity or negative infinity. Python lacks either infinity that works consistently or really is the ! most extreme value that can be attained. By adding ``Max`` and ! ``Min``, Python would have a real maximum and minimum value, and such ! algorithms can become clearer due to the reduction of special cases. ! ! ``Max`` Examples ! --------------------- Take for example, finding the minimum in a sequence:: *************** *** 115,120 **** :: ! def findmin_high(seq): ! cur = cmp.high for obj in seq: cur = min(obj, cur) --- 114,119 ---- :: ! def findmin_Max(seq): ! cur = Max for obj in seq: cur = min(obj, cur) *************** *** 123,128 **** Please note that there are an arbitrarily large number of ways to find the minimum (or maximum) of a sequence, these seek to show a simple ! example where using ``cmp.high`` makes the algorithm easier to ! understand and results in simplification of code. Guido brought up the idea of just negating everything and comparing --- 122,127 ---- Please note that there are an arbitrarily large number of ways to find the minimum (or maximum) of a sequence, these seek to show a simple ! example where using ``Max`` makes the algorithm easier to understand ! and results in the simplification of code. Guido brought up the idea of just negating everything and comparing *************** *** 131,138 **** being less readable. :: ! #we have cmp.high available a = min(a, b) ! #we don't have cmp.high available if a is not None: if b is None: --- 130,137 ---- being less readable. :: ! #we have Max available a = min(a, b) ! #we don't have Max available if a is not None: if b is None: *************** *** 167,174 **** for node in graph.iterkeys(): #(visited, distance, node, parent) ! table[node] = (0, cmp.high, node, None) table[S] = (0, 0, S, None) cur = min(table.values()) ! while (not cur[0]) and cur[1] < cmp.high: (visited, distance, node, parent) = cur table[node] = (1, distance, node, parent) --- 166,173 ---- for node in graph.iterkeys(): #(visited, distance, node, parent) ! table[node] = (0, Max, node, None) table[S] = (0, 0, S, None) cur = min(table.values()) ! while (not cur[0]) and cur[1] < Max: (visited, distance, node, parent) = cur table[node] = (1, distance, node, parent) *************** *** 195,202 **** #find the shortest path import heapq ! Q = [(cmp.high, i, None) for i in graph.iterkeys()] heapq.heappush(Q, (0, S, None)) V = {} ! while Q[0][0] < cmp.high and T not in V: dist, node, parent = heapq.heappop(Q) if node in V: --- 194,201 ---- #find the shortest path import heapq ! Q = [(Max, i, None) for i in graph.iterkeys()] heapq.heappush(Q, (0, S, None)) V = {} ! while Q[0][0] < Max and T not in V: dist, node, parent = heapq.heappop(Q) if node in V: *************** *** 216,233 **** return path ! Readers should note that replacing ``cmp.high`` in the above code with ! an arbitrarily large number does not guarantee that the actual distance to a node will never exceed that number. Well, with one caveat: one could certainly sum up the weights of every edge in the graph, and set the 'arbitrarily large number' to that total. However, doing so does not make the algorithm any easier to understand and has ! potential problems with various numeric overflows. ! A ``cmp.low`` Example ! --------------------- ! An example of usage for ``cmp.low`` is an algorithm that solves the ! following problem [7]_: Suppose you are given a directed graph, representing a --- 215,232 ---- return path ! Readers should note that replacing ``Max`` in the above code with an ! arbitrarily large number does not guarantee that the shortest path distance to a node will never exceed that number. Well, with one caveat: one could certainly sum up the weights of every edge in the graph, and set the 'arbitrarily large number' to that total. However, doing so does not make the algorithm any easier to understand and has ! potential problems with numeric overflows. ! A ``Min`` Example ! ----------------- ! An example of usage for ``Min`` is an algorithm that solves the ! following problem [6]_: Suppose you are given a directed graph, representing a *************** *** 247,254 **** #only showing the changed to lines with the proper indentation ! table[node] = (0, cmp.low, node, None) table[S] = (0, 1, S, None) cur = max(table.values()) ! while (not cur[0]) and cur[1] > cmp.low: ndist = distance*cdist if not table[child][0] and ndist > table[child][1]: --- 246,253 ---- #only showing the changed to lines with the proper indentation ! table[node] = (0, Min, node, None) table[S] = (0, 1, S, None) cur = max(table.values()) ! while (not cur[0]) and cur[1] > Min: ndist = distance*cdist if not table[child][0] and ndist > table[child][1]: *************** *** 261,267 **** #only showing the changed to lines with the proper indentation import maxheapq ! Q = [(cmp.low, i, None) for i in graph.iterkeys()] maxheapq.heappush(Q, (1, S, None)) ! while Q[0][0] > cmp.low and T not in V: dist, node, parent = maxheapq.heappop(Q) maxheapq.heappush(Q, (next*dist, dest, node)) --- 260,266 ---- #only showing the changed to lines with the proper indentation import maxheapq ! Q = [(Min, i, None) for i in graph.iterkeys()] maxheapq.heappush(Q, (1, S, None)) ! while Q[0][0] > Min and T not in V: dist, node, parent = maxheapq.heappop(Q) maxheapq.heappush(Q, (next*dist, dest, node)) *************** *** 271,276 **** Dijkstra shortest path algorithm. ! Further usage examples of both ``cmp.high`` and ``cmp.low`` are ! available in the realm of graph algorithms. --- 270,299 ---- Dijkstra shortest path algorithm. ! ! Other Examples ! -------------- ! ! Andrew P. Lentvorski, Jr. [7]_ has pointed out that various data ! structures involving range searching have immediate use for ``Max`` ! and ``Min`` values. More specifically; Segment trees, Range trees, ! k-d trees and database keys: ! ! ...The issue is that a range can be open on one side and does not ! always have an initialized case. ! ! The solutions I have seen are to either overload None as the ! extremum or use an arbitrary large magnitude number. Overloading ! None means that the built-ins can't really be used without special ! case checks to work around the undefined (or "wrongly defined") ! ordering of None. These checks tend to swamp the nice performance ! of built-ins like max() and min(). ! ! Choosing a large magnitude number throws away the ability of ! Python to cope with arbitrarily large integers and introduces a ! potential source of overrun/underrun bugs. ! ! Further use examples of both ``Max`` and ``Min`` are available in the ! realm of graph algorithms, range searching algorithms, computational ! geometry algorithms, and others. *************** *** 278,313 **** ---------------------------- ! Independent implementations of the top/bottom concept by users desiring such functionality are not likely to be compatible, and ! certainly will be inconsistent. The following examples seek to show ! how inconsistent they can be. - Let us pretend we have created proper separate implementations of ! Myhigh, Mylow, Yourhigh and Yourlow with the same code as given in the sample implementation (with some minor renaming):: ! >>> lst = [Yourlow, Mylow, Mylow, Yourlow, Myhigh, Yourlow, ! Myhigh, Yourhigh, Myhigh] >>> lst.sort() >>> lst ! [Yourlow, Yourlow, Mylow, Mylow, Yourlow, Myhigh, Myhigh, ! Yourhigh, Myhigh] ! Notice that while all the "low"s are before the "high"s, there is no ! guarantee that all instances of Yourlow will come before Mylow, the ! reverse, or the equivalent Myhigh and Yourhigh. ! - The problem is evident even when using the heapq module:: ! >>> lst = [Yourlow, Mylow, Mylow, Yourlow, Myhigh, Yourlow, ! Myhigh, Yourhigh, Myhigh] >>> heapq.heapify(lst) #not needed, but it can't hurt >>> while lst: print heapq.heappop(lst), ... ! Yourlow Mylow Yourlow Yourlow Mylow Myhigh Myhigh Yourhigh Myhigh ! - Furthermore, the findmin_high code and both versions of Dijkstra could result in incorrect output by passing in secondary versions of ! high. --- 301,336 ---- ---------------------------- ! Independent implementations of the ``Min``/``Max`` concept by users desiring such functionality are not likely to be compatible, and ! certainly will produce inconsistent orderings. The following examples ! seek to show how inconsistent they can be. - Let us pretend we have created proper separate implementations of ! MyMax, MyMin, YourMax and YourMin with the same code as given in the sample implementation (with some minor renaming):: ! >>> lst = [YourMin, MyMin, MyMin, YourMin, MyMax, YourMin, MyMax, ! YourMax, MyMax] >>> lst.sort() >>> lst ! [YourMin, YourMin, MyMin, MyMin, YourMin, MyMax, MyMax, YourMax, ! MyMax] ! Notice that while all the "Min"s are before the "Max"s, there is no ! guarantee that all instances of YourMin will come before MyMin, the ! reverse, or the equivalent MyMax and YourMax. ! - The problem is also evident when using the heapq module:: ! >>> lst = [YourMin, MyMin, MyMin, YourMin, MyMax, YourMin, MyMax, ! YourMax, MyMax] >>> heapq.heapify(lst) #not needed, but it can't hurt >>> while lst: print heapq.heappop(lst), ... ! YourMin MyMin YourMin YourMin MyMin MyMax MyMax YourMax MyMax ! - Furthermore, the findmin_Max code and both versions of Dijkstra could result in incorrect output by passing in secondary versions of ! ``Max``. *************** *** 317,356 **** :: ! class _HighType(object): ! ! def __cmp__(self, other): ! if isinstance(other, self.__class__): ! return 0 ! return 1 ! ! def __repr__(self): ! return 'cmp.high' ! class _LowType(object): def __cmp__(self, other): ! if isinstance(other, self.__class__): return 0 ! return -1 def __repr__(self): ! return 'cmp.low' ! # please note that the following code doesn't ! # work due to built-ins being read-only ! cmp.high = _HighType() ! cmp.low = _LowType() ! Results of Test Run if we could set cmp.high and cmp.low:: ! >>> max(cmp.high, 2**65536) ! cmp.high ! >>> min(cmp.high, 2**65536) 20035299304068464649790... (lines removed for brevity) ...72339445587895905719156736L ! >>> min(cmp.low, -2**65536) ! cmp.low ! >>> max(cmp.low, -2**65536) -2003529930406846464979... (lines removed for brevity) --- 340,373 ---- :: ! class _ExtremeType(object): ! def __init__(self, cmpr, rep): ! object.__init__(self) ! self._cmpr = cmpr ! self._rep = rep def __cmp__(self, other): ! if isinstance(other, self.__class__) and\ ! other._cmpr == self._cmpr: return 0 ! return self._cmpr def __repr__(self): ! return self._rep ! Max = _ExtremeType(1, "Max") ! Min = _ExtremeType(-1, "Min") ! Results of Test Run:: ! >>> max(Max, 2**65536) ! Max ! >>> min(Max, 2**65536) 20035299304068464649790... (lines removed for brevity) ...72339445587895905719156736L ! >>> min(Min, -2**65536) ! Min ! >>> max(Min, -2**65536) -2003529930406846464979... (lines removed for brevity) *************** *** 361,424 **** =========== ! - Previously, ``Some`` and ``All`` were names for the idea that ! ``cmp.high`` now represents. They have been subsumed by ! ``cmp.high`` due to the relative ambiguity of ``Some`` and ``All``. ! ! - Terry Reedy [5]_ and others have offered alternate names for the ! ``high/low`` objects: ``ObjHi/ObjLo``, ``NoneHi/NoneLo``, ! ``Highest/Lowest``, ``Infinity/NegativeInfinity``, ``hi/lo`` and ! ``High/Low``. ! ! - Terry Reedy has also offered possible default behaviors of ``min`` ! and ``max`` on empty lists using these values. Some have voiced ! that changing the behavior of min and max are not desirable due to ! the amount of code that actively uses min and max, which may rely on ! min and max raising exceptions on empty lists. ! ! - Choosing ``high`` and ``low`` to be the attributes of ``cmp`` is ! arbitrary, but meaningful. Other meaningful parent locations ! include, but are not limited to: ``math``, ``int`` and ``number`` ! (if such a numeric superclass existed). ``sys`` probably does not ! make sense, as such maximum and minimum values are not platform ! dependent. ! ! - The base class of the high and low objects do not necessarily have ! to be ``object``. ``object``, ``NoneType`` or even a new class ! called ``cmp.extreme`` have been suggested. ! ! - Various built-in names such as ``All`` and ``Some`` have been ! rejected by many users. Based on comments, it seems that regardless ! of name, any new built-in would be rejected. [6]_ ! ! - Should ``-cmp.high == cmp.low``? This seems to make logical sense. ! ! - Certainly ``bool(cmp.high) == True``, but should ``bool(cmp.low)`` ! be ``True`` or ``False``? Due to ``bool(1) == bool(-1) == True``, ! it seems to follow that ``bool(cmp.high) == bool(cmp.low) == True``. ! ! - Whatever name the concepts of a top and bottom value come to have, ! the question of whether or not math can be done on them may or may ! not make sense. If math were not allowed, it brings up a potential ! ambiguity that while ``-cmp.high == cmp.low``, ``-1 * cmp.high`` ! would produce an exception. ! ! ! Most-Preferred Options ! ====================== ! ! Through a non-rigorous method, the following behavior of the objects ! seem to be preferred by those who are generally in favor of this PEP ! in python-dev. ! ! - ``high`` and ``low`` objects should be attached to the ``cmp`` ! built-in as ``cmp.high`` and ``cmp.low`` (or ``cmp.High/cmp.Low``). ! ! - ``-cmp.high == cmp.low`` and equivalently ``-cmp.low == cmp.high``. ! ! - ``bool(cmp.high) == bool(cmp.low) == True`` ! - The base type seems to be a cosmetic issue and has not resulted in ! any real preference other than ``cmp.extreme`` making the most ! sense. --- 378,390 ---- =========== ! Current options for the naming and namespace for ``Min``/``Max``, in ! no particular order: ! 1. Give the built-in ``max`` and ``min`` appropriate ``__cmp__`` ! methods to allow them to double as ``Min``/``Max``. ! 2. Attach them to attributes of the ``cmp()`` built-in. ! 3. Attach them to attributes of an appropriate type object. ! 4. Make them an appropriate module object. ! 5. Create two new built-ins with appropriate names. *************** *** 432,451 **** (http://mail.python.org/pipermail/python-dev/2003-December/041352.html) ! .. [3] [Python-Dev] Re: Got None. Maybe Some?, Reedy, Terry ! (http://mail.python.org/pipermail/python-dev/2003-December/041337.html) ! ! .. [4] RE: [Python-Dev] Got None. Maybe Some?, Peters, Tim (http://mail.python.org/pipermail/python-dev/2003-December/041332.html) ! .. [5] [Python-Dev] Re: PEP 326 now online, Reedy, Terry (http://mail.python.org/pipermail/python-dev/2004-January/041685.html) ! .. [6] [Python-Dev] PEP 326 now online, Chermside, Michael (http://mail.python.org/pipermail/python-dev/2004-January/041704.html) ! .. [7] Homework 6, Problem 7, Dillencourt, Michael (link may not be valid in the future) (http://www.ics.uci.edu/~dillenco/ics161/hw/hw6.pdf) Changes --- 398,419 ---- (http://mail.python.org/pipermail/python-dev/2003-December/041352.html) ! .. [3] RE: [Python-Dev] Got None. Maybe Some?, Peters, Tim (http://mail.python.org/pipermail/python-dev/2003-December/041332.html) ! .. [4] [Python-Dev] Re: PEP 326 now online, Reedy, Terry (http://mail.python.org/pipermail/python-dev/2004-January/041685.html) ! .. [5] [Python-Dev] PEP 326 now online, Chermside, Michael (http://mail.python.org/pipermail/python-dev/2004-January/041704.html) ! .. [6] Homework 6, Problem 7, Dillencourt, Michael (link may not be valid in the future) (http://www.ics.uci.edu/~dillenco/ics161/hw/hw6.pdf) + .. [7] RE: [Python-Dev] PEP 326 now online, Lentvorski, Andrew P., Jr. + (http://mail.python.org/pipermail/python-dev/2004-January/041727.html) + + .. [8] Re: It's not really Some is it?, Ippolito, Bob + (http://www.livejournal.com/users/chouyu_31/138195.html?thread=274643#t274643) Changes *************** *** 454,490 **** - Added this section. - - Renamed ``Some`` to ``All``: "Some" was an arbitrary name that - suffered from being unclear. [3]_ - - - Made ``All`` a subclass of ``object`` in order for it to become a - new-style class. - - - Removed mathematical negation and casting to float in Open Issues. - ``None`` is not a number and is not treated as one, ``All`` - shouldn't be either. - - Added Motivation_ section. - Changed markup to reStructuredText. ! - Renamed ``All`` to ``cmp.hi`` to remove builtin requirement and to ! provide a better better name, as well as adding an equivalent ! future-proof bottom value ``cmp.lo``. [5]_ - Clarified Abstract_, Motivation_, `Reference Implementation`_ and ! `Open Issues`_ based on the simultaneous concepts of ``cmp.hi`` and ! ``cmp.lo``. - Added two implementations of Dijkstra's Shortest Path algorithm that ! show where ``cmp.hi`` can be used to remove special cases. ! - Renamed ``hi`` to ``high`` and ``lo`` to ``low`` to address concerns ! for non-native english speakers. ! - Added an example of use for ``cmp.low`` to Motivation_. ! - Added a couple `Open Issues`_ and clarified some others. ! - Added `Most-Preferred Options`_ section. --- 422,449 ---- - Added this section. - Added Motivation_ section. - Changed markup to reStructuredText. ! - Concept gets a possible name and location. [5]_ - Clarified Abstract_, Motivation_, `Reference Implementation`_ and ! `Open Issues`_ based on the simultaneous concepts of ``Max`` and ! ``Min``. - Added two implementations of Dijkstra's Shortest Path algorithm that ! show where ``Max`` can be used to remove special cases. ! - Added an example of use for ``Min`` to Motivation_. ! - Added some `Open Issues`_ and clarified some others. ! - Added an example and `Other Examples`_ subheading. ! - Modified `Reference Implementation`_ to instantiate both items from ! a single class/type. ! ! - Removed a large number of open issues that are not within the scope ! of this PEP. From jhylton at users.sourceforge.net Fri Jan 9 11:05:09 2004 From: jhylton at users.sourceforge.net (jhylton@users.sourceforge.net) Date: Fri Jan 9 11:05:14 2004 Subject: [Python-checkins] python/dist/src/PCbuild readme.txt, 1.47, 1.48 zlib.vcproj, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv22372/PCbuild Modified Files: readme.txt zlib.vcproj Log Message: Update Windows build to use zlib 1.2.1 Index: readme.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/readme.txt,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** readme.txt 6 Jan 2004 04:04:01 -0000 1.47 --- readme.txt 9 Jan 2004 16:05:07 -0000 1.48 *************** *** 118,130 **** zlib Python wrapper for the zlib compression library. Get the source code ! for version 1.1.4 from a convenient mirror at: http://www.gzip.org/zlib/ ! Unpack into dist\zlib-1.1.4. A custom pre-link step in the zlib project settings should manage to ! build zlib-1.1.4\zlib.lib by magic before zlib.pyd (or zlib_d.pyd) is linked in PCbuild\. However, the zlib project is not smart enough to remove anything under ! zlib-1.1.4\ when you do a clean, so if you want to rebuild zlib.lib ! you need to clean up zlib-1.1.4\ by hand. bz2 --- 118,130 ---- zlib Python wrapper for the zlib compression library. Get the source code ! for version 1.2.1 from a convenient mirror at: http://www.gzip.org/zlib/ ! Unpack into dist\zlib-1.2.1. A custom pre-link step in the zlib project settings should manage to ! build zlib-1.2.1\zlib.lib by magic before zlib.pyd (or zlib_d.pyd) is linked in PCbuild\. However, the zlib project is not smart enough to remove anything under ! zlib-1.2.1\ when you do a clean, so if you want to rebuild zlib.lib ! you need to clean up zlib-1.2.1\ by hand. bz2 Index: zlib.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/zlib.vcproj,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** zlib.vcproj 2 Jan 2004 21:13:59 -0000 1.1 --- zlib.vcproj 9 Jan 2004 16:05:07 -0000 1.2 *************** *** 4,7 **** --- 4,8 ---- Version="7.10" Name="zlib" + RootNamespace="zlib" SccProjectName="zlib" SccLocalPath=".."> *************** *** 21,25 **** Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="..\Include,..\PC,..\..\zlib-1.1.4" PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS" RuntimeLibrary="3" --- 22,26 ---- Name="VCCLCompilerTool" Optimization="0" ! AdditionalIncludeDirectories="..\Include,..\PC,..\..\zlib-1.2.1" PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS" RuntimeLibrary="3" *************** *** 37,41 **** Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory sc8-pr-cvs1:/tmp/cvs-serv15089 Modified Files: _Qtmodule.c qtscan.py Log Message: Added support for APIs in MediaHandlers.h. Index: _Qtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** _Qtmodule.c 4 Jan 2004 22:33:33 -0000 1.21 --- _Qtmodule.c 9 Jan 2004 23:18:47 -0000 1.22 *************** *** 23038,23041 **** --- 23038,24798 ---- } + static PyObject *Qt_MediaSetChunkManagementFlags(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + ComponentResult _rv; + MediaHandler mh; + UInt32 flags; + UInt32 flagsMask; [...1903 lines suppressed...] + {"MediaVideoOutputChanged", (PyCFunction)Qt_MediaVideoOutputChanged, 1, + PyDoc_STR("(MediaHandler mh, ComponentInstance vout) -> (ComponentResult _rv)")}, + {"MediaEmptySampleCache", (PyCFunction)Qt_MediaEmptySampleCache, 1, + PyDoc_STR("(MediaHandler mh, long sampleNum, long sampleCount) -> (ComponentResult _rv)")}, + {"MediaGetPublicInfo", (PyCFunction)Qt_MediaGetPublicInfo, 1, + PyDoc_STR("(MediaHandler mh, OSType infoSelector, void * infoDataPtr) -> (ComponentResult _rv, Size ioDataSize)")}, + {"MediaSetPublicInfo", (PyCFunction)Qt_MediaSetPublicInfo, 1, + PyDoc_STR("(MediaHandler mh, OSType infoSelector, void * infoDataPtr, Size dataSize) -> (ComponentResult _rv)")}, + {"MediaRefConSetProperty", (PyCFunction)Qt_MediaRefConSetProperty, 1, + PyDoc_STR("(MediaHandler mh, long refCon, long propertyType, void * propertyValue) -> (ComponentResult _rv)")}, + {"MediaRefConGetProperty", (PyCFunction)Qt_MediaRefConGetProperty, 1, + PyDoc_STR("(MediaHandler mh, long refCon, long propertyType, void * propertyValue) -> (ComponentResult _rv)")}, + {"MediaNavigateTargetRefCon", (PyCFunction)Qt_MediaNavigateTargetRefCon, 1, + PyDoc_STR("(MediaHandler mh, long navigation) -> (ComponentResult _rv, long refCon)")}, + {"MediaGGetIdleManager", (PyCFunction)Qt_MediaGGetIdleManager, 1, + PyDoc_STR("(MediaHandler mh) -> (ComponentResult _rv, IdleManager pim)")}, + {"MediaGSetIdleManager", (PyCFunction)Qt_MediaGSetIdleManager, 1, + PyDoc_STR("(MediaHandler mh, IdleManager im) -> (ComponentResult _rv)")}, {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1, PyDoc_STR("(WindowPtr wp, Boolean front) -> None")}, Index: qtscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtscan.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** qtscan.py 3 Jan 2004 17:23:27 -0000 1.25 --- qtscan.py 9 Jan 2004 23:18:47 -0000 1.26 *************** *** 9,13 **** LONG = "QuickTime" SHORT = "qt" ! HEADERFILES= ("Movies.h", "ImageCompression.h", "QuickTimeComponents.h") OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", "IdleManager", "SGOutput") --- 9,19 ---- LONG = "QuickTime" SHORT = "qt" ! HEADERFILES= ( ! "Movies.h", ! "ImageCompression.h", ! "QuickTimeComponents.h", ! # "ImageCodec.h" -- seems not too useful, and difficult. ! "MediaHandlers.h" ! ) OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", "IdleManager", "SGOutput") *************** *** 91,94 **** --- 97,104 ---- "VDReleaseCompressBuffer", "QTVideoOutputGetGWorldParameters", # How useful is this? + + # MediaHandlers + "MediaMakeMediaTimeTable", # just lazy + "MediaGetSampleDataPointer", # funny output pointer ] *************** *** 206,209 **** --- 216,227 ---- "UInt64", # XXXX lazy "UInt64_ptr", # XXXX lazy + + # From MediaHandlers + "ActionsUPP", + "PrePrerollCompleteUPP", + "CodecComponentHandle", # Difficult: handle containing list of components. + "GetMovieCompleteParams", # Immense struct + "LevelMeterInfoPtr", # Lazy. Also: can be an output parameter!! + "MediaEQSpectrumBandsRecordPtr", # ditto ] From rhettinger at users.sourceforge.net Sat Jan 10 05:24:30 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sat Jan 10 05:24:34 2004 Subject: [Python-checkins] python/nondist/peps pep-0290.txt,1.11,1.12 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv15358 Modified Files: pep-0290.txt Log Message: Py2.4 updates. Index: pep-0290.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0290.txt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pep-0290.txt 5 Dec 2003 17:51:40 -0000 1.11 --- pep-0290.txt 10 Jan 2004 10:24:27 -0000 1.12 *************** *** 99,102 **** --- 99,184 ---- take advantage of the modernization. + Python 2.4 or Later + ------------------- + + Simplifying Custom Sorts + '''''''''''''''''''''''' + + In Python 2.4, the ``sort`` method for lists and the new ``sorted`` + built-in function both accept a ``key`` function for computing sort + keys. Unlike the ``cmp`` function which gets applied to every + comparison, the key function gets applied only once to each record. + It is much faster than cmp and typically more readable while using + less code. The key function also maintains the stability of the + sort (records with the same key are left in their original order. + + Original code using a comparison function:: + + names.sort(lambda x,y: cmp(x.lower(), y.lower())) + + Alternative original code with explicit decoration:: + + tempnames = [(n.lower(), n) for n in names] + tempnames.sort() + names = [original for decorated, original in tempnames] + + Revised code using a key function:: + + names.sort(key=str.lower) # case-insensitive sort + + + Locating: ``grep sort *.py`` + + Replacing Common Uses of Lambda + ''''''''''''''''''''''''''''''' + + In Python 2.4, the ``operator`` module gained two new functions, + itemgetter() and attrgetter() that can replace common uses of + the ``lambda`` keyword. The new functions run faster and + are considered by some to improve readability. + + Pattern:: + + lambda r: r[2] --> itemgetter(2) + lambda r: r.myattr --> attrgetter('myattr') + + Typical contexts:: + + sort(studentrecords, key=attrgetter('gpa')) # set a sort field + map(studentrecords, attrgetter('lastname')) # extract a field + + Locating: ``grep lambda *.py`` + + Simplified Reverse Iteration + '''''''''''''''''''''''''''' + + Python 2.4 introduced the ``reversed`` builtin function for reverse + iteration. The existing approaches to reverse iteration suffered + from wordiness, performance issues (speed and memory consumption), + and/or lack of clarity. A preferred style is to express the + sequence in a forwards direction, apply ``reversed`` to the result, + and then loop over the resulting fast, memory friendly iterator. + + Original code expressed with half-open intervals:: + + for i in range(n-1, -1, -1): + print seqn[i] + + Alternative original code reversed in multiple steps:: + + rseqn = list(seqn) + rseqn.reverse() + for value in rseqn: + print value + + Alternative original code expressed with extending slicing: + + for value in seqn[::-1]: + print value + + Revised code using the ``reversed`` function: + + for value in reversed(seqn): + print value Python 2.3 or Later From sjoerd at users.sourceforge.net Sat Jan 10 15:43:45 2004 From: sjoerd at users.sourceforge.net (sjoerd@users.sourceforge.net) Date: Sat Jan 10 15:43:49 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libimageop.tex,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv5552/Doc/lib Modified Files: libimageop.tex Log Message: The format of the string data used in the imageop module is described as "This is the same format as used by gl.lrectwrite() and the imgfile module." This implies a certain byte order in multi-byte pixel formats. However, the code was originally written on an SGI (big-endian) and *uses* the fact that bytes are stored in a particular order in ints. This means that the code uses and produces different byte order on little-endian systems. This fix adds a module-level flag "backward_compatible" (default not set, and if not set, behaves as if set to 1--i.e. backward compatible) that can be used on a little-endian system to use the same byte order as the SGI. Using this flag it is then possible to prepare SGI-compatible images on a little-endian system. This patch is the result of a (small) discussion on python-dev and was submitted to SourceForge as patch #874358. Index: libimageop.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libimageop.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** libimageop.tex 16 Jul 2000 19:01:09 -0000 1.12 --- libimageop.tex 10 Jan 2004 20:43:43 -0000 1.13 *************** *** 87,88 **** --- 87,100 ---- Convert a 2-bit greyscale image to an 8-bit greyscale image. \end{funcdesc} + + \begin{datadesc}{backward_compatible} + If set to 0, the functions in this module use a non-backward + compatible way of representing multi-byte pixels on little-endian + systems. The SGI for which this module was originally written is a + big-endian system, so setting this variable will have no effect. + However, the code wasn't originally intended to run on anything else, + so it made assumptions about byte order which are not universal. + Setting this variable to 0 will cause the byte order to be reversed on + little-endian systems, so that it then is the same as on big-endian + systems. + \end{datadesc} From sjoerd at users.sourceforge.net Sat Jan 10 15:43:45 2004 From: sjoerd at users.sourceforge.net (sjoerd@users.sourceforge.net) Date: Sat Jan 10 15:43:51 2004 Subject: [Python-checkins] python/dist/src/Modules imageop.c,2.28,2.29 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv5552/Modules Modified Files: imageop.c Log Message: The format of the string data used in the imageop module is described as "This is the same format as used by gl.lrectwrite() and the imgfile module." This implies a certain byte order in multi-byte pixel formats. However, the code was originally written on an SGI (big-endian) and *uses* the fact that bytes are stored in a particular order in ints. This means that the code uses and produces different byte order on little-endian systems. This fix adds a module-level flag "backward_compatible" (default not set, and if not set, behaves as if set to 1--i.e. backward compatible) that can be used on a little-endian system to use the same byte order as the SGI. Using this flag it is then possible to prepare SGI-compatible images on a little-endian system. This patch is the result of a (small) discussion on python-dev and was submitted to SourceForge as patch #874358. Index: imageop.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/imageop.c,v retrieving revision 2.28 retrieving revision 2.29 diff -C2 -d -r2.28 -r2.29 *** imageop.c 2 Aug 2002 02:27:13 -0000 2.28 --- imageop.c 10 Jan 2004 20:43:43 -0000 2.29 *************** *** 25,29 **** static PyObject *ImageopError; ! static PyObject * imageop_crop(PyObject *self, PyObject *args) --- 25,76 ---- static PyObject *ImageopError; ! static PyObject *ImageopDict; ! ! /* If this function returns true (the default if anything goes wrong), we're ! behaving in a backward-compatible way with respect to how multi-byte pixels ! are stored in the strings. The code in this module was originally written ! for an SGI which is a big-endian system, and so the old code assumed that ! 4-byte integers hold the R, G, and B values in a particular order. ! However, on little-endian systems the order is reversed, and so not ! actually compatible with what gl.lrectwrite and imgfile expect. ! (gl.lrectwrite and imgfile are also SGI-specific, however, it is ! conceivable that the data handled here comes from or goes to an SGI or that ! it is otherwise used in the expectation that the byte order in the strings ! is as specified.) ! ! The function returns the value of the module variable ! "backward_compatible", or 1 if the variable does not exist or is not an ! int. ! */ ! ! static int ! imageop_backward_compatible(void) ! { ! static PyObject *bcos; ! PyObject *bco; ! long rc; ! ! if (ImageopDict == NULL) /* "cannot happen" */ ! return 1; ! if (bcos == NULL) { ! /* cache string object for future use */ ! bcos = PyString_FromString("backward_compatible"); ! if (bcos == NULL) ! return 1; ! } ! bco = PyDict_GetItem(ImageopDict, bcos); ! if (bco == NULL) ! return 1; ! if (!PyInt_Check(bco)) ! return 1; ! rc = PyInt_AsLong(bco); ! if (PyErr_Occurred()) { ! /* not an integer, or too large, or something */ ! PyErr_Clear(); ! rc = 1; ! } ! return rc != 0; /* convert to values 0, 1 */ ! } ! static PyObject * imageop_crop(PyObject *self, PyObject *args) *************** *** 498,506 **** { int x, y, len, nlen; ! Py_UInt32 *cp; unsigned char *ncp; PyObject *rv; int i, r, g, b; ! Py_UInt32 value, nvalue; if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) --- 545,553 ---- { int x, y, len, nlen; ! unsigned char *cp; unsigned char *ncp; PyObject *rv; int i, r, g, b; ! int backward_compatible = imageop_backward_compatible(); if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) *************** *** 520,535 **** for ( i=0; i < nlen; i++ ) { /* Bits in source: aaaaaaaa BBbbbbbb GGGggggg RRRrrrrr */ ! value = *cp++; ! #if 0 ! r = (value >> 5) & 7; ! g = (value >> 13) & 7; ! b = (value >> 22) & 3; ! #else ! r = (int) ((value & 0xff) / 255. * 7. + .5); ! g = (int) (((value >> 8) & 0xff) / 255. * 7. + .5); ! b = (int) (((value >> 16) & 0xff) / 255. * 3. + .5); ! #endif ! nvalue = (r<<5) | (b<<3) | g; ! *ncp++ = (unsigned char)nvalue; } return rv; --- 567,583 ---- for ( i=0; i < nlen; i++ ) { /* Bits in source: aaaaaaaa BBbbbbbb GGGggggg RRRrrrrr */ ! if (backward_compatible) { ! Py_UInt32 value = * (Py_UInt32 *) cp; ! cp += 4; ! r = (int) ((value & 0xff) / 255. * 7. + .5); ! g = (int) (((value >> 8) & 0xff) / 255. * 7. + .5); ! b = (int) (((value >> 16) & 0xff) / 255. * 3. + .5); ! } else { ! cp++; /* skip alpha channel */ ! b = (int) (*cp++ / 255. * 3. + .5); ! g = (int) (*cp++ / 255. * 7. + .5); ! r = (int) (*cp++ / 255. * 7. + .5); ! } ! *ncp++ = (unsigned char)((r<<5) | (b<<3) | g); } return rv; *************** *** 541,548 **** int x, y, len, nlen; unsigned char *cp; ! Py_UInt32 *ncp; PyObject *rv; int i, r, g, b; ! Py_UInt32 value, nvalue; if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) --- 589,597 ---- int x, y, len, nlen; unsigned char *cp; ! unsigned char *ncp; PyObject *rv; int i, r, g, b; ! unsigned char value; ! int backward_compatible = imageop_backward_compatible(); if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) *************** *** 558,562 **** if ( rv == 0 ) return 0; ! ncp = (Py_UInt32 *)PyString_AsString(rv); for ( i=0; i < nlen; i++ ) { --- 607,611 ---- if ( rv == 0 ) return 0; ! ncp = (unsigned char *)PyString_AsString(rv); for ( i=0; i < nlen; i++ ) { *************** *** 571,576 **** g = (g<<5) | (g<<3) | (g>>1); b = (b<<6) | (b<<4) | (b<<2) | b; ! nvalue = r | (g<<8) | (b<<16); ! *ncp++ = nvalue; } return rv; --- 620,633 ---- g = (g<<5) | (g<<3) | (g>>1); b = (b<<6) | (b<<4) | (b<<2) | b; ! if (backward_compatible) { ! Py_UInt32 nvalue = r | (g<<8) | (b<<16); ! * (Py_UInt32 *) ncp = nvalue; ! ncp += 4; ! } else { ! *ncp++ = 0; ! *ncp++ = b; ! *ncp++ = g; ! *ncp++ = r; ! } } return rv; *************** *** 581,589 **** { int x, y, len, nlen; ! Py_UInt32 *cp; unsigned char *ncp; PyObject *rv; int i, r, g, b; ! Py_UInt32 value, nvalue; if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) --- 638,647 ---- { int x, y, len, nlen; ! unsigned char *cp; unsigned char *ncp; PyObject *rv; int i, r, g, b; ! int nvalue; ! int backward_compatible = imageop_backward_compatible(); if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) *************** *** 602,609 **** for ( i=0; i < nlen; i++ ) { ! value = *cp++; ! r = (value ) & 0xff; ! g = (value >> 8) & 0xff; ! b = (value >> 16) & 0xff; nvalue = (int)(0.30*r + 0.59*g + 0.11*b); if ( nvalue > 255 ) nvalue = 255; --- 660,675 ---- for ( i=0; i < nlen; i++ ) { ! if (backward_compatible) { ! Py_UInt32 value = * (Py_UInt32 *) cp; ! cp += 4; ! r = (int) ((value & 0xff) / 255. * 7. + .5); ! g = (int) (((value >> 8) & 0xff) / 255. * 7. + .5); ! b = (int) (((value >> 16) & 0xff) / 255. * 3. + .5); ! } else { ! cp++; /* skip alpha channel */ ! b = *cp++; ! g = *cp++; ! r = *cp++; ! } nvalue = (int)(0.30*r + 0.59*g + 0.11*b); if ( nvalue > 255 ) nvalue = 255; *************** *** 618,625 **** int x, y, len, nlen; unsigned char *cp; ! Py_UInt32 *ncp; PyObject *rv; int i; ! Py_UInt32 value; if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) --- 684,692 ---- int x, y, len, nlen; unsigned char *cp; ! unsigned char *ncp; PyObject *rv; int i; ! unsigned char value; ! int backward_compatible = imageop_backward_compatible(); if ( !PyArg_ParseTuple(args, "s#ii", &cp, &len, &x, &y) ) *************** *** 635,643 **** if ( rv == 0 ) return 0; ! ncp = (Py_UInt32 *)PyString_AsString(rv); for ( i=0; i < nlen; i++ ) { value = *cp++; ! *ncp++ = value | (value << 8 ) | (value << 16); } return rv; --- 702,718 ---- if ( rv == 0 ) return 0; ! ncp = (unsigned char *)PyString_AsString(rv); for ( i=0; i < nlen; i++ ) { value = *cp++; ! if (backward_compatible) { ! * (Py_UInt32 *) ncp = (Py_UInt32) value | ((Py_UInt32) value << 8 ) | ((Py_UInt32) value << 16); ! ncp += 4; ! } else { ! *ncp++ = 0; ! *ncp++ = value; ! *ncp++ = value; ! *ncp++ = value; ! } } return rv; *************** *** 700,708 **** initimageop(void) { ! PyObject *m, *d; m = Py_InitModule("imageop", imageop_methods); ! d = PyModule_GetDict(m); ImageopError = PyErr_NewException("imageop.error", NULL, NULL); if (ImageopError != NULL) ! PyDict_SetItemString(d, "error", ImageopError); } --- 775,783 ---- initimageop(void) { ! PyObject *m; m = Py_InitModule("imageop", imageop_methods); ! ImageopDict = PyModule_GetDict(m); ImageopError = PyErr_NewException("imageop.error", NULL, NULL); if (ImageopError != NULL) ! PyDict_SetItemString(ImageopDict, "error", ImageopError); } From jackjansen at users.sourceforge.net Sun Jan 11 17:27:45 2004 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Sun Jan 11 17:27:49 2004 Subject: [Python-checkins] python/dist/src/Mac/Modules/qt _Qtmodule.c, 1.22, 1.23 qtscan.py, 1.26, 1.27 qtsupport.py, 1.26, 1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory sc8-pr-cvs1:/tmp/cvs-serv23010 Modified Files: _Qtmodule.c qtscan.py qtsupport.py Log Message: Added support for APIs in QuickTimeMusic.h. This one is a bit dodgy: the header file seems to be hand-written and missing the "const" keywords for input parameters passed by reference. Index: _Qtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** _Qtmodule.c 9 Jan 2004 23:18:47 -0000 1.22 --- _Qtmodule.c 11 Jan 2004 22:27:42 -0000 1.23 *************** *** 79,82 **** --- 79,92 ---- } + static int + QtMusicMIDIPacket_Convert(PyObject *v, MusicMIDIPacket *p_itself) + { + int dummy; + + if( !PyArg_ParseTuple(v, "hls#", &p_itself->length, &p_itself->reserved, p_itself->data, dummy) ) + return 0; [...1548 lines suppressed...] + {"TuneSetPartTranspose", (PyCFunction)Qt_TuneSetPartTranspose, 1, + PyDoc_STR("(TunePlayer tp, unsigned long part, long transpose, long velocityShift) -> (ComponentResult _rv)")}, + {"TuneGetNoteAllocator", (PyCFunction)Qt_TuneGetNoteAllocator, 1, + PyDoc_STR("(TunePlayer tp) -> (NoteAllocator _rv)")}, + {"TuneSetSofter", (PyCFunction)Qt_TuneSetSofter, 1, + PyDoc_STR("(TunePlayer tp, long softer) -> (ComponentResult _rv)")}, + {"TuneTask", (PyCFunction)Qt_TuneTask, 1, + PyDoc_STR("(TunePlayer tp) -> (ComponentResult _rv)")}, + {"TuneSetBalance", (PyCFunction)Qt_TuneSetBalance, 1, + PyDoc_STR("(TunePlayer tp, long balance) -> (ComponentResult _rv)")}, + {"TuneSetSoundLocalization", (PyCFunction)Qt_TuneSetSoundLocalization, 1, + PyDoc_STR("(TunePlayer tp, Handle data) -> (ComponentResult _rv)")}, + {"TuneSetHeaderWithSize", (PyCFunction)Qt_TuneSetHeaderWithSize, 1, + PyDoc_STR("(TunePlayer tp, unsigned long size) -> (ComponentResult _rv, unsigned long header)")}, + {"TuneSetPartMix", (PyCFunction)Qt_TuneSetPartMix, 1, + PyDoc_STR("(TunePlayer tp, unsigned long partNumber, long volume, long balance, long mixFlags) -> (ComponentResult _rv)")}, + {"TuneGetPartMix", (PyCFunction)Qt_TuneGetPartMix, 1, + PyDoc_STR("(TunePlayer tp, unsigned long partNumber) -> (ComponentResult _rv, long volumeOut, long balanceOut, long mixFlagsOut)")}, {"AlignWindow", (PyCFunction)Qt_AlignWindow, 1, PyDoc_STR("(WindowPtr wp, Boolean front) -> None")}, Index: qtscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtscan.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** qtscan.py 9 Jan 2004 23:18:47 -0000 1.26 --- qtscan.py 11 Jan 2004 22:27:42 -0000 1.27 *************** *** 14,18 **** "QuickTimeComponents.h", # "ImageCodec.h" -- seems not too useful, and difficult. ! "MediaHandlers.h" ) OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", --- 14,22 ---- "QuickTimeComponents.h", # "ImageCodec.h" -- seems not too useful, and difficult. ! "MediaHandlers.h", ! # "QTML.h", -- Windows only, needs separate module ! # "QuickTimeStreaming.h", -- Difficult ! # "QTStreamingComponents.h", -- Needs QTStreaming ! "QuickTimeMusic.h", ) OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", *************** *** 48,51 **** --- 52,73 ---- self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n") self.defsfile.write("xmlIdentifierUnrecognized = -1\n") + self.defsfile.write("kControllerMinimum = -0xf777\n") + self.defsfile.write("notImplementedMusicOSErr = -2071\n") + self.defsfile.write("cantSendToSynthesizerOSErr = -2072\n") + self.defsfile.write("cantReceiveFromSynthesizerOSErr = -2073\n") + self.defsfile.write("illegalVoiceAllocationOSErr = -2074\n") + self.defsfile.write("illegalPartOSErr = -2075\n") + self.defsfile.write("illegalChannelOSErr = -2076\n") + self.defsfile.write("illegalKnobOSErr = -2077\n") + self.defsfile.write("illegalKnobValueOSErr = -2078\n") + self.defsfile.write("illegalInstrumentOSErr = -2079\n") + self.defsfile.write("illegalControllerOSErr = -2080\n") + self.defsfile.write("midiManagerAbsentOSErr = -2081\n") + self.defsfile.write("synthesizerNotRespondingOSErr = -2082\n") + self.defsfile.write("synthesizerOSErr = -2083\n") + self.defsfile.write("illegalNoteChannelOSErr = -2084\n") + self.defsfile.write("noteChannelNotAllocatedOSErr = -2085\n") + self.defsfile.write("tunePlayerFullOSErr = -2086\n") + self.defsfile.write("tuneParseOSErr = -2087\n") def makeblacklistnames(self): *************** *** 101,104 **** --- 123,135 ---- "MediaMakeMediaTimeTable", # just lazy "MediaGetSampleDataPointer", # funny output pointer + + # QuickTimeMusic + "kControllerMinimum", + # These are artefacts of a macro definition + "ulen", + "_ext", + "x", + "w1", + "w2", ] *************** *** 224,227 **** --- 255,275 ---- "LevelMeterInfoPtr", # Lazy. Also: can be an output parameter!! "MediaEQSpectrumBandsRecordPtr", # ditto + + # From QuickTimeMusic + "MusicMIDISendUPP", + "MusicOfflineDataUPP", + "TuneCallBackUPP", + "TunePlayCallBackUPP", + "GCPart", # Struct with lots of fields + "GCPart_ptr", + "GenericKnobDescription", # Struct with lots of fields + "KnobDescription", # Struct with lots of fields + "InstrumentAboutInfo", # Struct, not too difficult + "NoteChannel", # XXXX Lazy. Could be opaque, I think + "NoteRequest", # XXXX Lazy. Not-too-difficult struct + "SynthesizerConnections", # Struct with lots of fields + "SynthesizerDescription", # Struct with lots of fields + "TuneStatus", # Struct with lots of fields + ] *************** *** 255,258 **** --- 303,310 ---- ([('FSSpecPtr', '*', 'InMode')], [('FSSpec_ptr', '*', 'InMode')]), ([('unsigned_char', 'swfVersion', 'OutMode')], [('UInt8', 'swfVersion', 'OutMode')]), + + # It seems MusicMIDIPacket if never flagged with const but always used + # for sending only. If that ever changes this needs to be fixed. + ([('MusicMIDIPacket', '*', 'OutMode')], [('MusicMIDIPacket_ptr', '*', 'InMode')]), ] Index: qtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtsupport.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** qtsupport.py 4 Jan 2004 22:33:33 -0000 1.26 --- qtsupport.py 11 Jan 2004 22:27:42 -0000 1.27 *************** *** 89,92 **** --- 89,102 ---- } + static int + QtMusicMIDIPacket_Convert(PyObject *v, MusicMIDIPacket *p_itself) + { + int dummy; + + if( !PyArg_ParseTuple(v, "hls#", &p_itself->length, &p_itself->reserved, p_itself->data, dummy) ) + return 0; + return 1; + } + *************** *** 144,147 **** --- 154,161 ---- DataHandler = OpaqueByValueType('DataHandler', 'CmpInstObj') SGChannel = OpaqueByValueType('SGChannel', 'CmpInstObj') + TunePlayer = OpaqueByValueType('TunePlayer', 'CmpInstObj') + MusicComponent = OpaqueByValueType('MusicComponent', 'CmpInstObj') + NoteAllocator = OpaqueByValueType('NoteAllocator', 'CmpInstObj') + QTMIDIComponent = OpaqueByValueType('QTMIDIComponent', 'CmpInstObj') ConstFSSpecPtr = FSSpec_ptr *************** *** 165,168 **** --- 179,185 ---- TimeCodeDescriptionHandle = OpaqueByValueType("TimeCodeDescriptionHandle", "ResObj") DataHFileTypeOrderingHandle = OpaqueByValueType("DataHFileTypeOrderingHandle", "ResObj") + QTMIDIPortListHandle = OpaqueByValueType("QTMIDIPortListHandle", "ResObj") + GenericKnobDescriptionListHandle = OpaqueByValueType("GenericKnobDescriptionListHandle", "ResObj") + InstrumentInfoListHandle = OpaqueByValueType("InstrumentInfoListHandle", "ResObj") # Silly Apple, passing an OStype by reference... OSType_ptr = OpaqueType("OSType", "PyMac_BuildOSType", "PyMac_GetOSType") *************** *** 174,177 **** --- 191,196 ---- TimeRecord = OpaqueType("TimeRecord", "QtTimeRecord") TimeRecord_ptr = TimeRecord + MusicMIDIPacket = OpaqueType("MusicMIDIPacket", "QtMusicMIDIPacket") + MusicMIDIPacket_ptr = MusicMIDIPacket # Non-opaque types, mostly integer-ish *************** *** 201,208 **** --- 220,232 ---- QTFloatSingle = Type("QTFloatSingle", "f") CodecQ = Type("CodecQ", "l") + MusicController = Type("MusicController", "l") # Could-not-be-bothered-types (NewMovieFromFile) dummyshortptr = FakeType('(short *)0') dummyStringPtr = FakeType('(StringPtr)0') + + # Not-quite-sure-this-is-okay types + AtomicInstrument = OpaqueByValueType("AtomicInstrument", "ResObj") + AtomicInstrumentPtr = InputOnlyType("AtomicInstrumentPtr", "s") # XXXX Need to override output_tp_newBody() to allow for None initializer. From jackjansen at users.sourceforge.net Sun Jan 11 17:52:14 2004 From: jackjansen at users.sourceforge.net (jackjansen@users.sourceforge.net) Date: Sun Jan 11 17:52:16 2004 Subject: [Python-checkins] python/dist/src/Mac/Modules/qt _Qtmodule.c, 1.23, 1.24 qtscan.py, 1.27, 1.28 qtsupport.py, 1.27, 1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory sc8-pr-cvs1:/tmp/cvs-serv28485 Modified Files: _Qtmodule.c qtscan.py qtsupport.py Log Message: More cases of input parameters passed by reference without const. Index: _Qtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** _Qtmodule.c 11 Jan 2004 22:27:42 -0000 1.23 --- _Qtmodule.c 11 Jan 2004 22:52:11 -0000 1.24 *************** *** 25836,25851 **** ComponentResult _rv; TunePlayer tp; ! unsigned long header; #ifndef TuneSetHeader PyMac_PRECHECK(TuneSetHeader); #endif ! if (!PyArg_ParseTuple(_args, "O&", ! CmpInstObj_Convert, &tp)) return NULL; _rv = TuneSetHeader(tp, ! &header); ! _res = Py_BuildValue("ll", ! _rv, ! header); return _res; } --- 25836,25851 ---- ComponentResult _rv; TunePlayer tp; ! unsigned long * header; #ifndef TuneSetHeader PyMac_PRECHECK(TuneSetHeader); #endif ! if (!PyArg_ParseTuple(_args, "O&s", ! CmpInstObj_Convert, &tp, ! &header)) return NULL; _rv = TuneSetHeader(tp, ! header); ! _res = Py_BuildValue("l", ! _rv); return _res; } *************** *** 26150,26168 **** ComponentResult _rv; TunePlayer tp; ! unsigned long header; unsigned long size; #ifndef TuneSetHeaderWithSize PyMac_PRECHECK(TuneSetHeaderWithSize); #endif ! if (!PyArg_ParseTuple(_args, "O&l", CmpInstObj_Convert, &tp, &size)) return NULL; _rv = TuneSetHeaderWithSize(tp, ! &header, size); ! _res = Py_BuildValue("ll", ! _rv, ! header); return _res; } --- 26150,26168 ---- ComponentResult _rv; TunePlayer tp; ! unsigned long * header; unsigned long size; #ifndef TuneSetHeaderWithSize PyMac_PRECHECK(TuneSetHeaderWithSize); #endif ! if (!PyArg_ParseTuple(_args, "O&sl", CmpInstObj_Convert, &tp, + &header, &size)) return NULL; _rv = TuneSetHeaderWithSize(tp, ! header, size); ! _res = Py_BuildValue("l", ! _rv); return _res; } *************** *** 27938,27942 **** PyDoc_STR("(NoteAllocator na) -> (ComponentResult _rv)")}, {"TuneSetHeader", (PyCFunction)Qt_TuneSetHeader, 1, ! PyDoc_STR("(TunePlayer tp) -> (ComponentResult _rv, unsigned long header)")}, {"TuneGetTimeBase", (PyCFunction)Qt_TuneGetTimeBase, 1, PyDoc_STR("(TunePlayer tp) -> (ComponentResult _rv, TimeBase tb)")}, --- 27938,27942 ---- PyDoc_STR("(NoteAllocator na) -> (ComponentResult _rv)")}, {"TuneSetHeader", (PyCFunction)Qt_TuneSetHeader, 1, ! PyDoc_STR("(TunePlayer tp, unsigned long * header) -> (ComponentResult _rv)")}, {"TuneGetTimeBase", (PyCFunction)Qt_TuneGetTimeBase, 1, PyDoc_STR("(TunePlayer tp) -> (ComponentResult _rv, TimeBase tb)")}, *************** *** 27970,27974 **** PyDoc_STR("(TunePlayer tp, Handle data) -> (ComponentResult _rv)")}, {"TuneSetHeaderWithSize", (PyCFunction)Qt_TuneSetHeaderWithSize, 1, ! PyDoc_STR("(TunePlayer tp, unsigned long size) -> (ComponentResult _rv, unsigned long header)")}, {"TuneSetPartMix", (PyCFunction)Qt_TuneSetPartMix, 1, PyDoc_STR("(TunePlayer tp, unsigned long partNumber, long volume, long balance, long mixFlags) -> (ComponentResult _rv)")}, --- 27970,27974 ---- PyDoc_STR("(TunePlayer tp, Handle data) -> (ComponentResult _rv)")}, {"TuneSetHeaderWithSize", (PyCFunction)Qt_TuneSetHeaderWithSize, 1, ! PyDoc_STR("(TunePlayer tp, unsigned long * header, unsigned long size) -> (ComponentResult _rv)")}, {"TuneSetPartMix", (PyCFunction)Qt_TuneSetPartMix, 1, PyDoc_STR("(TunePlayer tp, unsigned long partNumber, long volume, long balance, long mixFlags) -> (ComponentResult _rv)")}, Index: qtscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtscan.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** qtscan.py 11 Jan 2004 22:27:42 -0000 1.27 --- qtscan.py 11 Jan 2004 22:52:12 -0000 1.28 *************** *** 307,310 **** --- 307,313 ---- # for sending only. If that ever changes this needs to be fixed. ([('MusicMIDIPacket', '*', 'OutMode')], [('MusicMIDIPacket_ptr', '*', 'InMode')]), + + # QTMusic const-less input parameters + ([('unsigned_long', 'header', 'OutMode')], [('UnsignedLongPtr', 'header', 'InMode')]), ] Index: qtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtsupport.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** qtsupport.py 11 Jan 2004 22:27:42 -0000 1.27 --- qtsupport.py 11 Jan 2004 22:52:12 -0000 1.28 *************** *** 212,215 **** --- 212,216 ---- Ptr = InputOnlyType("Ptr", "s") StringPtr = Type("StringPtr", "s") + UnsignedLongPtr = Type("unsigned long *", "s") mcactionparams = InputOnlyType("void *", "s") QTParameterDialog = Type("QTParameterDialog", "l") From akuchling at users.sourceforge.net Sun Jan 11 18:00:18 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Sun Jan 11 18:00:20 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libpoplib.tex,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv30231 Modified Files: libpoplib.tex Log Message: [Bug #873205] Update URL Index: libpoplib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpoplib.tex,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** libpoplib.tex 31 Oct 2003 12:52:34 -0000 1.16 --- libpoplib.tex 11 Jan 2004 23:00:16 -0000 1.17 *************** *** 54,58 **** \begin{seealso} \seemodule{imaplib}{The standard Python IMAP module.} ! \seetitle[http://www.tuxedo.org/\~{}esr/fetchmail/fetchmail-FAQ.html] {Frequently Asked Questions About Fetchmail} {The FAQ for the \program{fetchmail} POP/IMAP client collects --- 54,58 ---- \begin{seealso} \seemodule{imaplib}{The standard Python IMAP module.} ! \seetitle[http://www.catb.org/\~{}esr/fetchmail/fetchmail-FAQ.html] {Frequently Asked Questions About Fetchmail} {The FAQ for the \program{fetchmail} POP/IMAP client collects From akuchling at users.sourceforge.net Sun Jan 11 18:04:36 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Sun Jan 11 18:04:39 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libpoplib.tex, 1.15, 1.15.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv31124 Modified Files: Tag: release23-branch libpoplib.tex Log Message: [Bug #873205] Update URL Index: libpoplib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpoplib.tex,v retrieving revision 1.15 retrieving revision 1.15.14.1 diff -C2 -d -r1.15 -r1.15.14.1 *** libpoplib.tex 18 Oct 2002 16:50:17 -0000 1.15 --- libpoplib.tex 11 Jan 2004 23:04:34 -0000 1.15.14.1 *************** *** 41,45 **** \begin{seealso} \seemodule{imaplib}{The standard Python IMAP module.} ! \seetitle[http://www.tuxedo.org/\~{}esr/fetchmail/fetchmail-FAQ.html] {Frequently Asked Questions About Fetchmail} {The FAQ for the \program{fetchmail} POP/IMAP client collects --- 41,45 ---- \begin{seealso} \seemodule{imaplib}{The standard Python IMAP module.} ! \seetitle[http://www.catb.org/\~{}esr/fetchmail/fetchmail-FAQ.html] {Frequently Asked Questions About Fetchmail} {The FAQ for the \program{fetchmail} POP/IMAP client collects From rhettinger at users.sourceforge.net Sun Jan 11 18:26:53 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Sun Jan 11 18:26:56 2004 Subject: [Python-checkins] python/dist/src/Objects abstract.c,2.122,2.123 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv2999 Modified Files: abstract.c Log Message: SF Patch #871704: Py_SequenceFast can mask errors (Contributed by Greg Chapman.) Since this only changes the error message, I doubt that it should be backported. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.122 retrieving revision 2.123 diff -C2 -d -r2.122 -r2.123 *** abstract.c 4 Jan 2004 11:00:08 -0000 2.122 --- abstract.c 11 Jan 2004 23:26:51 -0000 2.123 *************** *** 1497,1500 **** --- 1497,1502 ---- PySequence_Fast(PyObject *v, const char *m) { + PyObject *it; + if (v == NULL) return null_error(); *************** *** 1505,1511 **** } ! v = PySequence_Tuple(v); ! if (v == NULL && PyErr_ExceptionMatches(PyExc_TypeError)) ! return type_error(m); return v; --- 1507,1519 ---- } ! it = PyObject_GetIter(v); ! if (it == NULL) { ! if (PyErr_ExceptionMatches(PyExc_TypeError)) ! return type_error(m); ! return NULL; ! } ! ! v = PySequence_Tuple(it); ! Py_DECREF(it); return v; From mwh at users.sourceforge.net Tue Jan 13 06:08:02 2004 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Tue Jan 13 06:08:06 2004 Subject: [Python-checkins] python/nondist/peps pep-0320.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv5645 Modified Files: pep-0320.txt Log Message: Add collections package feature in a probably fruitless attempt to stop it being forgotten :-) Index: pep-0320.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0320.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pep-0320.txt 7 Jan 2004 05:23:45 -0000 1.4 --- pep-0320.txt 13 Jan 2004 11:08:00 -0000 1.5 *************** *** 57,60 **** --- 57,62 ---- Too early for anything more to get done here. + Add collections package (move new builtin set stuff to here?). + Ongoing tasks From rhettinger at users.sourceforge.net Tue Jan 13 12:46:28 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Jan 13 12:46:33 2004 Subject: [Python-checkins] python/nondist/peps pep-0320.txt,1.5,1.6 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv5266 Modified Files: pep-0320.txt Log Message: Misc updates Index: pep-0320.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0320.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0320.txt 13 Jan 2004 11:08:00 -0000 1.5 --- pep-0320.txt 13 Jan 2004 17:46:25 -0000 1.6 *************** *** 55,61 **** Remove support for platforms as described in PEP 11. ! Too early for anything more to get done here. ! Add collections package (move new builtin set stuff to here?). --- 55,69 ---- Remove support for platforms as described in PEP 11. ! Add a module for statistical and reduction functions: ! stddev, average, nlargest, nsmallest, product, etc. ! Add collections package: ! - deque/queue (suggested by Raymond) ! - BTrees (suggested by Tim) ! - ? bag (only if use cases established) ! - ? heap (with a min/max option flag, a key= option, ! and implemented as a fibonacci heap) ! ! Possibly add 'diff3' and 'patch' functions to the difflib module. From akuchling at users.sourceforge.net Tue Jan 13 12:56:50 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Tue Jan 13 12:56:53 2004 Subject: [Python-checkins] python/nondist/peps pep-0320.txt,1.6,1.7 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv6899 Modified Files: pep-0320.txt Log Message: Note two Distutils tasks Index: pep-0320.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0320.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** pep-0320.txt 13 Jan 2004 17:46:25 -0000 1.6 --- pep-0320.txt 13 Jan 2004 17:56:48 -0000 1.7 *************** *** 67,70 **** --- 67,73 ---- Possibly add 'diff3' and 'patch' functions to the difflib module. + Finish implementing the Distutils bdist_dpkg command. + + Ongoing tasks *************** *** 145,148 **** --- 148,157 ---- It seems we can't get consensus on this. + - PEP 262 Database of Installed Python Packages Kuchling + + This turns out to be useful for Jack Jansen's Python installer, + so the database is worth implementing. Code will go in + sandbox/pep262. + - PEP 269 Pgen Module for Python Riehl *************** *** 150,159 **** mature more.) - - Add support for the long-awaited Python catalog. Kapil - Thangavelu has a Zope-based implementation that he demoed at - OSCON 2002. Now all we need is a place to host it and a person - to champion it. (Some changes to distutils to support this are - in, at least.) - - PEP 266 Optimizing Global Variable/Attribute Access Montanaro PEP 267 Optimized Access to Module Namespaces Hylton --- 159,162 ---- From greg at users.sourceforge.net Tue Jan 13 15:00:00 2004 From: greg at users.sourceforge.net (greg@users.sourceforge.net) Date: Tue Jan 13 15:00:03 2004 Subject: [Python-checkins] python/dist/src/Lib/bsddb/test test_basics.py, 1.9, 1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/bsddb/test In directory sc8-pr-cvs1:/tmp/cvs-serv6865/bsddb/test Modified Files: test_basics.py Log Message: __init__.py: keep it compatible with older python (True and False == 1 and 0) test_basics.py: updated for the set_get_returns_none() default of 2 change. Index: test_basics.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/test/test_basics.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_basics.py 1 Oct 2003 06:48:51 -0000 1.9 --- test_basics.py 13 Jan 2004 19:59:57 -0000 1.10 *************** *** 291,295 **** #---------------------------------------- ! def test03_SimpleCursorStuff(self, get_raises_error=0, set_raises_error=1): if verbose: print '\n', '-=' * 30 --- 291,295 ---- #---------------------------------------- ! def test03_SimpleCursorStuff(self, get_raises_error=0, set_raises_error=0): if verbose: print '\n', '-=' * 30 *************** *** 460,466 **** old = self.d.set_get_returns_none(0) ! assert old == 1 self.test03_SimpleCursorStuff(get_raises_error=1, set_raises_error=1) def test03c_SimpleCursorGetReturnsNone2(self): # same test but raise exceptions instead of returning None --- 460,477 ---- old = self.d.set_get_returns_none(0) ! assert old == 2 self.test03_SimpleCursorStuff(get_raises_error=1, set_raises_error=1) + def test03b_SimpleCursorWithGetReturnsNone1(self): + # same test but raise exceptions instead of returning None + if verbose: + print '\n', '-=' * 30 + print "Running %s.test03b_SimpleCursorStuffWithoutGetReturnsNone..." % \ + self.__class__.__name__ + + old = self.d.set_get_returns_none(1) + self.test03_SimpleCursorStuff(get_raises_error=0, set_raises_error=1) + + def test03c_SimpleCursorGetReturnsNone2(self): # same test but raise exceptions instead of returning None *************** *** 470,477 **** self.__class__.__name__ old = self.d.set_get_returns_none(2) assert old == 1 - old = self.d.set_get_returns_none(2) - assert old == 2 self.test03_SimpleCursorStuff(get_raises_error=0, set_raises_error=0) --- 481,488 ---- self.__class__.__name__ + old = self.d.set_get_returns_none(1) + assert old == 2 old = self.d.set_get_returns_none(2) assert old == 1 self.test03_SimpleCursorStuff(get_raises_error=0, set_raises_error=0) From greg at users.sourceforge.net Tue Jan 13 14:59:59 2004 From: greg at users.sourceforge.net (greg@users.sourceforge.net) Date: Tue Jan 13 15:00:06 2004 Subject: [Python-checkins] python/dist/src/Lib/bsddb __init__.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/bsddb In directory sc8-pr-cvs1:/tmp/cvs-serv6865/bsddb Modified Files: __init__.py Log Message: __init__.py: keep it compatible with older python (True and False == 1 and 0) test_basics.py: updated for the set_get_returns_none() default of 2 change. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bsddb/__init__.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** __init__.py 3 Nov 2003 01:04:41 -0000 1.12 --- __init__.py 13 Jan 2004 19:59:57 -0000 1.13 *************** *** 185,189 **** # and DB_THREAD to be thread safe) when intermixing database # operations that use the cursor internally with those that don't. ! def _closeCursors(self, save=True): if self.dbc: c = self.dbc --- 185,189 ---- # and DB_THREAD to be thread safe) when intermixing database # operations that use the cursor internally with those that don't. ! def _closeCursors(self, save=1): if self.dbc: c = self.dbc *************** *** 224,228 **** def close(self): ! self._closeCursors(save=False) if self.dbc is not None: self.dbc.close() --- 224,228 ---- def close(self): ! self._closeCursors(save=0) if self.dbc is not None: self.dbc.close() From fdrake at users.sourceforge.net Tue Jan 13 18:41:34 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Jan 13 18:41:38 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libtarfile.tex,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv26169 Modified Files: libtarfile.tex Log Message: markup changes Index: libtarfile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtarfile.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** libtarfile.tex 12 Oct 2003 02:02:16 -0000 1.2 --- libtarfile.tex 13 Jan 2004 23:41:32 -0000 1.3 *************** *** 13,17 **** \begin{itemize} \item reads and writes \module{gzip} and \module{bzip2} compressed archives. ! \item creates POSIX 1003.1-1990 compliant or GNU tar compatible archives. \item reads GNU tar extensions \emph{longname}, \emph{longlink} and \emph{sparse}. --- 13,17 ---- \begin{itemize} \item reads and writes \module{gzip} and \module{bzip2} compressed archives. ! \item creates \POSIX{} 1003.1-1990 compliant or GNU tar compatible archives. \item reads GNU tar extensions \emph{longname}, \emph{longlink} and \emph{sparse}. *************** *** 53,69 **** For special purposes, there is a second format for \var{mode}: ! \code{'filemode|[compression]'}. \code{open} will return a \class{TarFile} ! object that processes its data as a stream of blocks. No random ! seeking will be done on the file. If given, \var{fileobj} may be any ! object that has a \code{read()} resp. \code{write()} method. ! \var{bufsize} specifies the blocksize and defaults to \code{20 * 512} ! bytes. Use this variant in combination with e.g. \code{sys.stdin}, a socket ! file object or a tape device. ! However, such a \class{TarFile} object is limited in that it does not allow ! to be accessed randomly, see \citetitle{Examples} (section ! \ref{tar-examples}). ! The currently possible modes: ! \begin{tableii}{c|l}{code}{mode}{action} \lineii{'r|'}{Open a \emph{stream} of uncompressed tar blocks for reading.} \lineii{'r|gz'}{Open a gzip compressed \emph{stream} for reading.} --- 53,69 ---- For special purposes, there is a second format for \var{mode}: ! \code{'filemode|[compression]'}. \function{open()} will return a ! \class{TarFile} object that processes its data as a stream of ! blocks. No random seeking will be done on the file. If given, ! \var{fileobj} may be any object that has a \method{read()} or ! \method{write()} method (depending on the \var{mode}). ! \var{bufsize} specifies the blocksize and defaults to \code{20 * ! 512} bytes. Use this variant in combination with ! e.g. \code{sys.stdin}, a socket file object or a tape device. ! However, such a \class{TarFile} object is limited in that it does ! not allow to be accessed randomly, see ``Examples'' ! (section~\ref{tar-examples}). The currently possible modes: ! \begin{tableii}{c|l}{code}{Mode}{Action} \lineii{'r|'}{Open a \emph{stream} of uncompressed tar blocks for reading.} \lineii{'r|gz'}{Open a gzip compressed \emph{stream} for reading.} *************** *** 78,101 **** Class for reading and writing tar archives. Do not use this class directly, better use \function{open()} instead. ! See \citetitle{TarFile Objects} (section \ref{tarfile-objects}). \end{classdesc*} \begin{funcdesc}{is_tarfile}{name} ! Return \code{True} if \var{name} is a tar archive file, that the ! \module{tarfile} module can read. \end{funcdesc} \begin{classdesc}{TarFileCompat}{filename\optional{, mode\optional{, ! compression}}} ! ! Class for limited access to tar archives with a \code{zipfile}-like ! interface. Please consult the documentation of \code{zipfile} for more ! details. ! \code{compression} must be one of the following constants: \begin{datadesc}{TAR_PLAIN} Constant for an uncompressed tar archive. \end{datadesc} \begin{datadesc}{TAR_GZIPPED} ! Constant for a \code{gzip} compressed tar archive. \end{datadesc} \end{classdesc} --- 78,100 ---- Class for reading and writing tar archives. Do not use this class directly, better use \function{open()} instead. ! See ``TarFile Objects'' (section~\ref{tarfile-objects}). \end{classdesc*} \begin{funcdesc}{is_tarfile}{name} ! Return \constant{True} if \var{name} is a tar archive file, that ! the \module{tarfile} module can read. \end{funcdesc} \begin{classdesc}{TarFileCompat}{filename\optional{, mode\optional{, ! compression}}} ! Class for limited access to tar archives with a ! \refmodule{zipfile}-like interface. Please consult the ! documentation of the \refmodule{zipfile} module for more details. ! \var{compression} must be one of the following constants: \begin{datadesc}{TAR_PLAIN} Constant for an uncompressed tar archive. \end{datadesc} \begin{datadesc}{TAR_GZIPPED} ! Constant for a \refmodule{gzip} compressed tar archive. \end{datadesc} \end{classdesc} *************** *** 126,130 **** \begin{seealso} ! \seemodule{zipfile}{Documentation of the \code{zipfile} standard module.} --- 125,129 ---- \begin{seealso} ! \seemodule{zipfile}{Documentation of the \refmodule{zipfile} standard module.} *************** *** 163,167 **** \begin{methoddesc}{open}{...} Alternative constructor. The \function{open()} function on module level is ! actually a shortcut to this classmethod. See section \ref{module-tarfile} for details. \end{methoddesc} --- 162,166 ---- \begin{methoddesc}{open}{...} Alternative constructor. The \function{open()} function on module level is ! actually a shortcut to this classmethod. See section~\ref{module-tarfile} for details. \end{methoddesc} *************** *** 188,193 **** \begin{methoddesc}{list}{verbose=True} Print a table of contents to \code{sys.stdout}. If \var{verbose} is ! \code{False}, only the names of the members are printed. If it is ! \code{True}, an \code{"ls -l"}-like output is produced. \end{methoddesc} --- 187,192 ---- \begin{methoddesc}{list}{verbose=True} Print a table of contents to \code{sys.stdout}. If \var{verbose} is ! \constant{False}, only the names of the members are printed. If it is ! \constant{True}, output similar to that of \program{ls -l} is produced. \end{methoddesc} *************** *** 220,234 **** \end{methoddesc} ! \begin{methoddesc}{add}{name\optional{, arcname\optional{, recursive=True}}} Add the file \var{name} to the archive. \var{name} may be any type of file (directory, fifo, symbolic link, etc.). If given, \var{arcname} specifies an alternative name for the file in the archive. Directories are added recursively by default. ! This can be avoided by setting \var{recursive} to \code{False}. \end{methoddesc} \begin{methoddesc}{addfile}{tarinfo\optional{, fileobj}} Add the \class{TarInfo} object \var{tarinfo} to the archive. ! If \var{fileobj} is given, \code{tarinfo.size} bytes are read from it and added to the archive. You can create \class{TarInfo} objects using \method{gettarinfo()}. --- 219,234 ---- \end{methoddesc} ! \begin{methoddesc}{add}{name\optional{, arcname\optional{, recursive}}} Add the file \var{name} to the archive. \var{name} may be any type of file (directory, fifo, symbolic link, etc.). If given, \var{arcname} specifies an alternative name for the file in the archive. Directories are added recursively by default. ! This can be avoided by setting \var{recursive} to \constant{False}; ! the default is \constant{True}. \end{methoddesc} \begin{methoddesc}{addfile}{tarinfo\optional{, fileobj}} Add the \class{TarInfo} object \var{tarinfo} to the archive. ! If \var{fileobj} is given, \code{\var{tarinfo}.size} bytes are read from it and added to the archive. You can create \class{TarInfo} objects using \method{gettarinfo()}. *************** *** 239,293 **** \end{methoddesc} ! \begin{methoddesc}{gettarinfo}{\optional{name\optional{, arcname ! \optional{, fileobj}}}} ! Create a \class{TarInfo} object for either the file \var{name} or the ! file object \var{fileobj} (using \code{os.fstat()} on its file descriptor). ! You can modify some of the \class{TarInfo}'s attributes before you add it ! using \method{addfile()}. ! If given, \var{arcname} specifies an alternative name for the file in the archive. \end{methoddesc} \begin{methoddesc}{close}{} ! Close the \class{TarFile}. In write-mode, two finishing zero blocks are ! appended to the archive. \end{methoddesc} ! \begin{memberdesc}{posix=True} ! If \code{True}, create a POSIX 1003.1-1990 compliant archive. GNU ! extensions are not used, because they are not part of the POSIX standard. ! This limits the length of filenames to at most 256 and linknames to 100 ! characters. A \exception{ValueError} is raised, if a pathname exceeds this ! limit. ! If \code{False}, create a GNU tar compatible archive. It will not be POSIX ! compliant, but can store pathnames of unlimited length. \end{memberdesc} ! \begin{memberdesc}{dereference=False} ! If \code{False}, add symbolic and hard links to archive. If \code{True}, ! add the content of the target files to the archive. This has no effect on ! systems that do not support links. \end{memberdesc} ! \begin{memberdesc}{ignore_zeros=False} ! If \code{False}, treat an empty block as the end of the archive. If ! \code{True}, skip empty (and invalid) blocks and try to get as many ! members as possible. This is only useful for concatenated or damaged archives. \end{memberdesc} \begin{memberdesc}{debug=0} ! To be set from \code{0}(no debug messages) up to \code{3}(all debug ! messages). The messages are written to \code{sys.stdout}. \end{memberdesc} ! \begin{memberdesc}{errorlevel=0} ! If \code{0}, all errors are ignored when using \method{extract()}. ! Nevertheless, they appear as error messages in the debug output, when ! debugging is enabled. ! If \code{1}, all \emph{fatal} errors are raised as \exception{OSError} ! or \exception{IOError} exceptions. ! If \code{2}, all \emph{non-fatal} errors are raised as \exception{TarError} ! exceptions as well. \end{memberdesc} --- 239,293 ---- \end{methoddesc} ! \begin{methoddesc}{gettarinfo}{\optional{name\optional{, ! arcname\optional{, fileobj}}}} ! Create a \class{TarInfo} object for either the file \var{name} or ! the file object \var{fileobj} (using \function{os.fstat()} on its ! file descriptor). You can modify some of the \class{TarInfo}'s ! attributes before you add it using \method{addfile()}. If given, ! \var{arcname} specifies an alternative name for the file in the archive. \end{methoddesc} \begin{methoddesc}{close}{} ! Close the \class{TarFile}. In write mode, two finishing zero ! blocks are appended to the archive. \end{methoddesc} ! \begin{memberdesc}{posix} ! If true, create a \POSIX{} 1003.1-1990 compliant archive. GNU ! extensions are not used, because they are not part of the \POSIX{} ! standard. This limits the length of filenames to at most 256 and ! link names to 100 characters. A \exception{ValueError} is raised ! if a pathname exceeds this limit. If false, create a GNU tar ! compatible archive. It will not be \POSIX{} compliant, but can ! store pathnames of unlimited length. \end{memberdesc} ! \begin{memberdesc}{dereference} ! If false, add symbolic and hard links to archive. If true, add the ! content of the target files to the archive. This has no effect on ! systems that do not support symbolic links. \end{memberdesc} ! \begin{memberdesc}{ignore_zeros} ! If false, treat an empty block as the end of the archive. If true, ! skip empty (and invalid) blocks and try to get as many members as ! possible. This is only useful for concatenated or damaged archives. \end{memberdesc} \begin{memberdesc}{debug=0} ! To be set from \code{0} (no debug messages; the default) up to ! \code{3} (all debug messages). The messages are written to ! \code{sys.stdout}. \end{memberdesc} ! \begin{memberdesc}{errorlevel} ! If \code{0} (the default), all errors are ignored when using ! \method{extract()}. Nevertheless, they appear as error messages ! in the debug output, when debugging is enabled. If \code{1}, all ! \emph{fatal} errors are raised as \exception{OSError} or ! \exception{IOError} exceptions. If \code{2}, all \emph{non-fatal} ! errors are raised as \exception{TarError} exceptions as well. \end{memberdesc} *************** *** 298,308 **** \subsection{TarInfo Objects \label{tarinfo-objects}} ! A \class{TarInfo} object represents one member in a \class{TarFile}. Aside from ! storing all required attributes of a file (like file type, size, time, ! permissions, owner etc.), it provides some useful methods to determine its ! type. It does \emph{not} contain the file's data itself. ! \class{TarInfo} objects are returned by \code{TarFile}'s methods ! \code{getmember()}, \code{getmembers()} and \code{gettarinfo()}. \begin{classdesc}{TarInfo}{\optional{name}} --- 298,309 ---- \subsection{TarInfo Objects \label{tarinfo-objects}} ! A \class{TarInfo} object represents one member in a ! \class{TarFile}. Aside from storing all required attributes of a file ! (like file type, size, time, permissions, owner etc.), it provides ! some useful methods to determine its type. It does \emph{not} contain ! the file's data itself. ! \class{TarInfo} objects are returned by \class{TarFile}'s methods ! \method{getmember()}, \method{getmembers()} and \method{gettarinfo()}. \begin{classdesc}{TarInfo}{\optional{name}} *************** *** 319,322 **** --- 320,324 ---- A \code{TarInfo} object has the following public data attributes: + \begin{memberdesc}{name} Name of the archive member. *************** *** 336,363 **** \begin{memberdesc}{type} ! File type. ! \var{type} is usually one of these constants: ! \code{REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, ! CHRTYPE, BLKTYPE, GNUTYPE_SPARSE}. ! To determine the type of a \class{TarInfo} object more conveniently, use ! the \code{is_*()} methods below. \end{memberdesc} \begin{memberdesc}{linkname} ! Name of the target file name, which is only present in \class{TarInfo} ! objects of type LNKTYPE and SYMTYPE. \end{memberdesc} ! \begin{memberdesc}{uid, gid} ! User and group ID of who originally stored this member. \end{memberdesc} ! \begin{memberdesc}{uname, gname} ! User and group name. \end{memberdesc} A \class{TarInfo} object also provides some convenient query methods: \begin{methoddesc}{isfile}{} ! Return \code{True} if the \class{Tarinfo} object is a regular file. \end{methoddesc} --- 338,377 ---- \begin{memberdesc}{type} ! File type. \var{type} is usually one of these constants: ! \constant{REGTYPE}, \constant{AREGTYPE}, \constant{LNKTYPE}, ! \constant{SYMTYPE}, \constant{DIRTYPE}, \constant{FIFOTYPE}, ! \constant{CONTTYPE}, \constant{CHRTYPE}, \constant{BLKTYPE}, ! \constant{GNUTYPE_SPARSE}. To determine the type of a ! \class{TarInfo} object more conveniently, use the \code{is_*()} ! methods below. \end{memberdesc} \begin{memberdesc}{linkname} ! Name of the target file name, which is only present in ! \class{TarInfo} objects of type \constant{LNKTYPE} and ! \constant{SYMTYPE}. \end{memberdesc} ! \begin{memberdesc}{uid} ! User ID of the user who originally stored this member. \end{memberdesc} ! \begin{memberdesc}{gid} ! Group ID of the user who originally stored this member. ! \end{memberdesc} ! ! \begin{memberdesc}{uname} ! User name. ! \end{memberdesc} ! ! \begin{memberdesc}{gname} ! Group name. \end{memberdesc} A \class{TarInfo} object also provides some convenient query methods: + \begin{methoddesc}{isfile}{} ! Return \constant{True} if the \class{Tarinfo} object is a regular ! file. \end{methoddesc} *************** *** 367,395 **** \begin{methoddesc}{isdir}{} ! Return \code{True} if it is a directory. \end{methoddesc} \begin{methoddesc}{issym}{} ! Return \code{True} if it is a symbolic link. \end{methoddesc} \begin{methoddesc}{islnk}{} ! Return \code{True} if it is a hard link. \end{methoddesc} \begin{methoddesc}{ischr}{} ! Return \code{True} if it is a character device. \end{methoddesc} \begin{methoddesc}{isblk}{} ! Return \code{True} if it is a block device. \end{methoddesc} \begin{methoddesc}{isfifo}{} ! Return \code{True} if it is a FIFO. \end{methoddesc} \begin{methoddesc}{isdev}{} ! Return \code{True} if it is one of character device, block device or FIFO. \end{methoddesc} --- 381,410 ---- \begin{methoddesc}{isdir}{} ! Return \constant{True} if it is a directory. \end{methoddesc} \begin{methoddesc}{issym}{} ! Return \constant{True} if it is a symbolic link. \end{methoddesc} \begin{methoddesc}{islnk}{} ! Return \constant{True} if it is a hard link. \end{methoddesc} \begin{methoddesc}{ischr}{} ! Return \constant{True} if it is a character device. \end{methoddesc} \begin{methoddesc}{isblk}{} ! Return \constant{True} if it is a block device. \end{methoddesc} \begin{methoddesc}{isfifo}{} ! Return \constant{True} if it is a FIFO. \end{methoddesc} \begin{methoddesc}{isdev}{} ! Return \constant{True} if it is one of character device, block ! device or FIFO. \end{methoddesc} *************** *** 448,450 **** tar.close() \end{verbatim} - --- 463,464 ---- From fdrake at users.sourceforge.net Tue Jan 13 18:44:00 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Jan 13 18:44:04 2004 Subject: [Python-checkins] python/dist/src/Doc/perl l2hinit.perl,1.80,1.81 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory sc8-pr-cvs1:/tmp/cvs-serv26617 Modified Files: l2hinit.perl Log Message: - add comment about $CUSTOM_BUTTONS - use_icon(): fix the check for whether a supplemental link is being used Index: l2hinit.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/l2hinit.perl,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** l2hinit.perl 27 Sep 2003 16:04:23 -0000 1.80 --- l2hinit.perl 13 Jan 2004 23:43:58 -0000 1.81 *************** *** 110,113 **** --- 110,114 ---- + # $CUSTOM_BUTTONS is only used for the module index link. $CUSTOM_BUTTONS = ''; *************** *** 164,168 **** sub use_icon($$$) { my($rel,$str,$title) = @_; ! if ($title) { my $s = "$str"; if ($s =~ /\/) { --- 165,169 ---- sub use_icon($$$) { my($rel,$str,$title) = @_; ! if ($str) { my $s = "$str"; if ($s =~ /\/) { From fdrake at users.sourceforge.net Tue Jan 13 18:56:05 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Tue Jan 13 18:56:12 2004 Subject: [Python-checkins] python/dist/src/Doc README,1.53,1.54 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory sc8-pr-cvs1:/tmp/cvs-serv29346 Modified Files: README Log Message: add a note about memory consumption and LaTeX closes SF bug #721157 Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/README,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** README 23 Dec 2003 17:04:35 -0000 1.53 --- README 13 Jan 2004 23:56:03 -0000 1.54 *************** *** 144,147 **** --- 144,164 ---- + LaTeX (or pdfLaTeX) ran out of memory; how can I fix it? + -------------------------------------------------------- + + This is known to be a problem at least on Mac OS X, but it has been + observed on other systems in the past. + + On some systems, the default sizes of some of the memory pools + allocated by TeX needs to be changed; this is a configuration setting + for installations based on web2c (most if not all installations). + This is usually set in a file named texmf/web2c/texmf.cnf (where the + top-level texmf/ directory is part of the TeX installation). If you + get a "buffer overflow" warning from LaTeX, open that configuration + file and look for the "main_memory.pdflatex" setting. If there is not + one, you can add a line with the setting. The value 1500000 seems to + be sufficient for formatting the Python documetantion. + + What if Times fonts are not available? -------------------------------------- From akuchling at users.sourceforge.net Fri Jan 16 08:18:44 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Jan 16 08:18:50 2004 Subject: [Python-checkins] python/dist/src/Modules posixmodule.c, 2.310, 2.311 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv27618 Modified Files: posixmodule.c Log Message: Make parameter names in docstring more mnemonic Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.310 retrieving revision 2.311 diff -C2 -d -r2.310 -r2.311 *** posixmodule.c 4 Jan 2004 13:54:25 -0000 2.310 --- posixmodule.c 16 Jan 2004 13:18:42 -0000 2.311 *************** *** 4982,4986 **** PyDoc_STRVAR(posix_dup2__doc__, ! "dup2(fd, fd2)\n\n\ Duplicate file descriptor."); --- 4982,4986 ---- PyDoc_STRVAR(posix_dup2__doc__, ! "dup2(old_fd, new_fd)\n\n\ Duplicate file descriptor."); From akuchling at users.sourceforge.net Fri Jan 16 10:58:39 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Fri Jan 16 10:58:43 2004 Subject: [Python-checkins] python/nondist/peps pep-0320.txt,1.7,1.8 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv1210 Modified Files: pep-0320.txt Log Message: Add two items; fix grammar typo Index: pep-0320.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0320.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pep-0320.txt 13 Jan 2004 17:56:48 -0000 1.7 --- pep-0320.txt 16 Jan 2004 15:58:37 -0000 1.8 *************** *** 67,73 **** Possibly add 'diff3' and 'patch' functions to the difflib module. ! Finish implementing the Distutils bdist_dpkg command. - Ongoing tasks --- 67,79 ---- Possibly add 'diff3' and 'patch' functions to the difflib module. ! Finish implementing the Distutils bdist_dpkg command. (AMK) ! ! Add support for reading shadow passwords (www.python.org/sf/579435) ! ! It would be nice if the built-in SSL socket type could be used ! for non-blocking SSL I/O. Currently packages such as Twisted ! which implement async servers using SSL have to require third-party ! packages such as pyopenssl. Ongoing tasks *************** *** 165,169 **** These are basically three friendly competing proposals. Jeremy has made a little progress with a new compiler, but it's going ! slow and the compiler is only the first step. Maybe we'll be able to refactor the compiler in this release. I'm tempted to say we won't hold our breath. --- 171,175 ---- These are basically three friendly competing proposals. Jeremy has made a little progress with a new compiler, but it's going ! slowly and the compiler is only the first step. Maybe we'll be able to refactor the compiler in this release. I'm tempted to say we won't hold our breath. From fdrake at users.sourceforge.net Fri Jan 16 11:07:07 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Jan 16 11:07:10 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libfcntl.tex,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv3373 Modified Files: libfcntl.tex Log Message: minor markup improvements Index: libfcntl.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfcntl.tex,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** libfcntl.tex 7 Dec 2003 13:00:25 -0000 1.32 --- libfcntl.tex 16 Jan 2004 16:07:04 -0000 1.33 *************** *** 34,38 **** C \cfunction{fcntl()} call. When the argument is a string it represents a binary structure, e.g.\ created by ! \function{struct.pack()}. The binary data is copied to a buffer whose address is passed to the C \cfunction{fcntl()} call. The return value after a successful call is the contents of the buffer, --- 34,38 ---- C \cfunction{fcntl()} call. When the argument is a string it represents a binary structure, e.g.\ created by ! \function{\refmodule{struct}.pack()}. The binary data is copied to a buffer whose address is passed to the C \cfunction{fcntl()} call. The return value after a successful call is the contents of the buffer, *************** *** 73,80 **** to the underlying \function{ioctl()} system call, the latter's return code is passed back to the calling Python, and the buffer's ! new contents reflect the action of the \function{ioctl}. This is a slight simplification, because if the supplied buffer is less than 1024 bytes long it is first copied into a static buffer 1024 bytes ! long which is then passed to \function{ioctl} and copied back into the supplied buffer. --- 73,80 ---- to the underlying \function{ioctl()} system call, the latter's return code is passed back to the calling Python, and the buffer's ! new contents reflect the action of the \function{ioctl()}. This is a slight simplification, because if the supplied buffer is less than 1024 bytes long it is first copied into a static buffer 1024 bytes ! long which is then passed to \function{ioctl()} and copied back into the supplied buffer. *************** *** 168,174 **** \begin{seealso} ! \seemodule{os}{The \function{os.open} function supports locking flags ! and is available on a wider variety of platforms than ! the \function{fcntl.lockf} and \function{fcntl.flock} functions, providing a more platform-independent file locking facility.} --- 168,174 ---- \begin{seealso} ! \seemodule{os}{The \function{os.open()} function supports locking flags ! and is available on a wider variety of platforms than ! the \function{lockf()} and \function{flock()} functions, providing a more platform-independent file locking facility.} From fdrake at users.sourceforge.net Fri Jan 16 12:30:18 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Jan 16 12:30:21 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libhotshot.tex,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv22281 Modified Files: libhotshot.tex Log Message: - add warning that hotshot doesn't work well with threads - fix some markup Index: libhotshot.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libhotshot.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** libhotshot.tex 9 Apr 2003 04:06:37 -0000 1.4 --- libhotshot.tex 16 Jan 2004 17:30:16 -0000 1.5 *************** *** 15,21 **** than the existing \refmodule{profile} module. ! \begin{classdesc}{Profile}{logfile\optional{, ! lineevents\code{=0}\optional{, ! linetimings\code{=1}}}} The profiler object. The argument \var{logfile} is the name of a log file to use for logged profile data. The argument \var{lineevents} --- 15,27 ---- than the existing \refmodule{profile} module. ! \begin{notice}[warning] ! The \module{hotshot} profiler does not yet work well with threads. ! It is useful to use an unthreaded script to run the profiler over ! the code you're interested in measuring if at all possible. ! \end{notice} ! ! ! \begin{classdesc}{Profile}{logfile\optional{, lineevents\optional{, ! linetimings}}} The profiler object. The argument \var{logfile} is the name of a log file to use for logged profile data. The argument \var{lineevents} From montanaro at users.sourceforge.net Fri Jan 16 19:16:14 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Jan 16 19:16:19 2004 Subject: [Python-checkins] python/dist/src/RISCOS pyconfig.h,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/RISCOS In directory sc8-pr-cvs1:/tmp/cvs-serv15435/RISCOS Modified Files: pyconfig.h Log Message: Remove support for minix. Remove unused and unnecessary checks for sizeof(char). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/RISCOS/pyconfig.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pyconfig.h 10 May 2003 07:36:56 -0000 1.7 --- pyconfig.h 17 Jan 2004 00:16:12 -0000 1.8 *************** *** 26,32 **** #undef HAVE_TZNAME - /* Define if on MINIX. */ - #undef _MINIX - /* Define to `int' if doesn't define. */ #undef mode_t --- 26,29 ---- From montanaro at users.sourceforge.net Fri Jan 16 19:16:14 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Jan 16 19:16:21 2004 Subject: [Python-checkins] python/dist/src/PC pyconfig.h,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv15435/PC Modified Files: pyconfig.h Log Message: Remove support for minix. Remove unused and unnecessary checks for sizeof(char). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/pyconfig.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** pyconfig.h 20 Oct 2003 14:01:55 -0000 1.21 --- pyconfig.h 17 Jan 2004 00:16:12 -0000 1.22 *************** *** 296,302 **** #define HAVE_TZNAME - /* Define if on MINIX. */ - /* #undef _MINIX */ - /* Define to `int' if doesn't define. */ /* #undef mode_t */ --- 296,299 ---- From montanaro at users.sourceforge.net Fri Jan 16 19:16:14 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Jan 16 19:16:24 2004 Subject: [Python-checkins] python/dist/src configure, 1.432, 1.433 configure.in, 1.442, 1.443 pyconfig.h.in, 1.87, 1.88 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv15435 Modified Files: configure configure.in pyconfig.h.in Log Message: Remove support for minix. Remove unused and unnecessary checks for sizeof(char). Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.432 retrieving revision 1.433 diff -C2 -d -r1.432 -r1.433 *** configure 8 Dec 2003 01:10:12 -0000 1.432 --- configure 17 Jan 2004 00:16:09 -0000 1.433 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.441 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.442 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 3008,3388 **** - echo "$as_me:$LINENO: checking for ANSI C header files" >&5 - echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 - if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - #include - #include - #include - - int - main () - { - - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_header_stdc=yes - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no - fi - rm -f conftest.$ac_objext conftest.$ac_ext - - if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - - _ACEOF - if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : - else - ac_cv_header_stdc=no - fi - rm -f conftest* - - fi - - if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - - _ACEOF - if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : - else - ac_cv_header_stdc=no - fi - rm -f conftest* - - fi - - if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - #if ((' ' & 0x0FF) == 0x020) - # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') - # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) - #else - # define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) - # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) - #endif - - #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) - int - main () - { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); - } - _ACEOF - rm -f conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : - else - echo "$as_me: program exited with status $ac_status" >&5 - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ( exit $ac_status ) - ac_cv_header_stdc=no - fi - rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext - fi - fi - fi - echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 - echo "${ECHO_T}$ac_cv_header_stdc" >&6 - if test $ac_cv_header_stdc = yes; then - - cat >>confdefs.h <<\_ACEOF - #define STDC_HEADERS 1 - _ACEOF - - fi - - # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - - for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h - do - as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` - echo "$as_me:$LINENO: checking for $ac_header" >&5 - echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 - if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - - #include <$ac_header> - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" - fi - rm -f conftest.$ac_objext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 - echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF - #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF - - fi - - done - - - if test "${ac_cv_header_minix_config_h+set}" = set; then - echo "$as_me:$LINENO: checking for minix/config.h" >&5 - echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 - if test "${ac_cv_header_minix_config_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - fi - echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 - echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 - else - # Is the header compilable? - echo "$as_me:$LINENO: checking minix/config.h usability" >&5 - echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - #include - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no - fi - rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 - echo "${ECHO_T}$ac_header_compiler" >&6 - - # Is the header present? - echo "$as_me:$LINENO: checking minix/config.h presence" >&5 - echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi - else - ac_cpp_err=yes - fi - if test -z "$ac_cpp_err"; then - ac_header_preproc=yes - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no - fi - rm -f conftest.err conftest.$ac_ext - echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 - echo "${ECHO_T}$ac_header_preproc" >&6 - - # So? What about this header? - case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 - echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 - echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX - ## ------------------------------------ ## - ## Report this to bug-autoconf@gnu.org. ## - ## ------------------------------------ ## - _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 - echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 - echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 - echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX - ## ------------------------------------ ## - ## Report this to bug-autoconf@gnu.org. ## - ## ------------------------------------ ## - _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - esac - echo "$as_me:$LINENO: checking for minix/config.h" >&5 - echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6 - if test "${ac_cv_header_minix_config_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_cv_header_minix_config_h=$ac_header_preproc - fi - echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 - echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6 - - fi - if test $ac_cv_header_minix_config_h = yes; then - MINIX=yes - else - MINIX= - fi - - - if test "$MINIX" = yes; then - - cat >>confdefs.h <<\_ACEOF - #define _POSIX_SOURCE 1 - _ACEOF - - - cat >>confdefs.h <<\_ACEOF - #define _POSIX_1_SOURCE 2 - _ACEOF - - - cat >>confdefs.h <<\_ACEOF - #define _MINIX 1 - _ACEOF - - fi - # Check for unsupported systems --- 3008,3011 ---- *************** *** 3394,3403 **** esac - if test "$MINIX" = yes; then - echo This system \(MINIX\) is no longer supported. - echo Read README for details. - exit 1 - fi - echo "$as_me:$LINENO: checking for --with-suffix" >&5 --- 3017,3020 ---- *************** *** 4641,4644 **** --- 4258,4324 ---- fi + # On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + + for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h + do + as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` + echo "$as_me:$LINENO: checking for $ac_header" >&5 + echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 + if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + $ac_includes_default + + #include <$ac_header> + _ACEOF + rm -f conftest.$ac_objext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" + fi + rm -f conftest.$ac_objext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 + echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF + #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 + _ACEOF + + fi + + done + + *************** *** 5976,5979 **** --- 5656,5660 ---- # Sizes of various common basic types + # ANSI C requires sizeof(char) == 1, so no need to check it echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6 *************** *** 7059,7423 **** - echo "$as_me:$LINENO: checking for char" >&5 - echo $ECHO_N "checking for char... $ECHO_C" >&6 - if test "${ac_cv_type_char+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - int - main () - { - if ((char *) 0) - return 0; - if (sizeof (char)) - return 0; - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_type_char=yes - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_char=no - fi - rm -f conftest.$ac_objext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: $ac_cv_type_char" >&5 - echo "${ECHO_T}$ac_cv_type_char" >&6 - - echo "$as_me:$LINENO: checking size of char" >&5 - echo $ECHO_N "checking size of char... $ECHO_C" >&6 - if test "${ac_cv_sizeof_char+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - if test "$ac_cv_type_char" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - int - main () - { - static int test_array [1 - 2 * !(((long) (sizeof (char))) >= 0)]; - test_array [0] = 0 - - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - int - main () - { - static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; - test_array [0] = 0 - - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid; break - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` - fi - rm -f conftest.$ac_objext conftest.$ac_ext - done - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - int - main () - { - static int test_array [1 - 2 * !(((long) (sizeof (char))) < 0)]; - test_array [0] = 0 - - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - int - main () - { - static int test_array [1 - 2 * !(((long) (sizeof (char))) >= $ac_mid)]; - test_array [0] = 0 - - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_lo=$ac_mid; break - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` - fi - rm -f conftest.$ac_objext conftest.$ac_ext - done - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= - fi - rm -f conftest.$ac_objext conftest.$ac_ext - fi - rm -f conftest.$ac_objext conftest.$ac_ext - # Binary search between lo and hi bounds. - while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - int - main () - { - static int test_array [1 - 2 * !(((long) (sizeof (char))) <= $ac_mid)]; - test_array [0] = 0 - - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_hi=$ac_mid - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` - fi - rm -f conftest.$ac_objext conftest.$ac_ext - done - case $ac_lo in - ?*) ac_cv_sizeof_char=$ac_lo;; - '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 - See \`config.log' for more details." >&5 - echo "$as_me: error: cannot compute sizeof (char), 77 - See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; - esac - else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling - See \`config.log' for more details." >&5 - echo "$as_me: error: cannot run test program while cross compiling - See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - $ac_includes_default - long longval () { return (long) (sizeof (char)); } - unsigned long ulongval () { return (long) (sizeof (char)); } - #include - #include - int - main () - { - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - exit (1); - if (((long) (sizeof (char))) < 0) - { - long i = longval (); - if (i != ((long) (sizeof (char)))) - exit (1); - fprintf (f, "%ld\n", i); - } - else - { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (char)))) - exit (1); - fprintf (f, "%lu\n", i); - } - exit (ferror (f) || fclose (f) != 0); - - ; - return 0; - } - _ACEOF - rm -f conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_char=`cat conftest.val` - else - echo "$as_me: program exited with status $ac_status" >&5 - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ( exit $ac_status ) - { { echo "$as_me:$LINENO: error: cannot compute sizeof (char), 77 - See \`config.log' for more details." >&5 - echo "$as_me: error: cannot compute sizeof (char), 77 - See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext - fi - fi - rm -f conftest.val - else - ac_cv_sizeof_char=0 - fi - fi - echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5 - echo "${ECHO_T}$ac_cv_sizeof_char" >&6 - cat >>confdefs.h <<_ACEOF - #define SIZEOF_CHAR $ac_cv_sizeof_char - _ACEOF - - echo "$as_me:$LINENO: checking for short" >&5 echo $ECHO_N "checking for short... $ECHO_C" >&6 --- 6740,6743 ---- Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.442 retrieving revision 1.443 diff -C2 -d -r1.442 -r1.443 *** configure.in 8 Dec 2003 01:10:12 -0000 1.442 --- configure.in 17 Jan 2004 00:16:11 -0000 1.443 *************** *** 330,334 **** # checks for UNIX variants that set C preprocessor variables AC_AIX - AC_MINIX # Check for unsupported systems --- 330,333 ---- *************** *** 340,349 **** esac - if test "$MINIX" = yes; then - echo This system \(MINIX\) is no longer supported. - echo Read README for details. - exit 1 - fi - AC_EXEEXT AC_MSG_CHECKING(for --with-suffix) --- 339,342 ---- *************** *** 1015,1022 **** # Sizes of various common basic types AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(void *, 4) - AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(float, 4) --- 1008,1015 ---- # Sizes of various common basic types + # ANSI C requires sizeof(char) == 1, so no need to check it AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(void *, 4) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(float, 4) Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** pyconfig.h.in 10 Nov 2003 06:35:36 -0000 1.87 --- pyconfig.h.in 17 Jan 2004 00:16:12 -0000 1.88 *************** *** 705,711 **** #undef SIGNED_RIGHT_SHIFT_ZERO_FILLS - /* The size of a `char', as computed by sizeof. */ - #undef SIZEOF_CHAR - /* The size of a `double', as computed by sizeof. */ #undef SIZEOF_DOUBLE --- 705,708 ---- *************** *** 834,840 **** #undef _LARGEFILE_SOURCE - /* Define to 1 if on MINIX. */ - #undef _MINIX - /* Define on NetBSD to activate all library features */ #undef _NETBSD_SOURCE --- 831,834 ---- From montanaro at users.sourceforge.net Fri Jan 16 19:29:34 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Jan 16 19:29:37 2004 Subject: [Python-checkins] python/dist/src/Python thread.c, 2.48, 2.49 thread_pthread.h, 2.48, 2.49 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv18168/Python Modified Files: thread.c thread_pthread.h Log Message: remove DGUX support. Index: thread.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread.c,v retrieving revision 2.48 retrieving revision 2.49 diff -C2 -d -r2.48 -r2.49 *** thread.c 19 Nov 2003 22:52:22 -0000 2.48 --- thread.c 17 Jan 2004 00:29:32 -0000 2.49 *************** *** 20,27 **** #endif - #ifdef __DGUX - #define _USING_POSIX4A_DRAFT6 - #endif - #ifdef __sgi #ifndef HAVE_PTHREAD_H /* XXX Need to check in configure.in */ --- 20,23 ---- Index: thread_pthread.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_pthread.h,v retrieving revision 2.48 retrieving revision 2.49 diff -C2 -d -r2.48 -r2.49 *** thread_pthread.h 19 Nov 2003 22:52:22 -0000 2.48 --- thread_pthread.h 17 Jan 2004 00:29:32 -0000 2.49 *************** *** 56,63 **** # endif - #elif defined(__DGUX) - # define PY_PTHREAD_D6 - # error Systems with PY_PTHREAD_D6 are unsupported. See README. - #elif defined(__hpux) && defined(_DECTHREADS_) # define PY_PTHREAD_D4 --- 56,59 ---- *************** *** 81,85 **** # define pthread_condattr_default pthread_condattr_default #endif ! #elif defined(PY_PTHREAD_STD) || defined(PY_PTHREAD_D6) #if !defined(pthread_attr_default) # define pthread_attr_default ((pthread_attr_t *)NULL) --- 77,81 ---- # define pthread_condattr_default pthread_condattr_default #endif ! #elif defined(PY_PTHREAD_STD) #if !defined(pthread_attr_default) # define pthread_attr_default ((pthread_attr_t *)NULL) *************** *** 212,219 **** (pthread_startroutine_t)func, (pthread_addr_t)arg - #elif defined(PY_PTHREAD_D6) - pthread_attr_default, - (void* (*)(void *))func, - arg #elif defined(PY_PTHREAD_D7) pthread_attr_default, --- 208,211 ---- *************** *** 240,244 **** return -1; ! #if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D6) || defined(PY_PTHREAD_D7) pthread_detach(&th); #elif defined(PY_PTHREAD_STD) --- 232,236 ---- return -1; ! #if defined(PY_PTHREAD_D4) || defined(PY_PTHREAD_D7) pthread_detach(&th); #elif defined(PY_PTHREAD_STD) From montanaro at users.sourceforge.net Fri Jan 16 19:29:35 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Jan 16 19:29:39 2004 Subject: [Python-checkins] python/dist/src configure, 1.433, 1.434 configure.in, 1.443, 1.444 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv18168 Modified Files: configure configure.in Log Message: remove DGUX support. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.433 retrieving revision 1.434 diff -C2 -d -r1.433 -r1.434 *** configure 17 Jan 2004 00:16:09 -0000 1.433 --- configure 17 Jan 2004 00:29:21 -0000 1.434 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.442 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.443 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 3011,3015 **** # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! SunOS/4*|DYNIX/*|dgux*/*|IRIX/4*|Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. --- 3011,3015 ---- # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! SunOS/4*|DYNIX/*|IRIX/4*|Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. *************** *** 3151,3156 **** fi LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";; - dgux*) - LINKCC="LD_RUN_PATH=$libdir $LINKCC";; Monterey64*) LINKCC="$LINKCC -L/usr/lib/ia64l64";; --- 3151,3154 ---- *************** *** 3242,3252 **** ;; esac - # DG/UX requires some fancy ld contortions to produce a .so from an .a - case $MACHDEP in - dguxR4) - LDLIBRARY='libpython$(VERSION).so' - BASECFLAGS="$BASECFLAGS -pic" - ;; - esac else # shared is disabled case $ac_sys_system in --- 3240,3243 ---- *************** *** 9423,9427 **** fi ;; Linux*|GNU*) LDSHARED='$(CC) -shared';; - dgux*) LDSHARED="ld -G";; BSD/OS*/4*) LDSHARED="gcc -shared";; OpenBSD*|FreeBSD*) --- 9414,9417 ---- Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.443 retrieving revision 1.444 diff -C2 -d -r1.443 -r1.444 *** configure.in 17 Jan 2004 00:16:11 -0000 1.443 --- configure.in 17 Jan 2004 00:29:32 -0000 1.444 *************** *** 333,337 **** # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! SunOS/4*|DYNIX/*|dgux*/*|IRIX/4*|Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. --- 333,337 ---- # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! SunOS/4*|DYNIX/*|IRIX/4*|Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. *************** *** 458,463 **** fi LINKCC="\$(srcdir)/Modules/makexp_aix Modules/python.exp $exp_extra \$(LIBRARY); $LINKCC";; - dgux*) - LINKCC="LD_RUN_PATH=$libdir $LINKCC";; Monterey64*) LINKCC="$LINKCC -L/usr/lib/ia64l64";; --- 458,461 ---- *************** *** 538,548 **** ;; esac - # DG/UX requires some fancy ld contortions to produce a .so from an .a - case $MACHDEP in - dguxR4) - LDLIBRARY='libpython$(VERSION).so' - BASECFLAGS="$BASECFLAGS -pic" - ;; - esac else # shared is disabled case $ac_sys_system in --- 536,539 ---- *************** *** 1279,1283 **** fi ;; Linux*|GNU*) LDSHARED='$(CC) -shared';; - dgux*) LDSHARED="ld -G";; BSD/OS*/4*) LDSHARED="gcc -shared";; OpenBSD*|FreeBSD*) --- 1270,1273 ---- From montanaro at users.sourceforge.net Fri Jan 16 22:04:49 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Jan 16 22:04:53 2004 Subject: [Python-checkins] python/dist/src configure, 1.434, 1.435 configure.in, 1.444, 1.445 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv12993 Modified Files: configure configure.in Log Message: Remove support for systems defining __d6_pthread_create. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.434 retrieving revision 1.435 diff -C2 -d -r1.434 -r1.435 *** configure 17 Jan 2004 00:29:21 -0000 1.434 --- configure 17 Jan 2004 03:04:45 -0000 1.435 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.443 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.444 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 11165,11235 **** else - echo "$as_me:$LINENO: checking for __d6_pthread_create in -lthread" >&5 - echo $ECHO_N "checking for __d6_pthread_create in -lthread... $ECHO_C" >&6 - if test "${ac_cv_lib_thread___d6_pthread_create+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lthread $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - - /* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus - extern "C" - #endif - /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char __d6_pthread_create (); - int - main () - { - __d6_pthread_create (); - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_thread___d6_pthread_create=yes - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_thread___d6_pthread_create=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_thread___d6_pthread_create" >&5 - echo "${ECHO_T}$ac_cv_lib_thread___d6_pthread_create" >&6 - if test $ac_cv_lib_thread___d6_pthread_create = yes; then - cat >>confdefs.h <<\_ACEOF - #define WITH_THREAD 1 - _ACEOF - - echo Systems with __d6_pthread_create are not supported anymore. - echo See README - exit 1 - posix_threads=yes - LIBS="$LIBS -lthread" - THREADOBJ="Python/thread.o" - else - echo "$as_me:$LINENO: checking for __pthread_create_system in -lpthread" >&5 echo $ECHO_N "checking for __pthread_create_system in -lpthread... $ECHO_C" >&6 --- 11165,11168 ---- *************** *** 11372,11377 **** fi - fi - fi --- 11305,11308 ---- Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.444 retrieving revision 1.445 diff -C2 -d -r1.444 -r1.445 *** configure.in 17 Jan 2004 00:29:32 -0000 1.444 --- configure.in 17 Jan 2004 03:04:46 -0000 1.445 *************** *** 1643,1653 **** LIBS="$LIBS -lc_r" THREADOBJ="Python/thread.o"], [ - AC_CHECK_LIB(thread, __d6_pthread_create, [AC_DEFINE(WITH_THREAD) - echo Systems with __d6_pthread_create are not supported anymore. - echo See README - exit 1 - posix_threads=yes - LIBS="$LIBS -lthread" - THREADOBJ="Python/thread.o"], [ AC_CHECK_LIB(pthread, __pthread_create_system, [AC_DEFINE(WITH_THREAD) posix_threads=yes --- 1643,1646 ---- *************** *** 1659,1663 **** THREADOBJ="Python/thread.o"],[ USE_THREAD_MODULE="#"]) ! ])])])])])])])])])])]) AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD) --- 1652,1656 ---- THREADOBJ="Python/thread.o"],[ USE_THREAD_MODULE="#"]) ! ])])])])])])])])])]) AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD) From montanaro at users.sourceforge.net Fri Jan 16 23:04:15 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Jan 16 23:04:18 2004 Subject: [Python-checkins] python/dist/src/RISCOS pyconfig.h,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/RISCOS In directory sc8-pr-cvs1:/tmp/cvs-serv21141/RISCOS Modified Files: pyconfig.h Log Message: Remove support for DYNIX, IRIX 4, --with-sgi-dl, --with-dl-dld Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/RISCOS/pyconfig.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pyconfig.h 17 Jan 2004 00:16:12 -0000 1.8 --- pyconfig.h 17 Jan 2004 04:04:13 -0000 1.9 *************** *** 231,245 **** #undef WANT_WCTYPE_FUNCTIONS - /* Define if you want to emulate SGI (IRIX 4) dynamic linking. - This is rumoured to work on VAX (Ultrix), Sun3 (SunOS 3.4), - Sequent Symmetry (Dynix), and Atari ST. - This requires the "dl-dld" library, - ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z, - as well as the "GNU dld" library, - ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z. - Don't bother on SunOS 4 or 5, they already have dynamic linking using - shared libraries */ - #undef WITH_DL_DLD - /* Define if you want to read files with foreign newlines. */ #define WITH_UNIVERSAL_NEWLINES 1 --- 231,234 ---- *************** *** 263,273 **** #undef USE_TOOLBOX_OBJECT_GLUE - /* Define if you want to use SGI (IRIX 4) dynamic linking. - This requires the "dl" library by Jack Jansen, - ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z. - Don't bother on IRIX 5, it already has dynamic linking using SunOS - style shared libraries */ - #undef WITH_SGI_DL - /* Define if you want to compile in rudimentary thread support */ #undef WITH_THREAD --- 252,255 ---- From montanaro at users.sourceforge.net Fri Jan 16 23:04:15 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Jan 16 23:04:20 2004 Subject: [Python-checkins] python/dist/src/PC pyconfig.h,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv21141/PC Modified Files: pyconfig.h Log Message: Remove support for DYNIX, IRIX 4, --with-sgi-dl, --with-dl-dld Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/pyconfig.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** pyconfig.h 17 Jan 2004 00:16:12 -0000 1.22 --- pyconfig.h 17 Jan 2004 04:04:13 -0000 1.23 *************** *** 370,391 **** /* #undef SYS_SELECT_WITH_SYS_TIME */ - /* Define if you want to use SGI (IRIX 4) dynamic linking. - This requires the "dl" library by Jack Jansen, - ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z. - Don't bother on IRIX 5, it already has dynamic linking using SunOS - style shared libraries */ - /* #undef WITH_SGI_DL */ - - /* Define if you want to emulate SGI (IRIX 4) dynamic linking. - This is rumoured to work on VAX (Ultrix), Sun3 (SunOS 3.4), - Sequent Symmetry (Dynix), and Atari ST. - This requires the "dl-dld" library, - ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z, - as well as the "GNU dld" library, - ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z. - Don't bother on SunOS 4 or 5, they already have dynamic linking using - shared libraries */ - /* #undef WITH_DL_DLD */ - /* Define if you want documentation strings in extension modules */ #define WITH_DOC_STRINGS 1 --- 370,373 ---- From montanaro at users.sourceforge.net Fri Jan 16 23:04:15 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Jan 16 23:04:22 2004 Subject: [Python-checkins] python/dist/src configure, 1.435, 1.436 configure.in, 1.445, 1.446 pyconfig.h.in, 1.88, 1.89 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv21141 Modified Files: configure configure.in pyconfig.h.in Log Message: Remove support for DYNIX, IRIX 4, --with-sgi-dl, --with-dl-dld Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.435 retrieving revision 1.436 diff -C2 -d -r1.435 -r1.436 *** configure 17 Jan 2004 03:04:45 -0000 1.435 --- configure 17 Jan 2004 04:04:09 -0000 1.436 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.444 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.445 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 872,877 **** --with(out)-pymalloc disable/enable specialized mallocs --with-wctype-functions use wctype.h functions - --with-sgi-dl=DIRECTORY IRIX 4 dynamic linking - --with-dl-dld=DL_DIR GNU dynamic linking --with-fpectl enable SIGFPE catching --with-libm=STRING math library --- 872,875 ---- *************** *** 3011,3015 **** # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! SunOS/4*|DYNIX/*|IRIX/4*|Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. --- 3009,3013 ---- # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! SunOS/4*|Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. *************** *** 9391,9395 **** hp*|HP*) LDSHARED="ld -b";; OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; - DYNIX/ptx*) LDSHARED="ld -G";; Darwin/1.3*) LDSHARED='$(CC) $(LDFLAGS) -bundle' --- 9389,9392 ---- *************** *** 9924,9932 **** # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. - # However on SGI IRIX 4, these exist but are broken. # BeOS' sockets are stashed in libnet. - case "$ac_sys_system" in - IRIX*) ;; - *) echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 echo $ECHO_N "checking for t_open in -lnsl... $ECHO_C" >&6 --- 9921,9925 ---- *************** *** 10045,10050 **** fi # SVR4 sockets ! ;; ! esac case "$ac_sys_system" in BeOS*) --- 10038,10042 ---- fi # SVR4 sockets ! case "$ac_sys_system" in BeOS*) *************** *** 12072,12138 **** DLINCLDIR=. - echo "$as_me:$LINENO: checking for --with-sgi-dl" >&5 - echo $ECHO_N "checking for --with-sgi-dl... $ECHO_C" >&6 - - # Check whether --with-sgi-dl or --without-sgi-dl was given. - if test "${with_sgi_dl+set}" = set; then - withval="$with_sgi_dl" - - echo "$as_me:$LINENO: result: $withval" >&5 - echo "${ECHO_T}$withval" >&6 - echo --with-sgi-dl is unsupported, see README - exit 1 - - cat >>confdefs.h <<\_ACEOF - #define WITH_SGI_DL 1 - _ACEOF - - DYNLOADFILE="dynload_dl.o" - dldir=$withval - if test ! -z "$dldir" -a -d "$dldir" - then LDFLAGS="$LDFLAGS -L$dldir" - else { { echo "$as_me:$LINENO: error: proper usage is --with-sgi-dl=DIRECTORY" >&5 - echo "$as_me: error: proper usage is --with-sgi-dl=DIRECTORY" >&2;} - { (exit 1); exit 1; }; } - fi - DLINCLDIR=${dldir} - LIBS="$LIBS -ldl -lmld" - else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi; - - echo "$as_me:$LINENO: checking for --with-dl-dld" >&5 - echo $ECHO_N "checking for --with-dl-dld... $ECHO_C" >&6 - - # Check whether --with-dl-dld or --without-dl-dld was given. - if test "${with_dl_dld+set}" = set; then - withval="$with_dl_dld" - - echo "$as_me:$LINENO: result: $withval" >&5 - echo "${ECHO_T}$withval" >&6 - echo --with-dl-dld is unsupported, see README - exit 1 - - cat >>confdefs.h <<\_ACEOF - #define WITH_DL_DLD 1 - _ACEOF - - DYNLOADFILE="dynload_dl.o" - dldir=`echo "$withval" | sed 's/,.*//'` - dlddir=`echo "$withval" | sed 's/.*,//'` - if test ! -z "$dldir" -a -d "$dldir" -a ! -z "$dlddir" -a -d "$dlddir" - then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir" - else { { echo "$as_me:$LINENO: error: proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY" >&5 - echo "$as_me: error: proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY" >&2;} - { (exit 1); exit 1; }; } - fi - DLINCLDIR=${dldir} - LIBS="$LIBS -ldl -ldld" - else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi; - # the dlopen() function means we might want to use dynload_shlib.o. some # platforms, such as AIX, have dlopen(), but don't want to use it. --- 12064,12067 ---- Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.445 retrieving revision 1.446 diff -C2 -d -r1.445 -r1.446 *** configure.in 17 Jan 2004 03:04:46 -0000 1.445 --- configure.in 17 Jan 2004 04:04:12 -0000 1.446 *************** *** 333,337 **** # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! SunOS/4*|DYNIX/*|IRIX/4*|Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. --- 333,337 ---- # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! SunOS/4*|Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. *************** *** 1247,1251 **** hp*|HP*) LDSHARED="ld -b";; OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; - DYNIX/ptx*) LDSHARED="ld -G";; Darwin/1.3*) LDSHARED='$(CC) $(LDFLAGS) -bundle' --- 1247,1250 ---- *************** *** 1444,1456 **** # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. - # However on SGI IRIX 4, these exist but are broken. # BeOS' sockets are stashed in libnet. - case "$ac_sys_system" in - IRIX*) ;; - *) AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets ! ;; ! esac case "$ac_sys_system" in BeOS*) --- 1443,1450 ---- # Most SVR4 platforms (e.g. Solaris) need -lsocket and -lnsl. # BeOS' sockets are stashed in libnet. AC_CHECK_LIB(nsl, t_open, [LIBS="-lnsl $LIBS"]) # SVR4 AC_CHECK_LIB(socket, socket, [LIBS="-lsocket $LIBS"], [], $LIBS) # SVR4 sockets ! case "$ac_sys_system" in BeOS*) *************** *** 1959,2011 **** DLINCLDIR=. - AC_MSG_CHECKING(for --with-sgi-dl) - AC_ARG_WITH(sgi-dl, - AC_HELP_STRING(--with-sgi-dl=DIRECTORY, IRIX 4 dynamic linking), - [ - AC_MSG_RESULT($withval) - echo --with-sgi-dl is unsupported, see README - exit 1 - AC_DEFINE(WITH_SGI_DL, 1, - [Define if you want to use SGI (IRIX 4) dynamic linking. - This requires the "dl" library by Jack Jansen, - ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z. - Do not bother on IRIX 5, it already has dynamic linking using SunOS - style shared libraries]) - DYNLOADFILE="dynload_dl.o" - dldir=$withval - if test ! -z "$dldir" -a -d "$dldir" - then LDFLAGS="$LDFLAGS -L$dldir" - else AC_MSG_ERROR([proper usage is --with-sgi-dl=DIRECTORY]) - fi - DLINCLDIR=${dldir} - LIBS="$LIBS -ldl -lmld"], AC_MSG_RESULT(no)) - - AC_MSG_CHECKING(for --with-dl-dld) - AC_ARG_WITH(dl-dld, - AC_HELP_STRING(--with-dl-dld=DL_DIR, GNU dynamic linking), - [ - AC_MSG_RESULT($withval) - echo --with-dl-dld is unsupported, see README - exit 1 - AC_DEFINE(WITH_DL_DLD, 1, - [Define if you want to emulate SGI (IRIX 4) dynamic linking. - This is rumoured to work on VAX (Ultrix), Sun3 (SunOS 3.4), - Sequent Symmetry (Dynix), and Atari ST. - This requires the 'dl-dld' library, - ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z, - as well as the 'GNU dld' library, - ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z. - Do not bother on SunOS 4 or 5, they already have dynamic linking using - shared libraries.]) - DYNLOADFILE="dynload_dl.o" - dldir=`echo "$withval" | sed 's/,.*//'` - dlddir=`echo "$withval" | sed 's/.*,//'` - if test ! -z "$dldir" -a -d "$dldir" -a ! -z "$dlddir" -a -d "$dlddir" - then LDFLAGS="$LDFLAGS -L$dldir -L$dlddir" - else AC_MSG_ERROR([proper usage is --with-dl-dld=DL_DIRECTORY,DLD_DIRECTORY]) - fi - DLINCLDIR=${dldir} - LIBS="$LIBS -ldl -ldld"], AC_MSG_RESULT(no)) - # the dlopen() function means we might want to use dynload_shlib.o. some # platforms, such as AIX, have dlopen(), but don't want to use it. --- 1953,1956 ---- Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** pyconfig.h.in 17 Jan 2004 00:16:12 -0000 1.88 --- pyconfig.h.in 17 Jan 2004 04:04:12 -0000 1.89 *************** *** 773,784 **** #undef WINDOW_HAS_FLAGS - /* Define if you want to emulate SGI (IRIX 4) dynamic linking. This is - rumoured to work on VAX (Ultrix), Sun3 (SunOS 3.4), Sequent Symmetry - (Dynix), and Atari ST. This requires the 'dl-dld' library, - ftp://ftp.cwi.nl/pub/dynload/dl-dld-1.1.tar.Z, as well as the 'GNU dld' - library, ftp://ftp.cwi.nl/pub/dynload/dld-3.2.3.tar.Z. Do not bother on - SunOS 4 or 5, they already have dynamic linking using shared libraries. */ - #undef WITH_DL_DLD - /* Define if you want documentation strings in extension modules */ #undef WITH_DOC_STRINGS --- 773,776 ---- *************** *** 799,808 **** #undef WITH_PYMALLOC - /* Define if you want to use SGI (IRIX 4) dynamic linking. This requires the - "dl" library by Jack Jansen, ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z. Do - not bother on IRIX 5, it already has dynamic linking using SunOS style - shared libraries */ - #undef WITH_SGI_DL - /* Define if you want to compile in rudimentary thread support */ #undef WITH_THREAD --- 791,794 ---- From montanaro at users.sourceforge.net Fri Jan 16 23:04:15 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Fri Jan 16 23:04:25 2004 Subject: [Python-checkins] python/dist/src/Python thread_sgi.h,2.17,2.18 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1:/tmp/cvs-serv21141/Python Modified Files: thread_sgi.h Log Message: Remove support for DYNIX, IRIX 4, --with-sgi-dl, --with-dl-dld Index: thread_sgi.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_sgi.h,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -d -r2.17 -r2.18 *** thread_sgi.h 19 Apr 2003 15:41:53 -0000 2.17 --- thread_sgi.h 17 Jan 2004 04:04:13 -0000 2.18 *************** *** 1,7 **** - #ifdef WITH_SGI_DL - #define USE_DL - #endif - #include #include --- 1,3 ---- From loewis at users.sourceforge.net Sat Jan 17 06:10:36 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Jan 17 06:10:40 2004 Subject: [Python-checkins] python/dist/src/PCbuild zlib.vcproj,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv17488 Modified Files: zlib.vcproj Log Message: Update to 1.2.1 for release build too. Index: zlib.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/zlib.vcproj,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** zlib.vcproj 9 Jan 2004 16:05:07 -0000 1.2 --- zlib.vcproj 17 Jan 2004 11:10:34 -0000 1.3 *************** *** 93,97 **** Optimization="2" InlineFunctionExpansion="1" ! AdditionalIncludeDirectories="..\Include,..\PC,..\..\zlib-1.1.4" PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS" StringPooling="TRUE" --- 93,97 ---- Optimization="2" InlineFunctionExpansion="1" ! AdditionalIncludeDirectories="..\Include,..\PC,..\..\zlib-1.2.1" PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS" StringPooling="TRUE" From loewis at users.sourceforge.net Sat Jan 17 06:20:19 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Jan 17 06:20:22 2004 Subject: [Python-checkins] python/dist/src/PCbuild zlib.vcproj,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv19050 Modified Files: zlib.vcproj Log Message: More updates for zlib 1.2.1 Index: zlib.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/zlib.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** zlib.vcproj 17 Jan 2004 11:10:34 -0000 1.3 --- zlib.vcproj 17 Jan 2004 11:20:17 -0000 1.4 *************** *** 42,46 **** LinkIncremental="1" SuppressStartupBanner="TRUE" ! IgnoreDefaultLibraryNames="libc" GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\./zlib_d.pdb" --- 42,46 ---- LinkIncremental="1" SuppressStartupBanner="TRUE" ! IgnoreDefaultLibraryNames="libc;msvcrt" GenerateDebugInformation="TRUE" ProgramDatabaseFile=".\./zlib_d.pdb" *************** *** 111,115 **** Update of /cvsroot/python/python/dist/src/Modules/cjkcodecs In directory sc8-pr-cvs1:/tmp/cvs-serv6008/cjkcodecs Log Message: Directory /cvsroot/python/python/dist/src/Modules/cjkcodecs added to the repository From montanaro at users.sourceforge.net Sat Jan 17 09:19:45 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Jan 17 09:19:49 2004 Subject: [Python-checkins] python/dist/src pyconfig.h.in, 1.89, 1.90 configure.in, 1.446, 1.447 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv12761 Modified Files: pyconfig.h.in configure.in Log Message: Remove support for SunOS 4. Remove BAD_EXEC_PROTOYPE (leftover from IRIX 4 demolition). Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** pyconfig.h.in 17 Jan 2004 04:04:12 -0000 1.89 --- pyconfig.h.in 17 Jan 2004 14:19:43 -0000 1.90 *************** *** 13,20 **** #undef ATHEOS_THREADS - /* Define if your contains bad prototypes for exec*() (as it does - on SGI IRIX 4.x) */ - #undef BAD_EXEC_PROTOTYPES - /* Define this if you have BeOS threads. */ #undef BEOS_THREADS --- 13,16 ---- Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.446 retrieving revision 1.447 diff -C2 -d -r1.446 -r1.447 *** configure.in 17 Jan 2004 04:04:12 -0000 1.446 --- configure.in 17 Jan 2004 14:19:43 -0000 1.447 *************** *** 333,337 **** # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! SunOS/4*|Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. --- 333,337 ---- # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. *************** *** 1222,1226 **** AC_MSG_RESULT($SO) # LDSHARED is the ld *command* used to create shared library ! # -- "ld" on SunOS 4.x.x, "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) --- 1222,1226 ---- AC_MSG_RESULT($SO) # LDSHARED is the ld *command* used to create shared library ! # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) *************** *** 1239,1243 **** IRIX/5*) LDSHARED="ld -shared";; IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";; - SunOS/4*) LDSHARED="ld";; SunOS/5*) if test "$GCC" = "yes" --- 1239,1242 ---- *************** *** 2427,2442 **** AC_MSG_RESULT($works) - if test "$have_prototypes" = yes; then - bad_prototypes=no - AC_MSG_CHECKING(for bad exec* prototypes) - AC_TRY_COMPILE([#include ], [char **t;execve("@",t,t);], , - AC_DEFINE(BAD_EXEC_PROTOTYPES, 1, - [Define if your contains bad prototypes for exec*() - (as it does on SGI IRIX 4.x)]) - bad_prototypes=yes - ) - AC_MSG_RESULT($bad_prototypes) - fi - # check if sockaddr has sa_len member AC_MSG_CHECKING(if sockaddr has sa_len member) --- 2426,2429 ---- From montanaro at users.sourceforge.net Sat Jan 17 09:19:45 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Jan 17 09:19:52 2004 Subject: [Python-checkins] python/dist/src/Include pyport.h,2.64,2.65 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory sc8-pr-cvs1:/tmp/cvs-serv12761/Include Modified Files: pyport.h Log Message: Remove support for SunOS 4. Remove BAD_EXEC_PROTOYPE (leftover from IRIX 4 demolition). Index: pyport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v retrieving revision 2.64 retrieving revision 2.65 diff -C2 -d -r2.64 -r2.65 *** pyport.h 30 Sep 2003 14:58:59 -0000 2.64 --- pyport.h 17 Jan 2004 14:19:43 -0000 2.65 *************** *** 390,400 **** /* From Modules/posixmodule.c */ extern int fdatasync(int); - /* XXX These are supposedly for SunOS4.1.3 but "shouldn't hurt elsewhere" */ - extern int rename(const char *, const char *); - extern int pclose(FILE *); - extern int lstat(const char *, struct stat *); - extern int symlink(const char *, const char *); - extern int fsync(int fd); - #endif /* 0 */ --- 390,393 ---- From montanaro at users.sourceforge.net Sat Jan 17 09:19:46 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Jan 17 09:19:54 2004 Subject: [Python-checkins] python/dist/src/Misc BeOS-setup.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv12761/Misc Modified Files: BeOS-setup.py Log Message: Remove support for SunOS 4. Remove BAD_EXEC_PROTOYPE (leftover from IRIX 4 demolition). Index: BeOS-setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/BeOS-setup.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BeOS-setup.py 14 Jun 2002 20:41:14 -0000 1.3 --- BeOS-setup.py 17 Jan 2004 14:19:43 -0000 1.4 *************** *** 402,409 **** # Curses support, requring the System V version of curses, often # provided by the ncurses library. - if platform == 'sunos4': - inc_dirs += ['/usr/5include'] - lib_dirs += ['/usr/5lib'] - if (self.compiler.find_library_file(lib_dirs, 'ncurses')): curses_libs = ['ncurses'] --- 402,405 ---- From montanaro at users.sourceforge.net Sat Jan 17 09:19:46 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Jan 17 09:20:00 2004 Subject: [Python-checkins] python/dist/src/Objects floatobject.c, 2.125, 2.126 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv12761/Objects Modified Files: floatobject.c Log Message: Remove support for SunOS 4. Remove BAD_EXEC_PROTOYPE (leftover from IRIX 4 demolition). Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.125 retrieving revision 2.126 diff -C2 -d -r2.125 -r2.126 *** floatobject.c 20 Nov 2003 01:44:58 -0000 2.125 --- floatobject.c 17 Jan 2004 14:19:44 -0000 2.126 *************** *** 14,27 **** #endif - #if defined(sun) && !defined(__SVR4) - /* On SunOS4.1 only libm.a exists. Make sure that references to all - needed math functions exist in the executable, so that dynamic - loading of mathmodule does not fail. */ - double (*_Py_math_funcs_hack[])() = { - acos, asin, atan, atan2, ceil, cos, cosh, exp, fabs, floor, - fmod, log, log10, pow, sin, sinh, sqrt, tan, tanh - }; - #endif - /* Special free list -- see comments for same code in intobject.c. */ #define BLOCK_SIZE 1000 /* 1K less typical malloc overhead */ --- 14,17 ---- From montanaro at users.sourceforge.net Sat Jan 17 09:19:46 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Jan 17 09:20:03 2004 Subject: [Python-checkins] python/dist/src/PC pyconfig.h,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv12761/PC Modified Files: pyconfig.h Log Message: Remove support for SunOS 4. Remove BAD_EXEC_PROTOYPE (leftover from IRIX 4 demolition). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/pyconfig.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** pyconfig.h 17 Jan 2004 04:04:13 -0000 1.23 --- pyconfig.h 17 Jan 2004 14:19:44 -0000 1.24 *************** *** 349,356 **** /* #undef VOID_CLOSEDIR */ - /* Define if your contains bad prototypes for exec*() - (as it does on SGI IRIX 4.x) */ - /* #undef BAD_EXEC_PROTOTYPES */ - /* Define if getpgrp() must be called as getpgrp(0) and (consequently) setpgrp() as setpgrp(0, 0). */ --- 349,352 ---- From montanaro at users.sourceforge.net Sat Jan 17 09:19:46 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Jan 17 09:20:06 2004 Subject: [Python-checkins] python/dist/src/RISCOS pyconfig.h,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/RISCOS In directory sc8-pr-cvs1:/tmp/cvs-serv12761/RISCOS Modified Files: pyconfig.h Log Message: Remove support for SunOS 4. Remove BAD_EXEC_PROTOYPE (leftover from IRIX 4 demolition). Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/RISCOS/pyconfig.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pyconfig.h 17 Jan 2004 04:04:13 -0000 1.9 --- pyconfig.h 17 Jan 2004 14:19:44 -0000 1.10 *************** *** 68,75 **** #undef AIX_GENUINE_CPLUSPLUS - /* Define if your contains bad prototypes for exec*() - (as it does on SGI IRIX 4.x) */ - #undef BAD_EXEC_PROTOTYPES - /* Define if your compiler botches static forward declarations (as it does on SCI ODT 3.0) */ --- 68,71 ---- From montanaro at users.sourceforge.net Sat Jan 17 09:19:46 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Jan 17 09:20:08 2004 Subject: [Python-checkins] python/dist/src/Modules Setup.dist, 1.41, 1.42 mmapmodule.c, 2.46, 2.47 pcre-int.h, 2.4, 2.5 posixmodule.c, 2.311, 2.312 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv12761/Modules Modified Files: Setup.dist mmapmodule.c pcre-int.h posixmodule.c Log Message: Remove support for SunOS 4. Remove BAD_EXEC_PROTOYPE (leftover from IRIX 4 demolition). Index: Setup.dist =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/Setup.dist,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Setup.dist 14 Jun 2003 21:03:05 -0000 1.41 --- Setup.dist 17 Jan 2004 14:19:43 -0000 1.42 *************** *** 362,367 **** # Curses support, requring the System V version of curses, often # provided by the ncurses library. e.g. on Linux, link with -lncurses ! # instead of -lcurses; on SunOS 4.1.3, insert -I/usr/5include ! # -L/usr/5lib before -lcurses). # # First, look at Setup.config; configure may have set this for you. --- 362,366 ---- # Curses support, requring the System V version of curses, often # provided by the ncurses library. e.g. on Linux, link with -lncurses ! # instead of -lcurses). # # First, look at Setup.config; configure may have set this for you. Index: mmapmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v retrieving revision 2.46 retrieving revision 2.47 diff -C2 -d -r2.46 -r2.47 *** mmapmodule.c 15 Jul 2003 12:37:46 -0000 2.46 --- mmapmodule.c 17 Jan 2004 14:19:44 -0000 2.47 *************** *** 40,48 **** #include - #ifndef MS_SYNC - /* This is missing e.g. on SunOS 4.1.4 */ - #define MS_SYNC 0 - #endif - #if defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) static int --- 40,43 ---- Index: pcre-int.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pcre-int.h,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -d -r2.4 -r2.5 *** pcre-int.h 7 May 1998 15:32:38 -0000 2.4 --- pcre-int.h 17 Jan 2004 14:19:44 -0000 2.5 *************** *** 36,47 **** - /* To cope with SunOS4 and other systems that lack memmove() but have bcopy(), - define a macro for memmove() if USE_BCOPY is defined. */ - - #ifdef USE_BCOPY - #undef memmove /* some systems may have a macro */ - #define memmove(a, b, c) bcopy(b, a, c) - #endif - /* Standard C headers plus the external interface definition */ --- 36,39 ---- Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.311 retrieving revision 2.312 diff -C2 -d -r2.311 -r2.312 *** posixmodule.c 16 Jan 2004 13:18:42 -0000 2.311 --- posixmodule.c 17 Jan 2004 14:19:44 -0000 2.312 *************** *** 137,150 **** #ifndef _MSC_VER - #if defined(sun) && !defined(__SVR4) - /* SunOS 4.1.4 doesn't have prototypes for these: */ - extern int rename(const char *, const char *); - extern int pclose(FILE *); - extern int fclose(FILE *); - extern int fsync(int); - extern int lstat(const char *, struct stat *); - extern int symlink(const char *, const char *); - #endif - #if defined(__sgi)&&_COMPILER_VERSION>=700 /* declare ctermid_r if compiling with MIPSPro 7.x in ANSI C mode --- 137,140 ---- *************** *** 2118,2126 **** argvlist[argc] = NULL; - #ifdef BAD_EXEC_PROTOTYPES - execv(path, (const char **) argvlist); - #else /* BAD_EXEC_PROTOTYPES */ execv(path, argvlist); - #endif /* BAD_EXEC_PROTOTYPES */ /* If we get here it's definitely an error */ --- 2108,2112 ---- *************** *** 2261,2270 **** envlist[envc] = 0; - - #ifdef BAD_EXEC_PROTOTYPES - execve(path, (const char **)argvlist, envlist); - #else /* BAD_EXEC_PROTOTYPES */ execve(path, argvlist, envlist); - #endif /* BAD_EXEC_PROTOTYPES */ /* If we get here it's definitely an error */ --- 2247,2251 ---- From montanaro at users.sourceforge.net Sat Jan 17 09:22:46 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Sat Jan 17 09:22:50 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.919,1.920 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv13504 Modified Files: NEWS Log Message: document PEP 11 progress so far. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.919 retrieving revision 1.920 diff -C2 -d -r1.919 -r1.920 *** NEWS 5 Jan 2004 10:13:34 -0000 1.919 --- NEWS 17 Jan 2004 14:22:44 -0000 1.920 *************** *** 291,294 **** --- 291,302 ---- ----- + - Support for DGUX, SunOS 4, IRIX 4 and Minix was removed (see PEP 11). + + - Support for systems requiring --with-dl-dld or --with-sgi-dl was removed + (see PEP 11). + + - Tests for sizeof(char) were removed since ANSI C mandates that + sizeof(char) must be 1. + C API ----- From perky at users.sourceforge.net Sat Jan 17 09:29:30 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sat Jan 17 09:29:39 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcodecs.tex,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv14239/Doc/lib Modified Files: libcodecs.tex Log Message: Add CJK codecs support as discussed on python-dev. (SF #873597) Several style fixes are suggested by Martin v. Loewis and Marc-Andre Lemburg. Thanks! Index: libcodecs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcodecs.tex,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** libcodecs.tex 23 Sep 2003 20:21:01 -0000 1.26 --- libcodecs.tex 17 Jan 2004 14:29:28 -0000 1.27 *************** *** 213,225 **** - \begin{seealso} - \seeurl{http://sourceforge.net/projects/python-codecs/}{A - SourceForge project working on additional support for Asian - codecs for use with Python. They are in the early stages of - development at the time of this writing --- look in their - FTP area for downloadable files.} - \end{seealso} - - \subsection{Codec Base Classes} --- 213,216 ---- *************** *** 554,557 **** --- 545,552 ---- {English} + \lineiii{big5} + {big5_tw, csbig5} + {Traditional Chinese} + \lineiii{cp037} {IBM037, IBM039} *************** *** 634,637 **** --- 629,644 ---- {Greek} + \lineiii{cp932} + {932, ms932, mskanji, ms_kanji} + {Japanese} + + \lineiii{cp949} + {949, ms949, uhc} + {Korean} + + \lineiii{cp950} + {950, ms950} + {Traditional Chinese} + \lineiii{cp1006} {} *************** *** 682,685 **** --- 689,745 ---- {Vietnamese} + \lineiii{euc_jp} + {eucjp, ujis, u_jis} + {Japanese} + + \lineiii{euc_jisx0213} + {jisx0213, eucjisx0213} + {Japanese} + + \lineiii{euc_kr} + {euckr, korean, ksc5601, ks_c_5601, ks_c_5601_1987, ksx1001, ks_x_1001} + {Korean} + + \lineiii{gb2312} + {chinese, csiso58gb231280, euc_cn, euccn, eucgb2312_cn, gb2312_1980, + gb2312_80, iso_ir_58} + {Simplified Chinese} + + \lineiii{gbk} + {936, cp936, ms936} + {Unified Chinese} + + \lineiii{gb18030} + {gb18030_2000} + {Unified Chinese} + + \lineiii{hz} + {hzgb, hz_gb, hz_gb_2312} + {Simplified Chinese} + + \lineiii{iso2022_jp} + {csiso2022jp, iso2022jp, iso_2022_jp} + {Japanese} + + \lineiii{iso2022_jp_1} + {iso2022jp_1, iso_2022_jp_1} + {Japanese} + + \lineiii{iso2022_jp_2} + {iso2022jp_2, iso_2022_jp_2} + {Japanese, Korean, Simplified Chinese, Western Europe, Greek} + + \lineiii{iso2022_jp_3} + {iso2022jp_3, iso_2022_jp_3} + {Japanese} + + \lineiii{iso2022_jp_ext} + {iso2022jp_ext, iso_2022_jp_ext} + {Japanese} + + \lineiii{iso2022_kr} + {csiso2022kr, iso2022kr, iso_2022_kr} + {Korean} + \lineiii{latin_1} {iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1} *************** *** 734,737 **** --- 794,801 ---- {Western Europe} + \lineiii{johab} + {cp1361, ms1361} + {Korean} + \lineiii{koi8_r} {} *************** *** 766,769 **** --- 830,841 ---- {Turkish} + \lineiii{shift_jis} + {csshiftjis, shiftjis, sjis, s_jis} + {Japanese} + + \lineiii{shift_jisx0213} + {shiftjisx0213, sjisx0213, s_jisx0213} + {Japanese} + \lineiii{utf_16} {U16, utf16} From perky at users.sourceforge.net Sat Jan 17 09:29:30 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sat Jan 17 09:29:41 2004 Subject: [Python-checkins] python/dist/src setup.py,1.180,1.181 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1:/tmp/cvs-serv14239 Modified Files: setup.py Log Message: Add CJK codecs support as discussed on python-dev. (SF #873597) Several style fixes are suggested by Martin v. Loewis and Marc-Andre Lemburg. Thanks! Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.180 retrieving revision 1.181 diff -C2 -d -r1.180 -r1.181 *** setup.py 5 Jan 2004 10:13:33 -0000 1.180 --- setup.py 17 Jan 2004 14:29:28 -0000 1.181 *************** *** 757,760 **** --- 757,773 ---- )) + # Hye-Shik Chang's CJKCodecs modules. + exts.append(Extension('_multibytecodec', + ['cjkcodecs/multibytecodec.c'])) + for loc in ('ja_JP', 'ko_KR', 'zh_CN', 'zh_TW'): + exts.append(Extension('_codecs_mapdata_' + loc, + ['cjkcodecs/mapdata_%s.c' % loc])) + for enc in ('shift_jis', 'cp932', 'euc_jp', 'iso2022_jp', + 'iso2022_jp_1', 'iso2022_jp_2', 'iso2022_jp_3', + 'iso2022_jp_ext', 'shift_jisx0213', 'euc_jisx0213', + 'euc_kr', 'cp949', 'johab', 'iso2022_kr', 'gb2312', + 'gbk', 'gb18030', 'hz', 'big5', 'cp950'): + exts.append(Extension('_codecs_' + enc, ['cjkcodecs/_%s.c' % enc])) + # Dynamic loading module if sys.maxint == 0x7fffffff: From perky at users.sourceforge.net Sat Jan 17 09:29:30 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sat Jan 17 09:29:43 2004 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email/test In directory sc8-pr-cvs1:/tmp/cvs-serv14239/Lib/email/test Modified Files: test_email_codecs.py Log Message: Add CJK codecs support as discussed on python-dev. (SF #873597) Several style fixes are suggested by Martin v. Loewis and Marc-Andre Lemburg. Thanks! Index: test_email_codecs.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/test/test_email_codecs.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_email_codecs.py 6 Mar 2003 05:41:07 -0000 1.4 --- test_email_codecs.py 17 Jan 2004 14:29:28 -0000 1.5 *************** *** 9,19 **** from email.Header import Header, decode_header - # See if we have the Japanese codecs package installed - try: - unicode('foo', 'japanese.iso-2022-jp') - except LookupError: - raise TestSkipped, 'Optional Japanese codecs not installed' - - class TestEmailAsianCodecs(TestEmailBase): --- 9,12 ---- From perky at users.sourceforge.net Sat Jan 17 09:29:30 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sat Jan 17 09:29:45 2004 Subject: [Python-checkins] python/dist/src/Lib/encodings big5.py, NONE, 1.1 cp932.py, NONE, 1.1 cp949.py, NONE, 1.1 cp950.py, NONE, 1.1 euc_jisx0213.py, NONE, 1.1 euc_jp.py, NONE, 1.1 euc_kr.py, NONE, 1.1 gb18030.py, NONE, 1.1 gb2312.py, NONE, 1.1 gbk.py, NONE, 1.1 hz.py, NONE, 1.1 iso2022_jp.py, NONE, 1.1 iso2022_jp_1.py, NONE, 1.1 iso2022_jp_2.py, NONE, 1.1 iso2022_jp_3.py, NONE, 1.1 iso2022_jp_ext.py, NONE, 1.1 iso2022_kr.py, NONE, 1.1 johab.py, NONE, 1.1 shift_jis.py, NONE, 1.1 shift_jisx0213.py, NONE, 1.1 aliases.py, 1.20, 1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory sc8-pr-cvs1:/tmp/cvs-serv14239/Lib/encodings Modified Files: aliases.py Added Files: big5.py cp932.py cp949.py cp950.py euc_jisx0213.py euc_jp.py euc_kr.py gb18030.py gb2312.py gbk.py hz.py iso2022_jp.py iso2022_jp_1.py iso2022_jp_2.py iso2022_jp_3.py iso2022_jp_ext.py iso2022_kr.py johab.py shift_jis.py shift_jisx0213.py Log Message: Add CJK codecs support as discussed on python-dev. (SF #873597) Several style fixes are suggested by Martin v. Loewis and Marc-Andre Lemburg. Thanks! --- NEW FILE: big5.py --- # # big5.py: Python Unicode Codec for BIG5 # # Written by Hye-Shik Chang # $CJKCodecs: big5.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_big5 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: cp932.py --- # # cp932.py: Python Unicode Codec for CP932 # # Written by Hye-Shik Chang # $CJKCodecs: cp932.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_cp932 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: cp949.py --- # # cp949.py: Python Unicode Codec for CP949 # # Written by Hye-Shik Chang # $CJKCodecs: cp949.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_cp949 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: cp950.py --- # # cp950.py: Python Unicode Codec for CP950 # # Written by Hye-Shik Chang # $CJKCodecs: cp950.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_cp950 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: euc_jisx0213.py --- # # euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213 # # Written by Hye-Shik Chang # $CJKCodecs: euc_jisx0213.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_euc_jisx0213 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: euc_jp.py --- # # euc_jp.py: Python Unicode Codec for EUC_JP # # Written by Hye-Shik Chang # $CJKCodecs: euc_jp.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_euc_jp import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: euc_kr.py --- # # euc_kr.py: Python Unicode Codec for EUC_KR # # Written by Hye-Shik Chang # $CJKCodecs: euc_kr.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_euc_kr import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: gb18030.py --- # # gb18030.py: Python Unicode Codec for GB18030 # # Written by Hye-Shik Chang # $CJKCodecs: gb18030.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_gb18030 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: gb2312.py --- # # gb2312.py: Python Unicode Codec for GB2312 # # Written by Hye-Shik Chang # $CJKCodecs: gb2312.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_gb2312 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: gbk.py --- # # gbk.py: Python Unicode Codec for GBK # # Written by Hye-Shik Chang # $CJKCodecs: gbk.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_gbk import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: hz.py --- # # hz.py: Python Unicode Codec for HZ # # Written by Hye-Shik Chang # $CJKCodecs: hz.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_hz import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: iso2022_jp.py --- # # iso2022_jp.py: Python Unicode Codec for ISO_2022_JP # # Written by Hye-Shik Chang # $CJKCodecs: iso2022_jp.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_iso2022_jp import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: iso2022_jp_1.py --- # # iso2022_jp_1.py: Python Unicode Codec for ISO_2022_JP_1 # # Written by Hye-Shik Chang # $CJKCodecs: iso2022_jp_1.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_iso2022_jp_1 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: iso2022_jp_2.py --- # # iso2022_jp_2.py: Python Unicode Codec for ISO_2022_JP_2 # # Written by Hye-Shik Chang # $CJKCodecs: iso2022_jp_2.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_iso2022_jp_2 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: iso2022_jp_3.py --- # # iso2022_jp_3.py: Python Unicode Codec for ISO_2022_JP_3 # # Written by Hye-Shik Chang # $CJKCodecs: iso2022_jp_3.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_iso2022_jp_3 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: iso2022_jp_ext.py --- # # iso2022_jp_ext.py: Python Unicode Codec for ISO_2022_JP_EXT # # Written by Hye-Shik Chang # $CJKCodecs: iso2022_jp_ext.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_iso2022_jp_ext import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: iso2022_kr.py --- # # iso2022_kr.py: Python Unicode Codec for ISO_2022_KR # # Written by Hye-Shik Chang # $CJKCodecs: iso2022_kr.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_iso2022_kr import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: johab.py --- # # johab.py: Python Unicode Codec for JOHAB # # Written by Hye-Shik Chang # $CJKCodecs: johab.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_johab import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: shift_jis.py --- # # shift_jis.py: Python Unicode Codec for SHIFT_JIS # # Written by Hye-Shik Chang # $CJKCodecs: shift_jis.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_shift_jis import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) --- NEW FILE: shift_jisx0213.py --- # # shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213 # # Written by Hye-Shik Chang # $CJKCodecs: shift_jisx0213.py,v 1.3 2004/01/17 11:26:10 perky Exp $ # from _codecs_shift_jisx0213 import codec import codecs class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class StreamReader(Codec, codecs.StreamReader): def __init__(self, stream, errors='strict'): codecs.StreamReader.__init__(self, stream, errors) __codec = codec.StreamReader(stream, errors) self.read = __codec.read self.readline = __codec.readline self.readlines = __codec.readlines self.reset = __codec.reset class StreamWriter(Codec, codecs.StreamWriter): def __init__(self, stream, errors='strict'): codecs.StreamWriter.__init__(self, stream, errors) __codec = codec.StreamWriter(stream, errors) self.write = __codec.write self.writelines = __codec.writelines self.reset = __codec.reset def getregentry(): return (Codec().encode,Codec().decode,StreamReader,StreamWriter) Index: aliases.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/aliases.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** aliases.py 23 Sep 2003 20:21:01 -0000 1.20 --- aliases.py 17 Jan 2004 14:29:28 -0000 1.21 *************** *** 15,24 **** 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 = { --- 15,18 ---- *************** *** 42,45 **** --- 36,43 ---- 'base_64' : 'base64_codec', + # big5 codec + 'big5_tw' : 'big5', + 'csbig5' : 'big5', + # bz2_codec codec 'bz2' : 'bz2_codec', *************** *** 169,175 **** --- 167,255 ---- 'ibm869' : 'cp869', + # cp932 codec + '932' : 'cp932', + 'ms932' : 'cp932', + 'mskanji' : 'cp932', + 'ms_kanji' : 'cp932', + + # cp949 codec + '949' : 'cp949', + 'ms949' : 'cp949', + 'uhc' : 'cp949', + + # cp950 codec + '950' : 'cp950', + 'ms950' : 'cp950', + + # euc_jisx0213 codec + 'jisx0213' : 'euc_jisx0213', + 'eucjisx0213' : 'euc_jisx0213', + + # euc_jp codec + 'eucjp' : 'euc_jp', + 'ujis' : 'euc_jp', + 'u_jis' : 'euc_jp', + + # euc_kr codec + 'euckr' : 'euc_kr', + 'korean' : 'euc_kr', + 'ksc5601' : 'euc_kr', + 'ks_c_5601' : 'euc_kr', + 'ks_c_5601_1987' : 'euc_kr', + 'ksx1001' : 'euc_kr', + 'ks_x_1001' : 'euc_kr', + + # gb18030 codec + 'gb18030_2000' : 'gb18030', + + # gb2312 codec + 'chinese' : 'gb2312', + 'csiso58gb231280' : 'gb2312', + 'euc_cn' : 'gb2312', + 'euccn' : 'gb2312', + 'eucgb2312_cn' : 'gb2312', + 'gb2312_1980' : 'gb2312', + 'gb2312_80' : 'gb2312', + 'iso_ir_58' : 'gb2312', + + # gbk codec + '936' : 'gbk', + 'cp936' : 'gbk', + 'ms936' : 'gbk', + # hex_codec codec 'hex' : 'hex_codec', + # hz codec + 'hzgb' : 'hz', + 'hz_gb' : 'hz', + 'hz_gb_2312' : 'hz', + + # iso2022_jp codec + 'csiso2022jp' : 'iso2022_jp', + 'iso2022jp' : 'iso2022_jp', + 'iso_2022_jp' : 'iso2022_jp', + + # iso2022_jp_1 codec + 'iso2022jp_1' : 'iso2022_jp_1', + 'iso_2022_jp_1' : 'iso2022_jp_1', + + # iso2022_jp_2 codec + 'iso2022jp_2' : 'iso2022_jp_2', + 'iso_2022_jp_2' : 'iso2022_jp_2', + + # iso_3022_jp_3 codec + 'iso2022jp_3' : 'iso2022_jp_3', + 'iso_2022_jp_3' : 'iso2022_jp_3', + + # iso2022_jp_ext codec + 'iso2022jp_ext' : 'iso2022_jp_ext', + 'iso_2022_jp_ext' : 'iso2022_jp_ext', + + # iso2022_kr codec + 'csiso2022kr' : 'iso2022_kr', + 'iso2022kr' : 'iso2022_kr', + 'iso_2022_kr' : 'iso2022_kr', + # iso8859_10 codec 'csisolatin6' : 'iso8859_10', *************** *** 259,265 **** 'latin5' : 'iso8859_9', ! # jis_7 codec ! 'csiso2022jp' : 'jis_7', ! 'iso_2022_jp' : 'jis_7', # koi8_r codec --- 339,345 ---- 'latin5' : 'iso8859_9', ! # johab codec ! 'cp1361' : 'johab', ! 'ms1361' : 'johab', # koi8_r codec *************** *** 309,312 **** --- 389,403 ---- 'rot13' : 'rot_13', + # shift_jis codec + 'csshiftjis' : 'shift_jis', + 'shiftjis' : 'shift_jis', + 'sjis' : 'shift_jis', + 's_jis' : 'shift_jis', + + # shift_jisx0213 codec + 'shiftjisx0213' : 'shift_jisx0213', + 'sjisx0213' : 'shift_jisx0213', + 's_jisx0213' : 'shift_jisx0213', + # tactis codec 'tis260' : 'tactis', From perky at users.sourceforge.net Sat Jan 17 09:29:30 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sat Jan 17 09:29:47 2004 Subject: [Python-checkins] python/dist/src/Modules Setup.dist,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv14239/Modules Modified Files: Setup.dist Log Message: Add CJK codecs support as discussed on python-dev. (SF #873597) Several style fixes are suggested by Martin v. Loewis and Marc-Andre Lemburg. Thanks! Index: Setup.dist =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/Setup.dist,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Setup.dist 17 Jan 2004 14:19:43 -0000 1.42 --- Setup.dist 17 Jan 2004 14:29:28 -0000 1.43 *************** *** 479,482 **** --- 479,524 ---- #pyexpat pyexpat.c -DHAVE_EXPAT_H -I$(EXPAT_DIR)/lib -L$(EXPAT_DIR) -lexpat + + # Hye-Shik Chang's CJKCodecs + + # multibytecodec is required for all the other CJK codec modules + #_multibytecodec cjkcodecs/multibytecodec.c + + # mapdata modules are required to support their respective dependent codecs + #_codecs_mapdata_ja_JP cjkcodecs/mapdata_ja_JP.c + #_codecs_mapdata_ko_KR cjkcodecs/mapdata_ko_KR.c + #_codecs_mapdata_zh_CN cjkcodecs/mapdata_zh_CN.c + #_codecs_mapdata_zh_TW cjkcodecs/mapdata_zh_TW.c + + # ja_JP codecs + #_codecs_cp932 cjkcodecs/_cp932.c + #_codecs_euc_jisx0213 cjkcodecs/_euc_jisx0213.c + #_codecs_euc_jp cjkcodecs/_euc_jp.c + #_codecs_iso2022_jp cjkcodecs/_iso2022_jp.c + #_codecs_iso2022_jp_1 cjkcodecs/_iso2022_jp_1.c + #_codecs_iso2022_jp_3 cjkcodecs/_iso2022_jp_3.c + #_codecs_iso2022_jp_ext cjkcodecs/_iso2022_jp_ext.c + #_codecs_shift_jis cjkcodecs/_shift_jis.c + #_codecs_shift_jisx0213 cjkcodecs/_shift_jisx0213.c + + # ko_KR codecs + #_codecs_cp949 cjkcodecs/_cp949.c + #_codecs_euc_kr cjkcodecs/_euc_kr.c + #_codecs_johab cjkcodecs/_johab.c + + # zh_CN codecs + #_codecs_gb18030 cjkcodecs/_gb18030.c + #_codecs_gb2312 cjkcodecs/_gb2312.c + #_codecs_gbk cjkcodecs/_gbk.c + #_codecs_hz cjkcodecs/_hz.c + + # zh_TW codecs + #_codecs_big5 cjkcodecs/_big5.c + #_codecs_cp950 cjkcodecs/_cp950.c + + # international codecs + #_codecs_iso2022_jp_2 cjkcodecs/_iso2022_jp_2.c # requires ja_JP, ko_KR, zh_CN + + # Example -- included for reference only: # xx xxmodule.c From perky at users.sourceforge.net Sat Jan 17 09:29:30 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sat Jan 17 09:29:50 2004 Subject: [Python-checkins] python/dist/src/Lib/test cjkencodings_test.py, NONE, 1.1 test_codecencodings_cn.py, NONE, 1.1 test_codecencodings_jp.py, NONE, 1.1 test_codecencodings_kr.py, NONE, 1.1 test_codecencodings_tw.py, NONE, 1.1 test_codecmaps_cn.py, NONE, 1.1 test_codecmaps_jp.py, NONE, 1.1 test_codecmaps_kr.py, NONE, 1.1 test_codecmaps_tw.py, NONE, 1.1 test_multibytecodec.py, NONE, 1.1 test_multibytecodec_support.py, NONE, 1.1 regrtest.py, 1.150, 1.151 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv14239/Lib/test Modified Files: regrtest.py Added Files: cjkencodings_test.py test_codecencodings_cn.py test_codecencodings_jp.py test_codecencodings_kr.py test_codecencodings_tw.py test_codecmaps_cn.py test_codecmaps_jp.py test_codecmaps_kr.py test_codecmaps_tw.py test_multibytecodec.py test_multibytecodec_support.py Log Message: Add CJK codecs support as discussed on python-dev. (SF #873597) Several style fixes are suggested by Martin v. Loewis and Marc-Andre Lemburg. Thanks! --- NEW FILE: cjkencodings_test.py --- teststring = { 'big5': ( "\xa6\x70\xa6\xf3\xa6\x62\x20\x50\x79\x74\x68\x6f\x6e\x20\xa4\xa4" "\xa8\xcf\xa5\xce\xac\x4a\xa6\xb3\xaa\xba\x20\x43\x20\x6c\x69\x62" "\x72\x61\x72\x79\x3f\x0a\xa1\x40\xa6\x62\xb8\xea\xb0\x54\xac\xec" "\xa7\xde\xa7\xd6\xb3\x74\xb5\x6f\xae\x69\xaa\xba\xa4\xb5\xa4\xd1" "\x2c\x20\xb6\x7d\xb5\x6f\xa4\xce\xb4\xfa\xb8\xd5\xb3\x6e\xc5\xe9" "\xaa\xba\xb3\x74\xab\xd7\xac\x4f\xa4\xa3\xae\x65\xa9\xbf\xb5\xf8" "\xaa\xba\x0a\xbd\xd2\xc3\x44\x2e\x20\xac\xb0\xa5\x5b\xa7\xd6\xb6" "\x7d\xb5\x6f\xa4\xce\xb4\xfa\xb8\xd5\xaa\xba\xb3\x74\xab\xd7\x2c" "\x20\xa7\xda\xad\xcc\xab\x4b\xb1\x60\xa7\xc6\xb1\xe6\xaf\xe0\xa7" "\x51\xa5\xce\xa4\x40\xa8\xc7\xa4\x77\xb6\x7d\xb5\x6f\xa6\x6e\xaa" "\xba\x0a\x6c\x69\x62\x72\x61\x72\x79\x2c\x20\xa8\xc3\xa6\xb3\xa4" "\x40\xad\xd3\x20\x66\x61\x73\x74\x20\x70\x72\x6f\x74\x6f\x74\x79" "\x70\x69\x6e\x67\x20\xaa\xba\x20\x70\x72\x6f\x67\x72\x61\x6d\x6d" "\x69\x6e\x67\x20\x6c\x61\x6e\x67\x75\x61\x67\x65\x20\xa5\x69\x0a" "\xa8\xd1\xa8\xcf\xa5\xce\x2e\x20\xa5\xd8\xab\x65\xa6\xb3\xb3\x5c" "\xb3\x5c\xa6\x68\xa6\x68\xaa\xba\x20\x6c\x69\x62\x72\x61\x72\x79" "\x20\xac\x4f\xa5\x48\x20\x43\x20\xbc\x67\xa6\xa8\x2c\x20\xa6\xd3" [...962 lines suppressed...] "\x20\xe3\x81\xa7\xe3\x81\xaf\xe3\x81\x9d\xe3\x81\x86\xe3\x81\x84" "\xe3\x81\xa3\xe3\x81\x9f\xe5\xb0\x8f\xe7\xb4\xb0\xe5\xb7\xa5\xe3" "\x81\x8c\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x95\xe3\x82\x8c\xe3\x82" "\x8b\xe3\x81\x93\xe3\x81\xa8\xe3\x81\xaf\xe3\x81\x82\xe3\x81\xbe" "\xe3\x82\x8a\xe3\x81\x82\xe3\x82\x8a\xe3\x81\xbe\xe3\x81\x9b\xe3" "\x82\x93\xe3\x80\x82\x0a\xe8\xa8\x80\xe8\xaa\x9e\xe8\x87\xaa\xe4" "\xbd\x93\xe3\x81\xae\xe6\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x9c" "\x80\xe5\xb0\x8f\xe9\x99\x90\xe3\x81\xab\xe6\x8a\xbc\xe3\x81\x95" "\xe3\x81\x88\xe3\x80\x81\xe5\xbf\x85\xe8\xa6\x81\xe3\x81\xaa\xe6" "\xa9\x9f\xe8\x83\xbd\xe3\x81\xaf\xe6\x8b\xa1\xe5\xbc\xb5\xe3\x83" "\xa2\xe3\x82\xb8\xe3\x83\xa5\xe3\x83\xbc\xe3\x83\xab\xe3\x81\xa8" "\xe3\x81\x97\xe3\x81\xa6\xe8\xbf\xbd\xe5\x8a\xa0\xe3\x81\x99\xe3" "\x82\x8b\xe3\x80\x81\xe3\x81\xa8\xe3\x81\x84\xe3\x81\x86\xe3\x81" "\xae\xe3\x81\x8c\x20\x50\x79\x74\x68\x6f\x6e\x20\xe3\x81\xae\xe3" "\x83\x9d\xe3\x83\xaa\xe3\x82\xb7\xe3\x83\xbc\xe3\x81\xa7\xe3\x81" "\x99\xe3\x80\x82\x0a\x0a\xe3\x83\x8e\xe3\x81\x8b\xe3\x82\x9a\x20" "\xe3\x83\x88\xe3\x82\x9a\x20\xe3\x83\x88\xe3\x82\xad\xef\xa8\xb6" "\xef\xa8\xb9\x20\xf0\xa1\x9a\xb4\xf0\xaa\x8e\x8c\x20\xe9\xba\x80" "\xe9\xbd\x81\xf0\xa9\x9b\xb0\x0a"), } --- NEW FILE: test_codecencodings_cn.py --- #!/usr/bin/env python # # test_codecencodings_cn.py # Codec encoding tests for PRC encodings. # # $CJKCodecs: test_codecencodings_cn.py,v 1.1 2003/12/19 03:00:05 perky Exp $ from test import test_support from test import test_multibytecodec_support import unittest class Test_GB2312(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'gb2312' tstring = test_multibytecodec_support.load_teststring('gb2312') codectests = ( # invalid bytes ("abc\x81\x81\xc1\xc4", "strict", None), ("abc\xc8", "strict", None), ("abc\x81\x81\xc1\xc4", "replace", u"abc\ufffd\u804a"), ("abc\x81\x81\xc1\xc4\xc8", "replace", u"abc\ufffd\u804a\ufffd"), ("abc\x81\x81\xc1\xc4", "ignore", u"abc\u804a"), ("\xc1\x64", "strict", None), ) class Test_GBK(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'gbk' tstring = test_multibytecodec_support.load_teststring('gbk') codectests = ( # invalid bytes ("abc\x80\x80\xc1\xc4", "strict", None), ("abc\xc8", "strict", None), ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u804a"), ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u804a\ufffd"), ("abc\x80\x80\xc1\xc4", "ignore", u"abc\u804a"), ("\x83\x34\x83\x31", "strict", None), ) class Test_GB18030(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'gb18030' tstring = test_multibytecodec_support.load_teststring('gb18030') codectests = ( # invalid bytes ("abc\x80\x80\xc1\xc4", "strict", None), ("abc\xc8", "strict", None), ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u804a"), ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u804a\ufffd"), ("abc\x80\x80\xc1\xc4", "ignore", u"abc\u804a"), ("abc\x84\x39\x84\x39\xc1\xc4", "replace", u"abc\ufffd\u804a"), ) has_iso10646 = True def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_GB2312)) suite.addTest(unittest.makeSuite(Test_GBK)) suite.addTest(unittest.makeSuite(Test_GB18030)) test_support.run_suite(suite) if __name__ == "__main__": test_main() --- NEW FILE: test_codecencodings_jp.py --- #!/usr/bin/env python # # test_codecencodings_jp.py # Codec encoding tests for Japanese encodings. # # $CJKCodecs: test_codecencodings_jp.py,v 1.2 2004/01/06 09:25:37 perky Exp $ from test import test_support from test import test_multibytecodec_support import unittest class Test_CP932(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'cp932' tstring = test_multibytecodec_support.load_teststring('shift_jis') codectests = ( # invalid bytes ("abc\x81\x00\x81\x00\x82\x84", "strict", None), ("abc\xf8", "strict", None), ("abc\x81\x00\x82\x84", "replace", u"abc\ufffd\uff44"), ("abc\x81\x00\x82\x84\x88", "replace", u"abc\ufffd\uff44\ufffd"), ("abc\x81\x00\x82\x84", "ignore", u"abc\uff44"), # sjis vs cp932 ("\\\x7e", "replace", u"\\\x7e"), ("\x81\x5f\x81\x61\x81\x7c", "replace", u"\uff3c\u2225\uff0d"), ) class Test_EUC_JISX0213(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'euc_jisx0213' tstring = test_multibytecodec_support.load_teststring('euc_jisx0213') codectests = ( # invalid bytes ("abc\x80\x80\xc1\xc4", "strict", None), ("abc\xc8", "strict", None), ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u7956"), ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u7956\ufffd"), ("abc\x80\x80\xc1\xc4", "ignore", u"abc\u7956"), ("abc\x8f\x83\x83", "replace", u"abc\ufffd"), ("\xc1\x64", "strict", None), ("\xa1\xc0", "strict", u"\uff3c"), ) xmlcharnametest = ( u"\xab\u211c\xbb = \u2329\u1234\u232a", "\xa9\xa8ℜ\xa9\xb2 = ⟨ሴ⟩" ) eucjp_commontests = ( ("abc\x80\x80\xc1\xc4", "strict", None), ("abc\xc8", "strict", None), ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u7956"), ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u7956\ufffd"), ("abc\x80\x80\xc1\xc4", "ignore", u"abc\u7956"), ("abc\x8f\x83\x83", "replace", u"abc\ufffd"), ("\xc1\x64", "strict", None), ) class Test_EUC_JP_COMPAT(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'euc_jp' tstring = test_multibytecodec_support.load_teststring('euc_jp') codectests = eucjp_commontests + ( ("\xa1\xc0\\", "strict", u"\uff3c\\"), (u"\xa5", "strict", "\x5c"), (u"\u203e", "strict", "\x7e"), ) class Test_EUC_JP_STRICT(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'euc_jp_strict' tstring = test_multibytecodec_support.load_teststring('euc_jp') codectests = eucjp_commontests + ( ("\xa1\xc0\\", "strict", u"\\\\"), (u"\xa5", "strict", None), (u"\u203e", "strict", None), ) shiftjis_commonenctests = ( ("abc\x80\x80\x82\x84", "strict", None), ("abc\xf8", "strict", None), ("abc\x80\x80\x82\x84", "replace", u"abc\ufffd\uff44"), ("abc\x80\x80\x82\x84\x88", "replace", u"abc\ufffd\uff44\ufffd"), ("abc\x80\x80\x82\x84def", "ignore", u"abc\uff44def"), ) class Test_SJIS_COMPAT(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'shift_jis' tstring = test_multibytecodec_support.load_teststring('shift_jis') codectests = shiftjis_commonenctests + ( ("\\\x7e", "strict", u"\\\x7e"), ("\x81\x5f\x81\x61\x81\x7c", "strict", u"\uff3c\u2016\u2212"), ) class Test_SJIS_STRICT(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'shift_jis_strict' tstring = test_multibytecodec_support.load_teststring('shift_jis') codectests = shiftjis_commonenctests + ( ("\\\x7e", "replace", u"\xa5\u203e"), ("\x81\x5f\x81\x61\x81\x7c", "replace", u"\x5c\u2016\u2212"), ) class Test_SJISX0213(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'shift_jisx0213' tstring = test_multibytecodec_support.load_teststring('shift_jisx0213') codectests = ( # invalid bytes ("abc\x80\x80\x82\x84", "strict", None), ("abc\xf8", "strict", None), ("abc\x80\x80\x82\x84", "replace", u"abc\ufffd\uff44"), ("abc\x80\x80\x82\x84\x88", "replace", u"abc\ufffd\uff44\ufffd"), ("abc\x80\x80\x82\x84def", "ignore", u"abc\uff44def"), # sjis vs cp932 ("\\\x7e", "replace", u"\xa5\u203e"), ("\x81\x5f\x81\x61\x81\x7c", "replace", u"\x5c\u2016\u2212"), ) xmlcharnametest = ( u"\xab\u211c\xbb = \u2329\u1234\u232a", "\x85Gℜ\x85Q = ⟨ሴ⟩" ) def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_CP932)) suite.addTest(unittest.makeSuite(Test_EUC_JISX0213)) suite.addTest(unittest.makeSuite(Test_EUC_JP_COMPAT)) suite.addTest(unittest.makeSuite(Test_SJIS_COMPAT)) if test_multibytecodec_support.__cjkcodecs__: suite.addTest(unittest.makeSuite(Test_EUC_JP_STRICT)) suite.addTest(unittest.makeSuite(Test_SJIS_STRICT)) suite.addTest(unittest.makeSuite(Test_SJISX0213)) test_support.run_suite(suite) if __name__ == "__main__": test_main() --- NEW FILE: test_codecencodings_kr.py --- #!/usr/bin/env python # # test_codecencodings_kr.py # Codec encoding tests for ROK encodings. # # $CJKCodecs: test_codecencodings_kr.py,v 1.1 2003/12/19 03:00:06 perky Exp $ from test import test_support from test import test_multibytecodec_support import unittest class Test_CP949(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'cp949' tstring = test_multibytecodec_support.load_teststring('cp949') codectests = ( # invalid bytes ("abc\x80\x80\xc1\xc4", "strict", None), ("abc\xc8", "strict", None), ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\uc894"), ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\uc894\ufffd"), ("abc\x80\x80\xc1\xc4", "ignore", u"abc\uc894"), ) class Test_EUCKR(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'euc_kr' tstring = test_multibytecodec_support.load_teststring('euc_kr') codectests = ( # invalid bytes ("abc\x80\x80\xc1\xc4", "strict", None), ("abc\xc8", "strict", None), ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\uc894"), ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\uc894\ufffd"), ("abc\x80\x80\xc1\xc4", "ignore", u"abc\uc894"), ) class Test_JOHAB(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'johab' tstring = test_multibytecodec_support.load_teststring('johab') codectests = ( # invalid bytes ("abc\x80\x80\xc1\xc4", "strict", None), ("abc\xc8", "strict", None), ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\ucd27"), ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\ucd27\ufffd"), ("abc\x80\x80\xc1\xc4", "ignore", u"abc\ucd27"), ) def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_CP949)) suite.addTest(unittest.makeSuite(Test_EUCKR)) suite.addTest(unittest.makeSuite(Test_JOHAB)) test_support.run_suite(suite) if __name__ == "__main__": test_main() --- NEW FILE: test_codecencodings_tw.py --- #!/usr/bin/env python # # test_codecencodings_tw.py # Codec encoding tests for ROC encodings. # # $CJKCodecs: test_codecencodings_tw.py,v 1.1 2003/12/19 03:00:06 perky Exp $ from test import test_support from test import test_multibytecodec_support import unittest class Test_Big5(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'big5' tstring = test_multibytecodec_support.load_teststring('big5') codectests = ( # invalid bytes ("abc\x80\x80\xc1\xc4", "strict", None), ("abc\xc8", "strict", None), ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u8b10"), ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u8b10\ufffd"), ("abc\x80\x80\xc1\xc4", "ignore", u"abc\u8b10"), ) def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_Big5)) test_support.run_suite(suite) if __name__ == "__main__": test_main() --- NEW FILE: test_codecmaps_cn.py --- #!/usr/bin/env python # # test_codecmaps_cn.py # Codec mapping tests for PRC encodings # # $CJKCodecs: test_codecmaps_cn.py,v 1.2 2004/01/17 12:47:19 perky Exp $ from test import test_support from test import test_multibytecodec_support import unittest class TestGB2312Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'gb2312' mapfilename = 'EUC-CN.TXT' mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-CN.TXT' class TestGBKMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'gbk' mapfilename = 'CP936.TXT' mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/' \ 'MICSFT/WINDOWS/CP936.TXT' def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestGB2312Map)) suite.addTest(unittest.makeSuite(TestGBKMap)) test_support.run_suite(suite) test_multibytecodec_support.register_skip_expected(TestGB2312Map, TestGBKMap) if __name__ == "__main__": test_main() --- NEW FILE: test_codecmaps_jp.py --- #!/usr/bin/env python # # test_codecmaps_jp.py # Codec mapping tests for Japanese encodings # # $CJKCodecs: test_codecmaps_jp.py,v 1.2 2004/01/17 12:47:19 perky Exp $ from test import test_support from test import test_multibytecodec_support import unittest class TestCP932Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'cp932' mapfilename = 'CP932.TXT' mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/' \ 'WINDOWS/CP932.TXT' supmaps = [ ('\x80', u'\u0080'), ('\xa0', u'\uf8f0'), ('\xfd', u'\uf8f1'), ('\xfe', u'\uf8f2'), ('\xff', u'\uf8f3'), ] for i in range(0xa1, 0xe0): supmaps.append((chr(i), unichr(i+0xfec0))) class TestEUCJPCOMPATMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'euc_jp' mapfilename = 'EUC-JP.TXT' mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-JP.TXT' class TestSJISCOMPATMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'shift_jis' mapfilename = 'SHIFTJIS.TXT' mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE' \ '/EASTASIA/JIS/SHIFTJIS.TXT' pass_enctest = [ ('\x81_', u'\\'), ] pass_dectest = [ ('\\', u'\xa5'), ('~', u'\u203e'), ('\x81_', u'\\'), ] class TestSJISSTRICTMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'shift_jis_strict' mapfilename = 'SHIFTJIS.TXT' mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE' \ '/EASTASIA/JIS/SHIFTJIS.TXT' class TestEUCJISX0213Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'euc_jisx0213' mapfilename = 'EUC-JISX0213.TXT' mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-JISX0213.TXT' class TestSJISX0213Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'shift_jisx0213' mapfilename = 'SHIFT_JISX0213.TXT' mapfileurl = 'http://people.freebsd.org/~perky/i18n/SHIFT_JISX0213.TXT' def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestCP932Map)) suite.addTest(unittest.makeSuite(TestEUCJPCOMPATMap)) suite.addTest(unittest.makeSuite(TestSJISCOMPATMap)) if test_multibytecodec_support.__cjkcodecs__: suite.addTest(unittest.makeSuite(TestSJISSTRICTMap)) suite.addTest(unittest.makeSuite(TestEUCJISX0213Map)) suite.addTest(unittest.makeSuite(TestSJISX0213Map)) test_support.run_suite(suite) test_multibytecodec_support.register_skip_expected(TestCP932Map, TestEUCJPCOMPATMap, TestSJISCOMPATMap, TestEUCJISX0213Map, TestSJISX0213Map) if __name__ == "__main__": test_main() --- NEW FILE: test_codecmaps_kr.py --- #!/usr/bin/env python # # test_codecmaps_kr.py # Codec mapping tests for ROK encodings # # $CJKCodecs: test_codecmaps_kr.py,v 1.2 2004/01/17 12:47:19 perky Exp $ from test import test_support from test import test_multibytecodec_support import unittest class TestCP949Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'cp949' mapfilename = 'CP949.TXT' mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT' \ '/WINDOWS/CP949.TXT' class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'euc_kr' mapfilename = 'EUC-KR.TXT' mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-KR.TXT' class TestJOHABMap(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'johab' mapfilename = 'JOHAB.TXT' mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/' \ 'KSC/JOHAB.TXT' # KS X 1001 standard assigned 0x5c as WON SIGN. # but, in early 90s that is the only era used johab widely, # the most softwares implements it as REVERSE SOLIDUS. # So, we ignore the standard here. pass_enctest = [('\\', u'\u20a9')] pass_dectest = [('\\', u'\u20a9')] def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestCP949Map)) suite.addTest(unittest.makeSuite(TestEUCKRMap)) suite.addTest(unittest.makeSuite(TestJOHABMap)) test_support.run_suite(suite) test_multibytecodec_support.register_skip_expected(TestCP949Map, TestEUCKRMap, TestJOHABMap) if __name__ == "__main__": test_main() --- NEW FILE: test_codecmaps_tw.py --- #!/usr/bin/env python # # test_codecmaps_tw.py # Codec mapping tests for ROC encodings # # $CJKCodecs: test_codecmaps_tw.py,v 1.2 2004/01/17 12:47:19 perky Exp $ from test import test_support from test import test_multibytecodec_support import unittest class TestBIG5Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'big5' mapfilename = 'BIG5.TXT' mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/' \ 'EASTASIA/OTHER/BIG5.TXT' class TestCP950Map(test_multibytecodec_support.TestBase_Mapping, unittest.TestCase): encoding = 'cp950' mapfilename = 'CP950.TXT' mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/' \ 'WINDOWS/CP950.TXT' pass_enctest = [ ('\xa2\xcc', u'\u5341'), ('\xa2\xce', u'\u5345'), ] def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TestBIG5Map)) suite.addTest(unittest.makeSuite(TestCP950Map)) test_support.run_suite(suite) test_multibytecodec_support.register_skip_expected(TestBIG5Map, TestCP950Map) if __name__ == "__main__": test_main() --- NEW FILE: test_multibytecodec.py --- #!/usr/bin/env python # # test_multibytecodec.py # Unit test for multibytecodec itself # # $CJKCodecs: test_multibytecodec.py,v 1.5 2004/01/06 02:26:28 perky Exp $ from test import test_support from test import test_multibytecodec_support import unittest, StringIO, codecs class Test_StreamWriter(unittest.TestCase): if len(u'\U00012345') == 2: # UCS2 def test_gb18030(self): s= StringIO.StringIO() c = codecs.lookup('gb18030')[3](s) c.write(u'123') self.assertEqual(s.getvalue(), '123') c.write(u'\U00012345') self.assertEqual(s.getvalue(), '123\x907\x959') c.write(u'\U00012345'[0]) self.assertEqual(s.getvalue(), '123\x907\x959') c.write(u'\U00012345'[1] + u'\U00012345' + u'\uac00\u00ac') self.assertEqual(s.getvalue(), '123\x907\x959\x907\x959\x907\x959\x827\xcf5\x810\x851') c.write(u'\U00012345'[0]) self.assertEqual(s.getvalue(), '123\x907\x959\x907\x959\x907\x959\x827\xcf5\x810\x851') self.assertRaises(UnicodeError, c.reset) self.assertEqual(s.getvalue(), '123\x907\x959\x907\x959\x907\x959\x827\xcf5\x810\x851') # standard utf-8 codecs has broken StreamReader if test_multibytecodec_support.__cjkcodecs__: def test_utf_8(self): s= StringIO.StringIO() c = codecs.lookup('utf-8')[3](s) c.write(u'123') self.assertEqual(s.getvalue(), '123') c.write(u'\U00012345') self.assertEqual(s.getvalue(), '123\xf0\x92\x8d\x85') c.write(u'\U00012345'[0]) self.assertEqual(s.getvalue(), '123\xf0\x92\x8d\x85') c.write(u'\U00012345'[1] + u'\U00012345' + u'\uac00\u00ac') self.assertEqual(s.getvalue(), '123\xf0\x92\x8d\x85\xf0\x92\x8d\x85\xf0\x92\x8d\x85' '\xea\xb0\x80\xc2\xac') c.write(u'\U00012345'[0]) self.assertEqual(s.getvalue(), '123\xf0\x92\x8d\x85\xf0\x92\x8d\x85\xf0\x92\x8d\x85' '\xea\xb0\x80\xc2\xac') c.reset() self.assertEqual(s.getvalue(), '123\xf0\x92\x8d\x85\xf0\x92\x8d\x85\xf0\x92\x8d\x85' '\xea\xb0\x80\xc2\xac\xed\xa0\x88') c.write(u'\U00012345'[1]) self.assertEqual(s.getvalue(), '123\xf0\x92\x8d\x85\xf0\x92\x8d\x85\xf0\x92\x8d\x85' '\xea\xb0\x80\xc2\xac\xed\xa0\x88\xed\xbd\x85') else: # UCS4 pass def test_nullcoding(self): self.assertEqual(''.decode('utf-8'), u'') self.assertEqual(unicode('', 'utf-8'), u'') self.assertEqual(u''.encode('utf-8'), '') def test_str_decode(self): self.assertEqual('abcd'.encode('utf-8'), 'abcd') def test_main(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(Test_StreamWriter)) test_support.run_suite(suite) if __name__ == "__main__": test_main() --- NEW FILE: test_multibytecodec_support.py --- #!/usr/bin/env python # # test_multibytecodec_support.py # Common Unittest Routines for CJK codecs # # $CJKCodecs: test_multibytecodec_support.py,v 1.5 2004/01/17 12:47:19 perky Exp $ import sys, codecs, os.path import unittest from test import test_support from StringIO import StringIO __cjkcodecs__ = 0 # define this as 0 for python class TestBase: encoding = '' # codec name codec = None # codec tuple (with 4 elements) tstring = '' # string to test StreamReader codectests = None # must set. codec test tuple roundtriptest = 1 # set if roundtrip is possible with unicode has_iso10646 = 0 # set if this encoding contains whole iso10646 map xmlcharnametest = None # string to test xmlcharrefreplace def setUp(self): if self.codec is None: self.codec = codecs.lookup(self.encoding) self.encode, self.decode, self.reader, self.writer = self.codec def test_chunkcoding(self): for native, utf8 in zip(*[StringIO(f).readlines() for f in self.tstring]): u = self.decode(native)[0] self.assertEqual(u, utf8.decode('utf-8')) if self.roundtriptest: self.assertEqual(native, self.encode(u)[0]) def test_errorhandle(self): for source, scheme, expected in self.codectests: if type(source) == type(''): func = self.decode else: func = self.encode if expected: result = func(source, scheme)[0] self.assertEqual(result, expected) else: self.assertRaises(UnicodeError, func, source, scheme) if sys.hexversion >= 0x02030000: def test_xmlcharrefreplace(self): if self.has_iso10646: return s = u"\u0b13\u0b23\u0b60 nd eggs" self.assertEqual( self.encode(s, "xmlcharrefreplace")[0], "ଓଣୠ nd eggs" ) def test_customreplace(self): if self.has_iso10646: return import htmlentitydefs names = {} for (key, value) in htmlentitydefs.entitydefs.items(): if len(value)==1: names[value.decode('latin-1')] = self.decode(key)[0] else: names[unichr(int(value[2:-1]))] = self.decode(key)[0] def xmlcharnamereplace(exc): if not isinstance(exc, UnicodeEncodeError): raise TypeError("don't know how to handle %r" % exc) l = [] for c in exc.object[exc.start:exc.end]: try: l.append(u"&%s;" % names[c]) except KeyError: l.append(u"&#%d;" % ord(c)) return (u"".join(l), exc.end) codecs.register_error( "test.xmlcharnamereplace", xmlcharnamereplace) if self.xmlcharnametest: sin, sout = self.xmlcharnametest else: sin = u"\xab\u211c\xbb = \u2329\u1234\u232a" sout = "«ℜ» = ⟨ሴ⟩" self.assertEqual(self.encode(sin, "test.xmlcharnamereplace")[0], sout) def test_streamreader(self): UTF8Writer = codecs.getwriter('utf-8') for name in ["read", "readline", "readlines"]: for sizehint in [None, -1] + range(1, 33) + \ [64, 128, 256, 512, 1024]: istream = self.reader(StringIO(self.tstring[0])) ostream = UTF8Writer(StringIO()) func = getattr(istream, name) while 1: data = func(sizehint) if not data: break if name == "readlines": ostream.writelines(data) else: ostream.write(data) self.assertEqual(ostream.getvalue(), self.tstring[1]) def test_streamwriter(self): if __cjkcodecs__: readfuncs = ('read', 'readline', 'readlines') else: # standard utf8 codec has broken readline and readlines. readfuncs = ('read',) UTF8Reader = codecs.getreader('utf-8') for name in readfuncs: for sizehint in [None] + range(1, 33) + \ [64, 128, 256, 512, 1024]: istream = UTF8Reader(StringIO(self.tstring[1])) ostream = self.writer(StringIO()) func = getattr(istream, name) while 1: if sizehint is not None: data = func(sizehint) else: data = func() if not data: break if name == "readlines": ostream.writelines(data) else: ostream.write(data) self.assertEqual(ostream.getvalue(), self.tstring[0]) if len(u'\U00012345') == 2: # ucs2 build _unichr = unichr def unichr(v): if v >= 0x10000: return _unichr(0xd800 + ((v - 0x10000) >> 10)) + \ _unichr(0xdc00 + ((v - 0x10000) & 0x3ff)) else: return _unichr(v) _ord = ord def ord(c): if len(c) == 2: return 0x10000 + ((_ord(c[0]) - 0xd800) << 10) + \ (ord(c[1]) - 0xdc00) else: return _ord(c) class TestBase_Mapping(unittest.TestCase): pass_enctest = [] pass_dectest = [] supmaps = [] def __init__(self, *args, **kw): unittest.TestCase.__init__(self, *args, **kw) if not os.path.exists(self.mapfilename): raise test_support.TestSkipped('%s not found, download from %s' % (self.mapfilename, self.mapfileurl)) def test_mapping_file(self): unichrs = lambda s: u''.join(map(unichr, map(eval, s.split('+')))) urt_wa = {} for line in open(self.mapfilename): if not line: break data = line.split('#')[0].strip().split() if len(data) != 2: continue csetval = eval(data[0]) if csetval <= 0x7F: csetch = chr(csetval & 0xff) elif csetval >= 0x1000000: csetch = chr(csetval >> 24) + chr((csetval >> 16) & 0xff) + \ chr((csetval >> 8) & 0xff) + chr(csetval & 0xff) elif csetval >= 0x10000: csetch = chr(csetval >> 16) + \ chr((csetval >> 8) & 0xff) + chr(csetval & 0xff) elif csetval >= 0x100: csetch = chr(csetval >> 8) + chr(csetval & 0xff) else: continue unich = unichrs(data[1]) if ord(unich) == 0xfffd or urt_wa.has_key(unich): continue urt_wa[unich] = csetch self._testpoint(csetch, unich) def test_mapping_supplemental(self): for mapping in self.supmaps: self._testpoint(*mapping) def _testpoint(self, csetch, unich): if (csetch, unich) not in self.pass_enctest: self.assertEqual(unich.encode(self.encoding), csetch) if (csetch, unich) not in self.pass_dectest: self.assertEqual(unicode(csetch, self.encoding), unich) def load_teststring(encoding): if __cjkcodecs__: etxt = open(os.path.join('sampletexts', encoding) + '.txt').read() utxt = open(os.path.join('sampletexts', encoding) + '.utf8').read() return (etxt, utxt) else: from test import cjkencodings_test return cjkencodings_test.teststring[encoding] def register_skip_expected(*cases): for case in cases: # len(cases) must be 1 at least. for path in [os.path.curdir, os.path.pardir]: fn = os.path.join(path, case.mapfilename) if os.path.exists(fn): case.mapfilename = fn break else: sys.modules[case.__module__].skip_expected = True break else: sys.modules[case.__module__].skip_expected = False Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.150 retrieving revision 1.151 diff -C2 -d -r1.150 -r1.151 *** regrtest.py 20 Nov 2003 22:11:29 -0000 1.150 --- regrtest.py 17 Jan 2004 14:29:28 -0000 1.151 *************** *** 550,553 **** --- 550,557 ---- # Controlled by test_timeout.skip_expected. Requires the network # resource and a socket module. + # test_codecmaps_* + # Whether a skip is expected here depends on whether a large test + # input file has been downloaded. test_codecmaps_*.skip_expected + # controls that. _expectations = { *************** *** 566,570 **** test_dbm test_dl - test_email_codecs test_fcntl test_fork1 --- 570,573 ---- *************** *** 599,603 **** test_curses test_dl - test_email_codecs test_gl test_imgfile --- 602,605 ---- *************** *** 624,628 **** test_dbm test_dl - test_email_codecs test_fcntl test_fork1 --- 626,629 ---- *************** *** 779,783 **** test_curses test_dl - test_email_codecs test_gdbm test_gl --- 780,783 ---- *************** *** 804,808 **** test_curses test_dbm - test_email_codecs test_gdbm test_gl --- 804,807 ---- *************** *** 851,855 **** test_curses test_dl - test_email_codecs test_gdbm test_gl --- 850,853 ---- *************** *** 877,881 **** test_curses test_dbm - test_email_codecs test_gl test_imgfile --- 875,878 ---- *************** *** 902,906 **** test_curses test_dl - test_email_codecs test_gl test_imgfile --- 899,902 ---- *************** *** 926,930 **** test_cd test_cl - test_email_codecs test_gl test_imgfile --- 922,925 ---- *************** *** 956,959 **** --- 951,956 ---- from test import test_socket_ssl from test import test_timeout + from test import test_codecmaps_cn, test_codecmaps_jp + from test import test_codecmaps_kr, test_codecmaps_tw self.valid = False *************** *** 974,977 **** --- 971,978 ---- self.expected.add('test_timeout') + for cc in ('cn', 'jp', 'kr', 'tw'): + if eval('test_codecmaps_' + cc).skip_expected: + self.expected.add('test_codecmaps_' + cc) + if not sys.platform in ("mac", "darwin"): MAC_ONLY = ["test_macostools", "test_macfs", "test_aepack", From perky at users.sourceforge.net Sat Jan 17 09:29:31 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sat Jan 17 09:29:55 2004 Subject: [Python-checkins] python/dist/src/Modules/cjkcodecs README, NONE, 1.1 _big5.c, NONE, 1.1 _cp932.c, NONE, 1.1 _cp949.c, NONE, 1.1 _cp950.c, NONE, 1.1 _euc_jisx0213.c, NONE, 1.1 _euc_jp.c, NONE, 1.1 _euc_kr.c, NONE, 1.1 _gb18030.c, NONE, 1.1 _gb2312.c, NONE, 1.1 _gbk.c, NONE, 1.1 _hz.c, NONE, 1.1 _iso2022_jp.c, NONE, 1.1 _iso2022_jp_1.c, NONE, 1.1 _iso2022_jp_2.c, NONE, 1.1 _iso2022_jp_3.c, NONE, 1.1 _iso2022_jp_ext.c, NONE, 1.1 _iso2022_kr.c, NONE, 1.1 _johab.c, NONE, 1.1 _shift_jis.c, NONE, 1.1 _shift_jisx0213.c, NONE, 1.1 alg_iso8859_1.h, NONE, 1.1 alg_iso8859_7.h, NONE, 1.1 alg_jisx0201.h, NONE, 1.1 cjkcommon.h, NONE, 1.1 codeccommon.h, NONE, 1.1 codecentry.h, NONE, 1.1 iso2022common.h, NONE, 1.1 map_big5.h, NONE, 1.1 map_cp932ext.h, NONE, 1.1 map_cp949.h, NONE, 1.1 map_cp949ext.h, NONE, 1.1 map_cp950ext.h, NONE, 1.1 map_gb18030ext.h, NONE, 1.1 map_gb18030uni.h, NONE, 1.1 map_gb2312.h, NONE, 1.1 map_gbcommon.h, NONE, 1.1 map_gbkext.h, NONE, 1.1 map_jisx0208.h, NONE, 1.1 map_jisx0212.h, NONE, 1.1 map_jisx0213.h, NONE, 1.1 map_jisx0213_pairs.h, NONE, 1.1 map_jisxcom! mon.h, NONE, 1.1 map_ksx1001.h, NONE, 1.1 mapdata_ja_JP.c, NONE, 1.1 mapdata_ko_KR.c, NONE, 1.1 mapdata_zh_CN.c, NONE, 1.1 mapdata_zh_TW.c, NONE, 1.1 multibytecodec.c, NONE, 1.1 multibytecodec.h, NONE, 1.1 tweak_gbk.h, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules/cjkcodecs In directory sc8-pr-cvs1:/tmp/cvs-serv14239/Modules/cjkcodecs Added Files: README _big5.c _cp932.c _cp949.c _cp950.c _euc_jisx0213.c _euc_jp.c _euc_kr.c _gb18030.c _gb2312.c _gbk.c _hz.c _iso2022_jp.c _iso2022_jp_1.c _iso2022_jp_2.c _iso2022_jp_3.c _iso2022_jp_ext.c _iso2022_kr.c _johab.c _shift_jis.c _shift_jisx0213.c alg_iso8859_1.h alg_iso8859_7.h alg_jisx0201.h cjkcommon.h codeccommon.h codecentry.h iso2022common.h map_big5.h map_cp932ext.h map_cp949.h map_cp949ext.h map_cp950ext.h map_gb18030ext.h map_gb18030uni.h map_gb2312.h map_gbcommon.h map_gbkext.h map_jisx0208.h map_jisx0212.h map_jisx0213.h map_jisx0213_pairs.h map_jisxcommon.h map_ksx1001.h mapdata_ja_JP.c mapdata_ko_KR.c mapdata_zh_CN.c mapdata_zh_TW.c multibytecodec.c multibytecodec.h tweak_gbk.h Log Message: Add CJK codecs support as discussed on python-dev. (SF #873597) Several style fixes are suggested by Martin v. Loewis and Marc-Andre Lemburg. Thanks! --- NEW FILE: README --- Notes on cjkcodecs ------------------- This directory contains source files for cjkcodecs extension modules. They are based on CJKCodecs (http://cjkpython.i18n.org/#CJKCodecs) as of Jan 17 2004 currently. To generate or modify mapping headers ------------------------------------- Mapping headers are imported from CJKCodecs as pre-generated form. If you need to tweak or add something on it, please look at tools/ subdirectory of CJKCodecs' distribution. Notes on implmentation characteristics of each codecs ----------------------------------------------------- 1) Big5 codec The big5 codec maps the following characters as cp950 does rather than conforming Unicode.org's that maps to 0xFFFD. BIG5 Unicode Description 0xA15A 0x2574 SPACING UNDERSCORE 0xA1C3 0xFFE3 SPACING HEAVY OVERSCORE 0xA1C5 0x02CD SPACING HEAVY UNDERSCORE 0xA1FE 0xFF0F LT DIAG UP RIGHT TO LOW LEFT 0xA240 0xFF3C LT DIAG UP LEFT TO LOW RIGHT 0xA2CC 0x5341 HANGZHOU NUMERAL TEN 0xA2CE 0x5345 HANGZHOU NUMERAL THIRTY Because unicode 0x5341, 0x5345, 0xFF0F, 0xFF3C is mapped to another big5 codes already, a roundtrip compatibility is not guaranteed for them. 2) cp932 codec To conform to Windows's real mapping, cp932 codec maps the following codepoints in addition of the official cp932 mapping. CP932 Unicode Description 0x80 0x80 UNDEFINED 0xA0 0xF8F0 UNDEFINED 0xFD 0xF8F1 UNDEFINED 0xFE 0xF8F2 UNDEFINED 0xFF 0xF8F3 UNDEFINED 3) euc-jisx0213 codec The euc-jisx0213 codec maps JIS X 0213 Plane 1 code 0x2140 into unicode U+FF3C instead of U+005C as on unicode.org's mapping. Because euc-jisx0213 has REVERSE SOLIDUS on 0x5c already and A140 is shown as a full width character, mapping to U+FF3C can make more sense. The euc-jisx0213 codec is enabled to decode JIS X 0212 codes on codeset 2. Because JIS X 0212 and JIS X 0213 Plane 2 don't have overlapped by each other, it doesn't bother standard conformations (and JIS X 0213 Plane 2 is intended to use so.) On encoding sessions, the codec will try to encode kanji characters in this order: JIS X 0213 Plane 1 -> JIS X 0213 Plane 2 -> JIS X 0212 4) euc-jp codec The euc-jp codec is a compatibility instance on these points: - U+FF3C FULLWIDTH REVERSE SOLIDUS is mapped to EUC-JP A1C0 (vice versa) - U+00A5 YEN SIGN is mapped to EUC-JP 0x5c. (one way) - U+203E OVERLINE is mapped to EUC-JP 0x7e. (one way) 5) shift-jis codec The shift-jis codec is mapping 0x20-0x7e area to U+20-U+7E directly instead of using JIS X 0201 for compatibility. The differences are: - U+005C REVERSE SOLIDUS is mapped to SHIFT-JIS 0x5c. - U+007E TILDE is mapped to SHIFT-JIS 0x7e. - U+FF3C FULL-WIDTH REVERSE SOLIDUS is mapped to SHIFT-JIS 815f. --- NEW FILE: _big5.c --- /* * _big5.c: the Big5 codec * * Written by Hye-Shik Chang * $CJKCodecs: _big5.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" ENCMAP(big5) DECMAP(big5) ENCODER(big5) { while (inleft > 0) { Py_UNICODE c = **inbuf; DBCHAR code; if (c < 0x80) { RESERVE_OUTBUF(1) **outbuf = c; NEXT(1, 1) continue; } UCS4INVALID(c) RESERVE_OUTBUF(2) TRYMAP_ENC(big5, code, c); else return 1; (*outbuf)[0] = code >> 8; (*outbuf)[1] = code & 0xFF; NEXT(1, 2) } return 0; } DECODER(big5) { while (inleft > 0) { unsigned char c = IN1; RESERVE_OUTBUF(1) if (c < 0x80) { OUT1(c) NEXT(1, 1) continue; } RESERVE_INBUF(2) TRYMAP_DEC(big5, **outbuf, c, IN2) { NEXT(2, 1) } else return 2; } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(big5) MAPOPEN(zh_TW) IMPORTMAP_ENCDEC(big5) MAPCLOSE() END_CODEC_REGISTRY(big5) --- NEW FILE: _cp932.c --- /* * _cp932.c: the CP932 codec * * Written by Hye-Shik Chang * $CJKCodecs: _cp932.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" ENCMAP(jisxcommon) ENCMAP(cp932ext) DECMAP(jisx0208) DECMAP(cp932ext) ENCODER(cp932) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; unsigned char c1, c2; if (c <= 0x80) { WRITE1(c) NEXT(1, 1) continue; } else if (c >= 0xff61 && c <= 0xff9f) { WRITE1(c - 0xfec0) NEXT(1, 1) continue; } else if (c >= 0xf8f0 && c <= 0xf8f3) { /* Windows compatability */ RESERVE_OUTBUF(1) if (c == 0xf8f0) OUT1(0xa0) else OUT1(c - 0xfef1 + 0xfd) NEXT(1, 1) continue; } UCS4INVALID(c) RESERVE_OUTBUF(2) TRYMAP_ENC(cp932ext, code, c) { OUT1(code >> 8) OUT2(code & 0xff) } else TRYMAP_ENC(jisxcommon, code, c) { if (code & 0x8000) /* MSB set: JIS X 0212 */ return 1; /* JIS X 0208 */ c1 = code >> 8; c2 = code & 0xff; c2 = (((c1 - 0x21) & 1) ? 0x5e : 0) + (c2 - 0x21); c1 = (c1 - 0x21) >> 1; OUT1(c1 < 0x1f ? c1 + 0x81 : c1 + 0xc1) OUT2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41) } else if (c >= 0xe000 && c < 0xe758) { /* User-defined area */ c1 = (Py_UNICODE)(c - 0xe000) / 188; c2 = (Py_UNICODE)(c - 0xe000) % 188; OUT1(c1 + 0xf0) OUT2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41) } else return 1; NEXT(1, 2) } return 0; } DECODER(cp932) { while (inleft > 0) { unsigned char c = IN1, c2; RESERVE_OUTBUF(1) if (c <= 0x80) { OUT1(c) NEXT(1, 1) continue; } else if (c >= 0xa0 && c <= 0xdf) { if (c == 0xa0) OUT1(0xf8f0) /* half-width katakana */ else OUT1(0xfec0 + c) NEXT(1, 1) continue; } else if (c >= 0xfd/* && c <= 0xff*/) { /* Windows compatibility */ OUT1(0xf8f1 - 0xfd + c) NEXT(1, 1) continue; } RESERVE_INBUF(2) c2 = IN2; TRYMAP_DEC(cp932ext, **outbuf, c, c2); else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)) { if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc) return 2; c = (c < 0xe0 ? c - 0x81 : c - 0xc1); c2 = (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41); c = (2 * c + (c2 < 0x5e ? 0 : 1) + 0x21); c2 = (c2 < 0x5e ? c2 : c2 - 0x5e) + 0x21; TRYMAP_DEC(jisx0208, **outbuf, c, c2); else return 2; } else if (c >= 0xf0 && c <= 0xf9) { if ((c2 >= 0x40 && c2 <= 0x7e) || (c2 >= 0x80 && c2 <= 0xfc)) OUT1(0xe000 + 188 * (c - 0xf0) + (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41)) else return 2; } else return 2; NEXT(2, 1) } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(cp932) MAPOPEN(ja_JP) IMPORTMAP_DEC(jisx0208) IMPORTMAP_ENCDEC(cp932ext) IMPORTMAP_ENC(jisxcommon) MAPCLOSE() END_CODEC_REGISTRY(cp932) --- NEW FILE: _cp949.c --- /* * _cp949.c: the CP949 codec * * Written by Hye-Shik Chang * $CJKCodecs: _cp949.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" ENCMAP(cp949) DECMAP(ksx1001) DECMAP(cp949ext) ENCODER(cp949) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; if (c < 0x80) { WRITE1(c) NEXT(1, 1) continue; } UCS4INVALID(c) RESERVE_OUTBUF(2) TRYMAP_ENC(cp949, code, c); else return 1; OUT1((code >> 8) | 0x80) if (code & 0x8000) OUT2(code & 0xFF) /* MSB set: CP949 */ else OUT2((code & 0xFF) | 0x80) /* MSB unset: ks x 1001 */ NEXT(1, 2) } return 0; } DECODER(cp949) { while (inleft > 0) { unsigned char c = IN1; RESERVE_OUTBUF(1) if (c < 0x80) { OUT1(c) NEXT(1, 1) continue; } RESERVE_INBUF(2) TRYMAP_DEC(ksx1001, **outbuf, c ^ 0x80, IN2 ^ 0x80); else TRYMAP_DEC(cp949ext, **outbuf, c, IN2); else return 2; NEXT(2, 1) } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(cp949) MAPOPEN(ko_KR) IMPORTMAP_DEC(ksx1001) IMPORTMAP_DEC(cp949ext) IMPORTMAP_ENC(cp949) MAPCLOSE() END_CODEC_REGISTRY(cp949) --- NEW FILE: _cp950.c --- /* * _cp950.c: the CP950 codec * * Written by Hye-Shik Chang * $CJKCodecs: _cp950.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" ENCMAP(big5) ENCMAP(cp950ext) DECMAP(big5) DECMAP(cp950ext) ENCODER(cp950) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; if (c < 0x80) { WRITE1(c) NEXT(1, 1) continue; } UCS4INVALID(c) RESERVE_OUTBUF(2) TRYMAP_ENC(cp950ext, code, c); else TRYMAP_ENC(big5, code, c); else return 1; OUT1(code >> 8) OUT2(code & 0xFF) NEXT(1, 2) } return 0; } DECODER(cp950) { while (inleft > 0) { unsigned char c = IN1; RESERVE_OUTBUF(1) if (c < 0x80) { OUT1(c) NEXT(1, 1) continue; } RESERVE_INBUF(2) TRYMAP_DEC(cp950ext, **outbuf, c, IN2); else TRYMAP_DEC(big5, **outbuf, c, IN2); else return 2; NEXT(2, 1) } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(cp950) MAPOPEN(zh_TW) IMPORTMAP_ENCDEC(big5) IMPORTMAP_ENCDEC(cp950ext) MAPCLOSE() END_CODEC_REGISTRY(cp950) --- NEW FILE: _euc_jisx0213.c --- /* * _euc_jisx0213.c: the EUC-JISX0213 codec * * Written by Hye-Shik Chang * $CJKCodecs: _euc_jisx0213.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #define USING_BINARY_PAIR_SEARCH #include "codeccommon.h" #include "map_jisx0213_pairs.h" ENCMAP(jisxcommon) DECMAP(jisx0208) DECMAP(jisx0212) ENCMAP(jisx0213_bmp) DECMAP(jisx0213_1_bmp) DECMAP(jisx0213_2_bmp) ENCMAP(jisx0213_emp) DECMAP(jisx0213_1_emp) DECMAP(jisx0213_2_emp) #define EMPBASE 0x20000 ENCODER(euc_jisx0213) { while (inleft > 0) { ucs4_t c = IN1; DBCHAR code; int insize; if (c < 0x80) { WRITE1(c) NEXT(1, 1) continue; } DECODE_SURROGATE(c) insize = GET_INSIZE(c); if (c <= 0xFFFF) { /* try 0213 first because it might have MULTIC */ TRYMAP_ENC(jisx0213_bmp, code, c) { if (code == MULTIC) { if (inleft < 2) { if (flags & MBENC_FLUSH) { code = find_pairencmap(c, 0, jisx0213_pairencmap, JISX0213_ENCPAIRS); if (code == DBCINV) return 1; } else return MBERR_TOOFEW; } else { code = find_pairencmap(c, (*inbuf)[1], jisx0213_pairencmap, JISX0213_ENCPAIRS); if (code == DBCINV) { code = find_pairencmap(c, 0, jisx0213_pairencmap, JISX0213_ENCPAIRS); if (code == DBCINV) return 1; } else insize = 2; } } } else TRYMAP_ENC(jisxcommon, code, c); else if (c >= 0xff61 && c <= 0xff9f) { /* JIS X 0201 half-width katakana */ WRITE2(0x8e, c - 0xfec0) NEXT(1, 2) continue; } else if (c == 0xff3c) /* F/W REVERSE SOLIDUS (see NOTES.euc-jisx0213) */ code = 0x2140; else if (c == 0xff5e) /* F/W TILDE (see NOTES.euc-jisx0213) */ code = 0x2232; else return 1; } else if (c >> 16 == EMPBASE >> 16) { TRYMAP_ENC(jisx0213_emp, code, c & 0xffff); else return insize; } else return insize; if (code & 0x8000) { /* Codeset 2 */ WRITE3(0x8f, code >> 8, (code & 0xFF) | 0x80) NEXT(insize, 3) } else { /* Codeset 1 */ WRITE2((code >> 8) | 0x80, (code & 0xFF) | 0x80) NEXT(insize, 2) } } return 0; } DECODER(euc_jisx0213) { while (inleft > 0) { unsigned char c = IN1; ucs4_t code; RESERVE_OUTBUF(1) if (c < 0x80) { OUT1(c) NEXT(1, 1) continue; } if (c == 0x8e) { /* JIS X 0201 half-width katakana */ unsigned char c2; RESERVE_INBUF(2) c2 = IN2; if (c2 >= 0xa1 && c2 <= 0xdf) { OUT1(0xfec0 + c2) NEXT(2, 1) } else return 2; } else if (c == 0x8f) { unsigned char c2, c3; RESERVE_INBUF(3) c2 = IN2 ^ 0x80; c3 = IN3 ^ 0x80; /* JIS X 0213 Plane 2 or JIS X 0212 (see NOTES.euc-jisx0213) */ TRYMAP_DEC(jisx0213_2_bmp, **outbuf, c2, c3) ; else TRYMAP_DEC(jisx0213_2_emp, code, c2, c3) { PUTUCS4(EMPBASE | code) NEXT_IN(3) continue; } else TRYMAP_DEC(jisx0212, **outbuf, c2, c3) ; else return 3; NEXT(3, 1) } else { unsigned char c2; RESERVE_INBUF(2) c ^= 0x80; c2 = IN2 ^ 0x80; /* JIS X 0213 Plane 1 */ if (c == 0x21 && c2 == 0x40) **outbuf = 0xff3c; else if (c == 0x22 && c2 == 0x32) **outbuf = 0xff5e; else TRYMAP_DEC(jisx0208, **outbuf, c, c2); else TRYMAP_DEC(jisx0213_1_bmp, **outbuf, c, c2); else TRYMAP_DEC(jisx0213_1_emp, code, c, c2) { PUTUCS4(EMPBASE | code) NEXT_IN(2) continue; } else TRYMAP_DEC(jisx0213_pair, code, c, c2) { WRITE2(code >> 16, code & 0xffff) NEXT(2, 2) continue; } else return 2; NEXT(2, 1) } } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(euc_jisx0213) MAPOPEN(ja_JP) IMPORTMAP_ENC(jisxcommon) IMPORTMAP_DEC(jisx0208) IMPORTMAP_DEC(jisx0212) IMPORTMAP_ENC(jisx0213_bmp) IMPORTMAP_DEC(jisx0213_1_bmp) IMPORTMAP_DEC(jisx0213_2_bmp) IMPORTMAP_ENC(jisx0213_emp) IMPORTMAP_DEC(jisx0213_1_emp) IMPORTMAP_DEC(jisx0213_2_emp) MAPCLOSE() END_CODEC_REGISTRY(euc_jisx0213) --- NEW FILE: _euc_jp.c --- /* * _euc_jp.c: the EUC-JP codec * * Written by Hye-Shik Chang * $CJKCodecs: _euc_jp.c,v 1.5 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" ENCMAP(jisxcommon) DECMAP(jisx0208) DECMAP(jisx0212) ENCODER(euc_jp) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; if (c < 0x80) { WRITE1(c) NEXT(1, 1) continue; } UCS4INVALID(c) TRYMAP_ENC(jisxcommon, code, c); else if (c >= 0xff61 && c <= 0xff9f) { /* JIS X 0201 half-width katakana */ WRITE2(0x8e, c - 0xfec0) NEXT(1, 2) continue; } #ifndef STRICT_BUILD else if (c == 0xff3c) /* FULL-WIDTH REVERSE SOLIDUS */ code = 0x2140; else if (c == 0xa5) { /* YEN SIGN */ WRITE1(0x5c); NEXT(1, 1) continue; } else if (c == 0x203e) { /* OVERLINE */ WRITE1(0x7e); NEXT(1, 1) continue; } #endif else return 1; if (code & 0x8000) { /* JIS X 0212 */ WRITE3(0x8f, code >> 8, (code & 0xFF) | 0x80) NEXT(1, 3) } else { /* JIS X 0208 */ WRITE2((code >> 8) | 0x80, (code & 0xFF) | 0x80) NEXT(1, 2) } } return 0; } DECODER(euc_jp) { while (inleft > 0) { unsigned char c = IN1; RESERVE_OUTBUF(1) if (c < 0x80) { OUT1(c) NEXT(1, 1) continue; } if (c == 0x8e) { /* JIS X 0201 half-width katakana */ unsigned char c2; RESERVE_INBUF(2) c2 = IN2; if (c2 >= 0xa1 && c2 <= 0xdf) { OUT1(0xfec0 + c2) NEXT(2, 1) } else return 2; } else if (c == 0x8f) { unsigned char c2, c3; RESERVE_INBUF(3) c2 = IN2; c3 = IN3; /* JIS X 0212 */ TRYMAP_DEC(jisx0212, **outbuf, c2 ^ 0x80, c3 ^ 0x80) { NEXT(3, 1) } else return 3; } else { unsigned char c2; RESERVE_INBUF(2) c2 = IN2; /* JIS X 0208 */ #ifndef STRICT_BUILD if (c == 0xa1 && c2 == 0xc0) /* FULL-WIDTH REVERSE SOLIDUS */ **outbuf = 0xff3c; else #endif TRYMAP_DEC(jisx0208, **outbuf, c ^ 0x80, c2 ^ 0x80) ; else return 2; NEXT(2, 1) } } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(euc_jp) MAPOPEN(ja_JP) IMPORTMAP_DEC(jisx0208) IMPORTMAP_DEC(jisx0212) IMPORTMAP_ENC(jisxcommon) MAPCLOSE() END_CODEC_REGISTRY(euc_jp) --- NEW FILE: _euc_kr.c --- /* * _euc_kr.c: the EUC-KR codec * * Written by Hye-Shik Chang * $CJKCodecs: _euc_kr.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" ENCMAP(cp949) DECMAP(ksx1001) ENCODER(euc_kr) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; if (c < 0x80) { WRITE1(c) NEXT(1, 1) continue; } UCS4INVALID(c) RESERVE_OUTBUF(2) TRYMAP_ENC(cp949, code, c); else return 1; if (code & 0x8000) /* MSB set: CP949 */ return 1; OUT1((code >> 8) | 0x80) OUT2((code & 0xFF) | 0x80) NEXT(1, 2) } return 0; } DECODER(euc_kr) { while (inleft > 0) { unsigned char c = IN1; RESERVE_OUTBUF(1) if (c < 0x80) { OUT1(c) NEXT(1, 1) continue; } RESERVE_INBUF(2) TRYMAP_DEC(ksx1001, **outbuf, c ^ 0x80, IN2 ^ 0x80) { NEXT(2, 1) } else return 2; } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(euc_kr) MAPOPEN(ko_KR) IMPORTMAP_DEC(ksx1001) IMPORTMAP_ENC(cp949) MAPCLOSE() END_CODEC_REGISTRY(euc_kr) --- NEW FILE: _gb18030.c --- /* * _gb18030.c: the GB18030 codec * * Written by Hye-Shik Chang * $CJKCodecs: _gb18030.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" #include "tweak_gbk.h" #include "map_gb18030uni.h" ENCMAP(gbcommon) ENCMAP(gb18030ext) DECMAP(gb2312) DECMAP(gbkext) DECMAP(gb18030ext) ENCODER(gb18030) { while (inleft > 0) { ucs4_t c = IN1; DBCHAR code; if (c < 0x80) { WRITE1(c) NEXT(1, 1) continue; } DECODE_SURROGATE(c) if (c > 0x10FFFF) #if Py_UNICODE_SIZE == 2 return 2; /* surrogates pair */ #else return 1; #endif else if (c >= 0x10000) { ucs4_t tc = c - 0x10000; RESERVE_OUTBUF(4) OUT4((unsigned char)(tc % 10) + 0x30) tc /= 10; OUT3((unsigned char)(tc % 126) + 0x81) tc /= 126; OUT2((unsigned char)(tc % 10) + 0x30) tc /= 10; OUT1((unsigned char)(tc + 0x90)) #if Py_UNICODE_SIZE == 2 NEXT(2, 4) /* surrogates pair */ #else NEXT(1, 4) #endif continue; } RESERVE_OUTBUF(2) GBK_PREENCODE(c, code) else TRYMAP_ENC(gbcommon, code, c); else TRYMAP_ENC(gb18030ext, code, c); else { const struct _gb18030_to_unibmp_ranges *utrrange; RESERVE_OUTBUF(4) for (utrrange = gb18030_to_unibmp_ranges; utrrange->first != 0; utrrange++) if (utrrange->first <= c && c <= utrrange->last) { Py_UNICODE tc; tc = c - utrrange->first + utrrange->base; OUT4((unsigned char)(tc % 10) + 0x30) tc /= 10; OUT3((unsigned char)(tc % 126) + 0x81) tc /= 126; OUT2((unsigned char)(tc % 10) + 0x30) tc /= 10; OUT1((unsigned char)tc + 0x81) NEXT(1, 4) break; } if (utrrange->first == 0) { PyErr_SetString(PyExc_RuntimeError, "unicode mapping invalid"); return 1; } continue; } OUT1((code >> 8) | 0x80) if (code & 0x8000) OUT2((code & 0xFF)) /* MSB set: GBK or GB18030ext */ else OUT2((code & 0xFF) | 0x80) /* MSB unset: GB2312 */ NEXT(1, 2) } return 0; } DECODER(gb18030) { while (inleft > 0) { unsigned char c = IN1, c2; RESERVE_OUTBUF(1) if (c < 0x80) { OUT1(c) NEXT(1, 1) continue; } RESERVE_INBUF(2) c2 = IN2; if (c2 >= 0x30 && c2 <= 0x39) { /* 4 bytes seq */ const struct _gb18030_to_unibmp_ranges *utr; unsigned char c3, c4; ucs4_t lseq; RESERVE_INBUF(4) c3 = IN3; c4 = IN4; if (c < 0x81 || c3 < 0x81 || c4 < 0x30 || c4 > 0x39) return 4; c -= 0x81; c2 -= 0x30; c3 -= 0x81; c4 -= 0x30; if (c < 4) { /* U+0080 - U+FFFF */ lseq = ((ucs4_t)c * 10 + c2) * 1260 + (ucs4_t)c3 * 10 + c4; if (lseq < 39420) { for (utr = gb18030_to_unibmp_ranges; lseq >= (utr + 1)->base; utr++) ; OUT1(utr->first - utr->base + lseq) NEXT(4, 1) continue; } } else if (c >= 15) { /* U+10000 - U+10FFFF */ lseq = 0x10000 + (((ucs4_t)c-15) * 10 + c2) * 1260 + (ucs4_t)c3 * 10 + c4; if (lseq <= 0x10FFFF) { PUTUCS4(lseq); NEXT_IN(4) continue; } } return 4; } GBK_PREDECODE(c, c2, **outbuf) else TRYMAP_DEC(gb2312, **outbuf, c ^ 0x80, c2 ^ 0x80); else TRYMAP_DEC(gbkext, **outbuf, c, c2); else TRYMAP_DEC(gb18030ext, **outbuf, c, c2); else return 2; NEXT(2, 1) } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(gb18030) MAPOPEN(zh_CN) IMPORTMAP_DEC(gb2312) IMPORTMAP_DEC(gbkext) IMPORTMAP_ENC(gbcommon) IMPORTMAP_ENCDEC(gb18030ext) MAPCLOSE() END_CODEC_REGISTRY(gb18030) --- NEW FILE: _gb2312.c --- /* * _gb2312.c: the GB2312 codec * * Written by Hye-Shik Chang * $CJKCodecs: _gb2312.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" ENCMAP(gbcommon) DECMAP(gb2312) ENCODER(gb2312) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; if (c < 0x80) { WRITE1(c) NEXT(1, 1) continue; } UCS4INVALID(c) RESERVE_OUTBUF(2) TRYMAP_ENC(gbcommon, code, c); else return 1; if (code & 0x8000) /* MSB set: GBK */ return 1; OUT1((code >> 8) | 0x80) OUT2((code & 0xFF) | 0x80) NEXT(1, 2) } return 0; } DECODER(gb2312) { while (inleft > 0) { unsigned char c = **inbuf; RESERVE_OUTBUF(1) if (c < 0x80) { OUT1(c) NEXT(1, 1) continue; } RESERVE_INBUF(2) TRYMAP_DEC(gb2312, **outbuf, c ^ 0x80, IN2 ^ 0x80) { NEXT(2, 1) } else return 2; } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(gb2312) MAPOPEN(zh_CN) IMPORTMAP_DEC(gb2312) IMPORTMAP_ENC(gbcommon) MAPCLOSE() END_CODEC_REGISTRY(gb2312) --- NEW FILE: _gbk.c --- /* * _gbk.c: the GBK codec * * Written by Hye-Shik Chang * $CJKCodecs: _gbk.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" #include "tweak_gbk.h" ENCMAP(gbcommon) DECMAP(gb2312) DECMAP(gbkext) ENCODER(gbk) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; if (c < 0x80) { WRITE1(c) NEXT(1, 1) continue; } UCS4INVALID(c) RESERVE_OUTBUF(2) GBK_PREENCODE(c, code) else TRYMAP_ENC(gbcommon, code, c); else return 1; OUT1((code >> 8) | 0x80) if (code & 0x8000) OUT2((code & 0xFF)) /* MSB set: GBK */ else OUT2((code & 0xFF) | 0x80) /* MSB unset: GB2312 */ NEXT(1, 2) } return 0; } DECODER(gbk) { while (inleft > 0) { unsigned char c = IN1; RESERVE_OUTBUF(1) if (c < 0x80) { OUT1(c) NEXT(1, 1) continue; } RESERVE_INBUF(2) GBK_PREDECODE(c, IN2, **outbuf) else TRYMAP_DEC(gb2312, **outbuf, c ^ 0x80, IN2 ^ 0x80); else TRYMAP_DEC(gbkext, **outbuf, c, IN2); else return 2; NEXT(2, 1) } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(gbk) MAPOPEN(zh_CN) IMPORTMAP_DEC(gb2312) IMPORTMAP_DEC(gbkext) IMPORTMAP_ENC(gbcommon) MAPCLOSE() END_CODEC_REGISTRY(gbk) --- NEW FILE: _hz.c --- /* * _hz.c: the HZ codec (RFC1843) * * Written by Hye-Shik Chang * $CJKCodecs: _hz.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" ENCMAP(gbcommon) DECMAP(gb2312) #define HAVE_ENCODER_INIT ENCODER_INIT(hz) { state->i = 0; return 0; } #define HAVE_ENCODER_RESET ENCODER_RESET(hz) { if (state->i != 0) { WRITE2('~', '}') state->i = 0; NEXT_OUT(2) } return 0; } ENCODER(hz) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; if (c < 0x80) { if (state->i == 0) { WRITE1(c) NEXT(1, 1) } else { WRITE3('~', '}', c) NEXT(1, 3) state->i = 0; } continue; } UCS4INVALID(c) TRYMAP_ENC(gbcommon, code, c); else return 1; if (code & 0x8000) /* MSB set: GBK */ return 1; if (state->i == 0) { WRITE4('~', '{', code >> 8, code & 0xff) NEXT(1, 4) state->i = 1; } else { WRITE2(code >> 8, code & 0xff) NEXT(1, 2) } } return 0; } #define HAVE_DECODER_INIT DECODER_INIT(hz) { state->i = 0; return 0; } #define HAVE_DECODER_RESET DECODER_RESET(hz) { state->i = 0; return 0; } DECODER(hz) { while (inleft > 0) { unsigned char c = IN1; if (c == '~') { unsigned char c2 = IN2; RESERVE_INBUF(2) if (c2 == '~') { WRITE1('~') NEXT(2, 1) continue; } else if (c2 == '{' && state->i == 0) state->i = 1; /* set GB */ else if (c2 == '}' && state->i == 1) state->i = 0; /* set ASCII */ else if (c2 == '\n') ; /* line-continuation */ else return 2; NEXT(2, 0); continue; } if (c & 0x80) return 1; if (state->i == 0) { /* ASCII mode */ WRITE1(c) NEXT(1, 1) } else { /* GB mode */ RESERVE_INBUF(2) RESERVE_OUTBUF(1) TRYMAP_DEC(gb2312, **outbuf, c, IN2) { NEXT(2, 1) } else return 2; } } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(hz) MAPOPEN(zh_CN) IMPORTMAP_DEC(gb2312) IMPORTMAP_ENC(gbcommon) MAPCLOSE() END_CODEC_REGISTRY(hz) --- NEW FILE: _iso2022_jp.c --- /* * _iso2022_jp.c: the ISO-2022-JP codec (RFC1468) * * Written by Hye-Shik Chang * $CJKCodecs: _iso2022_jp.c,v 1.7 2003/12/31 05:46:55 perky Exp $ */ #define ISO2022_DESIGNATIONS \ CHARSET_ASCII, CHARSET_JISX0201_R, CHARSET_JISX0208, CHARSET_JISX0208_O #define ISO2022_NO_SHIFT #define ISO2022_USE_JISX0208EXT #include "codeccommon.h" #include "iso2022common.h" #include "alg_jisx0201.h" ENCMAP(jisxcommon) DECMAP(jisx0208) #define HAVE_ENCODER_INIT ENCODER_INIT(iso2022_jp) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_ENCODER_RESET ENCODER_RESET(iso2022_jp) { if (STATE_GETG0(state) != CHARSET_ASCII) { RESERVE_OUTBUF(3) WRITE3(ESC, '(', 'B') STATE_SETG0(state, CHARSET_ASCII) NEXT_OUT(3) } return 0; } /* ISO-2022-JP changes designations instead of shifting-out */ ENCODER(iso2022_jp) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; if (c < 0x80) { switch (STATE_GETG0(state)) { case CHARSET_ASCII: WRITE1(c) NEXT(1, 1) break; case CHARSET_JISX0201_R: JISX0201_R_ENCODE(c, code) else { /* FALLTHROUGH (yay!) */ default: WRITE3(ESC, '(', 'B') NEXT_OUT(3) STATE_SETG0(state, CHARSET_ASCII) code = c; } WRITE1(code) NEXT(1, 1) break; } if (c == '\n') STATE_CLEARFLAG(state, F_SHIFTED) } else UCS4INVALID(c) else { unsigned char charset; charset = STATE_GETG0(state); if (charset == CHARSET_JISX0201_R) { code = DBCINV; JISX0201_R_ENCODE(c, code) if (code != DBCINV) { WRITE1(code) NEXT(1, 1) continue; } } TRYMAP_ENC(jisxcommon, code, c) { if (code & 0x8000) /* MSB set: JIS X 0212 */ return 1; jisx0208encode: if (charset != CHARSET_JISX0208) { WRITE3(ESC, '$', 'B') STATE_SETG0(state, CHARSET_JISX0208) NEXT_OUT(3) } WRITE2(code >> 8, code & 0xff) NEXT(1, 2) } else if (c == 0xff3c) { /* FULL-WIDTH REVERSE SOLIDUS */ code = 0x2140; goto jisx0208encode; } else { JISX0201_R_ENCODE(c, code) else return 1; /* if (charset == CHARSET_JISX0201_R) : already checked */ WRITE4(ESC, '(', 'J', code) STATE_SETG0(state, CHARSET_JISX0201_R) NEXT(1, 4) } } } return 0; } #define HAVE_DECODER_INIT DECODER_INIT(iso2022_jp) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_DECODER_RESET DECODER_RESET(iso2022_jp) { STATE_CLEARFLAG(state, F_SHIFTED) return 0; } DECODER(iso2022_jp) { ISO2022_LOOP_BEGIN unsigned char charset, c2; ISO2022_GETCHARSET(charset, c) if (charset & CHARSET_DOUBLEBYTE) { /* all double byte character sets are in JIS X 0208 here. * this means that we don't distinguish :1978 from :1983. */ RESERVE_INBUF(2) RESERVE_OUTBUF(1) c2 = IN2; if (c == 0x21 && c2 == 0x40) { /* FULL-WIDTH REVERSE SOLIDUS */ **outbuf = 0xff3c; NEXT(2, 1) } else TRYMAP_DEC(jisx0208, **outbuf, c, c2) { NEXT(2, 1) } else return 2; } else if (charset == CHARSET_ASCII) { RESERVE_OUTBUF(1) OUT1(c) NEXT(1, 1) } else if (charset == CHARSET_JISX0201_R) { RESERVE_OUTBUF(1) JISX0201_R_DECODE(c, **outbuf) else return 1; NEXT(1, 1) } else return MBERR_INTERNAL; ISO2022_LOOP_END return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(iso2022_jp) MAPOPEN(ja_JP) IMPORTMAP_DEC(jisx0208) IMPORTMAP_ENC(jisxcommon) MAPCLOSE() END_CODEC_REGISTRY(iso2022_jp) --- NEW FILE: _iso2022_jp_1.c --- /* * _iso2022_jp_1.c: the ISO-2022-JP-1 codec (RFC2237) * * Written by Hye-Shik Chang * $CJKCodecs: _iso2022_jp_1.c,v 1.8 2003/12/31 05:46:55 perky Exp $ */ #define ISO2022_DESIGNATIONS \ CHARSET_ASCII, CHARSET_JISX0201_R, CHARSET_JISX0208, \ CHARSET_JISX0208_O, CHARSET_JISX0212 #define ISO2022_NO_SHIFT #define ISO2022_USE_JISX0208EXT #include "codeccommon.h" #include "iso2022common.h" #include "alg_jisx0201.h" ENCMAP(jisxcommon) DECMAP(jisx0208) DECMAP(jisx0212) #define HAVE_ENCODER_INIT ENCODER_INIT(iso2022_jp_1) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_ENCODER_RESET ENCODER_RESET(iso2022_jp_1) { if (STATE_GETG0(state) != CHARSET_ASCII) { RESERVE_OUTBUF(3) WRITE3(ESC, '(', 'B') STATE_SETG0(state, CHARSET_ASCII) NEXT_OUT(3) } return 0; } /* ISO-2022-JP-1 changes designations instead of shifting-out */ ENCODER(iso2022_jp_1) { while (inleft > 0) { Py_UNICODE c = **inbuf; DBCHAR code; if (c < 0x80) { switch (STATE_GETG0(state)) { case CHARSET_ASCII: WRITE1(c) NEXT(1, 1) break; case CHARSET_JISX0201_R: JISX0201_R_ENCODE(c, code) else { /* FALLTHROUGH (yay!) */ default: WRITE3(ESC, '(', 'B') NEXT_OUT(3) STATE_SETG0(state, CHARSET_ASCII) code = c; } WRITE1(code) NEXT(1, 1) break; } if (c == '\n') STATE_CLEARFLAG(state, F_SHIFTED) } else UCS4INVALID(c) else { unsigned char charset; charset = STATE_GETG0(state); if (charset == CHARSET_JISX0201_R) { code = DBCINV; JISX0201_R_ENCODE(c, code) if (code != DBCINV) { WRITE1(code) NEXT(1, 1) continue; } } TRYMAP_ENC(jisxcommon, code, c) { if (code & 0x8000) { /* MSB set: JIS X 0212 */ if (charset != CHARSET_JISX0212) { WRITE4(ESC, '$', '(', 'D') STATE_SETG0(state, CHARSET_JISX0212) NEXT_OUT(4) } WRITE2((code >> 8) & 0x7f, code & 0x7f) } else { /* MSB unset: JIS X 0208 */ jisx0208encode: if (charset != CHARSET_JISX0208) { WRITE3(ESC, '$', 'B') STATE_SETG0(state, CHARSET_JISX0208) NEXT_OUT(3) } WRITE2(code >> 8, code & 0xff) } NEXT(1, 2) } else if (c == 0xff3c) { /* FULL-WIDTH REVERSE SOLIDUS */ code = 0x2140; goto jisx0208encode; } else { JISX0201_R_ENCODE(c, code) else return 1; /* if (charset == CHARSET_JISX0201_R) : already checked */ WRITE4(ESC, '(', 'J', code) STATE_SETG0(state, CHARSET_JISX0201_R) NEXT(1, 4) } } } return 0; } #define HAVE_DECODER_INIT DECODER_INIT(iso2022_jp_1) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_DECODER_RESET DECODER_RESET(iso2022_jp_1) { STATE_CLEARFLAG(state, F_SHIFTED) return 0; } DECODER(iso2022_jp_1) { ISO2022_LOOP_BEGIN unsigned char charset, c2; ISO2022_GETCHARSET(charset, c) if (charset & CHARSET_DOUBLEBYTE) { RESERVE_INBUF(2) RESERVE_OUTBUF(1) c2 = IN2; if (charset == CHARSET_JISX0208 || charset == CHARSET_JISX0208_O) { if (c == 0x21 && c2 == 0x40) /* FULL-WIDTH REVERSE SOLIDUS */ **outbuf = 0xff3c; else TRYMAP_DEC(jisx0208, **outbuf, c, c2); else return 2; } else if (charset == CHARSET_JISX0212) { TRYMAP_DEC(jisx0212, **outbuf, c, c2); else return 2; } else return MBERR_INTERNAL; NEXT(2, 1) } else if (charset == CHARSET_ASCII) { RESERVE_OUTBUF(1) OUT1(c) NEXT(1, 1) } else if (charset == CHARSET_JISX0201_R) { RESERVE_OUTBUF(1) JISX0201_R_DECODE(c, **outbuf) else return 1; NEXT(1, 1) } else return MBERR_INTERNAL; ISO2022_LOOP_END return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(iso2022_jp_1) MAPOPEN(ja_JP) IMPORTMAP_DEC(jisx0208) IMPORTMAP_DEC(jisx0212) IMPORTMAP_ENC(jisxcommon) MAPCLOSE() END_CODEC_REGISTRY(iso2022_jp_1) --- NEW FILE: _iso2022_jp_2.c --- /* * _iso2022_jp_2.c: the ISO-2022-JP-2 codec (RFC1554) * * Written by Hye-Shik Chang * $CJKCodecs: _iso2022_jp_2.c,v 1.8 2003/12/31 05:46:55 perky Exp $ */ #define ISO2022_DESIGNATIONS \ CHARSET_ASCII, CHARSET_JISX0201_R, CHARSET_JISX0208, \ CHARSET_JISX0208_O, CHARSET_JISX0212, CHARSET_GB2312, \ CHARSET_KSX1001, CHARSET_JISX0212, \ CHARSET_ISO8859_1, CHARSET_ISO8859_7 #define ISO2022_USE_G2_DESIGNATION yo! #define ISO2022_USE_JISX0208EXT #include "codeccommon.h" #include "iso2022common.h" #include "alg_jisx0201.h" #include "alg_iso8859_1.h" #include "alg_iso8859_7.h" ENCMAP(jisxcommon) DECMAP(jisx0208) DECMAP(jisx0212) ENCMAP(cp949) DECMAP(ksx1001) ENCMAP(gbcommon) DECMAP(gb2312) #define HAVE_ENCODER_INIT ENCODER_INIT(iso2022_jp_2) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) STATE_SETG2(state, CHARSET_ASCII) return 0; } #define HAVE_ENCODER_RESET ENCODER_RESET(iso2022_jp_2) { if (STATE_GETG0(state) != CHARSET_ASCII) { WRITE3(ESC, '(', 'B') STATE_SETG0(state, CHARSET_ASCII) NEXT_OUT(3) } return 0; } ENCODER(iso2022_jp_2) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; if (c < 0x80) { switch (STATE_GETG0(state)) { case CHARSET_ASCII: WRITE1(c) NEXT(1, 1) break; case CHARSET_JISX0201_R: JISX0201_R_ENCODE(c, code) else { /* FALLTHROUGH (yay!) */ default: WRITE3(ESC, '(', 'B') NEXT_OUT(3) STATE_SETG0(state, CHARSET_ASCII) code = c; } WRITE1(code) NEXT(1, 1) break; } if (c == '\n') STATE_CLEARFLAG(state, F_SHIFTED) } else UCS4INVALID(c) else { unsigned char charset; charset = STATE_GETG0(state); if (charset == CHARSET_JISX0201_R) { code = DBCINV; JISX0201_R_ENCODE(c, code) if (code != DBCINV) { WRITE1(code) NEXT(1, 1) continue; } } TRYMAP_ENC(jisxcommon, code, c) { if (code & 0x8000) { /* MSB set: JIS X 0212 */ if (charset != CHARSET_JISX0212) { WRITE4(ESC, '$', '(', 'D') STATE_SETG0(state, CHARSET_JISX0212) NEXT_OUT(4) } WRITE2((code >> 8) & 0x7f, code & 0x7f) } else { /* MSB unset: JIS X 0208 */ jisx0208encode: if (charset != CHARSET_JISX0208) { WRITE3(ESC, '$', 'B') STATE_SETG0(state, CHARSET_JISX0208) NEXT_OUT(3) } WRITE2(code >> 8, code & 0xff) } NEXT(1, 2) } else TRYMAP_ENC(cp949, code, c) { if (code & 0x8000) /* MSB set: CP949 */ return 2; if (charset != CHARSET_KSX1001) { WRITE4(ESC, '$', '(', 'C') STATE_SETG0(state, CHARSET_KSX1001) NEXT_OUT(4) } WRITE2(code >> 8, code & 0xff) NEXT(1, 2) } else TRYMAP_ENC(gbcommon, code, c) { if (code & 0x8000) /* MSB set: GBK */ return 2; if (charset != CHARSET_GB2312) { WRITE4(ESC, '$', '(', 'A') STATE_SETG0(state, CHARSET_GB2312) NEXT_OUT(4) } WRITE2(code >> 8, code & 0xff) NEXT(1, 2) } else if (c == 0xff3c) { /* FULL-WIDTH REVERSE SOLIDUS */ code = 0x2140; goto jisx0208encode; } else { JISX0201_R_ENCODE(c, code) else { /* There's no need to try to encode as ISO-8859-1 or * ISO-8859-7 because JIS X 0212 includes them already. */ return 1; } /* if (charset == CHARSET_JISX0201_R) : already checked */ WRITE4(ESC, '(', 'J', code) STATE_SETG0(state, CHARSET_JISX0201_R) NEXT(1, 4) } } } return 0; } #define HAVE_DECODER_INIT DECODER_INIT(iso2022_jp_2) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) STATE_SETG2(state, CHARSET_ASCII) return 0; } #define HAVE_DECODER_RESET DECODER_RESET(iso2022_jp_2) { STATE_CLEARFLAG(state, F_SHIFTED) return 0; } DECODER(iso2022_jp_2) { ISO2022_LOOP_BEGIN unsigned char charset, c2; ISO2022_GETCHARSET(charset, c) if (charset & CHARSET_DOUBLEBYTE) { RESERVE_INBUF(2) RESERVE_OUTBUF(1) c2 = IN2; if (charset == CHARSET_JISX0208 || charset == CHARSET_JISX0208_O) { if (c == 0x21 && c2 == 0x40) /* FULL-WIDTH REVERSE SOLIDUS */ **outbuf = 0xff3c; else TRYMAP_DEC(jisx0208, **outbuf, c, c2); else return 2; } else if (charset == CHARSET_JISX0212) { TRYMAP_DEC(jisx0212, **outbuf, c, c2); else return 2; } else if (charset == CHARSET_KSX1001) { TRYMAP_DEC(ksx1001, **outbuf, c, c2); else return 2; } else if (charset == CHARSET_GB2312) { TRYMAP_DEC(gb2312, **outbuf, c, c2); else return 2; } else return MBERR_INTERNAL; NEXT(2, 1) } else if (charset == CHARSET_ASCII) { RESERVE_OUTBUF(1) OUT1(c) NEXT(1, 1) } else if (charset == CHARSET_JISX0201_R) { RESERVE_OUTBUF(1) JISX0201_R_DECODE(c, **outbuf) else return 1; NEXT(1, 1) } else return MBERR_INTERNAL; ISO2022_LOOP_END return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(iso2022_jp_2) MAPOPEN(ja_JP) IMPORTMAP_DEC(jisx0208) IMPORTMAP_DEC(jisx0212) IMPORTMAP_ENC(jisxcommon) MAPCLOSE() MAPOPEN(ko_KR) IMPORTMAP_ENC(cp949) IMPORTMAP_DEC(ksx1001) MAPCLOSE() MAPOPEN(zh_CN) IMPORTMAP_ENC(gbcommon) IMPORTMAP_DEC(gb2312) MAPCLOSE() END_CODEC_REGISTRY(iso2022_jp_2) --- NEW FILE: _iso2022_jp_3.c --- /* * _iso2022_jp_3.c: the ISO-2022-JP-3 codec (JIS X 0213) * * Written by Hye-Shik Chang * $CJKCodecs: _iso2022_jp_3.c,v 1.7 2003/12/31 05:46:55 perky Exp $ */ #define USING_BINARY_PAIR_SEARCH #define ISO2022_DESIGNATIONS \ CHARSET_ASCII, CHARSET_JISX0208, CHARSET_JISX0213_1, CHARSET_JISX0213_2 #define ISO2022_NO_SHIFT #define ISO2022_USE_JISX0208EXT #include "codeccommon.h" #include "iso2022common.h" #include "map_jisx0213_pairs.h" ENCMAP(jisxcommon) DECMAP(jisx0208) DECMAP(jisx0212) ENCMAP(jisx0213_bmp) DECMAP(jisx0213_1_bmp) DECMAP(jisx0213_2_bmp) ENCMAP(jisx0213_emp) DECMAP(jisx0213_1_emp) DECMAP(jisx0213_2_emp) #define EMPBASE 0x20000 #define HAVE_ENCODER_INIT ENCODER_INIT(iso2022_jp_3) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_ENCODER_RESET ENCODER_RESET(iso2022_jp_3) { if (STATE_GETG0(state) != CHARSET_ASCII) { WRITE3(ESC, '(', 'B') STATE_SETG0(state, CHARSET_ASCII) NEXT_OUT(3) } return 0; } ENCODER(iso2022_jp_3) { while (inleft > 0) { unsigned char charset; ucs4_t c = IN1; DBCHAR code; size_t insize; if (c < 0x80) { switch (STATE_GETG0(state)) { case CHARSET_ASCII: WRITE1(c) NEXT(1, 1) break; default: WRITE4(ESC, '(', 'B', c) STATE_SETG0(state, CHARSET_ASCII) NEXT(1, 4) break; } if (c == '\n') STATE_CLEARFLAG(state, F_SHIFTED) continue; } DECODE_SURROGATE(c) insize = GET_INSIZE(c); if (c <= 0xffff) { TRYMAP_ENC(jisx0213_bmp, code, c) { if (code == MULTIC) { if (inleft < 2) { if (flags & MBENC_FLUSH) { code = find_pairencmap(c, 0, jisx0213_pairencmap, JISX0213_ENCPAIRS); if (code == DBCINV) return 1; } else return MBERR_TOOFEW; } else { code = find_pairencmap(c, IN2, jisx0213_pairencmap, JISX0213_ENCPAIRS); if (code == DBCINV) { code = find_pairencmap(c, 0, jisx0213_pairencmap, JISX0213_ENCPAIRS); if (code == DBCINV) return 1; } else insize = 2; } } } else TRYMAP_ENC(jisxcommon, code, c) { if (code & 0x8000) return 1; /* avoid JIS X 0212 codes */ } else if (c == 0xff3c) /* F/W REVERSE SOLIDUS */ code = 0x2140; else return 1; } else if (c >> 16 == EMPBASE >> 16) { TRYMAP_ENC(jisx0213_emp, code, c & 0xffff); else return insize; } else return insize; charset = STATE_GETG0(state); if (code & 0x8000) { /* MSB set: Plane 2 */ if (charset != CHARSET_JISX0213_2) { WRITE4(ESC, '$', '(', 'P') STATE_SETG0(state, CHARSET_JISX0213_2) NEXT_OUT(4) } WRITE2((code >> 8) & 0x7f, code & 0x7f) } else { /* MSB unset: Plane 1 */ if (charset != CHARSET_JISX0213_1) { WRITE4(ESC, '$', '(', 'O') STATE_SETG0(state, CHARSET_JISX0213_1) NEXT_OUT(4) } WRITE2(code >> 8, code & 0xff) } NEXT(insize, 2) } return 0; } #define HAVE_DECODER_INIT DECODER_INIT(iso2022_jp_3) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_DECODER_RESET DECODER_RESET(iso2022_jp_3) { STATE_CLEARFLAG(state, F_SHIFTED) return 0; } DECODER(iso2022_jp_3) { ISO2022_LOOP_BEGIN unsigned char charset, c2; ucs4_t code; ISO2022_GETCHARSET(charset, c) if (charset & CHARSET_DOUBLEBYTE) { RESERVE_INBUF(2) RESERVE_OUTBUF(1) c2 = IN2; if (charset == CHARSET_JISX0213_1) { if (c == 0x21 && c2 == 0x40) **outbuf = 0xff3c; else TRYMAP_DEC(jisx0208, **outbuf, c, c2); else TRYMAP_DEC(jisx0213_1_bmp, **outbuf, c, c2); else TRYMAP_DEC(jisx0213_1_emp, code, c, c2) { PUTUCS4(EMPBASE | code) NEXT_IN(2) continue; } else TRYMAP_DEC(jisx0213_pair, code, c, c2) { WRITE2(code >> 16, code & 0xffff) NEXT(2, 2) continue; } else return 2; } else if (charset == CHARSET_JISX0213_2) { TRYMAP_DEC(jisx0213_2_bmp, **outbuf, c, c2); else TRYMAP_DEC(jisx0213_2_emp, code, c, c2) { PUTUCS4(EMPBASE | code) NEXT_IN(2) continue; } else return 2; } else return MBERR_INTERNAL; NEXT(2, 1) } else if (charset == CHARSET_ASCII) { RESERVE_OUTBUF(1) OUT1(c) NEXT(1, 1) } else return MBERR_INTERNAL; ISO2022_LOOP_END return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(iso2022_jp_3) MAPOPEN(ja_JP) IMPORTMAP_DEC(jisx0208) IMPORTMAP_DEC(jisx0212) IMPORTMAP_ENC(jisxcommon) IMPORTMAP_ENC(jisx0213_bmp) IMPORTMAP_DEC(jisx0213_1_bmp) IMPORTMAP_DEC(jisx0213_2_bmp) IMPORTMAP_ENC(jisx0213_emp) IMPORTMAP_DEC(jisx0213_1_emp) IMPORTMAP_DEC(jisx0213_2_emp) MAPCLOSE() END_CODEC_REGISTRY(iso2022_jp_3) --- NEW FILE: _iso2022_jp_ext.c --- /* * _iso2022_jp_ext.c: the ISO-2022-JP-EXT codec (RFC2237 + alpha) * * Written by Hye-Shik Chang * $CJKCodecs: _iso2022_jp_ext.c,v 1.3 2003/12/31 05:46:55 perky Exp $ */ #define ISO2022_DESIGNATIONS \ CHARSET_ASCII, CHARSET_JISX0201_R, CHARSET_JISX0201_K, \ CHARSET_JISX0208, CHARSET_JISX0208_O, CHARSET_JISX0212 #define ISO2022_NO_SHIFT #define ISO2022_USE_JISX0208EXT #include "codeccommon.h" #include "iso2022common.h" #include "alg_jisx0201.h" ENCMAP(jisxcommon) DECMAP(jisx0208) DECMAP(jisx0212) #define HAVE_ENCODER_INIT ENCODER_INIT(iso2022_jp_ext) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_ENCODER_RESET ENCODER_RESET(iso2022_jp_ext) { if (STATE_GETG0(state) != CHARSET_ASCII) { RESERVE_OUTBUF(3) WRITE3(ESC, '(', 'B') STATE_SETG0(state, CHARSET_ASCII) NEXT_OUT(3) } return 0; } ENCODER(iso2022_jp_ext) { while (inleft > 0) { Py_UNICODE c = **inbuf; DBCHAR code; if (c < 0x80) { switch (STATE_GETG0(state)) { case CHARSET_ASCII: WRITE1(c) NEXT(1, 1) break; case CHARSET_JISX0201_R: JISX0201_R_ENCODE(c, code) else { /* FALLTHROUGH (yay!) */ default: WRITE3(ESC, '(', 'B') NEXT_OUT(3) STATE_SETG0(state, CHARSET_ASCII) code = c; } WRITE1(code) NEXT(1, 1) break; } if (c == '\n') STATE_CLEARFLAG(state, F_SHIFTED) } else UCS4INVALID(c) else { unsigned char charset; charset = STATE_GETG0(state); if (charset == CHARSET_JISX0201_R) { code = DBCINV; JISX0201_R_ENCODE(c, code) if (code != DBCINV) { WRITE1(code) NEXT(1, 1) continue; } } TRYMAP_ENC(jisxcommon, code, c) { if (code & 0x8000) { /* MSB set: JIS X 0212 */ if (charset != CHARSET_JISX0212) { WRITE4(ESC, '$', '(', 'D') STATE_SETG0(state, CHARSET_JISX0212) NEXT_OUT(4) } WRITE2((code >> 8) & 0x7f, code & 0x7f) } else { /* MSB unset: JIS X 0208 */ jisx0208encode: if (charset != CHARSET_JISX0208) { WRITE3(ESC, '$', 'B') STATE_SETG0(state, CHARSET_JISX0208) NEXT_OUT(3) } WRITE2(code >> 8, code & 0xff) } NEXT(1, 2) } else if (c == 0xff3c) { /* FULL-WIDTH REVERSE SOLIDUS */ code = 0x2140; goto jisx0208encode; } else { JISX0201_ENCODE(c, code) else return 1; if (code < 0x80) { /* JIS X 0201 Roman */ /* if (charset == CHARSET_JISX0201_R) : already checked */ WRITE4(ESC, '(', 'J', code) STATE_SETG0(state, CHARSET_JISX0201_R) NEXT(1, 4) } else { /* JIS X 0201 Katakana */ if (charset != CHARSET_JISX0201_K) { WRITE3(ESC, '(', 'I') STATE_SETG0(state, CHARSET_JISX0201_K) NEXT_OUT(3) } WRITE1(code - 0x80) NEXT(1, 1) } } } } return 0; } #define HAVE_DECODER_INIT DECODER_INIT(iso2022_jp_ext) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_DECODER_RESET DECODER_RESET(iso2022_jp_ext) { STATE_CLEARFLAG(state, F_SHIFTED) return 0; } DECODER(iso2022_jp_ext) { ISO2022_LOOP_BEGIN unsigned char charset, c2; ISO2022_GETCHARSET(charset, c) if (charset & CHARSET_DOUBLEBYTE) { RESERVE_INBUF(2) RESERVE_OUTBUF(1) c2 = IN2; if (charset == CHARSET_JISX0208 || charset == CHARSET_JISX0208_O) { if (c == 0x21 && c2 == 0x40) /* FULL-WIDTH REVERSE SOLIDUS */ **outbuf = 0xff3c; else TRYMAP_DEC(jisx0208, **outbuf, c, c2); else return 2; } else if (charset == CHARSET_JISX0212) { TRYMAP_DEC(jisx0212, **outbuf, c, c2); else return 2; } else return MBERR_INTERNAL; NEXT(2, 1) } else if (charset == CHARSET_ASCII) { RESERVE_OUTBUF(1) OUT1(c) NEXT(1, 1) } else if (charset == CHARSET_JISX0201_R) { RESERVE_OUTBUF(1) JISX0201_R_DECODE(c, **outbuf) else return 1; NEXT(1, 1) } else if (charset == CHARSET_JISX0201_K) { RESERVE_OUTBUF(1) JISX0201_K_DECODE(c ^ 0x80, **outbuf) else return 1; NEXT(1, 1) } else return MBERR_INTERNAL; ISO2022_LOOP_END return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(iso2022_jp_ext) MAPOPEN(ja_JP) IMPORTMAP_DEC(jisx0208) IMPORTMAP_DEC(jisx0212) IMPORTMAP_ENC(jisxcommon) MAPCLOSE() END_CODEC_REGISTRY(iso2022_jp_ext) --- NEW FILE: _iso2022_kr.c --- /* * _iso2022_kr.c: the ISO-2022-KR codec (RFC1557) * * Written by Hye-Shik Chang * $CJKCodecs: _iso2022_kr.c,v 1.3 2003/12/31 05:46:55 perky Exp $ */ #define ISO2022_DESIGNATIONS \ CHARSET_ASCII, CHARSET_KSX1001 #include "codeccommon.h" #include "iso2022common.h" ENCMAP(cp949) DECMAP(ksx1001) #define HAVE_ENCODER_INIT ENCODER_INIT(iso2022_kr) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_ENCODER_RESET ENCODER_RESET(iso2022_kr) { if (STATE_GETFLAG(state, F_SHIFTED)) { RESERVE_OUTBUF(1) OUT1(SI) NEXT_OUT(1) STATE_CLEARFLAG(state, F_SHIFTED) } return 0; } ENCODER(iso2022_kr) { while (inleft > 0) { Py_UNICODE c = **inbuf; DBCHAR code; if (c < 0x80) { if (STATE_GETFLAG(state, F_SHIFTED)) { WRITE2(SI, c) STATE_CLEARFLAG(state, F_SHIFTED) NEXT(1, 2) } else { WRITE1(c) NEXT(1, 1) } if (c == '\n') STATE_CLEARFLAG(state, F_SHIFTED) } else UCS4INVALID(c) else { if (STATE_GETG1(state) != CHARSET_KSX1001) { WRITE4(ESC, '$', ')', 'C') STATE_SETG1(state, CHARSET_KSX1001) NEXT_OUT(4) } if (!STATE_GETFLAG(state, F_SHIFTED)) { WRITE1(SO) STATE_SETFLAG(state, F_SHIFTED) NEXT_OUT(1) } TRYMAP_ENC(cp949, code, c) { if (code & 0x8000) /* MSB set: CP949 */ return 1; WRITE2(code >> 8, code & 0xff) NEXT(1, 2) } else return 1; } } return 0; } #define HAVE_DECODER_INIT DECODER_INIT(iso2022_kr) { STATE_CLEARFLAGS(state) STATE_SETG0(state, CHARSET_ASCII) STATE_SETG1(state, CHARSET_ASCII) return 0; } #define HAVE_DECODER_RESET DECODER_RESET(iso2022_kr) { STATE_CLEARFLAG(state, F_SHIFTED) return 0; } DECODER(iso2022_kr) { ISO2022_LOOP_BEGIN unsigned char charset, c2; ISO2022_GETCHARSET(charset, c) if (charset & CHARSET_DOUBLEBYTE) { /* all double byte character sets are in KS X 1001 here */ RESERVE_INBUF(2) RESERVE_OUTBUF(1) c2 = IN2; if (c2 >= 0x80) return 1; TRYMAP_DEC(ksx1001, **outbuf, c, c2) { NEXT(2, 1) } else return 2; } else { RESERVE_OUTBUF(1) OUT1(c); NEXT(1, 1) } ISO2022_LOOP_END return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(iso2022_kr) MAPOPEN(ko_KR) IMPORTMAP_DEC(ksx1001) IMPORTMAP_ENC(cp949) MAPCLOSE() END_CODEC_REGISTRY(iso2022_kr) --- NEW FILE: _johab.c --- /* * _johab.c: the Johab codec * * Written by Hye-Shik Chang * $CJKCodecs: _johab.c,v 1.3 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" ENCMAP(cp949) DECMAP(ksx1001) static const unsigned char u2johabidx_choseong[32] = { 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, }; static const unsigned char u2johabidx_jungseong[32] = { 0x03, 0x04, 0x05, 0x06, 0x07, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x1a, 0x1b, 0x1c, 0x1d, }; static const unsigned char u2johabidx_jongseong[32] = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, }; static const DBCHAR u2johabjamo[] = { 0x8841, 0x8c41, 0x8444, 0x9041, 0x8446, 0x8447, 0x9441, 0x9841, 0x9c41, 0x844a, 0x844b, 0x844c, 0x844d, 0x844e, 0x844f, 0x8450, 0xa041, 0xa441, 0xa841, 0x8454, 0xac41, 0xb041, 0xb441, 0xb841, 0xbc41, 0xc041, 0xc441, 0xc841, 0xcc41, 0xd041, 0x8461, 0x8481, 0x84a1, 0x84c1, 0x84e1, 0x8541, 0x8561, 0x8581, 0x85a1, 0x85c1, 0x85e1, 0x8641, 0x8661, 0x8681, 0x86a1, 0x86c1, 0x86e1, 0x8741, 0x8761, 0x8781, 0x87a1, }; ENCODER(johab) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; if (c < 0x80) { WRITE1(c) NEXT(1, 1) continue; } UCS4INVALID(c) RESERVE_OUTBUF(2) if (c >= 0xac00 && c <= 0xd7a3) { c -= 0xac00; code = 0x8000 | (u2johabidx_choseong[c / 588] << 10) | (u2johabidx_jungseong[(c / 28) % 21] << 5) | u2johabidx_jongseong[c % 28]; } else if (c >= 0x3131 && c <= 0x3163) code = u2johabjamo[c - 0x3131]; else TRYMAP_ENC(cp949, code, c) { unsigned char c1, c2, t2; unsigned short t1; assert((code & 0x8000) == 0); c1 = code >> 8; c2 = code & 0xff; if (((c1 >= 0x21 && c1 <= 0x2c) || (c1 >= 0x4a && c1 <= 0x7d)) && (c2 >= 0x21 && c2 <= 0x7e)) { t1 = (c1 < 0x4a ? (c1 - 0x21 + 0x1b2) : (c1 - 0x21 + 0x197)); t2 = ((t1 & 1) ? 0x5e : 0) + (c2 - 0x21); OUT1(t1 >> 1) OUT2(t2 < 0x4e ? t2 + 0x31 : t2 + 0x43) NEXT(1, 2) continue; } else return 1; } else return 1; OUT1(code >> 8) OUT2(code & 0xff) NEXT(1, 2) } return 0; } #define FILL 0xfd #define NONE 0xff static const unsigned char johabidx_choseong[32] = { NONE, FILL, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, }; static const unsigned char johabidx_jungseong[32] = { NONE, NONE, FILL, 0x00, 0x01, 0x02, 0x03, 0x04, NONE, NONE, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, NONE, NONE, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, NONE, NONE, 0x11, 0x12, 0x13, 0x14, NONE, NONE, }; static const unsigned char johabidx_jongseong[32] = { NONE, FILL, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, NONE, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, NONE, NONE, }; static const unsigned char johabjamo_choseong[32] = { NONE, FILL, 0x31, 0x32, 0x34, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, NONE, }; static const unsigned char johabjamo_jungseong[32] = { NONE, NONE, FILL, 0x4f, 0x50, 0x51, 0x52, 0x53, NONE, NONE, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, NONE, NONE, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f, NONE, NONE, 0x60, 0x61, 0x62, 0x63, NONE, NONE, }; static const unsigned char johabjamo_jongseong[32] = { NONE, FILL, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, NONE, 0x42, 0x44, 0x45, 0x46, 0x47, 0x48, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, NONE, NONE, }; DECODER(johab) { while (inleft > 0) { unsigned char c = IN1, c2; RESERVE_OUTBUF(1) if (c < 0x80) { OUT1(c) NEXT(1, 1) continue; } RESERVE_INBUF(2) c2 = IN2; if (c < 0xd8) { /* johab hangul */ unsigned char c_cho, c_jung, c_jong; unsigned char i_cho, i_jung, i_jong; c_cho = (c >> 2) & 0x1f; c_jung = ((c << 3) | c2 >> 5) & 0x1f; c_jong = c2 & 0x1f; i_cho = johabidx_choseong[c_cho]; i_jung = johabidx_jungseong[c_jung]; i_jong = johabidx_jongseong[c_jong]; if (i_cho == NONE || i_jung == NONE || i_jong == NONE) return 2; /* we don't use U+1100 hangul jamo yet. */ if (i_cho == FILL) { if (i_jung == FILL) { if (i_jong == FILL) OUT1(0x3000) else OUT1(0x3100 | johabjamo_jongseong[c_jong]) } else { if (i_jong == FILL) OUT1(0x3100 | johabjamo_jungseong[c_jung]) else return 2; } } else { if (i_jung == FILL) { if (i_jong == FILL) OUT1(0x3100 | johabjamo_choseong[c_cho]) else return 2; } else OUT1(0xac00 + i_cho * 588 + i_jung * 28 + (i_jong == FILL ? 0 : i_jong)) } NEXT(2, 1) } else { /* KS X 1001 except hangul jamos and syllables */ if (c == 0xdf || c > 0xf9 || c2 < 0x31 || (c2 >= 0x80 && c2 < 0x91) || (c2 & 0x7f) == 0x7f || (c == 0xda && (c2 >= 0xa1 && c2 <= 0xd3))) return 2; else { unsigned char t1, t2; t1 = (c < 0xe0 ? 2 * (c - 0xd9) : 2 * c - 0x197); t2 = (c2 < 0x91 ? c2 - 0x31 : c2 - 0x43); t1 = t1 + (t2 < 0x5e ? 0 : 1) + 0x21; t2 = (t2 < 0x5e ? t2 : t2 - 0x5e) + 0x21; TRYMAP_DEC(ksx1001, **outbuf, t1, t2); else return 2; NEXT(2, 1) } } } return 0; } #undef NONE #undef FILL #include "codecentry.h" BEGIN_CODEC_REGISTRY(johab) MAPOPEN(ko_KR) IMPORTMAP_DEC(ksx1001) IMPORTMAP_ENC(cp949) MAPCLOSE() END_CODEC_REGISTRY(johab) --- NEW FILE: _shift_jis.c --- /* * _shift_jis.c: the SHIFT-JIS codec * * Written by Hye-Shik Chang * $CJKCodecs: _shift_jis.c,v 1.4 2003/12/31 05:46:55 perky Exp $ */ #include "codeccommon.h" #include "alg_jisx0201.h" ENCMAP(jisxcommon) DECMAP(jisx0208) ENCODER(shift_jis) { while (inleft > 0) { Py_UNICODE c = IN1; DBCHAR code; unsigned char c1, c2; #ifdef STRICT_BUILD JISX0201_R_ENCODE(c, code) #else if (c < 0x80) code = c; else if (c == 0x00a5) code = 0x5c; /* YEN SIGN */ else if (c == 0x203e) code = 0x7e; /* OVERLINE */ #endif else JISX0201_K_ENCODE(c, code) else UCS4INVALID(c) else code = NOCHAR; if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) { RESERVE_OUTBUF(1) OUT1(code) NEXT(1, 1) continue; } RESERVE_OUTBUF(2) if (code == NOCHAR) { TRYMAP_ENC(jisxcommon, code, c); #ifndef STRICT_BUILD else if (c == 0xff3c) code = 0x2140; /* FULL-WIDTH REVERSE SOLIDUS */ #endif else return 1; if (code & 0x8000) /* MSB set: JIS X 0212 */ return 1; } c1 = code >> 8; c2 = code & 0xff; c2 = (((c1 - 0x21) & 1) ? 0x5e : 0) + (c2 - 0x21); c1 = (c1 - 0x21) >> 1; OUT1(c1 < 0x1f ? c1 + 0x81 : c1 + 0xc1) OUT2(c2 < 0x3f ? c2 + 0x40 : c2 + 0x41) NEXT(1, 2) } return 0; } DECODER(shift_jis) { while (inleft > 0) { unsigned char c = IN1; RESERVE_OUTBUF(1) #ifdef STRICT_BUILD JISX0201_R_DECODE(c, **outbuf) #else if (c < 0x80) **outbuf = c; #endif else JISX0201_K_DECODE(c, **outbuf) else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)) { unsigned char c1, c2; RESERVE_INBUF(2) c2 = IN2; if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc) return 2; c1 = (c < 0xe0 ? c - 0x81 : c - 0xc1); c2 = (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41); c1 = (2 * c1 + (c2 < 0x5e ? 0 : 1) + 0x21); c2 = (c2 < 0x5e ? c2 : c2 - 0x5e) + 0x21; #ifndef STRICT_BUILD if (c1 == 0x21 && c2 == 0x40) { /* FULL-WIDTH REVERSE SOLIDUS */ OUT1(0xff3c) NEXT(2, 1) continue; } #endif TRYMAP_DEC(jisx0208, **outbuf, c1, c2) { NEXT(2, 1) continue; } else return 2; } else return 2; NEXT(1, 1) /* JIS X 0201 */ } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(shift_jis) MAPOPEN(ja_JP) IMPORTMAP_DEC(jisx0208) IMPORTMAP_ENC(jisxcommon) MAPCLOSE() END_CODEC_REGISTRY(shift_jis) --- NEW FILE: _shift_jisx0213.c --- /* * _shift_jisx0213.c: the SHIFT-JISX0213 codec * * Written by Hye-Shik Chang * $CJKCodecs: _shift_jisx0213.c,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #define USING_BINARY_PAIR_SEARCH #include "codeccommon.h" #include "alg_jisx0201.h" #include "map_jisx0213_pairs.h" ENCMAP(jisxcommon) DECMAP(jisx0208) ENCMAP(jisx0213_bmp) DECMAP(jisx0213_1_bmp) DECMAP(jisx0213_2_bmp) ENCMAP(jisx0213_emp) DECMAP(jisx0213_1_emp) DECMAP(jisx0213_2_emp) #define EMPBASE 0x20000 ENCODER(shift_jisx0213) { while (inleft > 0) { ucs4_t c = IN1; DBCHAR code = NOCHAR; int c1, c2; size_t insize; JISX0201_ENCODE(c, code) else DECODE_SURROGATE(c) if (code < 0x80 || (code >= 0xa1 && code <= 0xdf)) { WRITE1(code) NEXT(1, 1) continue; } RESERVE_OUTBUF(2) insize = GET_INSIZE(c); if (code == NOCHAR) { if (c <= 0xffff) { TRYMAP_ENC(jisx0213_bmp, code, c) { if (code == MULTIC) { if (inleft < 2) { if (flags & MBENC_FLUSH) { code = find_pairencmap(c, 0, jisx0213_pairencmap, JISX0213_ENCPAIRS); if (code == DBCINV) return 1; } else return MBERR_TOOFEW; } else { code = find_pairencmap(c, IN2, jisx0213_pairencmap, JISX0213_ENCPAIRS); if (code == DBCINV) { code = find_pairencmap(c, 0, jisx0213_pairencmap, JISX0213_ENCPAIRS); if (code == DBCINV) return 1; } else insize = 2; } } } else TRYMAP_ENC(jisxcommon, code, c) { if (code & 0x8000) return 1; /* abandon JIS X 0212 codes */ } else return 1; } else if (c >> 16 == EMPBASE >> 16) { TRYMAP_ENC(jisx0213_emp, code, c & 0xffff); else return insize; } else return insize; } c1 = code >> 8; c2 = (code & 0xff) - 0x21; if (c1 & 0x80) { /* Plane 2 */ if (c1 >= 0xee) c1 -= 0x87; else if (c1 >= 0xac || c1 == 0xa8) c1 -= 0x49; else c1 -= 0x43; } else /* Plane 1 */ c1 -= 0x21; if (c1 & 1) c2 += 0x5e; c1 >>= 1; OUT1(c1 + (c1 < 0x1f ? 0x81 : 0xc1)) OUT2(c2 + (c2 < 0x3f ? 0x40 : 0x41)) NEXT(insize, 2) } return 0; } DECODER(shift_jisx0213) { while (inleft > 0) { unsigned char c = IN1; RESERVE_OUTBUF(1) JISX0201_DECODE(c, **outbuf) else if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc)) { unsigned char c1, c2 = IN2; ucs4_t code; RESERVE_INBUF(2) if (c2 < 0x40 || (c2 > 0x7e && c2 < 0x80) || c2 > 0xfc) return 2; c1 = (c < 0xe0 ? c - 0x81 : c - 0xc1); c2 = (c2 < 0x80 ? c2 - 0x40 : c2 - 0x41); c1 = (2 * c1 + (c2 < 0x5e ? 0 : 1)); c2 = (c2 < 0x5e ? c2 : c2 - 0x5e) + 0x21; if (c1 < 0x5e) { /* Plane 1 */ c1 += 0x21; TRYMAP_DEC(jisx0208, **outbuf, c1, c2) { NEXT_OUT(1) } else TRYMAP_DEC(jisx0213_1_bmp, **outbuf, c1, c2) { NEXT_OUT(1) } else TRYMAP_DEC(jisx0213_1_emp, code, c1, c2) { PUTUCS4(EMPBASE | code) } else TRYMAP_DEC(jisx0213_pair, code, c1, c2) { WRITE2(code >> 16, code & 0xffff) NEXT_OUT(2) } else return 2; NEXT_IN(2) } else { /* Plane 2 */ if (c1 >= 0x67) c1 += 0x07; else if (c1 >= 0x63 || c1 == 0x5f) c1 -= 0x37; else c1 -= 0x3d; TRYMAP_DEC(jisx0213_2_bmp, **outbuf, c1, c2) { NEXT_OUT(1) } else TRYMAP_DEC(jisx0213_2_emp, code, c1, c2) { PUTUCS4(EMPBASE | code) } else return 2; NEXT_IN(2) } continue; } else return 2; NEXT(1, 1) /* JIS X 0201 */ } return 0; } #include "codecentry.h" BEGIN_CODEC_REGISTRY(shift_jisx0213) MAPOPEN(ja_JP) IMPORTMAP_DEC(jisx0208) IMPORTMAP_ENC(jisxcommon) IMPORTMAP_ENC(jisx0213_bmp) IMPORTMAP_DEC(jisx0213_1_bmp) IMPORTMAP_DEC(jisx0213_2_bmp) IMPORTMAP_ENC(jisx0213_emp) IMPORTMAP_DEC(jisx0213_1_emp) IMPORTMAP_DEC(jisx0213_2_emp) MAPCLOSE() END_CODEC_REGISTRY(shift_jisx0213) --- NEW FILE: alg_iso8859_1.h --- /* * alg_iso8859_1.c: Encoder/Decoder macro for ISO8859-1 * * Written by Hye-Shik Chang * $CJKCodecs: alg_iso8859_1.h,v 1.3 2003/12/31 05:46:55 perky Exp $ */ #define ISO8859_1_ENCODE(c, assi) \ if ((c) <= 0xff) (assi) = (c); #define ISO8859_1_DECODE(c, assi) \ if (1/*(c) <= 0xff*/) (assi) = (c); --- NEW FILE: alg_iso8859_7.h --- /* * alg_iso8859_7.c: Encoder/Decoder macro for ISO8859-7 * * Written by Hye-Shik Chang * $CJKCodecs: alg_iso8859_7.h,v 1.2 2003/12/31 05:46:55 perky Exp $ */ /* * 0x2888fbc9 and 0xbffffd77 are magic number that indicates availability * of mapping for each differences. (0 and 0x2d0) */ #define ISO8859_7_ENCODE(c, assi) \ if ((c) <= 0xa0) (assi) = (c); \ else if ((c) < 0xc0 && (0x288f3bc9L & (1L << ((c)-0xa0)))) \ (assi) = (c); \ else if ((c) >= 0x0384 && (c) <= 0x03ce && ((c) >= 0x03a4 ||\ (0xbffffd77L & (1L << ((c)-0x0384))))) \ (assi) = (c) - 0x02d0; \ else if ((c)>>1 == 0x2018>>1) (assi) = (c) - 0x1f77; \ else if ((c) == 0x2015) (assi) = 0xaf; #define ISO8859_7_DECODE(c, assi) \ if ((c) < 0xa0) (assi) = (c); \ else if ((c) < 0xc0 && (0x288f3bc9L & (1L << ((c)-0xa0)))) \ (assi) = (c); \ else if ((c) >= 0xb4 && (c) <= 0xfe && ((c) >= 0xd4 || \ (0xbffffd77L & (1L << ((c)-0xb4))))) \ (assi) = 0x02d0 + (c); \ else if ((c) == 0xa1) (assi) = 0x2018; \ else if ((c) == 0xa2) (assi) = 0x2019; \ else if ((c) == 0xaf) (assi) = 0x2015; --- NEW FILE: alg_jisx0201.h --- /* $CJKCodecs: alg_jisx0201.h,v 1.2 2003/11/27 16:42:20 perky Exp $ */ #define JISX0201_R_ENCODE(c, assi) \ if ((c) < 0x80 && (c) != 0x5c && (c) != 0x7e) \ (assi) = (c); \ else if ((c) == 0x00a5) (assi) = 0x5c; \ else if ((c) == 0x203e) (assi) = 0x7e; #define JISX0201_K_ENCODE(c, assi) \ if ((c) >= 0xff61 && (c) <= 0xff9f) \ (assi) = (c) - 0xfec0; #define JISX0201_ENCODE(c, assi) \ JISX0201_R_ENCODE(c, assi) \ else JISX0201_K_ENCODE(c, assi) #define JISX0201_R_DECODE(c, assi) \ if ((c) < 0x5c) (assi) = (c); \ else if ((c) == 0x5c) (assi) = 0x00a5; \ else if ((c) < 0x7e) (assi) = (c); \ else if ((c) == 0x7e) (assi) = 0x203e; \ else if ((c) == 0x7f) (assi) = 0x7f; #define JISX0201_K_DECODE(c, assi) \ if ((c) >= 0xa1 && (c) <= 0xdf) \ (assi) = 0xfec0 + (c); #define JISX0201_DECODE(c, assi) \ JISX0201_R_DECODE(c, assi) \ else JISX0201_K_DECODE(c, assi) --- NEW FILE: cjkcommon.h --- /* * cjkcommon.h: Common Constants and Macroes for CJK Character Sets * * Written by Hye-Shik Chang * $CJKCodecs: cjkcommon.h,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #ifndef _CJKCOMMON_H_ #define _CJKCOMMON_H_ #ifdef uint32_t typedef uint32_t ucs4_t; #else typedef unsigned int ucs4_t; #endif #ifdef uint16_t typedef uint16_t ucs2_t, DBCHAR; #else typedef unsigned short ucs2_t, DBCHAR; #endif #define UNIINV Py_UNICODE_REPLACEMENT_CHARACTER #define NOCHAR 0xFFFF #define MULTIC 0xFFFE #define DBCINV 0xFFFD struct dbcs_index { const ucs2_t *map; unsigned char bottom, top; }; typedef struct dbcs_index decode_map; struct widedbcs_index { const ucs4_t *map; unsigned char bottom, top; }; typedef struct widedbcs_index widedecode_map; struct unim_index { const DBCHAR *map; unsigned char bottom, top; }; typedef struct unim_index encode_map; struct dbcs_map { const char *charset; const struct unim_index *encmap; const struct dbcs_index *decmap; }; struct pair_encodemap { ucs4_t uniseq; DBCHAR code; }; #endif --- NEW FILE: codeccommon.h --- /* * codeccommon.h: Common Codec Routines * * Written by Hye-Shik Chang * $CJKCodecs: codeccommon.h,v 1.4 2003/12/31 05:46:55 perky Exp $ */ #include "Python.h" #include "multibytecodec.h" #ifdef STRICT_BUILD #define STRICT_SUFX "_strict" #else #define STRICT_SUFX #endif #define ENCMAP(encoding) \ const static encode_map *encoding##encmap; #define DECMAP(encoding) \ const static decode_map *encoding##decmap; #define ENCODER_INIT(encoding) \ static int encoding##_encode_init( \ MultibyteCodec_State *state) #define ENCODER(encoding) \ static int encoding##_encode( \ MultibyteCodec_State *state, \ const Py_UNICODE **inbuf, size_t inleft, \ unsigned char **outbuf, size_t outleft, int flags) #define ENCODER_RESET(encoding) \ static int encoding##_encode_reset( \ MultibyteCodec_State *state, \ unsigned char **outbuf, size_t outleft) #define DECODER_INIT(encoding) \ static int encoding##_decode_init( \ MultibyteCodec_State *state) #define DECODER(encoding) \ static int encoding##_decode( \ MultibyteCodec_State *state, \ const unsigned char **inbuf, size_t inleft, \ Py_UNICODE **outbuf, size_t outleft) #define DECODER_RESET(encoding) \ static int encoding##_decode_reset( \ MultibyteCodec_State *state) #if Py_UNICODE_SIZE == 4 #define UCS4INVALID(code) \ if ((code) > 0xFFFF) \ return 1; #else #define UCS4INVALID(code) \ if (0) ; #endif #define NEXT_IN(i) \ (*inbuf) += (i); \ (inleft) -= (i); #define NEXT_OUT(o) \ (*outbuf) += (o); \ (outleft) -= (o); #define NEXT(i, o) NEXT_IN(i) NEXT_OUT(o) #define RESERVE_INBUF(n) \ if (inleft < (n)) \ return MBERR_TOOFEW; #define RESERVE_OUTBUF(n) \ if (outleft < (n)) \ return MBERR_TOOSMALL; #define IN1 ((*inbuf)[0]) #define IN2 ((*inbuf)[1]) #define IN3 ((*inbuf)[2]) #define IN4 ((*inbuf)[3]) #define OUT1(c) ((*outbuf)[0]) = (c); #define OUT2(c) ((*outbuf)[1]) = (c); #define OUT3(c) ((*outbuf)[2]) = (c); #define OUT4(c) ((*outbuf)[3]) = (c); #define WRITE1(c1) \ RESERVE_OUTBUF(1) \ (*outbuf)[0] = (c1); #define WRITE2(c1, c2) \ RESERVE_OUTBUF(2) \ (*outbuf)[0] = (c1); \ (*outbuf)[1] = (c2); #define WRITE3(c1, c2, c3) \ RESERVE_OUTBUF(3) \ (*outbuf)[0] = (c1); \ (*outbuf)[1] = (c2); \ (*outbuf)[2] = (c3); #define WRITE4(c1, c2, c3, c4) \ RESERVE_OUTBUF(4) \ (*outbuf)[0] = (c1); \ (*outbuf)[1] = (c2); \ (*outbuf)[2] = (c3); \ (*outbuf)[3] = (c4); #if Py_UNICODE_SIZE == 2 # define PUTUCS4(c) \ RESERVE_OUTBUF(2) \ (*outbuf)[0] = 0xd800 + (((c) - 0x10000) >> 10); \ (*outbuf)[1] = 0xdc00 + (((c) - 0x10000) & 0x3ff); \ NEXT_OUT(2) #else # define PUTUCS4(c) \ RESERVE_OUTBUF(1) \ **outbuf = (Py_UNICODE)(c); \ NEXT_OUT(1) #endif #define _TRYMAP_ENC(m, assi, val) \ if ((m)->map != NULL && (val) >= (m)->bottom && \ (val)<= (m)->top && ((assi) = (m)->map[(val) - \ (m)->bottom]) != NOCHAR) #define TRYMAP_ENC(charset, assi, uni) \ _TRYMAP_ENC(&charset##encmap[(uni) >> 8], assi, (uni) & 0xff) #define _TRYMAP_DEC(m, assi, val) \ if ((m)->map != NULL && (val) >= (m)->bottom && \ (val)<= (m)->top && ((assi) = (m)->map[(val) - \ (m)->bottom]) != UNIINV) #define TRYMAP_DEC(charset, assi, c1, c2) \ _TRYMAP_DEC(&charset##decmap[c1], assi, c2) #if Py_UNICODE_SIZE == 2 #define DECODE_SURROGATE(c) \ if (c >> 10 == 0xd800 >> 10) { /* high surrogate */ \ RESERVE_INBUF(2) \ if (IN2 >> 10 == 0xdc00 >> 10) { /* low surrogate */ \ c = 0x10000 + ((ucs4_t)(c - 0xd800) << 10) + \ ((ucs4_t)(IN2) - 0xdc00); \ } \ } #define GET_INSIZE(c) ((c) > 0xffff ? 2 : 1) #else #define DECODE_SURROGATE(c) {;} #define GET_INSIZE(c) 1 #endif #ifdef USING_BINARY_PAIR_SEARCH static DBCHAR find_pairencmap(ucs2_t , ucs2_t, struct pair_encodemap *, int); #endif --- NEW FILE: codecentry.h --- /* * codecentry.h: Common Codec Entry Routines * * Written by Hye-Shik Chang * $CJKCodecs: codecentry.h,v 1.5 2004/01/17 11:26:10 perky Exp $ */ #ifdef HAVE_ENCODER_INIT #define ENCODER_INIT_FUNC(encoding) encoding##_encode_init #else #define ENCODER_INIT_FUNC(encoding) NULL #endif #ifdef HAVE_ENCODER_RESET #define ENCODER_RESET_FUNC(encoding) encoding##_encode_reset #else #define ENCODER_RESET_FUNC(encoding) NULL #endif #ifdef HAVE_DECODER_INIT #define DECODER_INIT_FUNC(encoding) encoding##_decode_init #else #define DECODER_INIT_FUNC(encoding) NULL #endif #ifdef HAVE_DECODER_RESET #define DECODER_RESET_FUNC(encoding) encoding##_decode_reset #else #define DECODER_RESET_FUNC(encoding) NULL #endif #ifdef STRICT_BUILD #define BEGIN_CODEC_REGISTRY(encoding) \ __BEGIN_CODEC_REGISTRY(encoding, init_codecs_##encoding##_strict) #else #define BEGIN_CODEC_REGISTRY(encoding) \ __BEGIN_CODEC_REGISTRY(encoding, init_codecs_##encoding) #endif #define __BEGIN_CODEC_REGISTRY(encoding, initname) \ static MultibyteCodec __codec = { \ #encoding STRICT_SUFX, \ encoding##_encode, \ ENCODER_INIT_FUNC(encoding), \ ENCODER_RESET_FUNC(encoding), \ encoding##_decode, \ DECODER_INIT_FUNC(encoding), \ DECODER_RESET_FUNC(encoding), \ }; \ \ static struct PyMethodDef __methods[] = { \ {NULL, NULL}, \ }; \ \ void \ initname(void) \ { \ PyObject *codec; \ PyObject *m = NULL, *mod = NULL, *o = NULL; \ \ m = Py_InitModule("_codecs_" #encoding STRICT_SUFX, __methods); #define MAPOPEN(locale) \ mod = PyImport_ImportModule("_codecs_mapdata_" #locale);\ if (mod == NULL) goto errorexit; \ if ( #define IMPORTMAP_ENCDEC(charset) \ importmap(mod, "__map_" #charset, &charset##encmap, \ &charset##decmap) || #define IMPORTMAP_ENC(charset) \ importmap(mod, "__map_" #charset, &charset##encmap, \ NULL) || #define IMPORTMAP_DEC(charset) \ importmap(mod, "__map_" #charset, NULL, \ &charset##decmap) || #define MAPCLOSE() \ 0) goto errorexit; \ Py_DECREF(mod); #define END_CODEC_REGISTRY(encoding) \ mod = PyImport_ImportModule("_multibytecodec"); \ if (mod == NULL) goto errorexit; \ o = PyObject_GetAttrString(mod, "__create_codec"); \ if (o == NULL || !PyCallable_Check(o)) \ goto errorexit; \ \ codec = createcodec(o, &__codec); \ if (codec == NULL) \ goto errorexit; \ PyModule_AddObject(m, "codec", codec); \ Py_DECREF(o); Py_DECREF(mod); \ \ if (PyErr_Occurred()) \ Py_FatalError("can't initialize the _" #encoding \ STRICT_SUFX " module"); \ \ return; \ \ errorexit: \ Py_XDECREF(m); \ Py_XDECREF(mod); \ Py_XDECREF(o); \ } #define CODEC_REGISTRY(encoding) \ BEGIN_CODEC_REGISTRY(encoding) \ END_CODEC_REGISTRY(encoding) #ifdef USING_BINARY_PAIR_SEARCH static DBCHAR find_pairencmap(ucs2_t body, ucs2_t modifier, struct pair_encodemap *haystack, int haystacksize) { int pos, min, max; ucs4_t value = body << 16 | modifier; min = 0; max = haystacksize; for (pos = haystacksize >> 1; min != max; pos = (min + max) >> 1) if (value < haystack[pos].uniseq) { if (max == pos) break; else max = pos; } else if (value > haystack[pos].uniseq) { if (min == pos) break; else min = pos; } else break; if (value == haystack[pos].uniseq) return haystack[pos].code; else return DBCINV; } #endif #ifndef CODEC_WITHOUT_MAPS static int importmap(PyObject *mod, const char *symbol, const struct unim_index **encmap, const struct dbcs_index **decmap) { PyObject *o; o = PyObject_GetAttrString(mod, (char*)symbol); if (o == NULL) return -1; else if (!PyCObject_Check(o)) { PyErr_SetString(PyExc_ValueError, "map data must be a CObject."); return -1; } else { struct dbcs_map *map; map = PyCObject_AsVoidPtr(o); if (encmap != NULL) *encmap = map->encmap; if (decmap != NULL) *decmap = map->decmap; Py_DECREF(o); } return 0; } #endif static PyObject * createcodec(PyObject *cofunc, MultibyteCodec *codec) { PyObject *args, *r; args = PyTuple_New(1); if (args == NULL) return NULL; PyTuple_SET_ITEM(args, 0, PyCObject_FromVoidPtr(codec, NULL)); r = PyObject_CallObject(cofunc, args); Py_DECREF(args); return r; } --- NEW FILE: iso2022common.h --- /* * iso2022common.h: Common Codec Routines for ISO-2022 codecs. * * Written by Hye-Shik Chang * $CJKCodecs: iso2022common.h,v 1.8 2003/12/31 05:46:55 perky Exp $ */ /* This ISO-2022 implementation is intended to comply ECMA-43 Level 1 * rather than RFCs itself */ #define ESC 0x1b #define SO 0x0e #define SI 0x0f #define MAX_ESCSEQLEN 16 #define IS_ESCEND(c) (((c) >= 'A' && (c) <= 'Z') || (c) == '@') #define IS_ISO2022ESC(c2) ((c2) == '(' || (c2) == ')' || (c2) == '$' || \ (c2) == '.' || (c2) == '&') /* this is not a full list of ISO-2022 escape sequence headers. * but, it's enough to implement CJK instances of iso-2022. */ /* STATE state->c[0-3] 00000000 ||^^^^^| |+-----+---- G0-3 Character Set +----------- Is G0-3 double byte? state->c[4] 00000000 || |+---- Locked-Shift? +----- ESC Throughout */ #define CHARSET_DOUBLEBYTE 0x80 #define CHARSET_ASCII 'B' #define CHARSET_ISO8859_1 'A' #define CHARSET_ISO8859_7 'F' #define CHARSET_KSX1001 ('C'|CHARSET_DOUBLEBYTE) #define CHARSET_JISX0201_R 'J' #define CHARSET_JISX0201_K 'I' #define CHARSET_JISX0208 ('B'|CHARSET_DOUBLEBYTE) #define CHARSET_JISX0208_O ('@'|CHARSET_DOUBLEBYTE) #define CHARSET_JISX0212 ('D'|CHARSET_DOUBLEBYTE) #define CHARSET_JISX0213_1 ('O'|CHARSET_DOUBLEBYTE) #define CHARSET_JISX0213_2 ('P'|CHARSET_DOUBLEBYTE) #define CHARSET_GB2312 ('A'|CHARSET_DOUBLEBYTE) #define CHARSET_GB2312_8565 ('E'|CHARSET_DOUBLEBYTE) #define CHARSET_DESIGN(c) ((c) & 0x7f) #define CHARSET_ISDBCS(c) ((c) & 0x80) #define F_SHIFTED 0x01 #define F_ESCTHROUGHOUT 0x02 #define STATE_SETG(dn, s, v) ((s)->c[dn]) = (v); #define STATE_GETG(dn, s) ((s)->c[dn]) #define STATE_SETG0(s, v) STATE_SETG(0, s, v) #define STATE_GETG0(s) STATE_GETG(0, s) #define STATE_SETG1(s, v) STATE_SETG(1, s, v) #define STATE_GETG1(s) STATE_GETG(1, s) #define STATE_SETG2(s, v) STATE_SETG(2, s, v) #define STATE_GETG2(s) STATE_GETG(2, s) #define STATE_SETG3(s, v) STATE_SETG(3, s, v) #define STATE_GETG3(s) STATE_GETG(3, s) #define STATE_SETFLAG(s, f) ((s)->c[4]) |= (f); #define STATE_GETFLAG(s, f) ((s)->c[4] & (f)) #define STATE_CLEARFLAG(s, f) ((s)->c[4]) &= ~(f); #define STATE_CLEARFLAGS(s) ((s)->c[4]) = 0; #define ISO2022_GETCHARSET(charset, c1) \ if ((c) >= 0x80) \ return 1; \ if (STATE_GETFLAG(state, F_SHIFTED)) /* G1 */ \ (charset) = STATE_GETG1(state); \ else /* G1 */ \ (charset) = STATE_GETG0(state); \ #ifdef ISO2022_USE_G2_DESIGNATION /* hardcoded for iso-2022-jp-2 for now. we'll need to generalize it when we have more G2 designating encodings */ #define SS2_ROUTINE \ if (IN2 == 'N') { /* SS2 */ \ RESERVE_INBUF(3) \ if (STATE_GETG2(state) == CHARSET_ISO8859_1) { \ ISO8859_1_DECODE(IN3 ^ 0x80, **outbuf) \ else return 3; \ } else if (STATE_GETG2(state) == CHARSET_ISO8859_7) { \ ISO8859_7_DECODE(IN3 ^ 0x80, **outbuf) \ else return 3; \ } else if (STATE_GETG2(state) == CHARSET_ASCII) { \ if (IN3 & 0x80) return 3; \ else **outbuf = IN3; \ } else \ return MBERR_INTERNAL; \ NEXT(3, 1) \ } else #else #define SS2_ROUTINE #endif #ifndef ISO2022_NO_SHIFT #define SHIFT_CASES \ case SI: \ STATE_CLEARFLAG(state, F_SHIFTED) \ NEXT_IN(1) \ break; \ case SO: \ STATE_SETFLAG(state, F_SHIFTED) \ NEXT_IN(1) \ break; #else /* for compatibility with JapaneseCodecs */ #define SHIFT_CASES #endif #define ISO2022_BASECASES(c1) \ case ESC: \ RESERVE_INBUF(2) \ if (IS_ISO2022ESC(IN2)) { \ int err; \ err = iso2022processesc(state, inbuf, &inleft); \ if (err != 0) \ return err; \ } else SS2_ROUTINE { \ STATE_SETFLAG(state, F_ESCTHROUGHOUT) \ OUT1(ESC) \ NEXT(1, 1) \ } \ break; \ SHIFT_CASES \ case '\n': \ STATE_CLEARFLAG(state, F_SHIFTED) \ WRITE1('\n') \ NEXT(1, 1) \ break; #define ISO2022_ESCTHROUGHOUT(c) \ if (STATE_GETFLAG(state, F_ESCTHROUGHOUT)) { \ /* ESC throughout mode: for non-iso2022 escape sequences */ \ RESERVE_OUTBUF(1) \ OUT1(c) /* assume as ISO-8859-1 */ \ NEXT(1, 1) \ if (IS_ESCEND(c)) { \ STATE_CLEARFLAG(state, F_ESCTHROUGHOUT) \ } \ continue; \ } #define ISO2022_LOOP_BEGIN \ while (inleft > 0) { \ unsigned char c = IN1; \ ISO2022_ESCTHROUGHOUT(c) \ switch(c) { \ ISO2022_BASECASES(c) \ default: \ if (c < 0x20) { /* C0 */ \ RESERVE_OUTBUF(1) \ OUT1(c) \ NEXT(1, 1) \ } else if (c >= 0x80) \ return 1; \ else { #define ISO2022_LOOP_END \ } \ } \ } static int iso2022processesc(MultibyteCodec_State *state, const unsigned char **inbuf, size_t *inleft) { unsigned char charset, designation; int i, esclen; for (i = 1;i < MAX_ESCSEQLEN;i++) { if (i >= *inleft) return MBERR_TOOFEW; if (IS_ESCEND((*inbuf)[i])) { esclen = i + 1; break; } #ifdef ISO2022_USE_JISX0208EXT else if (i+1 < *inleft && (*inbuf)[i] == '&' && (*inbuf)[i+1] == '@') i += 2; #endif } if (i >= MAX_ESCSEQLEN) return 1; /* unterminated escape sequence */ switch (esclen) { case 3: if (IN2 == '$') { charset = IN3 | CHARSET_DOUBLEBYTE; designation = 0; } else { charset = IN3; if (IN2 == '(') designation = 0; else if (IN2 == ')') designation = 1; #ifdef ISO2022_USE_G2_DESIGNATION else if (IN2 == '.') designation = 2; #endif else return 3; } break; case 4: if (IN2 != '$') return 4; charset = IN4 | CHARSET_DOUBLEBYTE; if (IN3 == '(') designation = 0; else if (IN3 == ')') designation = 1; else return 4; break; #ifdef ISO2022_USE_JISX0208EXT case 6: /* designation with prefix */ if ((*inbuf)[3] == ESC && (*inbuf)[4] == '$' && (*inbuf)[5] == 'B') { charset = 'B' | CHARSET_DOUBLEBYTE; designation = 0; } else return 6; break; #endif default: return esclen; } { /* raise error when the charset is not designated for this encoding */ const unsigned char dsgs[] = {ISO2022_DESIGNATIONS, '\x00'}; for (i = 0; dsgs[i] != '\x00'; i++) if (dsgs[i] == charset) break; if (dsgs[i] == '\x00') return esclen; } STATE_SETG(designation, state, charset) *inleft -= esclen; (*inbuf) += esclen; return 0; } --- NEW FILE: map_big5.h --- /* * $CJKCodecs: map_big5.h,v 1.1.1.1 2003/09/24 17:45:19 perky Exp $ */ static const ucs2_t __big5_decmap[16702] = { 0x3000, 0xff0c, 0x3001, 0x3002, 0xff0e, 0x2022, 0xff1b, 0xff1a, 0xff1f, 0xff01, 0xfe30, 0x2026, 0x2025, 0xfe50, 0xff64, 0xfe52, 0x00b7, 0xfe54, 0xfe55, 0xfe56, 0xfe57, 0xff5c, 0x2013, 0xfe31, 0x2014, 0xfe33, 0x2574, 0xfe34, 0xfe4f, 0xff08, 0xff09, 0xfe35, 0xfe36, 0xff5b, 0xff5d, 0xfe37, 0xfe38, 0x3014, 0x3015, 0xfe39, 0xfe3a, 0x3010, 0x3011, 0xfe3b, 0xfe3c, 0x300a, 0x300b, 0xfe3d, 0xfe3e, 0x3008, 0x3009, 0xfe3f, 0xfe40, 0x300c, 0x300d, 0xfe41, 0xfe42, 0x300e, 0x300f, 0xfe43, 0xfe44, 0xfe59, 0xfe5a, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0xfe5b, 0xfe5c, 0xfe5d, 0xfe5e, 0x2018, 0x2019, 0x201c, 0x201d, 0x301d, 0x301e, 0x2035, 0x2032, 0xff03, 0xff06, 0xff0a, [...5299 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {__big5_encmap+21475, 0x0c, 0x0d}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {__big5_encmap+21477, 0x30, 0x6b}, /* 0xFF */ {__big5_encmap+21537, 0x01, 0xe3}, }; --- NEW FILE: map_cp932ext.h --- /* * $CJKCodecs: map_cp932ext.h,v 1.1.1.1 2003/09/24 17:45:26 perky Exp $ */ static const ucs2_t __cp932ext_decmap[969] = { 0xff3c, 0xff5e, 0x2225, 0xff5c, 0x2026, 0x2025, 0x2018, 0x2019, 0x201c, 0x201d, 0xff08, 0xff09, 0x3014, 0x3015, 0xff3b, 0xff3d, 0xff5b, 0xff5d, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, 0x300d, 0x300e, 0x300f, 0x3010, 0x3011, 0xff0b, 0xff0d, 0x00b1, 0x00d7, UNIINV, 0x00f7, 0xff1d, 0x2260, 0xff1c, 0xff1e, 0x2266, 0x2267, 0x221e, 0x2234, 0x2642, 0x2640, 0x00b0, 0x2032, 0x2033, 0x2103, 0xffe5, 0xff04, 0xffe0, 0xffe1, 0xff05, 0xff03, 0xff06, 0xff0a, 0xff20, 0x00a7, 0x2606, 0x2605, 0x25cb, 0x25cf, 0x25ce, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25b3, 0x25b2, 0x25bd, 0x25bc, 0x203b, 0x3012, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x2208, 0x220b, 0x2286, 0x2287, 0x2282, 0x2283, 0x222a, 0x2229, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x2227, 0x2228, 0xffe2, 0x2460, 0x2461, 0x2462, 0x2463, [...1823 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {__cp932ext_encmap+9247, 0x29, 0xdc}, /* 0xFA */ {__cp932ext_encmap+9427, 0x0e, 0x2d}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {__cp932ext_encmap+9459, 0x02, 0xe4}, }; --- NEW FILE: map_cp949.h --- /* * $CJKCodecs: map_cp949.h,v 1.1.1.1 2003/09/24 17:45:40 perky Exp $ */ static const DBCHAR __cp949_encmap[33133] = { 0x222e, NOCHAR, NOCHAR, 0x2234, NOCHAR, NOCHAR, 0x2157, 0x2127, NOCHAR, 0x2823, NOCHAR, NOCHAR, 0x2129, 0x2267, NOCHAR, 0x2146, 0x213e, 0x2977, 0x2978, 0x2225, NOCHAR, 0x2252, 0x2124, 0x222c, 0x2976, 0x282c, NOCHAR, 0x2879, 0x2876, 0x287a, 0x222f, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2821, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2822, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x213f, 0x282a, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x282d, 0x292c, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2921, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2923, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2140, 0x292a, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x292d, 0x2922, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, [...4370 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {__cp949_encmap+32635, 0x00, 0xff}, /* 0xFA */ {__cp949_encmap+32891, 0x00, 0x0b}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {__cp949_encmap+32903, 0x01, 0xe6}, }; --- NEW FILE: map_cp949ext.h --- /* * $CJKCodecs: map_cp949ext.h,v 1.1.1.1 2003/09/24 17:45:45 perky Exp $ */ static const ucs2_t __cp949ext_decmap[9650] = { 0xac02, 0xac03, 0xac05, 0xac06, 0xac0b, 0xac0c, 0xac0d, 0xac0e, 0xac0f, 0xac18, 0xac1e, 0xac1f, 0xac21, 0xac22, 0xac23, 0xac25, 0xac26, 0xac27, 0xac28, 0xac29, 0xac2a, 0xac2b, 0xac2e, 0xac32, 0xac33, 0xac34, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0xac35, 0xac36, 0xac37, 0xac3a, 0xac3b, 0xac3d, 0xac3e, 0xac3f, 0xac41, 0xac42, 0xac43, 0xac44, 0xac45, 0xac46, 0xac47, 0xac48, 0xac49, 0xac4a, 0xac4c, 0xac4e, 0xac4f, 0xac50, 0xac51, 0xac52, 0xac53, 0xac55, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0xac56, 0xac57, 0xac59, 0xac5a, 0xac5b, 0xac5d, 0xac5e, 0xac5f, 0xac60, 0xac61, 0xac62, 0xac63, 0xac64, 0xac65, 0xac66, 0xac67, 0xac68, 0xac69, 0xac6a, 0xac6b, 0xac6c, 0xac6d, 0xac6e, 0xac6f, 0xac72, 0xac73, 0xac75, 0xac76, 0xac79, 0xac7b, 0xac7c, 0xac7d, 0xac7e, 0xac7f, 0xac82, 0xac87, 0xac88, 0xac8d, 0xac8e, 0xac8f, 0xac91, 0xac92, 0xac93, 0xac95, 0xac96, 0xac97, 0xac98, 0xac99, [...1435 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {0, 0, 0}, }; --- NEW FILE: map_cp950ext.h --- /* * $CJKCodecs: map_cp950ext.h,v 1.1.1.1 2003/09/24 17:45:47 perky Exp $ */ static const ucs2_t __cp950ext_decmap[224] = { 0x2027, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0xfe51, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x00af, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0xff5e, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x2295, 0x2299, 0x2215, 0xfe68, UNIINV, 0xffe5, UNIINV, 0xffe0, 0xffe1, 0x20ac, 0x7881, 0x92b9, 0x88cf, 0x58bb, 0x6052, 0x7ca7, 0x5afa, 0x2554, 0x2566, 0x2557, 0x2560, 0x256c, 0x2563, 0x255a, 0x2569, 0x255d, 0x2552, 0x2564, 0x2555, 0x255e, 0x256a, 0x2561, 0x2558, 0x2567, 0x255b, 0x2553, 0x2565, 0x2556, 0x255f, 0x256b, 0x2562, 0x2559, 0x2568, 0x255c, 0x2551, 0x2550, 0x256d, 0x256e, 0x2570, 0x256f, 0x2593, }; static const struct dbcs_index cp950ext_decmap[256] = { /* 0x00 */ {0, 0, 0}, /* 0x01 */ {0, 0, 0}, /* 0x02 */ {0, 0, 0}, /* 0x03 */ {0, 0, 0}, /* 0x04 */ {0, 0, 0}, /* 0x05 */ {0, 0, 0}, /* 0x06 */ {0, 0, 0}, /* 0x07 */ {0, 0, 0}, /* 0x08 */ {0, 0, 0}, /* 0x09 */ {0, 0, 0}, /* 0x0A */ {0, 0, 0}, /* 0x0B */ {0, 0, 0}, /* 0x0C */ {0, 0, 0}, /* 0x0D */ {0, 0, 0}, /* 0x0E */ {0, 0, 0}, /* 0x0F */ {0, 0, 0}, /* 0x10 */ {0, 0, 0}, /* 0x11 */ {0, 0, 0}, /* 0x12 */ {0, 0, 0}, /* 0x13 */ {0, 0, 0}, /* 0x14 */ {0, 0, 0}, /* 0x15 */ {0, 0, 0}, /* 0x16 */ {0, 0, 0}, /* 0x17 */ {0, 0, 0}, /* 0x18 */ {0, 0, 0}, /* 0x19 */ {0, 0, 0}, /* 0x1A */ {0, 0, 0}, /* 0x1B */ {0, 0, 0}, /* 0x1C */ {0, 0, 0}, /* 0x1D */ {0, 0, 0}, /* 0x1E */ {0, 0, 0}, /* 0x1F */ {0, 0, 0}, /* 0x20 */ {0, 0, 0}, /* 0x21 */ {0, 0, 0}, /* 0x22 */ {0, 0, 0}, /* 0x23 */ {0, 0, 0}, /* 0x24 */ {0, 0, 0}, /* 0x25 */ {0, 0, 0}, /* 0x26 */ {0, 0, 0}, /* 0x27 */ {0, 0, 0}, /* 0x28 */ {0, 0, 0}, /* 0x29 */ {0, 0, 0}, /* 0x2A */ {0, 0, 0}, /* 0x2B */ {0, 0, 0}, /* 0x2C */ {0, 0, 0}, /* 0x2D */ {0, 0, 0}, /* 0x2E */ {0, 0, 0}, /* 0x2F */ {0, 0, 0}, /* 0x30 */ {0, 0, 0}, /* 0x31 */ {0, 0, 0}, /* 0x32 */ {0, 0, 0}, /* 0x33 */ {0, 0, 0}, /* 0x34 */ {0, 0, 0}, /* 0x35 */ {0, 0, 0}, /* 0x36 */ {0, 0, 0}, /* 0x37 */ {0, 0, 0}, /* 0x38 */ {0, 0, 0}, /* 0x39 */ {0, 0, 0}, /* 0x3A */ {0, 0, 0}, /* 0x3B */ {0, 0, 0}, /* 0x3C */ {0, 0, 0}, /* 0x3D */ {0, 0, 0}, /* 0x3E */ {0, 0, 0}, /* 0x3F */ {0, 0, 0}, /* 0x40 */ {0, 0, 0}, /* 0x41 */ {0, 0, 0}, /* 0x42 */ {0, 0, 0}, /* 0x43 */ {0, 0, 0}, /* 0x44 */ {0, 0, 0}, /* 0x45 */ {0, 0, 0}, /* 0x46 */ {0, 0, 0}, /* 0x47 */ {0, 0, 0}, /* 0x48 */ {0, 0, 0}, /* 0x49 */ {0, 0, 0}, /* 0x4A */ {0, 0, 0}, /* 0x4B */ {0, 0, 0}, /* 0x4C */ {0, 0, 0}, /* 0x4D */ {0, 0, 0}, /* 0x4E */ {0, 0, 0}, /* 0x4F */ {0, 0, 0}, /* 0x50 */ {0, 0, 0}, /* 0x51 */ {0, 0, 0}, /* 0x52 */ {0, 0, 0}, /* 0x53 */ {0, 0, 0}, /* 0x54 */ {0, 0, 0}, /* 0x55 */ {0, 0, 0}, /* 0x56 */ {0, 0, 0}, /* 0x57 */ {0, 0, 0}, /* 0x58 */ {0, 0, 0}, /* 0x59 */ {0, 0, 0}, /* 0x5A */ {0, 0, 0}, /* 0x5B */ {0, 0, 0}, /* 0x5C */ {0, 0, 0}, /* 0x5D */ {0, 0, 0}, /* 0x5E */ {0, 0, 0}, /* 0x5F */ {0, 0, 0}, /* 0x60 */ {0, 0, 0}, /* 0x61 */ {0, 0, 0}, /* 0x62 */ {0, 0, 0}, /* 0x63 */ {0, 0, 0}, /* 0x64 */ {0, 0, 0}, /* 0x65 */ {0, 0, 0}, /* 0x66 */ {0, 0, 0}, /* 0x67 */ {0, 0, 0}, /* 0x68 */ {0, 0, 0}, /* 0x69 */ {0, 0, 0}, /* 0x6A */ {0, 0, 0}, /* 0x6B */ {0, 0, 0}, /* 0x6C */ {0, 0, 0}, /* 0x6D */ {0, 0, 0}, /* 0x6E */ {0, 0, 0}, /* 0x6F */ {0, 0, 0}, /* 0x70 */ {0, 0, 0}, /* 0x71 */ {0, 0, 0}, /* 0x72 */ {0, 0, 0}, /* 0x73 */ {0, 0, 0}, /* 0x74 */ {0, 0, 0}, /* 0x75 */ {0, 0, 0}, /* 0x76 */ {0, 0, 0}, /* 0x77 */ {0, 0, 0}, /* 0x78 */ {0, 0, 0}, /* 0x79 */ {0, 0, 0}, /* 0x7A */ {0, 0, 0}, /* 0x7B */ {0, 0, 0}, /* 0x7C */ {0, 0, 0}, /* 0x7D */ {0, 0, 0}, /* 0x7E */ {0, 0, 0}, /* 0x7F */ {0, 0, 0}, /* 0x80 */ {0, 0, 0}, /* 0x81 */ {0, 0, 0}, /* 0x82 */ {0, 0, 0}, /* 0x83 */ {0, 0, 0}, /* 0x84 */ {0, 0, 0}, /* 0x85 */ {0, 0, 0}, /* 0x86 */ {0, 0, 0}, /* 0x87 */ {0, 0, 0}, /* 0x88 */ {0, 0, 0}, /* 0x89 */ {0, 0, 0}, /* 0x8A */ {0, 0, 0}, /* 0x8B */ {0, 0, 0}, /* 0x8C */ {0, 0, 0}, /* 0x8D */ {0, 0, 0}, /* 0x8E */ {0, 0, 0}, /* 0x8F */ {0, 0, 0}, /* 0x90 */ {0, 0, 0}, /* 0x91 */ {0, 0, 0}, /* 0x92 */ {0, 0, 0}, /* 0x93 */ {0, 0, 0}, /* 0x94 */ {0, 0, 0}, /* 0x95 */ {0, 0, 0}, /* 0x96 */ {0, 0, 0}, /* 0x97 */ {0, 0, 0}, /* 0x98 */ {0, 0, 0}, /* 0x99 */ {0, 0, 0}, /* 0x9A */ {0, 0, 0}, /* 0x9B */ {0, 0, 0}, /* 0x9C */ {0, 0, 0}, /* 0x9D */ {0, 0, 0}, /* 0x9E */ {0, 0, 0}, /* 0x9F */ {0, 0, 0}, /* 0xA0 */ {0, 0, 0}, /* 0xA1 */ {__cp950ext_decmap+0, 0x45, 0xf3}, /* 0xA2 */ {__cp950ext_decmap+175, 0x41, 0x47}, /* 0xA3 */ {__cp950ext_decmap+182, 0xe1, 0xe1}, /* 0xA4 */ {0, 0, 0}, /* 0xA5 */ {0, 0, 0}, /* 0xA6 */ {0, 0, 0}, /* 0xA7 */ {0, 0, 0}, /* 0xA8 */ {0, 0, 0}, /* 0xA9 */ {0, 0, 0}, /* 0xAA */ {0, 0, 0}, /* 0xAB */ {0, 0, 0}, /* 0xAC */ {0, 0, 0}, /* 0xAD */ {0, 0, 0}, /* 0xAE */ {0, 0, 0}, /* 0xAF */ {0, 0, 0}, /* 0xB0 */ {0, 0, 0}, /* 0xB1 */ {0, 0, 0}, /* 0xB2 */ {0, 0, 0}, /* 0xB3 */ {0, 0, 0}, /* 0xB4 */ {0, 0, 0}, /* 0xB5 */ {0, 0, 0}, /* 0xB6 */ {0, 0, 0}, /* 0xB7 */ {0, 0, 0}, /* 0xB8 */ {0, 0, 0}, /* 0xB9 */ {0, 0, 0}, /* 0xBA */ {0, 0, 0}, /* 0xBB */ {0, 0, 0}, /* 0xBC */ {0, 0, 0}, /* 0xBD */ {0, 0, 0}, /* 0xBE */ {0, 0, 0}, /* 0xBF */ {0, 0, 0}, /* 0xC0 */ {0, 0, 0}, /* 0xC1 */ {0, 0, 0}, /* 0xC2 */ {0, 0, 0}, /* 0xC3 */ {0, 0, 0}, /* 0xC4 */ {0, 0, 0}, /* 0xC5 */ {0, 0, 0}, /* 0xC6 */ {0, 0, 0}, /* 0xC7 */ {0, 0, 0}, /* 0xC8 */ {0, 0, 0}, /* 0xC9 */ {0, 0, 0}, /* 0xCA */ {0, 0, 0}, /* 0xCB */ {0, 0, 0}, /* 0xCC */ {0, 0, 0}, /* 0xCD */ {0, 0, 0}, /* 0xCE */ {0, 0, 0}, /* 0xCF */ {0, 0, 0}, /* 0xD0 */ {0, 0, 0}, /* 0xD1 */ {0, 0, 0}, /* 0xD2 */ {0, 0, 0}, /* 0xD3 */ {0, 0, 0}, /* 0xD4 */ {0, 0, 0}, /* 0xD5 */ {0, 0, 0}, /* 0xD6 */ {0, 0, 0}, /* 0xD7 */ {0, 0, 0}, /* 0xD8 */ {0, 0, 0}, /* 0xD9 */ {0, 0, 0}, /* 0xDA */ {0, 0, 0}, /* 0xDB */ {0, 0, 0}, /* 0xDC */ {0, 0, 0}, /* 0xDD */ {0, 0, 0}, /* 0xDE */ {0, 0, 0}, /* 0xDF */ {0, 0, 0}, /* 0xE0 */ {0, 0, 0}, /* 0xE1 */ {0, 0, 0}, /* 0xE2 */ {0, 0, 0}, /* 0xE3 */ {0, 0, 0}, /* 0xE4 */ {0, 0, 0}, /* 0xE5 */ {0, 0, 0}, /* 0xE6 */ {0, 0, 0}, /* 0xE7 */ {0, 0, 0}, /* 0xE8 */ {0, 0, 0}, /* 0xE9 */ {0, 0, 0}, /* 0xEA */ {0, 0, 0}, /* 0xEB */ {0, 0, 0}, /* 0xEC */ {0, 0, 0}, /* 0xED */ {0, 0, 0}, /* 0xEE */ {0, 0, 0}, /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {__cp950ext_decmap+183, 0xd6, 0xfe}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {0, 0, 0}, }; static const DBCHAR __cp950ext_encmap[581] = { 0xa1c2, 0xa145, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xa3e1, 0xa241, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xa1f2, NOCHAR, NOCHAR, NOCHAR, 0xa1f3, 0xf9f8, 0xf9e6, 0xf9ef, 0xf9dd, 0xf9e8, 0xf9f1, 0xf9df, 0xf9ec, 0xf9f5, 0xf9e3, 0xf9ee, 0xf9f7, 0xf9e5, NOCHAR, 0xf9f2, 0xf9e0, NOCHAR, 0xf9f4, 0xf9e2, 0xf9e7, 0xf9f0, 0xf9de, 0xf9ed, 0xf9f6, 0xf9e4, NOCHAR, 0xf9f3, 0xf9e1, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xf9fe, 0xf9d9, 0xf9dc, 0xf9da, 0xf9d6, 0xf9db, 0xf9d8, 0xf9d7, 0xa14e, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xa242, 0xa1fe, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xa240, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xa1e3, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xa246, 0xa247, NOCHAR, NOCHAR, NOCHAR, 0xa244, }; static const struct unim_index cp950ext_encmap[256] = { /* 0x00 */ {__cp950ext_encmap+0, 0xaf, 0xaf}, /* 0x01 */ {0, 0, 0}, /* 0x02 */ {0, 0, 0}, /* 0x03 */ {0, 0, 0}, /* 0x04 */ {0, 0, 0}, /* 0x05 */ {0, 0, 0}, /* 0x06 */ {0, 0, 0}, /* 0x07 */ {0, 0, 0}, /* 0x08 */ {0, 0, 0}, /* 0x09 */ {0, 0, 0}, /* 0x0A */ {0, 0, 0}, /* 0x0B */ {0, 0, 0}, /* 0x0C */ {0, 0, 0}, /* 0x0D */ {0, 0, 0}, /* 0x0E */ {0, 0, 0}, /* 0x0F */ {0, 0, 0}, /* 0x10 */ {0, 0, 0}, /* 0x11 */ {0, 0, 0}, /* 0x12 */ {0, 0, 0}, /* 0x13 */ {0, 0, 0}, /* 0x14 */ {0, 0, 0}, /* 0x15 */ {0, 0, 0}, /* 0x16 */ {0, 0, 0}, /* 0x17 */ {0, 0, 0}, /* 0x18 */ {0, 0, 0}, /* 0x19 */ {0, 0, 0}, /* 0x1A */ {0, 0, 0}, /* 0x1B */ {0, 0, 0}, /* 0x1C */ {0, 0, 0}, /* 0x1D */ {0, 0, 0}, /* 0x1E */ {0, 0, 0}, /* 0x1F */ {0, 0, 0}, /* 0x20 */ {__cp950ext_encmap+1, 0x27, 0xac}, /* 0x21 */ {0, 0, 0}, /* 0x22 */ {__cp950ext_encmap+135, 0x15, 0x99}, /* 0x23 */ {0, 0, 0}, /* 0x24 */ {0, 0, 0}, /* 0x25 */ {__cp950ext_encmap+268, 0x51, 0x93}, /* 0x26 */ {0, 0, 0}, /* 0x27 */ {0, 0, 0}, /* 0x28 */ {0, 0, 0}, /* 0x29 */ {0, 0, 0}, /* 0x2A */ {0, 0, 0}, /* 0x2B */ {0, 0, 0}, /* 0x2C */ {0, 0, 0}, /* 0x2D */ {0, 0, 0}, /* 0x2E */ {0, 0, 0}, /* 0x2F */ {0, 0, 0}, /* 0x30 */ {0, 0, 0}, /* 0x31 */ {0, 0, 0}, /* 0x32 */ {0, 0, 0}, /* 0x33 */ {0, 0, 0}, /* 0x34 */ {0, 0, 0}, /* 0x35 */ {0, 0, 0}, /* 0x36 */ {0, 0, 0}, /* 0x37 */ {0, 0, 0}, /* 0x38 */ {0, 0, 0}, /* 0x39 */ {0, 0, 0}, /* 0x3A */ {0, 0, 0}, /* 0x3B */ {0, 0, 0}, /* 0x3C */ {0, 0, 0}, /* 0x3D */ {0, 0, 0}, /* 0x3E */ {0, 0, 0}, /* 0x3F */ {0, 0, 0}, /* 0x40 */ {0, 0, 0}, /* 0x41 */ {0, 0, 0}, /* 0x42 */ {0, 0, 0}, /* 0x43 */ {0, 0, 0}, /* 0x44 */ {0, 0, 0}, /* 0x45 */ {0, 0, 0}, /* 0x46 */ {0, 0, 0}, /* 0x47 */ {0, 0, 0}, /* 0x48 */ {0, 0, 0}, /* 0x49 */ {0, 0, 0}, /* 0x4A */ {0, 0, 0}, /* 0x4B */ {0, 0, 0}, /* 0x4C */ {0, 0, 0}, /* 0x4D */ {0, 0, 0}, /* 0x4E */ {0, 0, 0}, /* 0x4F */ {0, 0, 0}, /* 0x50 */ {0, 0, 0}, /* 0x51 */ {0, 0, 0}, /* 0x52 */ {0, 0, 0}, /* 0x53 */ {0, 0, 0}, /* 0x54 */ {0, 0, 0}, /* 0x55 */ {0, 0, 0}, /* 0x56 */ {0, 0, 0}, /* 0x57 */ {0, 0, 0}, /* 0x58 */ {__cp950ext_encmap+335, 0xbb, 0xbb}, /* 0x59 */ {0, 0, 0}, /* 0x5A */ {__cp950ext_encmap+336, 0xfa, 0xfa}, /* 0x5B */ {0, 0, 0}, /* 0x5C */ {0, 0, 0}, /* 0x5D */ {0, 0, 0}, /* 0x5E */ {0, 0, 0}, /* 0x5F */ {0, 0, 0}, /* 0x60 */ {__cp950ext_encmap+337, 0x52, 0x52}, /* 0x61 */ {0, 0, 0}, /* 0x62 */ {0, 0, 0}, /* 0x63 */ {0, 0, 0}, /* 0x64 */ {0, 0, 0}, /* 0x65 */ {0, 0, 0}, /* 0x66 */ {0, 0, 0}, /* 0x67 */ {0, 0, 0}, /* 0x68 */ {0, 0, 0}, /* 0x69 */ {0, 0, 0}, /* 0x6A */ {0, 0, 0}, /* 0x6B */ {0, 0, 0}, /* 0x6C */ {0, 0, 0}, /* 0x6D */ {0, 0, 0}, /* 0x6E */ {0, 0, 0}, /* 0x6F */ {0, 0, 0}, /* 0x70 */ {0, 0, 0}, /* 0x71 */ {0, 0, 0}, /* 0x72 */ {0, 0, 0}, /* 0x73 */ {0, 0, 0}, /* 0x74 */ {0, 0, 0}, /* 0x75 */ {0, 0, 0}, /* 0x76 */ {0, 0, 0}, /* 0x77 */ {0, 0, 0}, /* 0x78 */ {__cp950ext_encmap+338, 0x81, 0x81}, /* 0x79 */ {0, 0, 0}, /* 0x7A */ {0, 0, 0}, /* 0x7B */ {0, 0, 0}, /* 0x7C */ {__cp950ext_encmap+339, 0xa7, 0xa7}, /* 0x7D */ {0, 0, 0}, /* 0x7E */ {0, 0, 0}, /* 0x7F */ {0, 0, 0}, /* 0x80 */ {0, 0, 0}, /* 0x81 */ {0, 0, 0}, /* 0x82 */ {0, 0, 0}, /* 0x83 */ {0, 0, 0}, /* 0x84 */ {0, 0, 0}, /* 0x85 */ {0, 0, 0}, /* 0x86 */ {0, 0, 0}, /* 0x87 */ {0, 0, 0}, /* 0x88 */ {__cp950ext_encmap+340, 0xcf, 0xcf}, /* 0x89 */ {0, 0, 0}, /* 0x8A */ {0, 0, 0}, /* 0x8B */ {0, 0, 0}, /* 0x8C */ {0, 0, 0}, /* 0x8D */ {0, 0, 0}, /* 0x8E */ {0, 0, 0}, /* 0x8F */ {0, 0, 0}, /* 0x90 */ {0, 0, 0}, /* 0x91 */ {0, 0, 0}, /* 0x92 */ {__cp950ext_encmap+341, 0xb9, 0xb9}, /* 0x93 */ {0, 0, 0}, /* 0x94 */ {0, 0, 0}, /* 0x95 */ {0, 0, 0}, /* 0x96 */ {0, 0, 0}, /* 0x97 */ {0, 0, 0}, /* 0x98 */ {0, 0, 0}, /* 0x99 */ {0, 0, 0}, /* 0x9A */ {0, 0, 0}, /* 0x9B */ {0, 0, 0}, /* 0x9C */ {0, 0, 0}, /* 0x9D */ {0, 0, 0}, /* 0x9E */ {0, 0, 0}, /* 0x9F */ {0, 0, 0}, /* 0xA0 */ {0, 0, 0}, /* 0xA1 */ {0, 0, 0}, /* 0xA2 */ {0, 0, 0}, /* 0xA3 */ {0, 0, 0}, /* 0xA4 */ {0, 0, 0}, /* 0xA5 */ {0, 0, 0}, /* 0xA6 */ {0, 0, 0}, /* 0xA7 */ {0, 0, 0}, /* 0xA8 */ {0, 0, 0}, /* 0xA9 */ {0, 0, 0}, /* 0xAA */ {0, 0, 0}, /* 0xAB */ {0, 0, 0}, /* 0xAC */ {0, 0, 0}, /* 0xAD */ {0, 0, 0}, /* 0xAE */ {0, 0, 0}, /* 0xAF */ {0, 0, 0}, /* 0xB0 */ {0, 0, 0}, /* 0xB1 */ {0, 0, 0}, /* 0xB2 */ {0, 0, 0}, /* 0xB3 */ {0, 0, 0}, /* 0xB4 */ {0, 0, 0}, /* 0xB5 */ {0, 0, 0}, /* 0xB6 */ {0, 0, 0}, /* 0xB7 */ {0, 0, 0}, /* 0xB8 */ {0, 0, 0}, /* 0xB9 */ {0, 0, 0}, /* 0xBA */ {0, 0, 0}, /* 0xBB */ {0, 0, 0}, /* 0xBC */ {0, 0, 0}, /* 0xBD */ {0, 0, 0}, /* 0xBE */ {0, 0, 0}, /* 0xBF */ {0, 0, 0}, /* 0xC0 */ {0, 0, 0}, /* 0xC1 */ {0, 0, 0}, /* 0xC2 */ {0, 0, 0}, /* 0xC3 */ {0, 0, 0}, /* 0xC4 */ {0, 0, 0}, /* 0xC5 */ {0, 0, 0}, /* 0xC6 */ {0, 0, 0}, /* 0xC7 */ {0, 0, 0}, /* 0xC8 */ {0, 0, 0}, /* 0xC9 */ {0, 0, 0}, /* 0xCA */ {0, 0, 0}, /* 0xCB */ {0, 0, 0}, /* 0xCC */ {0, 0, 0}, /* 0xCD */ {0, 0, 0}, /* 0xCE */ {0, 0, 0}, /* 0xCF */ {0, 0, 0}, /* 0xD0 */ {0, 0, 0}, /* 0xD1 */ {0, 0, 0}, /* 0xD2 */ {0, 0, 0}, /* 0xD3 */ {0, 0, 0}, /* 0xD4 */ {0, 0, 0}, /* 0xD5 */ {0, 0, 0}, /* 0xD6 */ {0, 0, 0}, /* 0xD7 */ {0, 0, 0}, /* 0xD8 */ {0, 0, 0}, /* 0xD9 */ {0, 0, 0}, /* 0xDA */ {0, 0, 0}, /* 0xDB */ {0, 0, 0}, /* 0xDC */ {0, 0, 0}, /* 0xDD */ {0, 0, 0}, /* 0xDE */ {0, 0, 0}, /* 0xDF */ {0, 0, 0}, /* 0xE0 */ {0, 0, 0}, /* 0xE1 */ {0, 0, 0}, /* 0xE2 */ {0, 0, 0}, /* 0xE3 */ {0, 0, 0}, /* 0xE4 */ {0, 0, 0}, /* 0xE5 */ {0, 0, 0}, /* 0xE6 */ {0, 0, 0}, /* 0xE7 */ {0, 0, 0}, /* 0xE8 */ {0, 0, 0}, /* 0xE9 */ {0, 0, 0}, /* 0xEA */ {0, 0, 0}, /* 0xEB */ {0, 0, 0}, /* 0xEC */ {0, 0, 0}, /* 0xED */ {0, 0, 0}, /* 0xEE */ {0, 0, 0}, /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {__cp950ext_encmap+342, 0x51, 0x68}, /* 0xFF */ {__cp950ext_encmap+366, 0x0f, 0xe5}, }; --- NEW FILE: map_gb18030ext.h --- /* * $CJKCodecs: map_gb18030ext.h,v 1.1.1.1 2003/09/24 17:45:51 perky Exp $ */ static const ucs2_t __gb18030ext_decmap[2729] = { 0xe4c6, 0xe4c7, 0xe4c8, 0xe4c9, 0xe4ca, 0xe4cb, 0xe4cc, 0xe4cd, 0xe4ce, 0xe4cf, 0xe4d0, 0xe4d1, 0xe4d2, 0xe4d3, 0xe4d4, 0xe4d5, 0xe4d6, 0xe4d7, 0xe4d8, 0xe4d9, 0xe4da, 0xe4db, 0xe4dc, 0xe4dd, 0xe4de, 0xe4df, 0xe4e0, 0xe4e1, 0xe4e2, 0xe4e3, 0xe4e4, 0xe4e5, 0xe4e6, 0xe4e7, 0xe4e8, 0xe4e9, 0xe4ea, 0xe4eb, 0xe4ec, 0xe4ed, 0xe4ee, 0xe4ef, 0xe4f0, 0xe4f1, 0xe4f2, 0xe4f3, 0xe4f4, 0xe4f5, 0xe4f6, 0xe4f7, 0xe4f8, 0xe4f9, 0xe4fa, 0xe4fb, 0xe4fc, 0xe4fd, 0xe4fe, 0xe4ff, 0xe500, 0xe501, 0xe502, 0xe503, 0xe504, UNIINV, 0xe505, 0xe506, 0xe507, 0xe508, 0xe509, 0xe50a, 0xe50b, 0xe50c, 0xe50d, 0xe50e, 0xe50f, 0xe510, 0xe511, 0xe512, 0xe513, 0xe514, 0xe515, 0xe516, 0xe517, 0xe518, 0xe519, 0xe51a, 0xe51b, 0xe51c, 0xe51d, 0xe51e, 0xe51f, 0xe520, 0xe521, 0xe522, 0xe523, 0xe524, 0xe525, 0xe526, 0xe527, 0xe528, 0xe529, 0xe52a, 0xe52b, 0xe52c, 0xe52d, 0xe52e, 0xe52f, 0xe530, 0xe531, 0xe532, 0xe533, 0xe534, [...1236 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {0, 0, 0}, }; --- NEW FILE: map_gb18030uni.h --- /* * $CJKCodecs: map_gb18030uni.h,v 1.1.1.1 2003/09/24 17:45:51 perky Exp $ */ static const struct _gb18030_to_unibmp_ranges { Py_UNICODE first, last; DBCHAR base; } gb18030_to_unibmp_ranges[] = { { 0x0080, 0x00a3, 0x0000 }, { 0x00a5, 0x00a6, 0x0024 }, { 0x00a9, 0x00af, 0x0026 }, { 0x00b2, 0x00b6, 0x002d }, { 0x00b8, 0x00d6, 0x0032 }, { 0x00d8, 0x00df, 0x0051 }, { 0x00e2, 0x00e7, 0x0059 }, { 0x00eb, 0x00eb, 0x005f }, { 0x00ee, 0x00f1, 0x0060 }, { 0x00f4, 0x00f6, 0x0064 }, { 0x00f8, 0x00f8, 0x0067 }, { 0x00fb, 0x00fb, 0x0068 }, { 0x00fd, 0x0100, 0x0069 }, { 0x0102, 0x0112, 0x006d }, { 0x0114, 0x011a, 0x007e }, { 0x011c, 0x012a, 0x0085 }, { 0x012c, 0x0143, 0x0094 }, { 0x0145, 0x0147, 0x00ac }, { 0x0149, 0x014c, 0x00af }, { 0x014e, 0x016a, 0x00b3 }, { 0x016c, 0x01cd, 0x00d0 }, { 0x01cf, 0x01cf, 0x0132 }, { 0x01d1, 0x01d1, 0x0133 }, { 0x01d3, 0x01d3, 0x0134 }, { 0x01d5, 0x01d5, 0x0135 }, { 0x01d7, 0x01d7, 0x0136 }, { 0x01d9, 0x01d9, 0x0137 }, { 0x01db, 0x01db, 0x0138 }, { 0x01dd, 0x01f8, 0x0139 }, { 0x01fa, 0x0250, 0x0155 }, { 0x0252, 0x0260, 0x01ac }, { 0x0262, 0x02c6, 0x01bb }, { 0x02c8, 0x02c8, 0x0220 }, { 0x02cc, 0x02d8, 0x0221 }, { 0x02da, 0x0390, 0x022e }, { 0x03a2, 0x03a2, 0x02e5 }, { 0x03aa, 0x03b0, 0x02e6 }, { 0x03c2, 0x03c2, 0x02ed }, { 0x03ca, 0x0400, 0x02ee }, { 0x0402, 0x040f, 0x0325 }, { 0x0450, 0x0450, 0x0333 }, { 0x0452, 0x200f, 0x0334 }, { 0x2011, 0x2012, 0x1ef2 }, { 0x2017, 0x2017, 0x1ef4 }, { 0x201a, 0x201b, 0x1ef5 }, { 0x201e, 0x2024, 0x1ef7 }, { 0x2027, 0x202f, 0x1efe }, { 0x2031, 0x2031, 0x1f07 }, { 0x2034, 0x2034, 0x1f08 }, { 0x2036, 0x203a, 0x1f09 }, { 0x203c, 0x20ab, 0x1f0e }, { 0x20ad, 0x2102, 0x1f7e }, { 0x2104, 0x2104, 0x1fd4 }, { 0x2106, 0x2108, 0x1fd5 }, { 0x210a, 0x2115, 0x1fd8 }, { 0x2117, 0x2120, 0x1fe4 }, { 0x2122, 0x215f, 0x1fee }, { 0x216c, 0x216f, 0x202c }, { 0x217a, 0x218f, 0x2030 }, { 0x2194, 0x2195, 0x2046 }, { 0x219a, 0x2207, 0x2048 }, { 0x2209, 0x220e, 0x20b6 }, { 0x2210, 0x2210, 0x20bc }, { 0x2212, 0x2214, 0x20bd }, { 0x2216, 0x2219, 0x20c0 }, { 0x221b, 0x221c, 0x20c4 }, { 0x2221, 0x2222, 0x20c6 }, { 0x2224, 0x2224, 0x20c8 }, { 0x2226, 0x2226, 0x20c9 }, { 0x222c, 0x222d, 0x20ca }, { 0x222f, 0x2233, 0x20cc }, { 0x2238, 0x223c, 0x20d1 }, { 0x223e, 0x2247, 0x20d6 }, { 0x2249, 0x224b, 0x20e0 }, { 0x224d, 0x2251, 0x20e3 }, { 0x2253, 0x225f, 0x20e8 }, { 0x2262, 0x2263, 0x20f5 }, { 0x2268, 0x226d, 0x20f7 }, { 0x2270, 0x2294, 0x20fd }, { 0x2296, 0x2298, 0x2122 }, { 0x229a, 0x22a4, 0x2125 }, { 0x22a6, 0x22be, 0x2130 }, { 0x22c0, 0x2311, 0x2149 }, { 0x2313, 0x245f, 0x219b }, { 0x246a, 0x2473, 0x22e8 }, { 0x249c, 0x24ff, 0x22f2 }, { 0x254c, 0x254f, 0x2356 }, { 0x2574, 0x2580, 0x235a }, { 0x2590, 0x2592, 0x2367 }, { 0x2596, 0x259f, 0x236a }, { 0x25a2, 0x25b1, 0x2374 }, { 0x25b4, 0x25bb, 0x2384 }, { 0x25be, 0x25c5, 0x238c }, { 0x25c8, 0x25ca, 0x2394 }, { 0x25cc, 0x25cd, 0x2397 }, { 0x25d0, 0x25e1, 0x2399 }, { 0x25e6, 0x2604, 0x23ab }, { 0x2607, 0x2608, 0x23ca }, { 0x260a, 0x263f, 0x23cc }, { 0x2641, 0x2641, 0x2402 }, { 0x2643, 0x2e80, 0x2403 }, { 0x2e82, 0x2e83, 0x2c41 }, { 0x2e85, 0x2e87, 0x2c43 }, { 0x2e89, 0x2e8a, 0x2c46 }, { 0x2e8d, 0x2e96, 0x2c48 }, { 0x2e98, 0x2ea6, 0x2c52 }, { 0x2ea8, 0x2ea9, 0x2c61 }, { 0x2eab, 0x2ead, 0x2c63 }, { 0x2eaf, 0x2eb2, 0x2c66 }, { 0x2eb4, 0x2eb5, 0x2c6a }, { 0x2eb8, 0x2eba, 0x2c6c }, { 0x2ebc, 0x2ec9, 0x2c6f }, { 0x2ecb, 0x2fef, 0x2c7d }, { 0x2ffc, 0x2fff, 0x2da2 }, { 0x3004, 0x3004, 0x2da6 }, { 0x3018, 0x301c, 0x2da7 }, { 0x301f, 0x3020, 0x2dac }, { 0x302a, 0x303d, 0x2dae }, { 0x303f, 0x3040, 0x2dc2 }, { 0x3094, 0x309a, 0x2dc4 }, { 0x309f, 0x30a0, 0x2dcb }, { 0x30f7, 0x30fb, 0x2dcd }, { 0x30ff, 0x3104, 0x2dd2 }, { 0x312a, 0x321f, 0x2dd8 }, { 0x322a, 0x3230, 0x2ece }, { 0x3232, 0x32a2, 0x2ed5 }, { 0x32a4, 0x338d, 0x2f46 }, { 0x3390, 0x339b, 0x3030 }, { 0x339f, 0x33a0, 0x303c }, { 0x33a2, 0x33c3, 0x303e }, { 0x33c5, 0x33cd, 0x3060 }, { 0x33cf, 0x33d0, 0x3069 }, { 0x33d3, 0x33d4, 0x306b }, { 0x33d6, 0x3446, 0x306d }, { 0x3448, 0x3472, 0x30de }, { 0x3474, 0x359d, 0x3109 }, { 0x359f, 0x360d, 0x3233 }, { 0x360f, 0x3619, 0x32a2 }, { 0x361b, 0x3917, 0x32ad }, { 0x3919, 0x396d, 0x35aa }, { 0x396f, 0x39ce, 0x35ff }, { 0x39d1, 0x39de, 0x365f }, { 0x39e0, 0x3a72, 0x366d }, { 0x3a74, 0x3b4d, 0x3700 }, { 0x3b4f, 0x3c6d, 0x37da }, { 0x3c6f, 0x3cdf, 0x38f9 }, { 0x3ce1, 0x4055, 0x396a }, { 0x4057, 0x415e, 0x3cdf }, { 0x4160, 0x4336, 0x3de7 }, { 0x4338, 0x43ab, 0x3fbe }, { 0x43ad, 0x43b0, 0x4032 }, { 0x43b2, 0x43dc, 0x4036 }, { 0x43de, 0x44d5, 0x4061 }, { 0x44d7, 0x464b, 0x4159 }, { 0x464d, 0x4660, 0x42ce }, { 0x4662, 0x4722, 0x42e2 }, { 0x4724, 0x4728, 0x43a3 }, { 0x472a, 0x477b, 0x43a8 }, { 0x477d, 0x478c, 0x43fa }, { 0x478e, 0x4946, 0x440a }, { 0x4948, 0x4979, 0x45c3 }, { 0x497b, 0x497c, 0x45f5 }, { 0x497e, 0x4981, 0x45f7 }, { 0x4984, 0x4984, 0x45fb }, { 0x4987, 0x499a, 0x45fc }, { 0x499c, 0x499e, 0x4610 }, { 0x49a0, 0x49b5, 0x4613 }, { 0x49b8, 0x4c76, 0x4629 }, { 0x4c78, 0x4c9e, 0x48e8 }, { 0x4ca4, 0x4d12, 0x490f }, { 0x4d1a, 0x4dad, 0x497e }, { 0x4daf, 0x4dff, 0x4a12 }, { 0x9fa6, 0xd7ff, 0x4a63 }, { 0xe76c, 0xe76c, 0x82bd }, { 0xe7c8, 0xe7c8, 0x82be }, { 0xe7e7, 0xe7f3, 0x82bf }, { 0xe815, 0xe815, 0x82cc }, { 0xe819, 0xe81d, 0x82cd }, { 0xe81f, 0xe825, 0x82d2 }, { 0xe827, 0xe82a, 0x82d9 }, { 0xe82d, 0xe830, 0x82dd }, { 0xe833, 0xe83a, 0x82e1 }, { 0xe83c, 0xe842, 0x82e9 }, { 0xe844, 0xe853, 0x82f0 }, { 0xe856, 0xe863, 0x8300 }, { 0xe865, 0xf92b, 0x830e }, { 0xf92d, 0xf978, 0x93d5 }, { 0xf97a, 0xf994, 0x9421 }, { 0xf996, 0xf9e6, 0x943c }, { 0xf9e8, 0xf9f0, 0x948d }, { 0xf9f2, 0xfa0b, 0x9496 }, { 0xfa10, 0xfa10, 0x94b0 }, { 0xfa12, 0xfa12, 0x94b1 }, { 0xfa15, 0xfa17, 0x94b2 }, { 0xfa19, 0xfa1e, 0x94b5 }, { 0xfa22, 0xfa22, 0x94bb }, { 0xfa25, 0xfa26, 0x94bc }, { 0xfa2a, 0xfe2f, 0x94be }, { 0xfe32, 0xfe32, 0x98c4 }, { 0xfe45, 0xfe48, 0x98c5 }, { 0xfe53, 0xfe53, 0x98c9 }, { 0xfe58, 0xfe58, 0x98ca }, { 0xfe67, 0xfe67, 0x98cb }, { 0xfe6c, 0xff00, 0x98cc }, { 0xff5f, 0xffdf, 0x9961 }, { 0xffe6, 0xffff, 0x99e2 }, { 0x0000, 0x0000, 0x99fc }, }; --- NEW FILE: map_gb2312.h --- /* * $CJKCodecs: map_gb2312.h,v 1.1.1.1 2003/09/24 17:45:54 perky Exp $ */ static const ucs2_t __gb2312_decmap[7482] = { 0x3000, 0x3001, 0x3002, 0x30fb, 0x02c9, 0x02c7, 0x00a8, 0x3003, 0x3005, 0x2015, 0xff5e, 0x2016, 0x2026, 0x2018, 0x2019, 0x201c, 0x201d, 0x3014, 0x3015, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, 0x300d, 0x300e, 0x300f, 0x3016, 0x3017, 0x3010, 0x3011, 0x00b1, 0x00d7, 0x00f7, 0x2236, 0x2227, 0x2228, 0x2211, 0x220f, 0x222a, 0x2229, 0x2208, 0x2237, 0x221a, 0x22a5, 0x2225, 0x2220, 0x2312, 0x2299, 0x222b, 0x222e, 0x2261, 0x224c, 0x2248, 0x223d, 0x221d, 0x2260, 0x226e, 0x226f, 0x2264, 0x2265, 0x221e, 0x2235, 0x2234, 0x2642, 0x2640, 0x00b0, 0x2032, 0x2033, 0x2103, 0xff04, 0x00a4, 0xffe0, 0xffe1, 0x2030, 0x00a7, 0x2116, 0x2606, 0x2605, 0x25cb, 0x25cf, 0x25ce, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25b3, 0x25b2, 0x203b, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, 0x2488, 0x2489, 0x248a, 0x248b, 0x248c, 0x248d, 0x248e, 0x248f, 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497, 0x2498, 0x2499, [...1164 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {0, 0, 0}, }; --- NEW FILE: map_gbcommon.h --- /* * $CJKCodecs: map_gbcommon.h,v 1.1.1.1 2003/09/24 17:46:08 perky Exp $ */ static const DBCHAR __gbcommon_encmap[23231] = { 0x2168, NOCHAR, NOCHAR, 0x216c, 0x2127, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2163, 0x2140, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xa1a4, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2141, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2824, 0x2822, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2828, 0x2826, 0x283a, NOCHAR, 0x282c, 0x282a, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2830, 0x282e, NOCHAR, NOCHAR, NOCHAR, 0x2142, NOCHAR, 0x2834, 0x2832, NOCHAR, 0x2839, 0x2821, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0x2825, NOCHAR, NOCHAR, NOCHAR, NOCHAR, [...3132 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {__gbcommon_encmap+22714, 0x2c, 0xf1}, /* 0xFA */ {__gbcommon_encmap+22912, 0x0c, 0x29}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {__gbcommon_encmap+22942, 0x30, 0x6b}, /* 0xFF */ {__gbcommon_encmap+23002, 0x01, 0xe5}, }; --- NEW FILE: map_gbkext.h --- /* * $CJKCodecs: map_gbkext.h,v 1.1.1.1 2003/09/24 17:46:15 perky Exp $ */ static const ucs2_t __gbkext_decmap[14531] = { 0x4e02, 0x4e04, 0x4e05, 0x4e06, 0x4e0f, 0x4e12, 0x4e17, 0x4e1f, 0x4e20, 0x4e21, 0x4e23, 0x4e26, 0x4e29, 0x4e2e, 0x4e2f, 0x4e31, 0x4e33, 0x4e35, 0x4e37, 0x4e3c, 0x4e40, 0x4e41, 0x4e42, 0x4e44, 0x4e46, 0x4e4a, 0x4e51, 0x4e55, 0x4e57, 0x4e5a, 0x4e5b, 0x4e62, 0x4e63, 0x4e64, 0x4e65, 0x4e67, 0x4e68, 0x4e6a, 0x4e6b, 0x4e6c, 0x4e6d, 0x4e6e, 0x4e6f, 0x4e72, 0x4e74, 0x4e75, 0x4e76, 0x4e77, 0x4e78, 0x4e79, 0x4e7a, 0x4e7b, 0x4e7c, 0x4e7d, 0x4e7f, 0x4e80, 0x4e81, 0x4e82, 0x4e83, 0x4e84, 0x4e85, 0x4e87, 0x4e8a, UNIINV, 0x4e90, 0x4e96, 0x4e97, 0x4e99, 0x4e9c, 0x4e9d, 0x4e9e, 0x4ea3, 0x4eaa, 0x4eaf, 0x4eb0, 0x4eb1, 0x4eb4, 0x4eb6, 0x4eb7, 0x4eb8, 0x4eb9, 0x4ebc, 0x4ebd, 0x4ebe, 0x4ec8, 0x4ecc, 0x4ecf, 0x4ed0, 0x4ed2, 0x4eda, 0x4edb, 0x4edc, 0x4ee0, 0x4ee2, 0x4ee6, 0x4ee7, 0x4ee9, 0x4eed, 0x4eee, 0x4eef, 0x4ef1, 0x4ef4, 0x4ef8, 0x4ef9, 0x4efa, 0x4efc, 0x4efe, 0x4f00, 0x4f02, 0x4f03, 0x4f04, 0x4f05, [...2045 lines suppressed...] /* 0xEF */ {__gbkext_decmap+13060, 0x40, 0xa0}, /* 0xF0 */ {__gbkext_decmap+13157, 0x40, 0xa0}, /* 0xF1 */ {__gbkext_decmap+13254, 0x40, 0xa0}, /* 0xF2 */ {__gbkext_decmap+13351, 0x40, 0xa0}, /* 0xF3 */ {__gbkext_decmap+13448, 0x40, 0xa0}, /* 0xF4 */ {__gbkext_decmap+13545, 0x40, 0xa0}, /* 0xF5 */ {__gbkext_decmap+13642, 0x40, 0xa0}, /* 0xF6 */ {__gbkext_decmap+13739, 0x40, 0xa0}, /* 0xF7 */ {__gbkext_decmap+13836, 0x40, 0xa0}, /* 0xF8 */ {__gbkext_decmap+13933, 0x40, 0xa0}, /* 0xF9 */ {__gbkext_decmap+14030, 0x40, 0xa0}, /* 0xFA */ {__gbkext_decmap+14127, 0x40, 0xa0}, /* 0xFB */ {__gbkext_decmap+14224, 0x40, 0xa0}, /* 0xFC */ {__gbkext_decmap+14321, 0x40, 0xa0}, /* 0xFD */ {__gbkext_decmap+14418, 0x40, 0xa0}, /* 0xFE */ {__gbkext_decmap+14515, 0x40, 0x4f}, /* 0xFF */ {0, 0, 0}, }; --- NEW FILE: map_jisx0208.h --- /* * $CJKCodecs: map_jisx0208.h,v 1.1.1.1 2003/09/24 17:46:20 perky Exp $ */ static const ucs2_t __jisx0208_decmap[6956] = { 0x3000, 0x3001, 0x3002, 0xff0c, 0xff0e, 0x30fb, 0xff1a, 0xff1b, 0xff1f, 0xff01, 0x309b, 0x309c, 0x00b4, 0xff40, 0x00a8, 0xff3e, 0xffe3, 0xff3f, 0x30fd, 0x30fe, 0x309d, 0x309e, 0x3003, 0x4edd, 0x3005, 0x3006, 0x3007, 0x30fc, 0x2015, 0x2010, 0xff0f, 0x005c, 0x301c, 0x2016, 0xff5c, 0x2026, 0x2025, 0x2018, 0x2019, 0x201c, 0x201d, 0xff08, 0xff09, 0x3014, 0x3015, 0xff3b, 0xff3d, 0xff5b, 0xff5d, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, 0x300d, 0x300e, 0x300f, 0x3010, 0x3011, 0xff0b, 0x2212, 0x00b1, 0x00d7, 0x00f7, 0xff1d, 0x2260, 0xff1c, 0xff1e, 0x2266, 0x2267, 0x221e, 0x2234, 0x2642, 0x2640, 0x00b0, 0x2032, 0x2033, 0x2103, 0xffe5, 0xff04, 0x00a2, 0x00a3, 0xff05, 0xff03, 0xff06, 0xff0a, 0xff20, 0x00a7, 0x2606, 0x2605, 0x25cb, 0x25cf, 0x25ce, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25b3, 0x25b2, 0x25bd, 0x25bc, 0x203b, 0x3012, 0x2192, 0x2190, 0x2191, 0x2193, 0x3013, UNIINV, UNIINV, UNIINV, UNIINV, [...1098 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {0, 0, 0}, }; --- NEW FILE: map_jisx0212.h --- /* * $CJKCodecs: map_jisx0212.h,v 1.1.1.1 2003/09/24 17:46:24 perky Exp $ */ static const ucs2_t __jisx0212_decmap[6179] = { 0x02d8, 0x02c7, 0x00b8, 0x02d9, 0x02dd, 0x00af, 0x02db, 0x02da, 0x007e, 0x0384, 0x0385, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x00a1, 0x00a6, 0x00bf, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x00ba, 0x00aa, 0x00a9, 0x00ae, 0x2122, 0x00a4, 0x2116, 0x0386, 0x0388, 0x0389, 0x038a, 0x03aa, UNIINV, 0x038c, UNIINV, 0x038e, 0x03ab, UNIINV, 0x038f, UNIINV, UNIINV, UNIINV, UNIINV, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03ca, 0x0390, 0x03cc, 0x03c2, 0x03cd, 0x03cb, 0x03b0, 0x03ce, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x040e, 0x040f, UNIINV, UNIINV, UNIINV, UNIINV, [...1001 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {0, 0, 0}, }; --- NEW FILE: map_jisx0213.h --- /* * $CJKCodecs: map_jisx0213.h,v 1.1.1.1 2003/09/24 17:46:45 perky Exp $ */ static const ucs2_t __jisx0213_1_bmp_decmap[2187] = { 0xff07, 0xff02, 0xff0d, 0x007e, 0x3033, 0x3034, 0x3035, 0x303b, 0x303c, 0x30ff, 0x309f, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x2284, 0x2285, 0x228a, 0x228b, 0x2209, 0x2205, 0x2305, 0x2306, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x2295, 0x2296, 0x2297, 0x2225, 0x2226, 0x2985, 0x2986, 0x3018, 0x3019, 0x3016, 0x3017, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x2262, 0x2243, 0x2245, 0x2248, 0x2276, 0x2277, 0x2194, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x266e, 0x266b, 0x266c, 0x2669, 0x25b7, 0x25b6, 0x25c1, 0x25c0, 0x2197, 0x2198, 0x2196, 0x2199, 0x21c4, 0x21e8, 0x21e6, 0x21e7, 0x21e9, 0x2934, 0x2935, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x29bf, 0x25c9, 0x303d, 0xfe46, 0xfe45, 0x25e6, 0x2022, UNIINV, [...6907 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {0, 0, 0}, }; --- NEW FILE: map_jisx0213_pairs.h --- /* * $CJKCodecs: map_jisx0213_pairs.h,v 1.2 2003/11/27 13:29:01 perky Exp $ */ static const ucs4_t __jisx0213_pairdecmap[49] = { 0x304b309a, 0x304d309a, 0x304f309a, 0x3051309a, 0x3053309a, 0x30ab309a, 0x30ad309a, 0x30af309a, 0x30b1309a, 0x30b3309a, 0x30bb309a, 0x30c4309a, 0x30c8309a, 0x31f7309a, 0x00e60300, UNIINV, UNIINV, UNIINV, 0x02540300, 0x02540301, 0x028c0300, 0x028c0301, 0x02590300, 0x02590301, 0x025a0300, 0x025a0301, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, UNIINV, 0x02e902e5, 0x02e502e9, }; static const struct widedbcs_index jisx0213_pairdecmap[256] = { /* 0x00 */ {0, 0, 0}, /* 0x01 */ {0, 0, 0}, /* 0x02 */ {0, 0, 0}, /* 0x03 */ {0, 0, 0}, /* 0x04 */ {0, 0, 0}, /* 0x05 */ {0, 0, 0}, /* 0x06 */ {0, 0, 0}, /* 0x07 */ {0, 0, 0}, /* 0x08 */ {0, 0, 0}, /* 0x09 */ {0, 0, 0}, /* 0x0A */ {0, 0, 0}, /* 0x0B */ {0, 0, 0}, /* 0x0C */ {0, 0, 0}, /* 0x0D */ {0, 0, 0}, /* 0x0E */ {0, 0, 0}, /* 0x0F */ {0, 0, 0}, /* 0x10 */ {0, 0, 0}, /* 0x11 */ {0, 0, 0}, /* 0x12 */ {0, 0, 0}, /* 0x13 */ {0, 0, 0}, /* 0x14 */ {0, 0, 0}, /* 0x15 */ {0, 0, 0}, /* 0x16 */ {0, 0, 0}, /* 0x17 */ {0, 0, 0}, /* 0x18 */ {0, 0, 0}, /* 0x19 */ {0, 0, 0}, /* 0x1A */ {0, 0, 0}, /* 0x1B */ {0, 0, 0}, /* 0x1C */ {0, 0, 0}, /* 0x1D */ {0, 0, 0}, /* 0x1E */ {0, 0, 0}, /* 0x1F */ {0, 0, 0}, /* 0x20 */ {0, 0, 0}, /* 0x21 */ {0, 0, 0}, /* 0x22 */ {0, 0, 0}, /* 0x23 */ {0, 0, 0}, /* 0x24 */ {__jisx0213_pairdecmap+0, 0x77, 0x7b}, /* 0x25 */ {__jisx0213_pairdecmap+5, 0x77, 0x7e}, /* 0x26 */ {__jisx0213_pairdecmap+13, 0x78, 0x78}, /* 0x27 */ {0, 0, 0}, /* 0x28 */ {0, 0, 0}, /* 0x29 */ {0, 0, 0}, /* 0x2A */ {0, 0, 0}, /* 0x2B */ {__jisx0213_pairdecmap+14, 0x44, 0x66}, /* 0x2C */ {0, 0, 0}, /* 0x2D */ {0, 0, 0}, /* 0x2E */ {0, 0, 0}, /* 0x2F */ {0, 0, 0}, /* 0x30 */ {0, 0, 0}, /* 0x31 */ {0, 0, 0}, /* 0x32 */ {0, 0, 0}, /* 0x33 */ {0, 0, 0}, /* 0x34 */ {0, 0, 0}, /* 0x35 */ {0, 0, 0}, /* 0x36 */ {0, 0, 0}, /* 0x37 */ {0, 0, 0}, /* 0x38 */ {0, 0, 0}, /* 0x39 */ {0, 0, 0}, /* 0x3A */ {0, 0, 0}, /* 0x3B */ {0, 0, 0}, /* 0x3C */ {0, 0, 0}, /* 0x3D */ {0, 0, 0}, /* 0x3E */ {0, 0, 0}, /* 0x3F */ {0, 0, 0}, /* 0x40 */ {0, 0, 0}, /* 0x41 */ {0, 0, 0}, /* 0x42 */ {0, 0, 0}, /* 0x43 */ {0, 0, 0}, /* 0x44 */ {0, 0, 0}, /* 0x45 */ {0, 0, 0}, /* 0x46 */ {0, 0, 0}, /* 0x47 */ {0, 0, 0}, /* 0x48 */ {0, 0, 0}, /* 0x49 */ {0, 0, 0}, /* 0x4A */ {0, 0, 0}, /* 0x4B */ {0, 0, 0}, /* 0x4C */ {0, 0, 0}, /* 0x4D */ {0, 0, 0}, /* 0x4E */ {0, 0, 0}, /* 0x4F */ {0, 0, 0}, /* 0x50 */ {0, 0, 0}, /* 0x51 */ {0, 0, 0}, /* 0x52 */ {0, 0, 0}, /* 0x53 */ {0, 0, 0}, /* 0x54 */ {0, 0, 0}, /* 0x55 */ {0, 0, 0}, /* 0x56 */ {0, 0, 0}, /* 0x57 */ {0, 0, 0}, /* 0x58 */ {0, 0, 0}, /* 0x59 */ {0, 0, 0}, /* 0x5A */ {0, 0, 0}, /* 0x5B */ {0, 0, 0}, /* 0x5C */ {0, 0, 0}, /* 0x5D */ {0, 0, 0}, /* 0x5E */ {0, 0, 0}, /* 0x5F */ {0, 0, 0}, /* 0x60 */ {0, 0, 0}, /* 0x61 */ {0, 0, 0}, /* 0x62 */ {0, 0, 0}, /* 0x63 */ {0, 0, 0}, /* 0x64 */ {0, 0, 0}, /* 0x65 */ {0, 0, 0}, /* 0x66 */ {0, 0, 0}, /* 0x67 */ {0, 0, 0}, /* 0x68 */ {0, 0, 0}, /* 0x69 */ {0, 0, 0}, /* 0x6A */ {0, 0, 0}, /* 0x6B */ {0, 0, 0}, /* 0x6C */ {0, 0, 0}, /* 0x6D */ {0, 0, 0}, /* 0x6E */ {0, 0, 0}, /* 0x6F */ {0, 0, 0}, /* 0x70 */ {0, 0, 0}, /* 0x71 */ {0, 0, 0}, /* 0x72 */ {0, 0, 0}, /* 0x73 */ {0, 0, 0}, /* 0x74 */ {0, 0, 0}, /* 0x75 */ {0, 0, 0}, /* 0x76 */ {0, 0, 0}, /* 0x77 */ {0, 0, 0}, /* 0x78 */ {0, 0, 0}, /* 0x79 */ {0, 0, 0}, /* 0x7A */ {0, 0, 0}, /* 0x7B */ {0, 0, 0}, /* 0x7C */ {0, 0, 0}, /* 0x7D */ {0, 0, 0}, /* 0x7E */ {0, 0, 0}, /* 0x7F */ {0, 0, 0}, /* 0x80 */ {0, 0, 0}, /* 0x81 */ {0, 0, 0}, /* 0x82 */ {0, 0, 0}, /* 0x83 */ {0, 0, 0}, /* 0x84 */ {0, 0, 0}, /* 0x85 */ {0, 0, 0}, /* 0x86 */ {0, 0, 0}, /* 0x87 */ {0, 0, 0}, /* 0x88 */ {0, 0, 0}, /* 0x89 */ {0, 0, 0}, /* 0x8A */ {0, 0, 0}, /* 0x8B */ {0, 0, 0}, /* 0x8C */ {0, 0, 0}, /* 0x8D */ {0, 0, 0}, /* 0x8E */ {0, 0, 0}, /* 0x8F */ {0, 0, 0}, /* 0x90 */ {0, 0, 0}, /* 0x91 */ {0, 0, 0}, /* 0x92 */ {0, 0, 0}, /* 0x93 */ {0, 0, 0}, /* 0x94 */ {0, 0, 0}, /* 0x95 */ {0, 0, 0}, /* 0x96 */ {0, 0, 0}, /* 0x97 */ {0, 0, 0}, /* 0x98 */ {0, 0, 0}, /* 0x99 */ {0, 0, 0}, /* 0x9A */ {0, 0, 0}, /* 0x9B */ {0, 0, 0}, /* 0x9C */ {0, 0, 0}, /* 0x9D */ {0, 0, 0}, /* 0x9E */ {0, 0, 0}, /* 0x9F */ {0, 0, 0}, /* 0xA0 */ {0, 0, 0}, /* 0xA1 */ {0, 0, 0}, /* 0xA2 */ {0, 0, 0}, /* 0xA3 */ {0, 0, 0}, /* 0xA4 */ {0, 0, 0}, /* 0xA5 */ {0, 0, 0}, /* 0xA6 */ {0, 0, 0}, /* 0xA7 */ {0, 0, 0}, /* 0xA8 */ {0, 0, 0}, /* 0xA9 */ {0, 0, 0}, /* 0xAA */ {0, 0, 0}, /* 0xAB */ {0, 0, 0}, /* 0xAC */ {0, 0, 0}, /* 0xAD */ {0, 0, 0}, /* 0xAE */ {0, 0, 0}, /* 0xAF */ {0, 0, 0}, /* 0xB0 */ {0, 0, 0}, /* 0xB1 */ {0, 0, 0}, /* 0xB2 */ {0, 0, 0}, /* 0xB3 */ {0, 0, 0}, /* 0xB4 */ {0, 0, 0}, /* 0xB5 */ {0, 0, 0}, /* 0xB6 */ {0, 0, 0}, /* 0xB7 */ {0, 0, 0}, /* 0xB8 */ {0, 0, 0}, /* 0xB9 */ {0, 0, 0}, /* 0xBA */ {0, 0, 0}, /* 0xBB */ {0, 0, 0}, /* 0xBC */ {0, 0, 0}, /* 0xBD */ {0, 0, 0}, /* 0xBE */ {0, 0, 0}, /* 0xBF */ {0, 0, 0}, /* 0xC0 */ {0, 0, 0}, /* 0xC1 */ {0, 0, 0}, /* 0xC2 */ {0, 0, 0}, /* 0xC3 */ {0, 0, 0}, /* 0xC4 */ {0, 0, 0}, /* 0xC5 */ {0, 0, 0}, /* 0xC6 */ {0, 0, 0}, /* 0xC7 */ {0, 0, 0}, /* 0xC8 */ {0, 0, 0}, /* 0xC9 */ {0, 0, 0}, /* 0xCA */ {0, 0, 0}, /* 0xCB */ {0, 0, 0}, /* 0xCC */ {0, 0, 0}, /* 0xCD */ {0, 0, 0}, /* 0xCE */ {0, 0, 0}, /* 0xCF */ {0, 0, 0}, /* 0xD0 */ {0, 0, 0}, /* 0xD1 */ {0, 0, 0}, /* 0xD2 */ {0, 0, 0}, /* 0xD3 */ {0, 0, 0}, /* 0xD4 */ {0, 0, 0}, /* 0xD5 */ {0, 0, 0}, /* 0xD6 */ {0, 0, 0}, /* 0xD7 */ {0, 0, 0}, /* 0xD8 */ {0, 0, 0}, /* 0xD9 */ {0, 0, 0}, /* 0xDA */ {0, 0, 0}, /* 0xDB */ {0, 0, 0}, /* 0xDC */ {0, 0, 0}, /* 0xDD */ {0, 0, 0}, /* 0xDE */ {0, 0, 0}, /* 0xDF */ {0, 0, 0}, /* 0xE0 */ {0, 0, 0}, /* 0xE1 */ {0, 0, 0}, /* 0xE2 */ {0, 0, 0}, /* 0xE3 */ {0, 0, 0}, /* 0xE4 */ {0, 0, 0}, /* 0xE5 */ {0, 0, 0}, /* 0xE6 */ {0, 0, 0}, /* 0xE7 */ {0, 0, 0}, /* 0xE8 */ {0, 0, 0}, /* 0xE9 */ {0, 0, 0}, /* 0xEA */ {0, 0, 0}, /* 0xEB */ {0, 0, 0}, /* 0xEC */ {0, 0, 0}, /* 0xED */ {0, 0, 0}, /* 0xEE */ {0, 0, 0}, /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {0, 0, 0}, }; #define JISX0213_ENCPAIRS 46 static struct pair_encodemap jisx0213_pairencmap[JISX0213_ENCPAIRS] = { { 0x00e60000, 0x295c }, { 0x00e60300, 0x2b44 }, { 0x02540000, 0x2b38 }, { 0x02540300, 0x2b48 }, { 0x02540301, 0x2b49 }, { 0x02590000, 0x2b30 }, { 0x02590300, 0x2b4c }, { 0x02590301, 0x2b4d }, { 0x025a0000, 0x2b43 }, { 0x025a0300, 0x2b4e }, { 0x025a0301, 0x2b4f }, { 0x028c0000, 0x2b37 }, { 0x028c0300, 0x2b4a }, { 0x028c0301, 0x2b4b }, { 0x02e50000, 0x2b60 }, { 0x02e502e9, 0x2b66 }, { 0x02e90000, 0x2b64 }, { 0x02e902e5, 0x2b65 }, { 0x304b0000, 0x242b }, { 0x304b309a, 0x2477 }, { 0x304d0000, 0x242d }, { 0x304d309a, 0x2478 }, { 0x304f0000, 0x242f }, { 0x304f309a, 0x2479 }, { 0x30510000, 0x2431 }, { 0x3051309a, 0x247a }, { 0x30530000, 0x2433 }, { 0x3053309a, 0x247b }, { 0x30ab0000, 0x252b }, { 0x30ab309a, 0x2577 }, { 0x30ad0000, 0x252d }, { 0x30ad309a, 0x2578 }, { 0x30af0000, 0x252f }, { 0x30af309a, 0x2579 }, { 0x30b10000, 0x2531 }, { 0x30b1309a, 0x257a }, { 0x30b30000, 0x2533 }, { 0x30b3309a, 0x257b }, { 0x30bb0000, 0x253b }, { 0x30bb309a, 0x257c }, { 0x30c40000, 0x2544 }, { 0x30c4309a, 0x257d }, { 0x30c80000, 0x2548 }, { 0x30c8309a, 0x257e }, { 0x31f70000, 0x2675 }, { 0x31f7309a, 0x2678 }, }; --- NEW FILE: map_jisxcommon.h --- /* * $CJKCodecs: map_jisxcommon.h,v 1.1.1.1 2003/09/24 17:46:57 perky Exp $ */ static const DBCHAR __jisxcommon_encmap[22016] = { 0x2140, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xa237, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xa242, 0x2171, 0x2172, 0xa270, NOCHAR, 0xa243, 0x2178, 0x212f, 0xa26d, 0xa26c, NOCHAR, 0x224c, NOCHAR, 0xa26e, 0xa234, 0x216b, 0x215e, NOCHAR, NOCHAR, 0x212d, NOCHAR, 0x2279, NOCHAR, 0xa231, NOCHAR, 0xa26b, NOCHAR, NOCHAR, NOCHAR, NOCHAR, 0xa244, 0xaa22, 0xaa21, 0xaa24, 0xaa2a, 0xaa23, 0xaa29, 0xa921, 0xaa2e, 0xaa32, 0xaa31, 0xaa34, 0xaa33, [...2980 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {__jisxcommon_encmap+21787, 0x01, 0xe5}, }; --- NEW FILE: map_ksx1001.h --- /* * $CJKCodecs: map_ksx1001.h,v 1.1.1.1 2003/09/24 17:47:00 perky Exp $ */ static const ucs2_t __ksx1001_decmap[8264] = { 0x3000, 0x3001, 0x3002, 0x00b7, 0x2025, 0x2026, 0x00a8, 0x3003, 0x00ad, 0x2015, 0x2225, 0xff3c, 0x223c, 0x2018, 0x2019, 0x201c, 0x201d, 0x3014, 0x3015, 0x3008, 0x3009, 0x300a, 0x300b, 0x300c, 0x300d, 0x300e, 0x300f, 0x3010, 0x3011, 0x00b1, 0x00d7, 0x00f7, 0x2260, 0x2264, 0x2265, 0x221e, 0x2234, 0x00b0, 0x2032, 0x2033, 0x2103, 0x212b, 0xffe0, 0xffe1, 0xffe5, 0x2642, 0x2640, 0x2220, 0x22a5, 0x2312, 0x2202, 0x2207, 0x2261, 0x2252, 0x00a7, 0x203b, 0x2606, 0x2605, 0x25cb, 0x25cf, 0x25ce, 0x25c7, 0x25c6, 0x25a1, 0x25a0, 0x25b3, 0x25b2, 0x25bd, 0x25bc, 0x2192, 0x2190, 0x2191, 0x2193, 0x2194, 0x3013, 0x226a, 0x226b, 0x221a, 0x223d, 0x221d, 0x2235, 0x222b, 0x222c, 0x2208, 0x220b, 0x2286, 0x2287, 0x2282, 0x2283, 0x222a, 0x2229, 0x2227, 0x2228, 0xffe2, 0x21d2, 0x21d4, 0x2200, 0x2203, 0x00b4, 0xff5e, 0x02c7, 0x02d8, 0x02dd, 0x02da, 0x02d9, 0x00b8, 0x02db, 0x00a1, 0x00bf, 0x02d0, 0x222e, 0x2211, [...1261 lines suppressed...] /* 0xEF */ {0, 0, 0}, /* 0xF0 */ {0, 0, 0}, /* 0xF1 */ {0, 0, 0}, /* 0xF2 */ {0, 0, 0}, /* 0xF3 */ {0, 0, 0}, /* 0xF4 */ {0, 0, 0}, /* 0xF5 */ {0, 0, 0}, /* 0xF6 */ {0, 0, 0}, /* 0xF7 */ {0, 0, 0}, /* 0xF8 */ {0, 0, 0}, /* 0xF9 */ {0, 0, 0}, /* 0xFA */ {0, 0, 0}, /* 0xFB */ {0, 0, 0}, /* 0xFC */ {0, 0, 0}, /* 0xFD */ {0, 0, 0}, /* 0xFE */ {0, 0, 0}, /* 0xFF */ {0, 0, 0}, }; --- NEW FILE: mapdata_ja_JP.c --- /* * mapdata_ja_JP.c: Map Provider for Japanese Encodings * * Written by Hye-Shik Chang * $CJKCodecs: mapdata_ja_JP.c,v 1.3 2004/01/17 11:26:10 perky Exp $ */ #include "Python.h" #include "cjkcommon.h" #include "map_jisx0208.h" #include "map_jisx0212.h" #include "map_jisx0213.h" #include "map_jisxcommon.h" #include "map_cp932ext.h" static struct dbcs_map mapholders[] = { {"jisx0208", NULL, jisx0208_decmap}, {"jisx0212", NULL, jisx0212_decmap}, {"jisxcommon", jisxcommon_encmap, NULL}, {"jisx0213_1_bmp", NULL, jisx0213_1_bmp_decmap}, {"jisx0213_2_bmp", NULL, jisx0213_2_bmp_decmap}, {"jisx0213_bmp", jisx0213_bmp_encmap, NULL}, {"jisx0213_1_emp", NULL, jisx0213_1_emp_decmap}, {"jisx0213_2_emp", NULL, jisx0213_2_emp_decmap}, {"jisx0213_emp", jisx0213_emp_encmap, NULL}, {"cp932ext", cp932ext_encmap, cp932ext_decmap}, {"", NULL, NULL}, }; static struct PyMethodDef __methods[] = { {NULL, NULL}, }; void init_codecs_mapdata_ja_JP(void) { struct dbcs_map *h; PyObject *m; m = Py_InitModule("_codecs_mapdata_ja_JP", __methods); for (h = mapholders; h->charset[0] != '\0'; h++) { char mhname[256] = "__map_"; strcpy(mhname + sizeof("__map_") - 1, h->charset); PyModule_AddObject(m, mhname, PyCObject_FromVoidPtr(h, NULL)); } if (PyErr_Occurred()) Py_FatalError("can't initialize the _codecs_mapdata_ja_JP module"); } --- NEW FILE: mapdata_ko_KR.c --- /* * mapdata_ko_KR.c: Map Provider for Korean Encodings * * Written by Hye-Shik Chang * $CJKCodecs: mapdata_ko_KR.c,v 1.3 2004/01/17 11:26:10 perky Exp $ */ #include "Python.h" #include "cjkcommon.h" #include "map_ksx1001.h" #include "map_cp949.h" #include "map_cp949ext.h" static struct dbcs_map mapholders[] = { {"ksx1001", NULL, ksx1001_decmap}, {"cp949", cp949_encmap, NULL}, {"cp949ext", NULL, cp949ext_decmap}, {"", NULL, NULL}, }; static struct PyMethodDef __methods[] = { {NULL, NULL}, }; void init_codecs_mapdata_ko_KR(void) { struct dbcs_map *h; PyObject *m; m = Py_InitModule("_codecs_mapdata_ko_KR", __methods); for (h = mapholders; h->charset[0] != '\0'; h++) { char mhname[256] = "__map_"; strcpy(mhname + sizeof("__map_") - 1, h->charset); PyModule_AddObject(m, mhname, PyCObject_FromVoidPtr(h, NULL)); } if (PyErr_Occurred()) Py_FatalError("can't initialize the _codecs_mapdata_ko_KR module"); } --- NEW FILE: mapdata_zh_CN.c --- /* * mapdata_zh_CN.c: Map Provider for Simplified Chinese Encodings * * Written by Hye-Shik Chang * $CJKCodecs: mapdata_zh_CN.c,v 1.3 2004/01/17 11:26:10 perky Exp $ */ #include "Python.h" #include "cjkcommon.h" #include "map_gb2312.h" #include "map_gbkext.h" #include "map_gbcommon.h" #include "map_gb18030ext.h" static struct dbcs_map mapholders[] = { {"gb2312", NULL, gb2312_decmap}, {"gbkext", NULL, gbkext_decmap}, {"gbcommon", gbcommon_encmap, NULL}, {"gb18030ext", gb18030ext_encmap, gb18030ext_decmap}, {"", NULL, NULL}, }; static struct PyMethodDef __methods[] = { {NULL, NULL}, }; void init_codecs_mapdata_zh_CN(void) { struct dbcs_map *h; PyObject *m; m = Py_InitModule("_codecs_mapdata_zh_CN", __methods); for (h = mapholders; h->charset[0] != '\0'; h++) { char mhname[256] = "__map_"; strcpy(mhname + sizeof("__map_") - 1, h->charset); PyModule_AddObject(m, mhname, PyCObject_FromVoidPtr(h, NULL)); } if (PyErr_Occurred()) Py_FatalError("can't initialize the _codecs_mapdata_zh_CN module"); } --- NEW FILE: mapdata_zh_TW.c --- /* * mapdata_zh_TW.c: Map Provider for Traditional Chinese Encodings * * Written by Hye-Shik Chang * $CJKCodecs: mapdata_zh_TW.c,v 1.3 2004/01/17 11:26:10 perky Exp $ */ #include "Python.h" #include "cjkcommon.h" #include "map_big5.h" #include "map_cp950ext.h" static struct dbcs_map mapholders[] = { {"big5", big5_encmap, big5_decmap}, {"cp950ext", cp950ext_encmap, cp950ext_decmap}, {"", NULL, NULL}, }; static struct PyMethodDef __methods[] = { {NULL, NULL}, }; void init_codecs_mapdata_zh_TW(void) { struct dbcs_map *h; PyObject *m; m = Py_InitModule("_codecs_mapdata_zh_TW", __methods); for (h = mapholders; h->charset[0] != '\0'; h++) { char mhname[256] = "__map_"; strcpy(mhname + sizeof("__map_") - 1, h->charset); PyModule_AddObject(m, mhname, PyCObject_FromVoidPtr(h, NULL)); } if (PyErr_Occurred()) Py_FatalError("can't initialize the _codecs_mapdata_zh_TW module"); } --- NEW FILE: multibytecodec.c --- /* * multibytecodec.c: Common Multibyte Codec Implementation * * Written by Hye-Shik Chang * $CJKCodecs: multibytecodec.c,v 1.6 2004/01/17 11:26:10 perky Exp $ */ #include "Python.h" #include "multibytecodec.h" typedef struct { const Py_UNICODE *inbuf, *inbuf_top, *inbuf_end; unsigned char *outbuf, *outbuf_end; PyObject *excobj, *outobj; } MultibyteEncodeBuffer; typedef struct { const unsigned char *inbuf, *inbuf_top, *inbuf_end; [...1171 lines suppressed...] return (PyObject *)self; errorexit: Py_XDECREF(self); return NULL; } static struct PyMethodDef __methods[] = { {"__create_codec", (PyCFunction)__create_codec, METH_O}, {NULL, NULL}, }; void init_multibytecodec(void) { Py_InitModule("_multibytecodec", __methods); if (PyErr_Occurred()) Py_FatalError("can't initialize the _multibytecodec module"); } --- NEW FILE: multibytecodec.h --- /* * multibytecodec.h: Common Multibyte Codec Implementation * * Written by Hye-Shik Chang * $CJKCodecs: multibytecodec.h,v 1.2 2003/12/31 05:46:55 perky Exp $ */ #ifndef _PYTHON_MULTIBYTECODEC_H_ #define _PYTHON_MULTIBYTECODEC_H_ #ifdef __cplusplus extern "C" { #endif #include "cjkcommon.h" typedef union { void *p; int i; unsigned char c[8]; ucs2_t u2[4]; ucs4_t u4[2]; } MultibyteCodec_State; typedef int (*mbencode_func)(MultibyteCodec_State *state, const Py_UNICODE **inbuf, size_t inleft, unsigned char **outbuf, size_t outleft, int flags); typedef int (*mbencodeinit_func)(MultibyteCodec_State *state); typedef int (*mbencodereset_func)(MultibyteCodec_State *state, unsigned char **outbuf, size_t outleft); typedef int (*mbdecode_func)(MultibyteCodec_State *state, const unsigned char **inbuf, size_t inleft, Py_UNICODE **outbuf, size_t outleft); typedef int (*mbdecodeinit_func)(MultibyteCodec_State *state); typedef int (*mbdecodereset_func)(MultibyteCodec_State *state); typedef struct { const char *encoding; mbencode_func encode; mbencodeinit_func encinit; mbencodereset_func encreset; mbdecode_func decode; mbdecodeinit_func decinit; mbdecodereset_func decreset; } MultibyteCodec; typedef struct { PyObject_HEAD MultibyteCodec *codec; } MultibyteCodecObject; #define MAXDECPENDING 8 typedef struct { PyObject_HEAD MultibyteCodec *codec; MultibyteCodec_State state; unsigned char pending[MAXDECPENDING]; int pendingsize; PyObject *stream, *errors; } MultibyteStreamReaderObject; #define MAXENCPENDING 2 typedef struct { PyObject_HEAD MultibyteCodec *codec; MultibyteCodec_State state; Py_UNICODE pending[MAXENCPENDING]; int pendingsize; PyObject *stream, *errors; } MultibyteStreamWriterObject; /* positive values for illegal sequences */ #define MBERR_TOOSMALL (-1) /* insufficient output buffer space */ #define MBERR_TOOFEW (-2) /* incomplete input buffer */ #define MBERR_INTERNAL (-3) /* internal runtime error */ #define ERROR_STRICT (PyObject *)(1) #define ERROR_IGNORE (PyObject *)(2) #define ERROR_REPLACE (PyObject *)(3) #define ERROR_MAX ERROR_REPLACE #define MBENC_FLUSH 0x0001 /* encode all characters encodable */ #define MBENC_MAX MBENC_FLUSH #ifdef __cplusplus } #endif #endif --- NEW FILE: tweak_gbk.h --- /* $CJKCodecs: tweak_gbk.h,v 1.1.1.1 2003/09/24 17:47:00 perky Exp $ */ #define GBK_PREDECODE(dc1, dc2, assi) \ if ((dc1) == 0xa1 && (dc2) == 0xaa) (assi) = 0x2014; \ else if ((dc1) == 0xa8 && (dc2) == 0x44) (assi) = 0x2015; \ else if ((dc1) == 0xa1 && (dc2) == 0xa4) (assi) = 0x00b7; #define GBK_PREENCODE(code, assi) \ if ((code) == 0x2014) (assi) = 0xa1aa; \ else if ((code) == 0x2015) (assi) = 0xa844; \ else if ((code) == 0x00b7) (assi) = 0xa1a4; From perky at users.sourceforge.net Sat Jan 17 09:59:38 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Sat Jan 17 09:59:41 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.920,1.921 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv19600 Modified Files: NEWS Log Message: Add a news entry for importing of CJK codecs. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.920 retrieving revision 1.921 diff -C2 -d -r1.920 -r1.921 *** NEWS 17 Jan 2004 14:22:44 -0000 1.920 --- NEWS 17 Jan 2004 14:59:36 -0000 1.921 *************** *** 261,264 **** --- 261,266 ---- - Bug #823328: urllib2.py's HTTP Digest Auth support works again. + - Patch #873597: CJK codecs are imported into rank of default codecs. + Tools/Demos ----------- From barry at python.org Sat Jan 17 11:06:32 2004 From: barry at python.org (Barry Warsaw) Date: Sat Jan 17 11:06:36 2004 Subject: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5 In-Reply-To: References: Message-ID: <1074355591.27252.77.camel@anthem> On Sat, 2004-01-17 at 09:29, perky@users.sourceforge.net wrote: > Update of /cvsroot/python/python/dist/src/Lib/email/test > In directory sc8-pr-cvs1:/tmp/cvs-serv14239/Lib/email/test > > Modified Files: > test_email_codecs.py > Log Message: > Add CJK codecs support as discussed on python-dev. (SF #873597) Should we backport this to 2.3? I still intend to backport 852347 when the branch is unfrozen . -Barry From loewis at users.sourceforge.net Sat Jan 17 15:51:26 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Sat Jan 17 15:51:31 2004 Subject: [Python-checkins] python/nondist/sandbox/msi msi.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/msi In directory sc8-pr-cvs1:/tmp/cvs-serv681 Modified Files: msi.py Log Message: Attempt to remove existing versions. Check whether target dir exists. Silence some validation warnings. Index: msi.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/msi/msi.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** msi.py 7 Jan 2004 22:04:10 -0000 1.5 --- msi.py 17 Jan 2004 20:51:24 -0000 1.6 *************** *** 13,23 **** srcdir = r'e:\pyinst\python' ! major, minor = current_version.split(".")[:2] short_version = major+"."+minor # This should never change ! upgrade_code='{92A24481-3ECB-40FC-8836-04B7966EC0D5}' # This should be extended for each Python release product_codes = { '2.3.2' : "{3ad0c9ed-7e5e-478c-b539-5cc3a2f8772a}", --- 13,25 ---- srcdir = r'e:\pyinst\python' ! major, minor, micro = current_version.split(".") short_version = major+"."+minor # This should never change ! upgrade_code_alpha='{92A24481-3ECB-40FC-8836-04B7966EC0D5}' ! upgrade_code='{65E6DE48-A358-434D-AA4F-4AF72DB4718F}' # This should be extended for each Python release + # Alpha releases have their own product code product_codes = { '2.3.2' : "{3ad0c9ed-7e5e-478c-b539-5cc3a2f8772a}", *************** *** 54,58 **** if alpha: release = int(time.time()/3600/24) ! current_version += ".%d" % release if testpackage: --- 56,62 ---- if alpha: release = int(time.time()/3600/24) ! full_current_version = "%s.%d" % (current_version, release) ! else: ! full_current_version = current_version if testpackage: *************** *** 66,76 **** def build_database(): ! db = msilib.init_database("python%s.msi" % current_version,schema, ! ProductName="Python "+current_version, ! ProductCode=product_code, ! ProductVersion=current_version, Manufacturer=u"Martin v. L\xf6wis") msilib.add_tables(db, sequence) ! add_data(db, "Property", [("UpgradeCode", upgrade_code), ("DEFAULTPYTHON", "1"), ("WhichUsers", "ALL")]) --- 70,88 ---- def build_database(): ! if alpha: ! cv = "%s.%s.%s" % (major, minor, release) ! uc = upgrade_code_alpha ! pc = msilib.gen_uuid() ! else: ! cv = current_version ! uc = upgrade_code ! pc = product_code ! db = msilib.init_database("python%s.msi" % full_current_version, schema, ! ProductName="Python "+full_current_version, ! ProductCode=pc, ! ProductVersion=cv, Manufacturer=u"Martin v. L\xf6wis") msilib.add_tables(db, sequence) ! add_data(db, "Property", [("UpgradeCode", uc), ("DEFAULTPYTHON", "1"), ("WhichUsers", "ALL")]) *************** *** 78,81 **** --- 90,113 ---- return db + def remove_old_versions(db): + start = "%s.%s.0" % (major, minor) + remove_package = 0 + migrate_features = 1 + if alpha: + add_data(db, "Upgrade", + [(upgrade_code_alpha, start, + "%s.%s.%s" % (major, minor, release), None, migrate_features, + None, "REMOVEOLDALPHA")]) + props = "REMOVEOLDALPHA" + else: + add_data(db, "Upgrade", + [(upgrade_code, start, current_version, + None, migrate_features, None, "REMOVEOLDVERSION"), + (upgrade_code_alpha, start, "%s.%s.0" % (major, minor+1), + None, migrate_features, None, "REMOVEOLDALPHA")]) + props = "REMOVEOLDALPHA;REMOVEOLDVERSION" + add_data(db, "Property", [("SecureCustomProperties", props)]) + + class PyDialog(Dialog): def __init__(self, *args, **kw): *************** *** 136,139 **** --- 168,185 ---- ("py.ico",msilib.Binary(srcdir+r"\PC\py.ico")), ]) + # Scripts + open("inst.vbs","w").write(""" + Function CheckDir() + Set FSO = CreateObject("Scripting.FileSystemObject") + if FSO.FolderExists(Session.Property("TARGETDIR")) then + Session.Property("TargetExists") = "1" + else + Session.Property("TargetExists") = "0" + end if + End Function + """) + add_data(db, "Binary", [("Script", msilib.Binary("inst.vbs"))]) + add_data(db, "CustomAction", [("CheckDir", 6, "Script", "CheckDir")]) + os.unlink("inst.vbs") *************** *** 290,296 **** seldlg.back("< Back", None, active=0) c = seldlg.next("Next >", "Cancel") ! c.event("SetTargetPath", "TARGETDIR", order=1) ! c.event("SpawnWaitDialog", "WaitForCostingDlg", "CostingComplete = 1", 2) ! c.event("NewDialog", "SelectFeaturesDlg", order=3) c = seldlg.cancel("Cancel", "DirectoryCombo") --- 336,344 ---- seldlg.back("< Back", None, active=0) c = seldlg.next("Next >", "Cancel") ! c.event("DoAction", "CheckDir", "TargetExistsOk<>1", order=1) ! c.event("SpawnDialog", "ExistingDirectoryDlg", "TargetExists=1", 2) ! c.event("SetTargetPath", "TARGETDIR", "TargetExists=0", 3) ! c.event("SpawnWaitDialog", "WaitForCostingDlg", "CostingComplete=1", 4) ! c.event("NewDialog", "SelectFeaturesDlg", "TargetExists=0", 5) c = seldlg.cancel("Cancel", "DirectoryCombo") *************** *** 398,401 **** --- 446,461 ---- advanced.cancel("Ok", "Default", name="OK").event("EndDialog", "Return") + ##################################################################### + # Existing Directory dialog + dlg = Dialog(db, "ExistingDirectoryDlg", 50, 30, 200, 80, modal, title, + "No", "No", "No") + dlg.text("Title", 10, 20, 180, 40, 3, + "[TARGETDIR] exists. Are you sure you want to overwrite existing files?") + c=dlg.pushbutton("Yes", 30, 60, 55, 17, 3, "Yes", "No") + c.event("[TargetExists]", "0", order=1) + c.event("[TargetExistsOk]", "1", order=2) + c.event("EndDialog", "Return", order=3) + c=dlg.pushbutton("No", 115, 60, 55, 17, 3, "No", "Yes") + c.event("EndDialog", "Return") ##################################################################### *************** *** 722,726 **** add_data(db, "Directory", [("ProgramMenuFolder", "TARGETDIR", "."), ! ("MENUDIR", "ProgramMenuFolder", "PY%s%s|%sPython %s.%s" % (major,minor,testprefix,major,minor))]) add_data(db, "Shortcut", [# Advertised shortcuts: targets are features, not files --- 782,786 ---- add_data(db, "Directory", [("ProgramMenuFolder", "TARGETDIR", "."), ! ("MenuDir", "ProgramMenuFolder", "PY%s%s|%sPython %s.%s" % (major,minor,testprefix,major,minor))]) add_data(db, "Shortcut", [# Advertised shortcuts: targets are features, not files *************** *** 728,755 **** # XXX, advertised shortcuts don't work, so make them unadvertised # for now ! #("IDLE", "MENUDIR", "IDLE|IDLE (Python GUI)", "pythonw.exe", # default_feature.id, r"[TARGETDIR]Lib\idlelib\idle.pyw", # None, None, None, None, None, "TARGETDIR"), ! #("PyDoc", "MENUDIR", "MODDOCS|Module Docs", "pythonw.exe", # default_feature.id, r"[TARGETDIR]Tools\scripts\pydocgui.pyw", # None, None, None, None, None, "TARGETDIR"), ! #("Python", "MENUDIR", "PYTHON|Python (command line)", "python.exe", # default_feature.id, None, # None, None, None, None, None, "TARGETDIR"), ! ("IDLE", "MENUDIR", "IDLE|IDLE (Python GUI)", "REGISTRY", r"[TARGETDIR]pythonw.exe", r"[TARGETDIR]Lib\idlelib\idle.pyw", None, None, None, None, None, "TARGETDIR"), ! ("PyDoc", "MENUDIR", "MODDOCS|Module Docs", "REGISTRY", r"[TARGETDIR]pythonw.exe", r"[TARGETDIR]Tools\scripts\pydocgui.pyw", None, None, None, None, None, "TARGETDIR"), ! ("Python", "MENUDIR", "PYTHON|Python (command line)", "REGISTRY", r"[TARGETDIR]python.exe", None, None, None, None, None, None, "TARGETDIR"), # Non-advertised features: must be associated with a registry component ! ("Manual", "MENUDIR", "MANUAL|Python Manuals", "REGISTRY", r"[TARGETDIR]Doc\python%s%s.chm" % (major, minor), None, None, None, None, None, None, None), # XXX: System64Folder on Win64 ! ("Uninstall", "MENUDIR", "UNINST|Uninstall Python", "REGISTRY", "[SystemFolder]msiexec", "/x%s" % product_code, None, None, None, None, None, None), --- 788,815 ---- # XXX, advertised shortcuts don't work, so make them unadvertised # for now ! #("IDLE", "MenuDir", "IDLE|IDLE (Python GUI)", "pythonw.exe", # default_feature.id, r"[TARGETDIR]Lib\idlelib\idle.pyw", # None, None, None, None, None, "TARGETDIR"), ! #("PyDoc", "MenuDir", "MODDOCS|Module Docs", "pythonw.exe", # default_feature.id, r"[TARGETDIR]Tools\scripts\pydocgui.pyw", # None, None, None, None, None, "TARGETDIR"), ! #("Python", "MenuDir", "PYTHON|Python (command line)", "python.exe", # default_feature.id, None, # None, None, None, None, None, "TARGETDIR"), ! ("IDLE", "MenuDir", "IDLE|IDLE (Python GUI)", "REGISTRY", r"[TARGETDIR]pythonw.exe", r"[TARGETDIR]Lib\idlelib\idle.pyw", None, None, None, None, None, "TARGETDIR"), ! ("PyDoc", "MenuDir", "MODDOCS|Module Docs", "REGISTRY", r"[TARGETDIR]pythonw.exe", r"[TARGETDIR]Tools\scripts\pydocgui.pyw", None, None, None, None, None, "TARGETDIR"), ! ("Python", "MenuDir", "PYTHON|Python (command line)", "REGISTRY", r"[TARGETDIR]python.exe", None, None, None, None, None, None, "TARGETDIR"), # Non-advertised features: must be associated with a registry component ! ("Manual", "MenuDir", "MANUAL|Python Manuals", "REGISTRY", r"[TARGETDIR]Doc\python%s%s.chm" % (major, minor), None, None, None, None, None, None, None), # XXX: System64Folder on Win64 ! ("Uninstall", "MenuDir", "UNINST|Uninstall Python", "REGISTRY", "[SystemFolder]msiexec", "/x%s" % product_code, None, None, None, None, None, None), *************** *** 763,766 **** --- 823,827 ---- add_files(db) add_registry(db) + remove_old_versions(db) db.Commit() finally: From martin at v.loewis.de Sat Jan 17 19:20:50 2004 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sat Jan 17 19:21:07 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5 In-Reply-To: <1074355591.27252.77.camel@anthem> References: <1074355591.27252.77.camel@anthem> Message-ID: <4009D162.3000700@v.loewis.de> Barry Warsaw wrote: > Should we backport this to 2.3? I think the maintainer of 2.3 has voiced a clear "no to new features" policy for 2.3. This would be certainly a new feature. Regards, Martin From anthony at interlink.com.au Sun Jan 18 07:26:33 2004 From: anthony at interlink.com.au (Anthony Baxter) Date: Sun Jan 18 07:27:21 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5 In-Reply-To: <4009D162.3000700@v.loewis.de> Message-ID: <20040118122633.F068625AF47@bonanza.off.ekorp.com> >>> =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?= wrote > I think the maintainer of 2.3 has voiced a clear "no to new features" > policy for 2.3. This would be certainly a new feature. If it can be shown that this is a pure win (that is, it improves code for 2.3.4, but is both backwards and forwards compatible, then I don't mind. I _do_ mind if we end up with the horror of 2.2.2's not-really- booleans, which has resulted in FAR FAR too much code of the form: try: True, False except: True, False = 1, 0 I do not wish to see something like this again. Anthony -- Anthony Baxter It's never too late to have a happy childhood. From python at rcn.com Sun Jan 18 08:33:48 2004 From: python at rcn.com (Raymond Hettinger) Date: Sun Jan 18 08:34:48 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/testtest_email_codecs.py, 1.4, 1.5 In-Reply-To: <20040118122633.F068625AF47@bonanza.off.ekorp.com> Message-ID: <000101c3ddc7$b4335800$311dc797@oemcomputer> [Martin v. L?wis] > > I think the maintainer of 2.3 has voiced a clear "no to new features" > > policy for 2.3. This would be certainly a new feature. [Anthony Baxter] > If it can be shown that this is a pure win (that is, it improves code > for 2.3.4, but is both backwards and forwards compatible, then I don't > mind. I _do_ mind if we end up with the horror of 2.2.2's not-really- > booleans, which has resulted in FAR FAR too much code of the form: > > try: > True, False > except: > True, False = 1, 0 > > I do not wish to see something like this again. +1 on backporting it. The CJK codecs are essentially invisible to most users. However, its availability will increase python's acceptance in places where it is not currently being used. Increasing the user base should not have to wait for Py2.4. Raymond Hettinger From martin at v.loewis.de Sun Jan 18 09:56:51 2004 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sun Jan 18 09:57:43 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5 In-Reply-To: <20040118122633.F068625AF47@bonanza.off.ekorp.com> References: <20040118122633.F068625AF47@bonanza.off.ekorp.com> Message-ID: <400A9EB3.6030602@v.loewis.de> Anthony Baxter wrote: > If it can be shown that this is a pure win (that is, it improves code > for 2.3.4, but is both backwards and forwards compatible, then I don't > mind. I _do_ mind if we end up with the horror of 2.2.2's not-really- > booleans, which has resulted in FAR FAR too much code of the form: > > try: > True, False > except: > True, False = 1, 0 It depends on the usage. If applications just do foo.encode("some-cjk-encoding") then all will work fine. However, it may be that applications do try: codecs.lookup("some-cjk-encoding") except LookupError: try: import japanese japanese.register_aliases() except ImportError: pass Regards, Martin From perky at i18n.org Sun Jan 18 10:26:16 2004 From: perky at i18n.org (Hye-Shik Chang) Date: Sun Jan 18 10:25:47 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5 In-Reply-To: <400A9EB3.6030602@v.loewis.de> References: <20040118122633.F068625AF47@bonanza.off.ekorp.com> <400A9EB3.6030602@v.loewis.de> Message-ID: <20040118152616.GA56270@i18n.org> On Sun, Jan 18, 2004 at 03:56:51PM +0100, "Martin v. L?wis" wrote: > Anthony Baxter wrote: > >If it can be shown that this is a pure win (that is, it improves code > >for 2.3.4, but is both backwards and forwards compatible, then I don't > >mind. I _do_ mind if we end up with the horror of 2.2.2's not-really- > >booleans, which has resulted in FAR FAR too much code of the form: > > > >try: > > True, False > >except: > > True, False = 1, 0 > > It depends on the usage. If applications just do > > foo.encode("some-cjk-encoding") > > then all will work fine. However, it may be that applications > do > > try: > codecs.lookup("some-cjk-encoding") > except LookupError: > try: > import japanese > japanese.register_aliases() > except ImportError: > pass This usage is useful only for -S mode. The recent Asian codecs register its aliases by their respective .pth. So, backporting CJK codecs won't let Japanese developers code in this way. If there's a man who need real JapaneseCodecs not CJK codecs, they can use it by installing JapaneseCodecs package as they've been done. Hye-Shik From barry at python.org Sun Jan 18 10:50:26 2004 From: barry at python.org (Barry Warsaw) Date: Sun Jan 18 10:50:30 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5 In-Reply-To: <20040118122633.F068625AF47@bonanza.off.ekorp.com> References: <20040118122633.F068625AF47@bonanza.off.ekorp.com> Message-ID: <1074441025.28485.23.camel@anthem> On Sun, 2004-01-18 at 07:26, Anthony Baxter wrote: > If it can be shown that this is a pure win (that is, it improves code > for 2.3.4, but is both backwards and forwards compatible, then I don't > mind. Understood. I'll do the best I can to test this, but it would help if someone less monolingual than I can help. Here's the plan: I'm going to run the tests w/o the patch, but with JapaneseCodecs installed. Then I'll apply the patch and re-run the test. Then I'll install/enable CJKCodecs and re-run the test. I'd expect everything to pass, but I'm not sure that's a complete enough test. In addition, I plan on running Mailman 2.1.x with Python 2.3.x under similar environments as above. I'd expect to see the same pretty pictures in the web interface under both scenarios. I'll try to cobble together some Japanese charset emails and send them through, but since I can't read Japanese, I'm really shooting blind. -Barry From akuchling at users.sourceforge.net Sun Jan 18 10:55:53 2004 From: akuchling at users.sourceforge.net (akuchling@users.sourceforge.net) Date: Sun Jan 18 10:55:57 2004 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.27, 1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1:/tmp/cvs-serv21448 Modified Files: whatsnew24.tex Log Message: Add CJK codecs Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** whatsnew24.tex 5 Jan 2004 10:13:34 -0000 1.27 --- whatsnew24.tex 18 Jan 2004 15:55:51 -0000 1.28 *************** *** 310,313 **** --- 310,327 ---- (Contributed by Dmitry Vasiliev.) + \item The CJKCodecs collections of East Asian codecs, maintained + by Hye-Shik Chang, was integrated into 2.4. + The new encodings are: + + \begin{itemize} + \item Chinese (PRC): gb2312, gbk, gb18030, hz + \item Chinese (ROC): big5, cp950 + \item Japanese: cp932, shift-jis, shift-jisx0213, euc-jp, + euc-jisx0213, iso-2022-jp, iso-2022-jp-1, iso-2022-jp-2, + iso-2022-jp-3, iso-2022-jp-ext + \item Korean: cp949, euc-kr, johab, iso-2022-kr + \end{itemize} + + \item The \module{heapq} module has been converted to C. The resulting ten-fold improvement in speed makes the module suitable for handling From tim_one at users.sourceforge.net Sun Jan 18 15:29:57 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun Jan 18 15:30:04 2004 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.175,2.176 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv17688/Objects Modified Files: listobject.c Log Message: Whitespace normalization. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.175 retrieving revision 2.176 diff -C2 -d -r2.175 -r2.176 *** listobject.c 4 Jan 2004 06:08:16 -0000 2.175 --- listobject.c 18 Jan 2004 20:29:55 -0000 2.176 *************** *** 58,68 **** PyListObject *op; size_t nbytes; if (size < 0) { PyErr_BadInternalCall(); return NULL; } ! nbytes = size * sizeof(PyObject *); /* Check for overflow */ ! if (nbytes / sizeof(PyObject *) != (size_t)size) { return PyErr_NoMemory(); } --- 58,70 ---- PyListObject *op; size_t nbytes; + int allocated_size = roundupsize(size); + if (size < 0) { PyErr_BadInternalCall(); return NULL; } ! nbytes = allocated_size * sizeof(PyObject *); /* Check for overflow */ ! if (nbytes / sizeof(PyObject *) != (size_t)allocated_size) { return PyErr_NoMemory(); } *************** *** 79,83 **** return PyErr_NoMemory(); } ! memset(op->ob_item, 0, sizeof(*op->ob_item) * size); } op->ob_size = size; --- 81,85 ---- return PyErr_NoMemory(); } ! memset(op->ob_item, 0, sizeof(*op->ob_item) * allocated_size); } op->ob_size = size; *************** *** 155,159 **** } items = self->ob_item; ! NRESIZE(items, PyObject *, self->ob_size+1); if (items == NULL) { PyErr_NoMemory(); --- 157,162 ---- } items = self->ob_item; ! if (roundupsize(self->ob_size) - 1 == self->ob_size || items == NULL) ! NRESIZE(items, PyObject *, self->ob_size+1); if (items == NULL) { PyErr_NoMemory(); *************** *** 1879,1883 **** saved_ob_item = self->ob_item; self->ob_size = 0; ! self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0); if (keyfunc != NULL) { --- 1882,1887 ---- saved_ob_item = self->ob_item; self->ob_size = 0; ! /* self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0); */ ! self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, roundupsize(0)); if (keyfunc != NULL) { From tim_one at users.sourceforge.net Sun Jan 18 15:29:57 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun Jan 18 15:30:08 2004 Subject: [Python-checkins] python/dist/src/Lib/distutils/command build_ext.py, 1.91, 1.92 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory sc8-pr-cvs1:/tmp/cvs-serv17688/Lib/distutils/command Modified Files: build_ext.py Log Message: Whitespace normalization. Index: build_ext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_ext.py,v retrieving revision 1.91 retrieving revision 1.92 diff -C2 -d -r1.91 -r1.92 *** build_ext.py 19 Nov 2002 13:12:28 -0000 1.91 --- build_ext.py 18 Jan 2004 20:29:54 -0000 1.92 *************** *** 172,176 **** # this allows distutils on windows to work in the source tree self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC')) ! self.library_dirs.append(os.path.join(sys.exec_prefix, 'PCBuild')) # OS/2 (EMX) doesn't support Debug vs Release builds, but has the --- 172,177 ---- # this allows distutils on windows to work in the source tree self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC')) ! self.library_dirs.append(os.path.join(sys.exec_prefix, 'PC', 'VC6')) ! #self.library_dirs.append(os.path.join(sys.exec_prefix, 'PCBuild')) # OS/2 (EMX) doesn't support Debug vs Release builds, but has the From tim_one at users.sourceforge.net Sun Jan 18 15:29:57 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun Jan 18 15:30:10 2004 Subject: [Python-checkins] python/dist/src/Lib StringIO.py, 1.31, 1.32 _strptime.py, 1.29, 1.30 httplib.py, 1.82, 1.83 random.py, 1.58, 1.59 sre_parse.py, 1.58, 1.59 traceback.py, 1.29, 1.30 urllib2.py, 1.59, 1.60 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1:/tmp/cvs-serv17688/Lib Modified Files: StringIO.py _strptime.py httplib.py random.py sre_parse.py traceback.py urllib2.py Log Message: Whitespace normalization. Index: StringIO.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/StringIO.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** StringIO.py 15 Dec 2003 10:16:09 -0000 1.31 --- StringIO.py 18 Jan 2004 20:29:54 -0000 1.32 *************** *** 143,147 **** def truncate(self, size=None): ! _complain_ifclosed(self.closed) if size is None: size = self.pos --- 143,147 ---- def truncate(self, size=None): ! _complain_ifclosed(self.closed) if size is None: size = self.pos Index: _strptime.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** _strptime.py 16 Nov 2003 16:17:48 -0000 1.29 --- _strptime.py 18 Jan 2004 20:29:54 -0000 1.30 *************** *** 366,370 **** if time.tzname[0] == time.tzname[1] and \ time.daylight: ! break else: tz = value --- 366,370 ---- if time.tzname[0] == time.tzname[1] and \ time.daylight: ! break else: tz = value Index: httplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/httplib.py,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -d -r1.82 -r1.83 *** httplib.py 19 Nov 2003 19:51:55 -0000 1.82 --- httplib.py 18 Jan 2004 20:29:54 -0000 1.83 *************** *** 611,615 **** self.__response = None ! # in certain cases, we cannot issue another request on this connection. # this occurs when: --- 611,615 ---- self.__response = None ! # in certain cases, we cannot issue another request on this connection. # this occurs when: *************** *** 732,736 **** # optional skip_host argument to putrequest(). The check is # harder because field names are case insensitive. ! if 'host' in [k.lower() for k in headers]: self.putrequest(method, url, skip_host=1) else: --- 732,736 ---- # optional skip_host argument to putrequest(). The check is # harder because field names are case insensitive. ! if 'host' in [k.lower() for k in headers]: self.putrequest(method, url, skip_host=1) else: Index: random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** random.py 6 Nov 2003 14:06:47 -0000 1.58 --- random.py 18 Jan 2004 20:29:54 -0000 1.59 *************** *** 178,182 **** if width >= maxwidth: ! return int(istart + self._randbelow(width)) return int(istart + int(self.random()*width)) if step == 1: --- 178,182 ---- if width >= maxwidth: ! return int(istart + self._randbelow(width)) return int(istart + int(self.random()*width)) if step == 1: Index: sre_parse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** sre_parse.py 17 Oct 2003 22:13:16 -0000 1.58 --- sre_parse.py 18 Jan 2004 20:29:54 -0000 1.59 *************** *** 366,372 **** def _parse_sub_cond(source, state, condgroup): ! item_yes = _parse(source, state) if source.match("|"): ! item_no = _parse(source, state) if source.match("|"): raise error, "conditional backref with more than two branches" --- 366,372 ---- def _parse_sub_cond(source, state, condgroup): ! item_yes = _parse(source, state) if source.match("|"): ! item_no = _parse(source, state) if source.match("|"): raise error, "conditional backref with more than two branches" Index: traceback.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/traceback.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** traceback.py 5 Nov 2003 23:03:00 -0000 1.29 --- traceback.py 18 Jan 2004 20:29:54 -0000 1.30 *************** *** 220,224 **** finally: etype = value = tb = None ! def print_last(limit=None, file=None): --- 220,224 ---- finally: etype = value = tb = None ! def print_last(limit=None, file=None): Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** urllib2.py 17 Dec 2003 18:52:16 -0000 1.59 --- urllib2.py 18 Jan 2004 20:29:54 -0000 1.60 *************** *** 427,435 **** def add_parent(self, parent): self.parent = parent ! def close(self): # Only exists for backwards compatibility pass ! def __lt__(self, other): if not hasattr(other, "handler_order"): --- 427,435 ---- def add_parent(self, parent): self.parent = parent ! def close(self): # Only exists for backwards compatibility pass ! def __lt__(self, other): if not hasattr(other, "handler_order"): *************** *** 771,775 **** # but it's better than the current 'repeat until recursion # depth exceeded' approach ! raise HTTPError(req.get_full_url(), 401, "digest auth failed", headers, None) else: --- 771,775 ---- # but it's better than the current 'repeat until recursion # depth exceeded' approach ! raise HTTPError(req.get_full_url(), 401, "digest auth failed", headers, None) else: *************** *** 846,850 **** # XXX handle auth-int. pass ! # XXX should the partial digests be encoded too? --- 846,850 ---- # XXX handle auth-int. pass ! # XXX should the partial digests be encoded too? *************** *** 888,892 **** def http_error_401(self, req, fp, code, msg, headers): host = urlparse.urlparse(req.get_full_url())[1] ! retry = self.http_error_auth_reqed('www-authenticate', host, req, headers) self.reset_retry_count() --- 888,892 ---- def http_error_401(self, req, fp, code, msg, headers): host = urlparse.urlparse(req.get_full_url())[1] ! retry = self.http_error_auth_reqed('www-authenticate', host, req, headers) self.reset_retry_count() *************** *** 900,904 **** def http_error_407(self, req, fp, code, msg, headers): host = req.get_host() ! retry = self.http_error_auth_reqed('proxy-authenticate', host, req, headers) self.reset_retry_count() --- 900,904 ---- def http_error_407(self, req, fp, code, msg, headers): host = req.get_host() ! retry = self.http_error_auth_reqed('proxy-authenticate', host, req, headers) self.reset_retry_count() *************** *** 965,969 **** # Pick apart the HTTPResponse object to get the various pieces ! # of the resp = addinfourl(r.fp, r.msg, req.get_full_url()) resp.code = r.status --- 965,969 ---- # Pick apart the HTTPResponse object to get the various pieces ! # of the resp = addinfourl(r.fp, r.msg, req.get_full_url()) resp.code = r.status From tim_one at users.sourceforge.net Sun Jan 18 15:29:57 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun Jan 18 15:30:13 2004 Subject: [Python-checkins] python/dist/src/Lib/test pystone.py, 1.8, 1.9 test_applesingle.py, 1.1, 1.2 test_codeccallbacks.py, 1.15, 1.16 test_codecencodings_cn.py, 1.1, 1.2 test_codecencodings_jp.py, 1.1, 1.2 test_codecencodings_kr.py, 1.1, 1.2 test_codecencodings_tw.py, 1.1, 1.2 test_codecmaps_cn.py, 1.1, 1.2 test_codecmaps_jp.py, 1.1, 1.2 test_codecmaps_kr.py, 1.1, 1.2 test_codecmaps_tw.py, 1.1, 1.2 test_curses.py, 1.6, 1.7 test_descr.py, 1.198, 1.199 test_difflib.py, 1.8, 1.9 test_marshal.py, 1.4, 1.5 test_md5.py, 1.5, 1.6 test_multibytecodec.py, 1.1, 1.2 test_multibytecodec_support.py, 1.1, 1.2 test_os.py, 1.20, 1.21 test_re.py, 1.46, 1.47 test_set.py, 1.9, 1.10 test_sort.py, 1.11, 1.12 test_support.py, 1.61, 1.62 test_unicode_file.py, 1.12, 1.13 test_urllib2.py, 1.10, 1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv17688/Lib/test Modified Files: pystone.py test_applesingle.py test_codeccallbacks.py test_codecencodings_cn.py test_codecencodings_jp.py test_codecencodings_kr.py test_codecencodings_tw.py test_codecmaps_cn.py test_codecmaps_jp.py test_codecmaps_kr.py test_codecmaps_tw.py test_curses.py test_descr.py test_difflib.py test_marshal.py test_md5.py test_multibytecodec.py test_multibytecodec_support.py test_os.py test_re.py test_set.py test_sort.py test_support.py test_unicode_file.py test_urllib2.py Log Message: Whitespace normalization. Index: pystone.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/pystone.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** pystone.py 2 Jan 2004 17:11:54 -0000 1.8 --- pystone.py 18 Jan 2004 20:29:54 -0000 1.9 *************** *** 265,267 **** loops = LOOPS main(loops) - --- 265,266 ---- Index: test_applesingle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_applesingle.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_applesingle.py 18 Nov 2003 22:36:12 -0000 1.1 --- test_applesingle.py 18 Jan 2004 20:29:54 -0000 1.2 *************** *** 56,60 **** self.compareData(False, dataforkdata) self.compareData(True, resourceforkdata) ! def test_applesingle_resonly(self): try: --- 56,60 ---- self.compareData(False, dataforkdata) self.compareData(True, resourceforkdata) ! def test_applesingle_resonly(self): try: Index: test_codeccallbacks.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codeccallbacks.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** test_codeccallbacks.py 24 Oct 2003 14:25:28 -0000 1.15 --- test_codeccallbacks.py 18 Jan 2004 20:29:54 -0000 1.16 *************** *** 698,702 **** ord('"'): u""", } ! for n in (1, 10, 100, 1000): text = u'abcghi'*n --- 698,702 ---- ord('"'): u""", } ! for n in (1, 10, 100, 1000): text = u'abcghi'*n Index: test_codecencodings_cn.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codecencodings_cn.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_codecencodings_cn.py 17 Jan 2004 14:29:28 -0000 1.1 --- test_codecencodings_cn.py 18 Jan 2004 20:29:54 -0000 1.2 *************** *** 28,33 **** codectests = ( # invalid bytes ! ("abc\x80\x80\xc1\xc4", "strict", None), ! ("abc\xc8", "strict", None), ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u804a"), ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u804a\ufffd"), --- 28,33 ---- codectests = ( # invalid bytes ! ("abc\x80\x80\xc1\xc4", "strict", None), ! ("abc\xc8", "strict", None), ("abc\x80\x80\xc1\xc4", "replace", u"abc\ufffd\u804a"), ("abc\x80\x80\xc1\xc4\xc8", "replace", u"abc\ufffd\u804a\ufffd"), *************** *** 59,61 **** if __name__ == "__main__": test_main() - --- 59,60 ---- Index: test_codecencodings_jp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codecencodings_jp.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_codecencodings_jp.py 17 Jan 2004 14:29:28 -0000 1.1 --- test_codecencodings_jp.py 18 Jan 2004 20:29:54 -0000 1.2 *************** *** 132,134 **** if __name__ == "__main__": test_main() - --- 132,133 ---- Index: test_codecencodings_kr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codecencodings_kr.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_codecencodings_kr.py 17 Jan 2004 14:29:28 -0000 1.1 --- test_codecencodings_kr.py 18 Jan 2004 20:29:54 -0000 1.2 *************** *** 55,57 **** if __name__ == "__main__": test_main() - --- 55,56 ---- Index: test_codecencodings_tw.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codecencodings_tw.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_codecencodings_tw.py 17 Jan 2004 14:29:28 -0000 1.1 --- test_codecencodings_tw.py 18 Jan 2004 20:29:54 -0000 1.2 *************** *** 29,31 **** if __name__ == "__main__": test_main() - --- 29,30 ---- Index: test_codecmaps_cn.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codecmaps_cn.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_codecmaps_cn.py 17 Jan 2004 14:29:28 -0000 1.1 --- test_codecmaps_cn.py 18 Jan 2004 20:29:54 -0000 1.2 *************** *** 32,34 **** if __name__ == "__main__": test_main() - --- 32,33 ---- Index: test_codecmaps_jp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codecmaps_jp.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_codecmaps_jp.py 17 Jan 2004 14:29:28 -0000 1.1 --- test_codecmaps_jp.py 18 Jan 2004 20:29:55 -0000 1.2 *************** *** 88,90 **** if __name__ == "__main__": test_main() - --- 88,89 ---- Index: test_codecmaps_kr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codecmaps_kr.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_codecmaps_kr.py 17 Jan 2004 14:29:28 -0000 1.1 --- test_codecmaps_kr.py 18 Jan 2004 20:29:55 -0000 1.2 *************** *** 49,51 **** if __name__ == "__main__": test_main() - --- 49,50 ---- Index: test_codecmaps_tw.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_codecmaps_tw.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_codecmaps_tw.py 17 Jan 2004 14:29:28 -0000 1.1 --- test_codecmaps_tw.py 18 Jan 2004 20:29:55 -0000 1.2 *************** *** 37,39 **** if __name__ == "__main__": test_main() - --- 37,38 ---- Index: test_curses.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_curses.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_curses.py 29 Aug 2003 18:49:05 -0000 1.6 --- test_curses.py 18 Jan 2004 20:29:55 -0000 1.7 *************** *** 205,209 **** if ascii.unctrl(ch) != expected: print 'curses.unctrl fails on character', repr(ch) ! --- 205,209 ---- if ascii.unctrl(ch) != expected: print 'curses.unctrl fails on character', repr(ch) ! *************** *** 216,220 **** curses.resetty() ! if __name__ == '__main__': curses.wrapper(main) --- 216,220 ---- curses.resetty() ! if __name__ == '__main__': curses.wrapper(main) Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.198 retrieving revision 1.199 diff -C2 -d -r1.198 -r1.199 *** test_descr.py 15 Aug 2003 13:07:47 -0000 1.198 --- test_descr.py 18 Jan 2004 20:29:55 -0000 1.199 *************** *** 3967,3971 **** import gc; gc.collect() vereq(hasattr(c, 'attr'), False) ! def test_main(): --- 3967,3971 ---- import gc; gc.collect() vereq(hasattr(c, 'attr'), False) ! def test_main(): Index: test_difflib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_difflib.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_difflib.py 16 Jul 2003 04:34:56 -0000 1.8 --- test_difflib.py 18 Jan 2004 20:29:55 -0000 1.9 *************** *** 16,18 **** test_support.run_unittest(TestSFbugs, Doctests) - --- 16,17 ---- Index: test_marshal.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_marshal.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_marshal.py 2 Aug 2003 15:02:33 -0000 1.4 --- test_marshal.py 18 Jan 2004 20:29:55 -0000 1.5 *************** *** 56,60 **** self.assertEqual(b, new) self.assertEqual(type(b), type(new)) ! class FloatTestCase(unittest.TestCase): def test_floats(self): --- 56,60 ---- self.assertEqual(b, new) self.assertEqual(type(b), type(new)) ! class FloatTestCase(unittest.TestCase): def test_floats(self): *************** *** 123,127 **** self.assertEqual(s, new) os.unlink(test_support.TESTFN) ! class ExceptionTestCase(unittest.TestCase): def test_exceptions(self): --- 123,127 ---- self.assertEqual(s, new) os.unlink(test_support.TESTFN) ! class ExceptionTestCase(unittest.TestCase): def test_exceptions(self): *************** *** 152,156 **** self.assertEqual(self.d, new) os.unlink(test_support.TESTFN) ! def test_list(self): lst = self.d.items() --- 152,156 ---- self.assertEqual(self.d, new) os.unlink(test_support.TESTFN) ! def test_list(self): lst = self.d.items() *************** *** 170,174 **** self.assertEqual(t, new) os.unlink(test_support.TESTFN) ! class BugsTestCase(unittest.TestCase): def test_bug_5888452(self): --- 170,174 ---- self.assertEqual(t, new) os.unlink(test_support.TESTFN) ! class BugsTestCase(unittest.TestCase): def test_bug_5888452(self): Index: test_md5.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_md5.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** test_md5.py 11 Dec 2003 12:33:58 -0000 1.5 --- test_md5.py 18 Jan 2004 20:29:55 -0000 1.6 *************** *** 27,33 **** eq('message digest', 'f96b697d7cb7938d525a2f31aaf161d0') eq('abcdefghijklmnopqrstuvwxyz', 'c3fcd3d76192e4007dfb496cca67e13b') ! eq('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 'd174ab98d277d9f5a5611c2c9f419d9f') ! eq('12345678901234567890123456789012345678901234567890123456789012345678901234567890', '57edf4a22be3c955ac49da2e2107b67a') --- 27,33 ---- eq('message digest', 'f96b697d7cb7938d525a2f31aaf161d0') eq('abcdefghijklmnopqrstuvwxyz', 'c3fcd3d76192e4007dfb496cca67e13b') ! eq('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 'd174ab98d277d9f5a5611c2c9f419d9f') ! eq('12345678901234567890123456789012345678901234567890123456789012345678901234567890', '57edf4a22be3c955ac49da2e2107b67a') Index: test_multibytecodec.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_multibytecodec.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_multibytecodec.py 17 Jan 2004 14:29:28 -0000 1.1 --- test_multibytecodec.py 18 Jan 2004 20:29:55 -0000 1.2 *************** *** 77,79 **** if __name__ == "__main__": test_main() - --- 77,78 ---- Index: test_multibytecodec_support.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_multibytecodec_support.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_multibytecodec_support.py 17 Jan 2004 14:29:28 -0000 1.1 --- test_multibytecodec_support.py 18 Jan 2004 20:29:55 -0000 1.2 *************** *** 231,233 **** else: sys.modules[case.__module__].skip_expected = False - --- 231,232 ---- Index: test_os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_os.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test_os.py 23 Dec 2003 16:36:11 -0000 1.20 --- test_os.py 18 Jan 2004 20:29:55 -0000 1.21 *************** *** 320,327 **** 'dir5', 'dir6') os.makedirs(path) - ! ! def tearDown(self): path = os.path.join(test_support.TESTFN, 'dir1', 'dir2', 'dir3', --- 320,327 ---- 'dir5', 'dir6') os.makedirs(path) ! ! ! def tearDown(self): path = os.path.join(test_support.TESTFN, 'dir1', 'dir2', 'dir3', Index: test_re.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_re.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** test_re.py 17 Oct 2003 22:13:16 -0000 1.46 --- test_re.py 18 Jan 2004 20:29:55 -0000 1.47 *************** *** 406,410 **** self.assertEqual(re.match('.*?cd', 20000*'abc'+'de').end(0), 60001) # non-simple '*?' still used to hit the recursion limit, before the ! # non-recursive scheme was implemented. self.assertEqual(re.search('(a|b)*?c', 10000*'ab'+'cd').end(0), 20001) --- 406,410 ---- self.assertEqual(re.match('.*?cd', 20000*'abc'+'de').end(0), 60001) # non-simple '*?' still used to hit the recursion limit, before the ! # non-recursive scheme was implemented. self.assertEqual(re.search('(a|b)*?c', 10000*'ab'+'cd').end(0), 20001) Index: test_set.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_set.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_set.py 31 Dec 2003 02:01:33 -0000 1.9 --- test_set.py 18 Jan 2004 20:29:55 -0000 1.10 *************** *** 180,184 **** self.value = value def __hash__(self): ! return self.value def __deepcopy__(self, memo=None): return Tracer(self.value + 1) --- 180,184 ---- self.value = value def __hash__(self): ! return self.value def __deepcopy__(self, memo=None): return Tracer(self.value + 1) Index: test_sort.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sort.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_sort.py 17 Dec 2003 20:43:32 -0000 1.11 --- test_sort.py 18 Jan 2004 20:29:55 -0000 1.12 *************** *** 271,274 **** if __name__ == "__main__": test_main(verbose=True) - - --- 271,272 ---- Index: test_support.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_support.py,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** test_support.py 4 Dec 2003 05:39:43 -0000 1.61 --- test_support.py 18 Jan 2004 20:29:55 -0000 1.62 *************** *** 142,146 **** if (not hasattr(sys, "getwindowsversion") or sys.getwindowsversion()[3] < 2): # 0=win32s or 1=9x/ME ! TESTFN_UNICODE_UNENCODEABLE = None else: # Japanese characters (I think - from bug 846133) --- 142,146 ---- if (not hasattr(sys, "getwindowsversion") or sys.getwindowsversion()[3] < 2): # 0=win32s or 1=9x/ME ! TESTFN_UNICODE_UNENCODEABLE = None else: # Japanese characters (I think - from bug 846133) Index: test_unicode_file.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode_file.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_unicode_file.py 3 Dec 2003 22:16:47 -0000 1.12 --- test_unicode_file.py 18 Jan 2004 20:29:55 -0000 1.13 *************** *** 21,25 **** # The 'do_' functions are the actual tests. They generally assume the # file already exists etc. ! # Do all the tests we can given only a single filename. The file should # exist. --- 21,25 ---- # The 'do_' functions are the actual tests. They generally assume the # file already exists etc. ! # Do all the tests we can given only a single filename. The file should # exist. *************** *** 40,44 **** path, base = os.path.split(os.path.abspath(filename)) self.failUnless(base in os.listdir(path)) ! # Do as many "equivalancy' tests as we can - ie, check that although we # have different types for the filename, they refer to the same file. --- 40,44 ---- path, base = os.path.split(os.path.abspath(filename)) self.failUnless(base in os.listdir(path)) ! # Do as many "equivalancy' tests as we can - ie, check that although we # have different types for the filename, they refer to the same file. *************** *** 125,129 **** finally: os.unlink(filename) ! def _test_equivalent(self, filename1, filename2): remove_if_exists(filename1) --- 125,129 ---- finally: os.unlink(filename) ! def _test_equivalent(self, filename1, filename2): remove_if_exists(filename1) Index: test_urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_urllib2.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_urllib2.py 17 Dec 2003 20:47:28 -0000 1.10 --- test_urllib2.py 18 Jan 2004 20:29:55 -0000 1.11 *************** *** 270,273 **** --- 270,281 ---- + def sanepathname2url(path): + import urllib + urlpath = urllib.pathname2url(path) + if os.name == "nt" and urlpath.startswith("///"): + urlpath = urlpath[2:] + # XXX don't ask me about the mac... + return urlpath + class HandlerTests(unittest.TestCase): *************** *** 324,340 **** o = h.parent = MockOpener() ! #from test_support import TESTFN ! TESTFN = "test.txt" towrite = "hello, world\n" for url in [ ! "file://localhost%s/%s" % (os.getcwd(), TESTFN), ! "file://%s/%s" % (os.getcwd(), TESTFN), ! "file://%s%s/%s" % (socket.gethostbyname('localhost'), ! os.getcwd(), TESTFN), ! "file://%s%s/%s" % (socket.gethostbyname(socket.gethostname()), ! os.getcwd(), TESTFN), ! # XXX Windows / Mac format(s), ... ? ]: ! f = open(TESTFN, "w") try: try: --- 332,346 ---- o = h.parent = MockOpener() ! TESTFN = test_support.TESTFN ! urlpath = sanepathname2url(os.path.abspath(TESTFN)) towrite = "hello, world\n" for url in [ ! "file://localhost%s" % urlpath, ! "file://%s" % urlpath, ! "file://%s%s" % (socket.gethostbyname('localhost'), urlpath), ! "file://%s%s" % (socket.gethostbyname(socket.gethostname()), ! urlpath), ]: ! f = open(TESTFN, "wb") try: try: *************** *** 346,354 **** try: data = r.read() - read_time = time.time() headers = r.info() newurl = r.geturl() finally: r.close() finally: os.remove(TESTFN) --- 352,361 ---- try: data = r.read() headers = r.info() newurl = r.geturl() finally: r.close() + stats = os.stat(TESTFN) + modified = rfc822.formatdate(stats.st_mtime) finally: os.remove(TESTFN) *************** *** 356,368 **** self.assertEqual(headers["Content-type"], "text/plain") self.assertEqual(headers["Content-length"], "13") ! # Fudge Last-modified string comparison by one second to ! # prevent spurious failure on crossing a second boundary while ! # executing this test. ! unfudged = rfc822.formatdate(read_time) ! fudged = rfc822.formatdate(read_time-1) ! self.assert_(headers["Last-modified"] in [unfudged, fudged]) for url in [ ! "file://localhost:80%s/%s" % (os.getcwd(), TESTFN), # XXXX bug: these fail with socket.gaierror, should be URLError ## "file://%s:80%s/%s" % (socket.gethostbyname('localhost'), --- 363,370 ---- self.assertEqual(headers["Content-type"], "text/plain") self.assertEqual(headers["Content-length"], "13") ! self.assertEqual(headers["Last-modified"], modified) for url in [ ! "file://localhost:80%s" % urlpath, # XXXX bug: these fail with socket.gaierror, should be URLError ## "file://%s:80%s/%s" % (socket.gethostbyname('localhost'), *************** *** 372,376 **** ]: try: ! f = open(TESTFN, "w") try: f.write(towrite) --- 374,378 ---- ]: try: ! f = open(TESTFN, "wb") try: f.write(towrite) From tim_one at users.sourceforge.net Sun Jan 18 15:31:04 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun Jan 18 15:31:09 2004 Subject: [Python-checkins] python/dist/src/Objects listobject.c,2.176,2.177 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1:/tmp/cvs-serv17990 Modified Files: listobject.c Log Message: Revert change accidentally checked in as part of a whitespace normalization patch. Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.176 retrieving revision 2.177 diff -C2 -d -r2.176 -r2.177 *** listobject.c 18 Jan 2004 20:29:55 -0000 2.176 --- listobject.c 18 Jan 2004 20:31:02 -0000 2.177 *************** *** 58,70 **** PyListObject *op; size_t nbytes; - int allocated_size = roundupsize(size); - if (size < 0) { PyErr_BadInternalCall(); return NULL; } ! nbytes = allocated_size * sizeof(PyObject *); /* Check for overflow */ ! if (nbytes / sizeof(PyObject *) != (size_t)allocated_size) { return PyErr_NoMemory(); } --- 58,68 ---- PyListObject *op; size_t nbytes; if (size < 0) { PyErr_BadInternalCall(); return NULL; } ! nbytes = size * sizeof(PyObject *); /* Check for overflow */ ! if (nbytes / sizeof(PyObject *) != (size_t)size) { return PyErr_NoMemory(); } *************** *** 81,85 **** return PyErr_NoMemory(); } ! memset(op->ob_item, 0, sizeof(*op->ob_item) * allocated_size); } op->ob_size = size; --- 79,83 ---- return PyErr_NoMemory(); } ! memset(op->ob_item, 0, sizeof(*op->ob_item) * size); } op->ob_size = size; *************** *** 157,162 **** } items = self->ob_item; ! if (roundupsize(self->ob_size) - 1 == self->ob_size || items == NULL) ! NRESIZE(items, PyObject *, self->ob_size+1); if (items == NULL) { PyErr_NoMemory(); --- 155,159 ---- } items = self->ob_item; ! NRESIZE(items, PyObject *, self->ob_size+1); if (items == NULL) { PyErr_NoMemory(); *************** *** 1882,1887 **** saved_ob_item = self->ob_item; self->ob_size = 0; ! /* self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0); */ ! self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, roundupsize(0)); if (keyfunc != NULL) { --- 1879,1883 ---- saved_ob_item = self->ob_item; self->ob_size = 0; ! self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0); if (keyfunc != NULL) { From tim_one at users.sourceforge.net Sun Jan 18 15:39:37 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun Jan 18 15:39:42 2004 Subject: [Python-checkins] python/dist/src/Lib/distutils/command build_ext.py, 1.92, 1.93 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils/command In directory sc8-pr-cvs1:/tmp/cvs-serv19537 Modified Files: build_ext.py Log Message: Revert another local change that snuck into a whitespace normalization patch. Index: build_ext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/command/build_ext.py,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** build_ext.py 18 Jan 2004 20:29:54 -0000 1.92 --- build_ext.py 18 Jan 2004 20:39:35 -0000 1.93 *************** *** 172,177 **** # this allows distutils on windows to work in the source tree self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC')) ! self.library_dirs.append(os.path.join(sys.exec_prefix, 'PC', 'VC6')) ! #self.library_dirs.append(os.path.join(sys.exec_prefix, 'PCBuild')) # OS/2 (EMX) doesn't support Debug vs Release builds, but has the --- 172,176 ---- # this allows distutils on windows to work in the source tree self.include_dirs.append(os.path.join(sys.exec_prefix, 'PC')) ! self.library_dirs.append(os.path.join(sys.exec_prefix, 'PCBuild')) # OS/2 (EMX) doesn't support Debug vs Release builds, but has the From perky at i18n.org Sun Jan 18 15:48:38 2004 From: perky at i18n.org (Hye-Shik Chang) Date: Sun Jan 18 15:48:05 2004 Subject: [Python-checkins] python/dist/src/Objects listobject.c, 2.176, 2.177 In-Reply-To: References: Message-ID: <20040118204838.GA75072@i18n.org> On Sun, Jan 18, 2004 at 12:31:04PM -0800, tim_one@users.sourceforge.net wrote: > Update of /cvsroot/python/python/dist/src/Objects > In directory sc8-pr-cvs1:/tmp/cvs-serv17990 > > Modified Files: > listobject.c > Log Message: > Revert change accidentally checked in as part of a whitespace normalization > patch. > > > Index: listobject.c > =================================================================== > RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v [snip] > *************** > *** 1882,1887 **** > saved_ob_item = self->ob_item; > self->ob_size = 0; > ! /* self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0); */ > ! self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, roundupsize(0)); > > if (keyfunc != NULL) { > --- 1879,1883 ---- > saved_ob_item = self->ob_item; > self->ob_size = 0; > ! self->ob_item = empty_ob_item = PyMem_NEW(PyObject *, 0); > > if (keyfunc != NULL) { Is there a particular reason for allocating zero-sized memory for this? On my test, assigning NULL on self->ob_item instead is worked either. Hye-Shik From tim_one at users.sourceforge.net Sun Jan 18 16:03:25 2004 From: tim_one at users.sourceforge.net (tim_one@users.sourceforge.net) Date: Sun Jan 18 16:03:30 2004 Subject: [Python-checkins] python/dist/src/Lib/test list_tests.py, 1.1, 1.2 seq_tests.py, 1.1, 1.2 test_list.py, 1.1, 1.2 test_tuple.py, 1.1, 1.2 test_userlist.py, 1.11, 1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv24882 Modified Files: list_tests.py seq_tests.py test_list.py test_tuple.py test_userlist.py Log Message: For whatever reason, these files had \r\r\n line endings on Windows, meaning they must have been checked in to CVS from a Linuxish box with Windowish \r\n line endings to begin with. Index: list_tests.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/list_tests.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** list_tests.py 8 Dec 2003 11:38:45 -0000 1.1 --- list_tests.py 18 Jan 2004 21:03:23 -0000 1.2 *************** *** 1,418 **** ! """ ! Tests common to list and UserList.UserList ! """ ! ! import sys ! ! import unittest ! from test import test_support, seq_tests ! ! class CommonTest(seq_tests.CommonTest): ! ! def test_repr(self): ! l0 = [] ! l2 = [0, 1, 2] ! a0 = self.type2test(l0) ! a2 = self.type2test(l2) ! ! self.assertEqual(str(a0), str(l0)) ! self.assertEqual(repr(a0), repr(l0)) ! self.assertEqual(`a2`, `l2`) ! self.assertEqual(str(a2), "[0, 1, 2]") ! self.assertEqual(repr(a2), "[0, 1, 2]") ! ! def test_setitem(self): ! a = self.type2test([0, 1]) ! a[0] = 0 ! a[1] = 100 ! self.assertEqual(a, self.type2test([0, 100])) ! a[-1] = 200 ! self.assertEqual(a, self.type2test([0, 200])) ! a[-2] = 100 ! self.assertEqual(a, self.type2test([100, 200])) ! self.assertRaises(IndexError, a.__setitem__, -3, 200) ! self.assertRaises(IndexError, a.__setitem__, 2, 200) ! ! a = self.type2test([]) ! self.assertRaises(IndexError, a.__setitem__, 0, 200) ! self.assertRaises(IndexError, a.__setitem__, -1, 200) ! ! self.assertRaises(TypeError, a.__setitem__) ! ! a = self.type2test([0,1,2,3,4]) ! a[0L] = 1 ! a[1L] = 2 ! a[2L] = 3 ! self.assertEqual(a, self.type2test([1,2,3,3,4])) ! a[0] = 5 ! a[1] = 6 ! a[2] = 7 ! self.assertEqual(a, self.type2test([5,6,7,3,4])) ! a[-2L] = 88 ! a[-1L] = 99 ! self.assertEqual(a, self.type2test([5,6,7,88,99])) ! a[-2] = 8 ! a[-1] = 9 ! self.assertEqual(a, self.type2test([5,6,7,8,9])) ! ! def test_delitem(self): ! a = self.type2test([0, 1]) ! del a[1] ! self.assertEqual(a, [0]) ! del a[0] ! self.assertEqual(a, []) ! ! a = self.type2test([0, 1]) ! del a[-2] ! self.assertEqual(a, [1]) ! del a[-1] ! self.assertEqual(a, []) ! ! a = self.type2test([0, 1]) ! self.assertRaises(IndexError, a.__delitem__, -3) ! self.assertRaises(IndexError, a.__delitem__, 2) ! ! a = self.type2test([]) ! self.assertRaises(IndexError, a.__delitem__, 0) ! ! self.assertRaises(TypeError, a.__delitem__) ! ! def test_setslice(self): ! l = [0, 1] ! a = self.type2test(l) ! ! for i in range(-3, 4): ! a[:i] = l[:i] ! self.assertEqual(a, l) ! a2 = a[:] ! a2[:i] = a[:i] ! self.assertEqual(a2, a) ! a[i:] = l[i:] ! self.assertEqual(a, l) ! a2 = a[:] ! a2[i:] = a[i:] ! self.assertEqual(a2, a) ! for j in range(-3, 4): ! a[i:j] = l[i:j] ! self.assertEqual(a, l) ! a2 = a[:] ! a2[i:j] = a[i:j] ! self.assertEqual(a2, a) ! ! aa2 = a2[:] ! aa2[:0] = [-2, -1] ! self.assertEqual(aa2, [-2, -1, 0, 1]) ! aa2[0:] = [] ! self.assertEqual(aa2, []) ! ! a = self.type2test([1, 2, 3, 4, 5]) ! a[:-1] = a ! self.assertEqual(a, self.type2test([1, 2, 3, 4, 5, 5])) ! a = self.type2test([1, 2, 3, 4, 5]) ! a[1:] = a ! self.assertEqual(a, self.type2test([1, 1, 2, 3, 4, 5])) ! a = self.type2test([1, 2, 3, 4, 5]) ! a[1:-1] = a ! self.assertEqual(a, self.type2test([1, 1, 2, 3, 4, 5, 5])) ! ! a = self.type2test([]) ! a[:] = tuple(range(10)) ! self.assertEqual(a, self.type2test(range(10))) ! ! self.assertRaises(TypeError, a.__setslice__, 0, 1, 5) ! ! self.assertRaises(TypeError, a.__setslice__) ! ! def test_delslice(self): ! a = self.type2test([0, 1]) ! del a[1:2] ! del a[0:1] ! self.assertEqual(a, self.type2test([])) ! ! a = self.type2test([0, 1]) ! del a[1L:2L] ! del a[0L:1L] ! self.assertEqual(a, self.type2test([])) ! ! a = self.type2test([0, 1]) ! del a[-2:-1] ! self.assertEqual(a, self.type2test([1])) ! ! a = self.type2test([0, 1]) ! del a[-2L:-1L] ! self.assertEqual(a, self.type2test([1])) ! ! a = self.type2test([0, 1]) ! del a[1:] ! del a[:1] ! self.assertEqual(a, self.type2test([])) ! ! a = self.type2test([0, 1]) ! del a[1L:] ! del a[:1L] ! self.assertEqual(a, self.type2test([])) ! ! a = self.type2test([0, 1]) ! del a[-1:] ! self.assertEqual(a, self.type2test([0])) ! ! a = self.type2test([0, 1]) ! del a[-1L:] ! self.assertEqual(a, self.type2test([0])) ! ! a = self.type2test([0, 1]) ! del a[:] ! self.assertEqual(a, self.type2test([])) ! ! def test_append(self): ! a = self.type2test([]) ! a.append(0) ! a.append(1) ! a.append(2) ! self.assertEqual(a, self.type2test([0, 1, 2])) ! ! self.assertRaises(TypeError, a.append) ! ! def test_extend(self): ! a1 = self.type2test([0]) ! a2 = self.type2test((0, 1)) ! a = a1[:] ! a.extend(a2) ! self.assertEqual(a, a1 + a2) ! ! a.extend(self.type2test([])) ! self.assertEqual(a, a1 + a2) ! ! a.extend(a) ! self.assertEqual(a, self.type2test([0, 0, 1, 0, 0, 1])) ! ! a = self.type2test("spam") ! a.extend("eggs") ! self.assertEqual(a, list("spameggs")) ! ! self.assertRaises(TypeError, a.extend, None) ! ! self.assertRaises(TypeError, a.extend) ! ! def test_insert(self): ! a = self.type2test([0, 1, 2]) ! a.insert(0, -2) ! a.insert(1, -1) ! a.insert(2, 0) ! self.assertEqual(a, [-2, -1, 0, 0, 1, 2]) ! ! b = a[:] ! b.insert(-2, "foo") ! b.insert(-200, "left") ! b.insert(200, "right") ! self.assertEqual(b, self.type2test(["left",-2,-1,0,0,"foo",1,2,"right"])) ! ! self.assertRaises(TypeError, a.insert) ! ! def test_pop(self): ! a = self.type2test([-1, 0, 1]) ! a.pop() ! self.assertEqual(a, [-1, 0]) ! a.pop(0) ! self.assertEqual(a, [0]) ! self.assertRaises(IndexError, a.pop, 5) ! a.pop(0) ! self.assertEqual(a, []) ! self.assertRaises(IndexError, a.pop) ! ! self.assertRaises(TypeError, a.pop, 42, 42) ! ! def test_remove(self): ! a = self.type2test([0, 0, 1]) ! a.remove(1) ! self.assertEqual(a, [0, 0]) ! a.remove(0) ! self.assertEqual(a, [0]) ! a.remove(0) ! self.assertEqual(a, []) ! ! self.assertRaises(ValueError, a.remove, 0) ! ! self.assertRaises(TypeError, a.remove) ! ! class BadExc(Exception): ! pass ! ! class BadCmp: ! def __eq__(self, other): ! if other == 2: ! raise BadExc() ! return False ! ! a = self.type2test([0, 1, 2, 3]) ! self.assertRaises(BadExc, a.remove, BadCmp()) ! ! def test_count(self): ! a = self.type2test([0, 1, 2])*3 ! self.assertEqual(a.count(0), 3) ! self.assertEqual(a.count(1), 3) ! self.assertEqual(a.count(3), 0) ! ! self.assertRaises(TypeError, a.count) ! ! class BadExc(Exception): ! pass ! ! class BadCmp: ! def __eq__(self, other): ! if other == 2: ! raise BadExc() ! return False ! ! self.assertRaises(BadExc, a.count, BadCmp()) ! ! def test_index(self): ! u = self.type2test([0, 1]) ! self.assertEqual(u.index(0), 0) ! self.assertEqual(u.index(1), 1) ! self.assertRaises(ValueError, u.index, 2) ! ! u = self.type2test([-2, -1, 0, 0, 1, 2]) ! self.assertEqual(u.count(0), 2) ! self.assertEqual(u.index(0), 2) ! self.assertEqual(u.index(0, 2), 2) ! self.assertEqual(u.index(-2, -10), 0) ! self.assertEqual(u.index(0, 3), 3) ! self.assertEqual(u.index(0, 3, 4), 3) ! self.assertRaises(ValueError, u.index, 2, 0, -10) ! ! self.assertRaises(TypeError, u.index) ! ! class BadExc(Exception): ! pass ! ! class BadCmp: ! def __eq__(self, other): ! if other == 2: ! raise BadExc() ! return False ! ! a = self.type2test([0, 1, 2, 3]) ! self.assertRaises(BadExc, a.index, BadCmp()) ! ! a = self.type2test([-2, -1, 0, 0, 1, 2]) ! self.assertEqual(a.index(0), 2) ! self.assertEqual(a.index(0, 2), 2) ! self.assertEqual(a.index(0, -4), 2) ! self.assertEqual(a.index(-2, -10), 0) ! self.assertEqual(a.index(0, 3), 3) ! self.assertEqual(a.index(0, -3), 3) ! self.assertEqual(a.index(0, 3, 4), 3) ! self.assertEqual(a.index(0, -3, -2), 3) ! self.assertEqual(a.index(0, -4*sys.maxint, 4*sys.maxint), 2) ! self.assertRaises(ValueError, a.index, 0, 4*sys.maxint,-4*sys.maxint) ! self.assertRaises(ValueError, a.index, 2, 0, -10) ! a.remove(0) ! self.assertRaises(ValueError, a.index, 2, 0, 4) ! self.assertEqual(a, self.type2test([-2, -1, 0, 1, 2])) ! ! def test_reverse(self): ! u = self.type2test([-2, -1, 0, 1, 2]) ! u2 = u[:] ! u.reverse() ! self.assertEqual(u, [2, 1, 0, -1, -2]) ! u.reverse() ! self.assertEqual(u, u2) ! ! self.assertRaises(TypeError, u.reverse, 42) ! ! def test_sort(self): ! u = self.type2test([1, 0]) ! u.sort() ! self.assertEqual(u, [0, 1]) ! ! u = self.type2test([2,1,0,-1,-2]) ! u.sort() ! self.assertEqual(u, self.type2test([-2,-1,0,1,2])) ! ! self.assertRaises(TypeError, u.sort, 42, 42) ! ! def revcmp(a, b): ! return cmp(b, a) ! u.sort(revcmp) ! self.assertEqual(u, self.type2test([2,1,0,-1,-2])) ! ! # The following dumps core in unpatched Python 1.5: ! def myComparison(x,y): ! return cmp(x%3, y%7) ! z = self.type2test(range(12)) ! z.sort(myComparison) ! ! self.assertRaises(TypeError, z.sort, 2) ! ! def selfmodifyingComparison(x,y): ! z.append(1) ! return cmp(x, y) ! self.assertRaises(ValueError, z.sort, selfmodifyingComparison) ! ! self.assertRaises(TypeError, z.sort, lambda x, y: 's') ! ! self.assertRaises(TypeError, z.sort, 42, 42, 42, 42) ! ! def test_slice(self): ! u = self.type2test("spam") ! u[:2] = "h" ! self.assertEqual(u, list("ham")) ! ! def test_iadd(self): ! super(CommonTest, self).test_iadd() ! u = self.type2test([0, 1]) ! u2 = u ! u += [2, 3] ! self.assert_(u is u2) ! ! u = self.type2test("spam") ! u += "eggs" ! self.assertEqual(u, self.type2test("spameggs")) ! ! self.assertRaises(TypeError, u.__iadd__, None) ! ! def test_imul(self): ! u = self.type2test([0, 1]) ! u *= 3 ! self.assertEqual(u, self.type2test([0, 1, 0, 1, 0, 1])) ! u *= 0 ! self.assertEqual(u, self.type2test([])) ! ! def test_extendedslicing(self): ! # subscript ! a = self.type2test([0,1,2,3,4]) ! ! # deletion ! del a[::2] ! self.assertEqual(a, self.type2test([1,3])) ! a = self.type2test(range(5)) ! del a[1::2] ! self.assertEqual(a, self.type2test([0,2,4])) ! a = self.type2test(range(5)) ! del a[1::-2] ! self.assertEqual(a, self.type2test([0,2,3,4])) ! a = self.type2test(range(10)) ! del a[::1000] ! self.assertEqual(a, self.type2test([1, 2, 3, 4, 5, 6, 7, 8, 9])) ! # assignment ! a = self.type2test(range(10)) ! a[::2] = [-1]*5 ! self.assertEqual(a, self.type2test([-1, 1, -1, 3, -1, 5, -1, 7, -1, 9])) ! a = self.type2test(range(10)) ! a[::-4] = [10]*3 ! self.assertEqual(a, self.type2test([0, 10, 2, 3, 4, 10, 6, 7, 8 ,10])) ! a = self.type2test(range(4)) ! a[::-1] = a ! self.assertEqual(a, self.type2test([3, 2, 1, 0])) ! a = self.type2test(range(10)) ! b = a[:] ! c = a[:] ! a[2:3] = self.type2test(["two", "elements"]) ! b[slice(2,3)] = self.type2test(["two", "elements"]) ! c[2:3:] = self.type2test(["two", "elements"]) ! self.assertEqual(a, b) ! self.assertEqual(a, c) ! a = self.type2test(range(10)) ! a[::2] = tuple(range(5)) ! self.assertEqual(a, self.type2test([0, 1, 1, 3, 2, 5, 3, 7, 4, 9])) --- 1,418 ---- ! """ ! Tests common to list and UserList.UserList ! """ ! ! import sys ! ! import unittest ! from test import test_support, seq_tests ! ! class CommonTest(seq_tests.CommonTest): ! ! def test_repr(self): ! l0 = [] ! l2 = [0, 1, 2] ! a0 = self.type2test(l0) ! a2 = self.type2test(l2) ! ! self.assertEqual(str(a0), str(l0)) ! self.assertEqual(repr(a0), repr(l0)) ! self.assertEqual(`a2`, `l2`) ! self.assertEqual(str(a2), "[0, 1, 2]") ! self.assertEqual(repr(a2), "[0, 1, 2]") ! ! def test_setitem(self): ! a = self.type2test([0, 1]) ! a[0] = 0 ! a[1] = 100 ! self.assertEqual(a, self.type2test([0, 100])) ! a[-1] = 200 ! self.assertEqual(a, self.type2test([0, 200])) ! a[-2] = 100 ! self.assertEqual(a, self.type2test([100, 200])) ! self.assertRaises(IndexError, a.__setitem__, -3, 200) ! self.assertRaises(IndexError, a.__setitem__, 2, 200) ! ! a = self.type2test([]) ! self.assertRaises(IndexError, a.__setitem__, 0, 200) ! self.assertRaises(IndexError, a.__setitem__, -1, 200) ! ! self.assertRaises(TypeError, a.__setitem__) ! ! a = self.type2test([0,1,2,3,4]) ! a[0L] = 1 ! a[1L] = 2 ! a[2L] = 3 ! self.assertEqual(a, self.type2test([1,2,3,3,4])) ! a[0] = 5 ! a[1] = 6 ! a[2] = 7 ! self.assertEqual(a, self.type2test([5,6,7,3,4])) ! a[-2L] = 88 ! a[-1L] = 99 ! self.assertEqual(a, self.type2test([5,6,7,88,99])) ! a[-2] = 8 ! a[-1] = 9 ! self.assertEqual(a, self.type2test([5,6,7,8,9])) ! ! def test_delitem(self): ! a = self.type2test([0, 1]) ! del a[1] ! self.assertEqual(a, [0]) ! del a[0] ! self.assertEqual(a, []) ! ! a = self.type2test([0, 1]) ! del a[-2] ! self.assertEqual(a, [1]) ! del a[-1] ! self.assertEqual(a, []) ! ! a = self.type2test([0, 1]) ! self.assertRaises(IndexError, a.__delitem__, -3) ! self.assertRaises(IndexError, a.__delitem__, 2) ! ! a = self.type2test([]) ! self.assertRaises(IndexError, a.__delitem__, 0) ! ! self.assertRaises(TypeError, a.__delitem__) ! ! def test_setslice(self): ! l = [0, 1] ! a = self.type2test(l) ! ! for i in range(-3, 4): ! a[:i] = l[:i] ! self.assertEqual(a, l) ! a2 = a[:] ! a2[:i] = a[:i] ! self.assertEqual(a2, a) ! a[i:] = l[i:] ! self.assertEqual(a, l) ! a2 = a[:] ! a2[i:] = a[i:] ! self.assertEqual(a2, a) ! for j in range(-3, 4): ! a[i:j] = l[i:j] ! self.assertEqual(a, l) ! a2 = a[:] ! a2[i:j] = a[i:j] ! self.assertEqual(a2, a) ! ! aa2 = a2[:] ! aa2[:0] = [-2, -1] ! self.assertEqual(aa2, [-2, -1, 0, 1]) ! aa2[0:] = [] ! self.assertEqual(aa2, []) ! ! a = self.type2test([1, 2, 3, 4, 5]) ! a[:-1] = a ! self.assertEqual(a, self.type2test([1, 2, 3, 4, 5, 5])) ! a = self.type2test([1, 2, 3, 4, 5]) ! a[1:] = a ! self.assertEqual(a, self.type2test([1, 1, 2, 3, 4, 5])) ! a = self.type2test([1, 2, 3, 4, 5]) ! a[1:-1] = a ! self.assertEqual(a, self.type2test([1, 1, 2, 3, 4, 5, 5])) ! ! a = self.type2test([]) ! a[:] = tuple(range(10)) ! self.assertEqual(a, self.type2test(range(10))) ! ! self.assertRaises(TypeError, a.__setslice__, 0, 1, 5) ! ! self.assertRaises(TypeError, a.__setslice__) ! ! def test_delslice(self): ! a = self.type2test([0, 1]) ! del a[1:2] ! del a[0:1] ! self.assertEqual(a, self.type2test([])) ! ! a = self.type2test([0, 1]) ! del a[1L:2L] ! del a[0L:1L] ! self.assertEqual(a, self.type2test([])) ! ! a = self.type2test([0, 1]) ! del a[-2:-1] ! self.assertEqual(a, self.type2test([1])) ! ! a = self.type2test([0, 1]) ! del a[-2L:-1L] ! self.assertEqual(a, self.type2test([1])) ! ! a = self.type2test([0, 1]) ! del a[1:] ! del a[:1] ! self.assertEqual(a, self.type2test([])) ! ! a = self.type2test([0, 1]) ! del a[1L:] ! del a[:1L] ! self.assertEqual(a, self.type2test([])) ! ! a = self.type2test([0, 1]) ! del a[-1:] ! self.assertEqual(a, self.type2test([0])) ! ! a = self.type2test([0, 1]) ! del a[-1L:] ! self.assertEqual(a, self.type2test([0])) ! ! a = self.type2test([0, 1]) ! del a[:] ! self.assertEqual(a, self.type2test([])) ! ! def test_append(self): ! a = self.type2test([]) ! a.append(0) ! a.append(1) ! a.append(2) ! self.assertEqual(a, self.type2test([0, 1, 2])) ! ! self.assertRaises(TypeError, a.append) ! ! def test_extend(self): ! a1 = self.type2test([0]) ! a2 = self.type2test((0, 1)) ! a = a1[:] ! a.extend(a2) ! self.assertEqual(a, a1 + a2) ! ! a.extend(self.type2test([])) ! self.assertEqual(a, a1 + a2) ! ! a.extend(a) ! self.assertEqual(a, self.type2test([0, 0, 1, 0, 0, 1])) ! ! a = self.type2test("spam") ! a.extend("eggs") ! self.assertEqual(a, list("spameggs")) ! ! self.assertRaises(TypeError, a.extend, None) ! ! self.assertRaises(TypeError, a.extend) ! ! def test_insert(self): ! a = self.type2test([0, 1, 2]) ! a.insert(0, -2) ! a.insert(1, -1) ! a.insert(2, 0) ! self.assertEqual(a, [-2, -1, 0, 0, 1, 2]) ! ! b = a[:] ! b.insert(-2, "foo") ! b.insert(-200, "left") ! b.insert(200, "right") ! self.assertEqual(b, self.type2test(["left",-2,-1,0,0,"foo",1,2,"right"])) ! ! self.assertRaises(TypeError, a.insert) ! ! def test_pop(self): ! a = self.type2test([-1, 0, 1]) ! a.pop() ! self.assertEqual(a, [-1, 0]) ! a.pop(0) ! self.assertEqual(a, [0]) ! self.assertRaises(IndexError, a.pop, 5) ! a.pop(0) ! self.assertEqual(a, []) ! self.assertRaises(IndexError, a.pop) ! ! self.assertRaises(TypeError, a.pop, 42, 42) ! ! def test_remove(self): ! a = self.type2test([0, 0, 1]) ! a.remove(1) ! self.assertEqual(a, [0, 0]) ! a.remove(0) ! self.assertEqual(a, [0]) ! a.remove(0) ! self.assertEqual(a, []) ! ! self.assertRaises(ValueError, a.remove, 0) ! ! self.assertRaises(TypeError, a.remove) ! ! class BadExc(Exception): ! pass ! ! class BadCmp: ! def __eq__(self, other): ! if other == 2: ! raise BadExc() ! return False ! ! a = self.type2test([0, 1, 2, 3]) ! self.assertRaises(BadExc, a.remove, BadCmp()) ! ! def test_count(self): ! a = self.type2test([0, 1, 2])*3 ! self.assertEqual(a.count(0), 3) ! self.assertEqual(a.count(1), 3) ! self.assertEqual(a.count(3), 0) ! ! self.assertRaises(TypeError, a.count) ! ! class BadExc(Exception): ! pass ! ! class BadCmp: ! def __eq__(self, other): ! if other == 2: ! raise BadExc() ! return False ! ! self.assertRaises(BadExc, a.count, BadCmp()) ! ! def test_index(self): ! u = self.type2test([0, 1]) ! self.assertEqual(u.index(0), 0) ! self.assertEqual(u.index(1), 1) ! self.assertRaises(ValueError, u.index, 2) ! ! u = self.type2test([-2, -1, 0, 0, 1, 2]) ! self.assertEqual(u.count(0), 2) ! self.assertEqual(u.index(0), 2) ! self.assertEqual(u.index(0, 2), 2) ! self.assertEqual(u.index(-2, -10), 0) ! self.assertEqual(u.index(0, 3), 3) ! self.assertEqual(u.index(0, 3, 4), 3) ! self.assertRaises(ValueError, u.index, 2, 0, -10) ! ! self.assertRaises(TypeError, u.index) ! ! class BadExc(Exception): ! pass ! ! class BadCmp: ! def __eq__(self, other): ! if other == 2: ! raise BadExc() ! return False ! ! a = self.type2test([0, 1, 2, 3]) ! self.assertRaises(BadExc, a.index, BadCmp()) ! ! a = self.type2test([-2, -1, 0, 0, 1, 2]) ! self.assertEqual(a.index(0), 2) ! self.assertEqual(a.index(0, 2), 2) ! self.assertEqual(a.index(0, -4), 2) ! self.assertEqual(a.index(-2, -10), 0) ! self.assertEqual(a.index(0, 3), 3) ! self.assertEqual(a.index(0, -3), 3) ! self.assertEqual(a.index(0, 3, 4), 3) ! self.assertEqual(a.index(0, -3, -2), 3) ! self.assertEqual(a.index(0, -4*sys.maxint, 4*sys.maxint), 2) ! self.assertRaises(ValueError, a.index, 0, 4*sys.maxint,-4*sys.maxint) ! self.assertRaises(ValueError, a.index, 2, 0, -10) ! a.remove(0) ! self.assertRaises(ValueError, a.index, 2, 0, 4) ! self.assertEqual(a, self.type2test([-2, -1, 0, 1, 2])) ! ! def test_reverse(self): ! u = self.type2test([-2, -1, 0, 1, 2]) ! u2 = u[:] ! u.reverse() ! self.assertEqual(u, [2, 1, 0, -1, -2]) ! u.reverse() ! self.assertEqual(u, u2) ! ! self.assertRaises(TypeError, u.reverse, 42) ! ! def test_sort(self): ! u = self.type2test([1, 0]) ! u.sort() ! self.assertEqual(u, [0, 1]) ! ! u = self.type2test([2,1,0,-1,-2]) ! u.sort() ! self.assertEqual(u, self.type2test([-2,-1,0,1,2])) ! ! self.assertRaises(TypeError, u.sort, 42, 42) ! ! def revcmp(a, b): ! return cmp(b, a) ! u.sort(revcmp) ! self.assertEqual(u, self.type2test([2,1,0,-1,-2])) ! ! # The following dumps core in unpatched Python 1.5: ! def myComparison(x,y): ! return cmp(x%3, y%7) ! z = self.type2test(range(12)) ! z.sort(myComparison) ! ! self.assertRaises(TypeError, z.sort, 2) ! ! def selfmodifyingComparison(x,y): ! z.append(1) ! return cmp(x, y) ! self.assertRaises(ValueError, z.sort, selfmodifyingComparison) ! ! self.assertRaises(TypeError, z.sort, lambda x, y: 's') ! ! self.assertRaises(TypeError, z.sort, 42, 42, 42, 42) ! ! def test_slice(self): ! u = self.type2test("spam") ! u[:2] = "h" ! self.assertEqual(u, list("ham")) ! ! def test_iadd(self): ! super(CommonTest, self).test_iadd() ! u = self.type2test([0, 1]) ! u2 = u ! u += [2, 3] ! self.assert_(u is u2) ! ! u = self.type2test("spam") ! u += "eggs" ! self.assertEqual(u, self.type2test("spameggs")) ! ! self.assertRaises(TypeError, u.__iadd__, None) ! ! def test_imul(self): ! u = self.type2test([0, 1]) ! u *= 3 ! self.assertEqual(u, self.type2test([0, 1, 0, 1, 0, 1])) ! u *= 0 ! self.assertEqual(u, self.type2test([])) ! ! def test_extendedslicing(self): ! # subscript ! a = self.type2test([0,1,2,3,4]) ! ! # deletion ! del a[::2] ! self.assertEqual(a, self.type2test([1,3])) ! a = self.type2test(range(5)) ! del a[1::2] ! self.assertEqual(a, self.type2test([0,2,4])) ! a = self.type2test(range(5)) ! del a[1::-2] ! self.assertEqual(a, self.type2test([0,2,3,4])) ! a = self.type2test(range(10)) ! del a[::1000] ! self.assertEqual(a, self.type2test([1, 2, 3, 4, 5, 6, 7, 8, 9])) ! # assignment ! a = self.type2test(range(10)) ! a[::2] = [-1]*5 ! self.assertEqual(a, self.type2test([-1, 1, -1, 3, -1, 5, -1, 7, -1, 9])) ! a = self.type2test(range(10)) ! a[::-4] = [10]*3 ! self.assertEqual(a, self.type2test([0, 10, 2, 3, 4, 10, 6, 7, 8 ,10])) ! a = self.type2test(range(4)) ! a[::-1] = a ! self.assertEqual(a, self.type2test([3, 2, 1, 0])) ! a = self.type2test(range(10)) ! b = a[:] ! c = a[:] ! a[2:3] = self.type2test(["two", "elements"]) ! b[slice(2,3)] = self.type2test(["two", "elements"]) ! c[2:3:] = self.type2test(["two", "elements"]) ! self.assertEqual(a, b) ! self.assertEqual(a, c) ! a = self.type2test(range(10)) ! a[::2] = tuple(range(5)) ! self.assertEqual(a, self.type2test([0, 1, 1, 3, 2, 5, 3, 7, 4, 9])) Index: seq_tests.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/seq_tests.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** seq_tests.py 8 Dec 2003 11:38:45 -0000 1.1 --- seq_tests.py 18 Jan 2004 21:03:23 -0000 1.2 *************** *** 1,171 **** ! """ ! Tests common to tuple, list and UserList.UserList ! """ ! ! import unittest ! from test import test_support ! ! class CommonTest(unittest.TestCase): ! # The type to be tested ! type2test = None ! ! def test_constructors(self): ! l0 = [] ! l1 = [0] ! l2 = [0, 1] ! ! u = self.type2test() ! u0 = self.type2test(l0) ! u1 = self.type2test(l1) ! u2 = self.type2test(l2) ! ! uu = self.type2test(u) ! uu0 = self.type2test(u0) ! uu1 = self.type2test(u1) ! uu2 = self.type2test(u2) ! ! v = self.type2test(tuple(u)) ! class OtherSeq: ! def __init__(self, initseq): ! self.__data = initseq ! def __len__(self): ! return len(self.__data) ! def __getitem__(self, i): ! return self.__data[i] ! s = OtherSeq(u0) ! v0 = self.type2test(s) ! self.assertEqual(len(v0), len(s)) ! ! s = "this is also a sequence" ! vv = self.type2test(s) ! self.assertEqual(len(vv), len(s)) ! ! def test_truth(self): ! self.assert_(not self.type2test()) ! self.assert_(self.type2test([42])) ! ! def test_getitem(self): ! u = self.type2test([0, 1, 2, 3, 4]) ! for i in xrange(len(u)): ! self.assertEqual(u[i], i) ! for i in xrange(-len(u), -1): ! self.assertEqual(u[i], len(u)+i) ! self.assertRaises(IndexError, u.__getitem__, -len(u)-1) ! self.assertRaises(IndexError, u.__getitem__, len(u)) ! ! u = self.type2test() ! self.assertRaises(IndexError, u.__getitem__, 0) ! self.assertRaises(IndexError, u.__getitem__, -1) ! ! self.assertRaises(TypeError, u.__getitem__) ! ! def test_getslice(self): ! l = [0, 1, 2, 3, 4] ! u = self.type2test(l) ! ! self.assertEqual(u[0:0], self.type2test()) ! self.assertEqual(u[1:2], self.type2test([1])) ! self.assertEqual(u[-2:-1], self.type2test([3])) ! self.assertEqual(u[-1000:1000], u) ! self.assertEqual(u[1000:-1000], self.type2test([])) ! self.assertEqual(u[:], u) ! self.assertEqual(u[1:None], self.type2test([1, 2, 3, 4])) ! self.assertEqual(u[None:3], self.type2test([0, 1, 2])) ! ! # Extended slices ! self.assertEqual(u[::], u) ! self.assertEqual(u[::2], self.type2test([0, 2, 4])) ! self.assertEqual(u[1::2], self.type2test([1, 3])) ! self.assertEqual(u[::-1], self.type2test([4, 3, 2, 1, 0])) ! self.assertEqual(u[::-2], self.type2test([4, 2, 0])) ! self.assertEqual(u[3::-2], self.type2test([3, 1])) ! self.assertEqual(u[3:3:-2], self.type2test([])) ! self.assertEqual(u[3:2:-2], self.type2test([3])) ! self.assertEqual(u[3:1:-2], self.type2test([3])) ! self.assertEqual(u[3:0:-2], self.type2test([3, 1])) ! self.assertEqual(u[::-100], self.type2test([4])) ! self.assertEqual(u[100:-100:], self.type2test([])) ! self.assertEqual(u[-100:100:], u) ! self.assertEqual(u[100:-100:-1], u[::-1]) ! self.assertEqual(u[-100:100:-1], self.type2test([])) ! self.assertEqual(u[-100L:100L:2L], self.type2test([0, 2, 4])) ! ! # Test extreme cases with long ints ! a = self.type2test([0,1,2,3,4]) ! self.assertEqual(a[ -pow(2,128L): 3 ], self.type2test([0,1,2])) ! self.assertEqual(a[ 3: pow(2,145L) ], self.type2test([3,4])) ! ! self.assertRaises(TypeError, u.__getslice__) ! ! def test_contains(self): ! u = self.type2test([0, 1, 2]) ! for i in u: ! self.assert_(i in u) ! for i in min(u)-1, max(u)+1: ! self.assert_(i not in u) ! ! self.assertRaises(TypeError, u.__contains__) ! ! def test_len(self): ! self.assertEqual(len(self.type2test()), 0) ! self.assertEqual(len(self.type2test([])), 0) ! self.assertEqual(len(self.type2test([0])), 1) ! self.assertEqual(len(self.type2test([0, 1, 2])), 3) ! ! def test_minmax(self): ! u = self.type2test([0, 1, 2]) ! self.assertEqual(min(u), 0) ! self.assertEqual(max(u), 2) ! ! def test_addmul(self): ! u1 = self.type2test([0]) ! u2 = self.type2test([0, 1]) ! self.assertEqual(u1, u1 + self.type2test()) ! self.assertEqual(u1, self.type2test() + u1) ! self.assertEqual(u1 + self.type2test([1]), u2) ! self.assertEqual(self.type2test([-1]) + u1, self.type2test([-1, 0])) ! self.assertEqual(self.type2test(), u2*0) ! self.assertEqual(self.type2test(), 0*u2) ! self.assertEqual(self.type2test(), u2*0L) ! self.assertEqual(self.type2test(), 0L*u2) ! self.assertEqual(u2, u2*1) ! self.assertEqual(u2, 1*u2) ! self.assertEqual(u2, u2*1L) ! self.assertEqual(u2, 1L*u2) ! self.assertEqual(u2+u2, u2*2) ! self.assertEqual(u2+u2, 2*u2) ! self.assertEqual(u2+u2, u2*2L) ! self.assertEqual(u2+u2, 2L*u2) ! self.assertEqual(u2+u2+u2, u2*3) ! self.assertEqual(u2+u2+u2, 3*u2) ! ! class subclass(self.type2test): ! pass ! u3 = subclass([0, 1]) ! self.assertEqual(u3, u3*1) ! self.assert_(u3 is not u3*1) ! ! def test_iadd(self): ! u = self.type2test([0, 1]) ! u += self.type2test() ! self.assertEqual(u, self.type2test([0, 1])) ! u += self.type2test([2, 3]) ! self.assertEqual(u, self.type2test([0, 1, 2, 3])) ! u += self.type2test([4, 5]) ! self.assertEqual(u, self.type2test([0, 1, 2, 3, 4, 5])) ! ! u = self.type2test("spam") ! u += self.type2test("eggs") ! self.assertEqual(u, self.type2test("spameggs")) ! ! def test_imul(self): ! u = self.type2test([0, 1]) ! u *= 3 ! self.assertEqual(u, self.type2test([0, 1, 0, 1, 0, 1])) ! ! def test_getitemoverwriteiter(self): ! # Verify that __getitem__ overrides are not recognized by __iter__ ! class T(self.type2test): ! def __getitem__(self, key): ! return str(key) + '!!!' ! self.assertEqual(iter(T((1,2))).next(), 1) --- 1,171 ---- ! """ ! Tests common to tuple, list and UserList.UserList ! """ ! ! import unittest ! from test import test_support ! ! class CommonTest(unittest.TestCase): ! # The type to be tested ! type2test = None ! ! def test_constructors(self): ! l0 = [] ! l1 = [0] ! l2 = [0, 1] ! ! u = self.type2test() ! u0 = self.type2test(l0) ! u1 = self.type2test(l1) ! u2 = self.type2test(l2) ! ! uu = self.type2test(u) ! uu0 = self.type2test(u0) ! uu1 = self.type2test(u1) ! uu2 = self.type2test(u2) ! ! v = self.type2test(tuple(u)) ! class OtherSeq: ! def __init__(self, initseq): ! self.__data = initseq ! def __len__(self): ! return len(self.__data) ! def __getitem__(self, i): ! return self.__data[i] ! s = OtherSeq(u0) ! v0 = self.type2test(s) ! self.assertEqual(len(v0), len(s)) ! ! s = "this is also a sequence" ! vv = self.type2test(s) ! self.assertEqual(len(vv), len(s)) ! ! def test_truth(self): ! self.assert_(not self.type2test()) ! self.assert_(self.type2test([42])) ! ! def test_getitem(self): ! u = self.type2test([0, 1, 2, 3, 4]) ! for i in xrange(len(u)): ! self.assertEqual(u[i], i) ! for i in xrange(-len(u), -1): ! self.assertEqual(u[i], len(u)+i) ! self.assertRaises(IndexError, u.__getitem__, -len(u)-1) ! self.assertRaises(IndexError, u.__getitem__, len(u)) ! ! u = self.type2test() ! self.assertRaises(IndexError, u.__getitem__, 0) ! self.assertRaises(IndexError, u.__getitem__, -1) ! ! self.assertRaises(TypeError, u.__getitem__) ! ! def test_getslice(self): ! l = [0, 1, 2, 3, 4] ! u = self.type2test(l) ! ! self.assertEqual(u[0:0], self.type2test()) ! self.assertEqual(u[1:2], self.type2test([1])) ! self.assertEqual(u[-2:-1], self.type2test([3])) ! self.assertEqual(u[-1000:1000], u) ! self.assertEqual(u[1000:-1000], self.type2test([])) ! self.assertEqual(u[:], u) ! self.assertEqual(u[1:None], self.type2test([1, 2, 3, 4])) ! self.assertEqual(u[None:3], self.type2test([0, 1, 2])) ! ! # Extended slices ! self.assertEqual(u[::], u) ! self.assertEqual(u[::2], self.type2test([0, 2, 4])) ! self.assertEqual(u[1::2], self.type2test([1, 3])) ! self.assertEqual(u[::-1], self.type2test([4, 3, 2, 1, 0])) ! self.assertEqual(u[::-2], self.type2test([4, 2, 0])) ! self.assertEqual(u[3::-2], self.type2test([3, 1])) ! self.assertEqual(u[3:3:-2], self.type2test([])) ! self.assertEqual(u[3:2:-2], self.type2test([3])) ! self.assertEqual(u[3:1:-2], self.type2test([3])) ! self.assertEqual(u[3:0:-2], self.type2test([3, 1])) ! self.assertEqual(u[::-100], self.type2test([4])) ! self.assertEqual(u[100:-100:], self.type2test([])) ! self.assertEqual(u[-100:100:], u) ! self.assertEqual(u[100:-100:-1], u[::-1]) ! self.assertEqual(u[-100:100:-1], self.type2test([])) ! self.assertEqual(u[-100L:100L:2L], self.type2test([0, 2, 4])) ! ! # Test extreme cases with long ints ! a = self.type2test([0,1,2,3,4]) ! self.assertEqual(a[ -pow(2,128L): 3 ], self.type2test([0,1,2])) ! self.assertEqual(a[ 3: pow(2,145L) ], self.type2test([3,4])) ! ! self.assertRaises(TypeError, u.__getslice__) ! ! def test_contains(self): ! u = self.type2test([0, 1, 2]) ! for i in u: ! self.assert_(i in u) ! for i in min(u)-1, max(u)+1: ! self.assert_(i not in u) ! ! self.assertRaises(TypeError, u.__contains__) ! ! def test_len(self): ! self.assertEqual(len(self.type2test()), 0) ! self.assertEqual(len(self.type2test([])), 0) ! self.assertEqual(len(self.type2test([0])), 1) ! self.assertEqual(len(self.type2test([0, 1, 2])), 3) ! ! def test_minmax(self): ! u = self.type2test([0, 1, 2]) ! self.assertEqual(min(u), 0) ! self.assertEqual(max(u), 2) ! ! def test_addmul(self): ! u1 = self.type2test([0]) ! u2 = self.type2test([0, 1]) ! self.assertEqual(u1, u1 + self.type2test()) ! self.assertEqual(u1, self.type2test() + u1) ! self.assertEqual(u1 + self.type2test([1]), u2) ! self.assertEqual(self.type2test([-1]) + u1, self.type2test([-1, 0])) ! self.assertEqual(self.type2test(), u2*0) ! self.assertEqual(self.type2test(), 0*u2) ! self.assertEqual(self.type2test(), u2*0L) ! self.assertEqual(self.type2test(), 0L*u2) ! self.assertEqual(u2, u2*1) ! self.assertEqual(u2, 1*u2) ! self.assertEqual(u2, u2*1L) ! self.assertEqual(u2, 1L*u2) ! self.assertEqual(u2+u2, u2*2) ! self.assertEqual(u2+u2, 2*u2) ! self.assertEqual(u2+u2, u2*2L) ! self.assertEqual(u2+u2, 2L*u2) ! self.assertEqual(u2+u2+u2, u2*3) ! self.assertEqual(u2+u2+u2, 3*u2) ! ! class subclass(self.type2test): ! pass ! u3 = subclass([0, 1]) ! self.assertEqual(u3, u3*1) ! self.assert_(u3 is not u3*1) ! ! def test_iadd(self): ! u = self.type2test([0, 1]) ! u += self.type2test() ! self.assertEqual(u, self.type2test([0, 1])) ! u += self.type2test([2, 3]) ! self.assertEqual(u, self.type2test([0, 1, 2, 3])) ! u += self.type2test([4, 5]) ! self.assertEqual(u, self.type2test([0, 1, 2, 3, 4, 5])) ! ! u = self.type2test("spam") ! u += self.type2test("eggs") ! self.assertEqual(u, self.type2test("spameggs")) ! ! def test_imul(self): ! u = self.type2test([0, 1]) ! u *= 3 ! self.assertEqual(u, self.type2test([0, 1, 0, 1, 0, 1])) ! ! def test_getitemoverwriteiter(self): ! # Verify that __getitem__ overrides are not recognized by __iter__ ! class T(self.type2test): ! def __getitem__(self, key): ! return str(key) + '!!!' ! self.assertEqual(iter(T((1,2))).next(), 1) Index: test_list.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_list.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_list.py 8 Dec 2003 11:38:45 -0000 1.1 --- test_list.py 18 Jan 2004 21:03:23 -0000 1.2 *************** *** 1,25 **** ! import unittest ! from test import test_support, list_tests ! ! class ListTest(list_tests.CommonTest): ! type2test = list ! ! def test_truth(self): ! super(ListTest, self).test_truth() ! self.assert_(not []) ! self.assert_([42]) ! ! def test_identity(self): ! self.assert_([] is not []) ! ! def test_len(self): ! super(ListTest, self).test_len() ! self.assertEqual(len([]), 0) ! self.assertEqual(len([0]), 1) ! self.assertEqual(len([0, 1, 2]), 3) ! ! def test_main(): ! test_support.run_unittest(ListTest) ! ! if __name__=="__main__": ! test_main() --- 1,25 ---- ! import unittest ! from test import test_support, list_tests ! ! class ListTest(list_tests.CommonTest): ! type2test = list ! ! def test_truth(self): ! super(ListTest, self).test_truth() ! self.assert_(not []) ! self.assert_([42]) ! ! def test_identity(self): ! self.assert_([] is not []) ! ! def test_len(self): ! super(ListTest, self).test_len() ! self.assertEqual(len([]), 0) ! self.assertEqual(len([0]), 1) ! self.assertEqual(len([0, 1, 2]), 3) ! ! def test_main(): ! test_support.run_unittest(ListTest) ! ! if __name__=="__main__": ! test_main() Index: test_tuple.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_tuple.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_tuple.py 8 Dec 2003 11:38:45 -0000 1.1 --- test_tuple.py 18 Jan 2004 21:03:23 -0000 1.2 *************** *** 1,49 **** ! import unittest ! from test import test_support, seq_tests ! ! class TupleTest(seq_tests.CommonTest): ! type2test = tuple ! ! def test_constructors(self): ! super(TupleTest, self).test_len() ! # calling built-in types without argument must return empty ! self.assertEqual(tuple(), ()) ! ! def test_truth(self): ! super(TupleTest, self).test_truth() ! self.assert_(not ()) ! self.assert_((42, )) ! ! def test_len(self): ! super(TupleTest, self).test_len() ! self.assertEqual(len(()), 0) ! self.assertEqual(len((0,)), 1) ! self.assertEqual(len((0, 1, 2)), 3) ! ! def test_iadd(self): ! super(TupleTest, self).test_iadd() ! u = (0, 1) ! u2 = u ! u += (2, 3) ! self.assert_(u is not u2) ! ! def test_imul(self): ! super(TupleTest, self).test_imul() ! u = (0, 1) ! u2 = u ! u *= 3 ! self.assert_(u is not u2) ! ! def test_tupleresizebug(self): ! # Check that a specific bug in _PyTuple_Resize() is squashed. ! def f(): ! for i in range(1000): ! yield i ! self.assertEqual(list(tuple(f())), range(1000)) ! ! ! def test_main(): ! test_support.run_unittest(TupleTest) ! ! if __name__=="__main__": ! test_main() --- 1,49 ---- ! import unittest ! from test import test_support, seq_tests ! ! class TupleTest(seq_tests.CommonTest): ! type2test = tuple ! ! def test_constructors(self): ! super(TupleTest, self).test_len() ! # calling built-in types without argument must return empty ! self.assertEqual(tuple(), ()) ! ! def test_truth(self): ! super(TupleTest, self).test_truth() ! self.assert_(not ()) ! self.assert_((42, )) ! ! def test_len(self): ! super(TupleTest, self).test_len() ! self.assertEqual(len(()), 0) ! self.assertEqual(len((0,)), 1) ! self.assertEqual(len((0, 1, 2)), 3) ! ! def test_iadd(self): ! super(TupleTest, self).test_iadd() ! u = (0, 1) ! u2 = u ! u += (2, 3) ! self.assert_(u is not u2) ! ! def test_imul(self): ! super(TupleTest, self).test_imul() ! u = (0, 1) ! u2 = u ! u *= 3 ! self.assert_(u is not u2) ! ! def test_tupleresizebug(self): ! # Check that a specific bug in _PyTuple_Resize() is squashed. ! def f(): ! for i in range(1000): ! yield i ! self.assertEqual(list(tuple(f())), range(1000)) ! ! ! def test_main(): ! test_support.run_unittest(TupleTest) ! ! if __name__=="__main__": ! test_main() Index: test_userlist.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_userlist.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** test_userlist.py 8 Dec 2003 11:38:45 -0000 1.11 --- test_userlist.py 18 Jan 2004 21:03:23 -0000 1.12 *************** *** 2,21 **** from UserList import UserList ! import unittest from test import test_support, list_tests ! class UserListTest(list_tests.CommonTest): type2test = UserList ! ! def test_getslice(self): super(UserListTest, self).test_getslice() ! l = [0, 1, 2, 3, 4] ! u = self.type2test(l) ! for i in range(-3, 6): ! self.assertEqual(u[:i], l[:i]) ! self.assertEqual(u[i:], l[i:]) ! for j in xrange(-3, 6): ! self.assertEqual(u[i:j], l[i:j]) ! def test_add_specials(self): u = UserList("spam") --- 2,21 ---- from UserList import UserList ! import unittest from test import test_support, list_tests ! class UserListTest(list_tests.CommonTest): type2test = UserList ! ! def test_getslice(self): super(UserListTest, self).test_getslice() ! l = [0, 1, 2, 3, 4] ! u = self.type2test(l) ! for i in range(-3, 6): ! self.assertEqual(u[:i], l[:i]) ! self.assertEqual(u[i:], l[i:]) ! for j in xrange(-3, 6): ! self.assertEqual(u[i:j], l[i:j]) ! def test_add_specials(self): u = UserList("spam") *************** *** 30,56 **** self.assertEqual(u2, list("spameggs")) ! def test_iadd(self): ! super(UserListTest, self).test_iadd() ! u = [0, 1] ! u += UserList([0, 1]) ! self.assertEqual(u, [0, 1, 0, 1]) ! ! def test_mixedcmp(self): ! u = self.type2test([0, 1]) ! self.assertEqual(u, [0, 1]) ! self.assertNotEqual(u, [0]) ! self.assertNotEqual(u, [0, 2]) ! ! def test_mixedadd(self): ! u = self.type2test([0, 1]) ! self.assertEqual(u + [], u) ! self.assertEqual(u + [2], [0, 1, 2]) ! ! def test_getitemoverwriteiter(self): ! # Verify that __getitem__ overrides *are* recognized by __iter__ ! class T(self.type2test): ! def __getitem__(self, key): ! return str(key) + '!!!' ! self.assertEqual(iter(T((1,2))).next(), "0!!!") def test_main(): --- 30,56 ---- self.assertEqual(u2, list("spameggs")) ! def test_iadd(self): ! super(UserListTest, self).test_iadd() ! u = [0, 1] ! u += UserList([0, 1]) ! self.assertEqual(u, [0, 1, 0, 1]) ! ! def test_mixedcmp(self): ! u = self.type2test([0, 1]) ! self.assertEqual(u, [0, 1]) ! self.assertNotEqual(u, [0]) ! self.assertNotEqual(u, [0, 2]) ! ! def test_mixedadd(self): ! u = self.type2test([0, 1]) ! self.assertEqual(u + [], u) ! self.assertEqual(u + [2], [0, 1, 2]) ! ! def test_getitemoverwriteiter(self): ! # Verify that __getitem__ overrides *are* recognized by __iter__ ! class T(self.type2test): ! def __getitem__(self, key): ! return str(key) + '!!!' ! self.assertEqual(iter(T((1,2))).next(), "0!!!") def test_main(): From jepler at unpythonic.net Sun Jan 18 16:09:13 2004 From: jepler at unpythonic.net (Jeff Epler) Date: Sun Jan 18 16:12:46 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Objects listobject.c, 2.176, 2.177 In-Reply-To: <20040118204838.GA75072@i18n.org> References: <20040118204838.GA75072@i18n.org> Message-ID: <20040118210913.GB20915@unpythonic.net> On Mon, Jan 19, 2004 at 05:48:38AM +0900, Hye-Shik Chang wrote: > Is there a particular reason for allocating zero-sized memory for > this? On my test, assigning NULL on self->ob_item instead is worked > either. Yes. I think that the explanation goes something like this: Only values returned by malloc/calloc/realloc are suitable as an argument to realloc/free. So, if you want to start with 0 bytes but not special case the deallocation or reallocation case, you write f = malloc(0); instead of f = NULL; later, you can use f = realloc(f, newsize); /* Ignoring error checking */ and f = free(f) instead of if (f) f = realloc(f, newsize); else f = malloc(newsize); and if(f) free(f); now, some systems have malloc(0) return NULL, and accept free(NULL) as a no-op, and realloc(NULL, newsize) as malloc(newsize), but behavior other than that is allowed by the C standard. Jeff From perky at i18n.org Sun Jan 18 16:20:29 2004 From: perky at i18n.org (Hye-Shik Chang) Date: Sun Jan 18 16:20:01 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Objects listobject.c, 2.176, 2.177 In-Reply-To: <20040118210913.GB20915@unpythonic.net> References: <20040118204838.GA75072@i18n.org> <20040118210913.GB20915@unpythonic.net> Message-ID: <20040118212029.GA75402@i18n.org> On Sun, Jan 18, 2004 at 03:09:13PM -0600, Jeff Epler wrote: > On Mon, Jan 19, 2004 at 05:48:38AM +0900, Hye-Shik Chang wrote: > > Is there a particular reason for allocating zero-sized memory for > > this? On my test, assigning NULL on self->ob_item instead is worked > > either. > > Yes. I think that the explanation goes something like this: > > Only values returned by malloc/calloc/realloc are suitable as an argument > to realloc/free. So, if you want to start with 0 bytes but not special > case the deallocation or reallocation case, you write > f = malloc(0); > instead of > f = NULL; > later, you can use > f = realloc(f, newsize); /* Ignoring error checking */ > and > f = free(f) > instead of > if (f) f = realloc(f, newsize); > else f = malloc(newsize); > and > if(f) free(f); > > now, some systems have malloc(0) return NULL, and accept free(NULL) as a > no-op, and realloc(NULL, newsize) as malloc(newsize), but behavior other > than that is allowed by the C standard. > Thanks for the explanation. But listobject isn't using realloc and ob_item == NULL case is concerned in the code already. In PyList_New: 73 if (size <= 0) { 74 op->ob_item = NULL; 75 } Excuse me but am I missed something? Hye-Shik From martin at v.loewis.de Sun Jan 18 16:24:12 2004 From: martin at v.loewis.de (=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=) Date: Sun Jan 18 16:25:14 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5 In-Reply-To: <20040118152616.GA56270@i18n.org> References: <20040118122633.F068625AF47@bonanza.off.ekorp.com> <400A9EB3.6030602@v.loewis.de> <20040118152616.GA56270@i18n.org> Message-ID: <400AF97C.7060609@v.loewis.de> Hye-Shik Chang wrote: >>try: >> codecs.lookup("some-cjk-encoding") >>except LookupError: >> try: >> import japanese >> japanese.register_aliases() >> except ImportError: >> pass > > > This usage is useful only for -S mode. The recent Asian codecs > register its aliases by their respective .pth. So, backporting > CJK codecs won't let Japanese developers code in this way. Of course, users may have installed JapaneseCodecs with --without-aliases, in which case the aliases won't be there (neither automatically, nor after explicitly importing japanese). I believe mailman use it that way So people who currently do encodings.aliases.aliases.update( {"shift_jis" : "japanese.shift_jis"}) would have to adjust their code. I also find that installing JapaneseCodecs on top of a CJK-enabled Python 2.4 causes shift_jis to use the CJK codec, not the japanese codec. Regards, Martin From tim.one at comcast.net Sun Jan 18 16:51:24 2004 From: tim.one at comcast.net (Tim Peters) Date: Sun Jan 18 16:51:32 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Objectslistobject.c, 2.176, 2.177 In-Reply-To: <20040118212029.GA75402@i18n.org> Message-ID: [Hye-Shik Chang] > Thanks for the explanation. But listobject isn't using realloc To the contrary, listobject uses realloc() a lot, but that doesn't matter here. empty_ob_item has to be a unique pointer value so that the later if (self->ob_item != empty_ob_item || self->ob_size) { /* The user mucked with the list during the sort. */ error check is robust. The C standard doesn't promise much about malloc(0), but it does promise that pointers returned by distinct malloc(0) calls are non-equal so long as none have been passed to free(). In contrast, all NULL pointers must compare equal. If empty_ob_item were NULL, and user code (e.g.) added something to the list during sorting, then managed to NULL it out again, the error check about couldn't catch that. In any case, the patch you're talking about was simply reverting a change I made by mistake, and the restored code has been there forever. Ain't broke, don't fix . From perky at i18n.org Sun Jan 18 17:01:08 2004 From: perky at i18n.org (Hye-Shik Chang) Date: Sun Jan 18 17:00:36 2004 Subject: Changing codec lookup order. (was: Re: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5) In-Reply-To: <400AF97C.7060609@v.loewis.de> References: <20040118122633.F068625AF47@bonanza.off.ekorp.com> <400A9EB3.6030602@v.loewis.de> <20040118152616.GA56270@i18n.org> <400AF97C.7060609@v.loewis.de> Message-ID: <20040118220108.GA75991@i18n.org> On Sun, Jan 18, 2004 at 10:24:12PM +0100, "Martin v. L?wis" wrote: > > I also find that installing JapaneseCodecs on top of a CJK-enabled > Python 2.4 causes shift_jis to use the CJK codec, not the japanese > codec. > Aah. We need to change codec lookup order of encodings.search_function to enable to override default codec by 3rd party one. With attached patch, I could get JapaneseCodecs's one. Now, I admit that CJK codecs are obviously un-backportable to 2.3 due to this change. ;-) Hye-Shik -------------- next part -------------- *** __init__.py.orig Mon Jan 19 06:49:27 2004 --- __init__.py Mon Jan 19 06:46:16 2004 *************** *** 28,33 **** --- 28,34 ---- """#" import codecs, exceptions, types + import aliases _cache = {} _unknown = '--unknown--' *************** *** 74,96 **** # 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 = normalize_encoding(encoding) ! try: ! mod = __import__('encodings.' + modname, ! globals(), locals(), _import_tail) ! except ImportError: ! import aliases ! modname = (aliases.aliases.get(modname) or ! aliases.aliases.get(modname.replace('.', '_')) or ! modname) try: ! mod = __import__(modname, globals(), locals(), _import_tail) except ImportError: mod = None try: getregentry = mod.getregentry --- 75,97 ---- # Import the module: # ! # First lookup the encoding in the aliases mapping and try the ! # import using the default import module lookup scheme with the ! # alias name if available. Then look in the encodings package. # modname = normalize_encoding(encoding) ! modnamestry = ['encodings.' + modname] ! aliasedname = (aliases.aliases.get(modname) or ! aliases.aliases.get(modname.replace('.', '_'))) ! if aliasedname is not None: ! modnamestry.insert(0, aliasedname) ! for mn in modnamestry: try: ! mod = __import__(mn, globals(), locals(), _import_tail) except ImportError: mod = None + else: + break try: getregentry = mod.getregentry *************** *** 125,131 **** except AttributeError: pass else: - import aliases for alias in codecaliases: if not aliases.aliases.has_key(alias): aliases.aliases[alias] = modname --- 126,131 ---- From perky at users.sourceforge.net Tue Jan 20 04:11:50 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Tue Jan 20 04:11:57 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_multibytecodec.py, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv13473 Modified Files: test_multibytecodec.py Log Message: Test not the standard utf-8 codec but gb18030 which is the most complex codec in multibytecodec consumers. Index: test_multibytecodec.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_multibytecodec.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_multibytecodec.py 18 Jan 2004 20:29:55 -0000 1.2 --- test_multibytecodec.py 20 Jan 2004 09:11:48 -0000 1.3 *************** *** 63,72 **** def test_nullcoding(self): ! self.assertEqual(''.decode('utf-8'), u'') ! self.assertEqual(unicode('', 'utf-8'), u'') ! self.assertEqual(u''.encode('utf-8'), '') def test_str_decode(self): ! self.assertEqual('abcd'.encode('utf-8'), 'abcd') def test_main(): --- 63,72 ---- def test_nullcoding(self): ! self.assertEqual(''.decode('gb18030'), u'') ! self.assertEqual(unicode('', 'gb18030'), u'') ! self.assertEqual(u''.encode('gb18030'), '') def test_str_decode(self): ! self.assertEqual('abcd'.encode('gb18030'), 'abcd') def test_main(): From perky at users.sourceforge.net Tue Jan 20 04:33:32 2004 From: perky at users.sourceforge.net (perky@users.sourceforge.net) Date: Tue Jan 20 04:33:36 2004 Subject: [Python-checkins] python/dist/src/Lib/encodings aliases.py, 1.21, 1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory sc8-pr-cvs1:/tmp/cvs-serv17432 Modified Files: aliases.py Log Message: Fix a typo: s/iso_3022/iso2022/ Index: aliases.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/aliases.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** aliases.py 17 Jan 2004 14:29:28 -0000 1.21 --- aliases.py 20 Jan 2004 09:33:30 -0000 1.22 *************** *** 239,243 **** 'iso_2022_jp_2' : 'iso2022_jp_2', ! # iso_3022_jp_3 codec 'iso2022jp_3' : 'iso2022_jp_3', 'iso_2022_jp_3' : 'iso2022_jp_3', --- 239,243 ---- 'iso_2022_jp_2' : 'iso2022_jp_2', ! # iso2022_jp_3 codec 'iso2022jp_3' : 'iso2022_jp_3', 'iso_2022_jp_3' : 'iso2022_jp_3', From lemburg at users.sourceforge.net Tue Jan 20 04:38:54 2004 From: lemburg at users.sourceforge.net (lemburg@users.sourceforge.net) Date: Tue Jan 20 04:38:57 2004 Subject: [Python-checkins] python/dist/src/Lib/encodings aliases.py, 1.22, 1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory sc8-pr-cvs1:/tmp/cvs-serv18572 Modified Files: aliases.py Log Message: Add some more code page aliases needed for completeness. Index: aliases.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/aliases.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** aliases.py 20 Jan 2004 09:33:30 -0000 1.22 --- aliases.py 20 Jan 2004 09:38:52 -0000 1.23 *************** *** 44,47 **** --- 44,48 ---- # cp037 codec + '037' : 'cp037', 'csibm037' : 'cp037', 'ebcdic_cp_ca' : 'cp037', *************** *** 53,90 **** --- 54,103 ---- # cp1026 codec + '1026' : 'cp1026', 'csibm1026' : 'cp1026', 'ibm1026' : 'cp1026', # cp1140 codec + '1140' : 'cp1140', 'ibm1140' : 'cp1140', # cp1250 codec + '1250' : 'cp1250', 'windows_1250' : 'cp1250', # cp1251 codec + '1251' : 'cp1251', 'windows_1251' : 'cp1251', # cp1252 codec + '1252' : 'cp1252', 'windows_1252' : 'cp1252', # cp1253 codec + '1253' : 'cp1253', 'windows_1253' : 'cp1253', # cp1254 codec + '1254' : 'cp1254', 'windows_1254' : 'cp1254', # cp1255 codec + '1255' : 'cp1255', 'windows_1255' : 'cp1255', # cp1256 codec + '1256' : 'cp1256', 'windows_1256' : 'cp1256', # cp1257 codec + '1257' : 'cp1257', 'windows_1257' : 'cp1257', # cp1258 codec + '1258' : 'cp1258', 'windows_1258' : 'cp1258', # cp424 codec + '424' : 'cp424', 'csibm424' : 'cp424', 'ebcdic_cp_he' : 'cp424', *************** *** 97,100 **** --- 110,114 ---- # cp500 codec + '500' : 'cp500', 'csibm500' : 'cp500', 'ebcdic_cp_be' : 'cp500', *************** *** 103,106 **** --- 117,121 ---- # cp775 codec + '775' : 'cp775', 'cspc775baltic' : 'cp775', 'ibm775' : 'cp775', *************** *** 148,151 **** --- 163,167 ---- # cp864 codec + '864' : 'cp864', 'csibm864' : 'cp864', 'ibm864' : 'cp864', From lemburg at users.sourceforge.net Tue Jan 20 04:40:16 2004 From: lemburg at users.sourceforge.net (lemburg@users.sourceforge.net) Date: Tue Jan 20 04:40:19 2004 Subject: [Python-checkins] python/dist/src/Lib/encodings __init__.py, 1.19, 1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/encodings In directory sc8-pr-cvs1:/tmp/cvs-serv19015 Modified Files: __init__.py Log Message: Let the default encodings search function lookup aliases before trying the codec import. This allows applications to install codecs which override (non-special-cased) builtin codecs. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/encodings/__init__.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** __init__.py 16 May 2003 17:07:51 -0000 1.19 --- __init__.py 20 Jan 2004 09:40:14 -0000 1.20 *************** *** 28,32 **** """#" ! import codecs, exceptions, types _cache = {} --- 28,32 ---- """#" ! import codecs, exceptions, types, aliases _cache = {} *************** *** 39,42 **** --- 39,43 ---- ' ' ' ') + _aliases = aliases.aliases class CodecRegistryError(exceptions.LookupError, *************** *** 75,95 **** # 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 = normalize_encoding(encoding) ! try: ! mod = __import__('encodings.' + modname, ! globals(), locals(), _import_tail) ! except ImportError: ! import aliases ! modname = (aliases.aliases.get(modname) or ! aliases.aliases.get(modname.replace('.', '_')) or ! modname) try: ! mod = __import__(modname, globals(), locals(), _import_tail) except ImportError: ! mod = None try: --- 76,104 ---- # Import the module: # ! # First try to find an alias for the normalized encoding ! # name and lookup the module using the aliased name, then try to ! # lookup the module using the standard import scheme, i.e. first ! # try in the encodings package, then at top-level. # ! norm_encoding = normalize_encoding(encoding) ! aliased_encoding = _aliases.get(norm_encoding) or \ ! _aliases.get(norm_encoding.replace('.', '_')) ! if aliased_encoding is not None: ! modnames = [aliased_encoding, ! norm_encoding] ! else: ! modnames = [norm_encoding] ! for modname in modnames: ! if not modname: ! continue try: ! mod = __import__(modname, ! globals(), locals(), _import_tail) except ImportError: ! pass ! else: ! break ! else: ! mod = None try: *************** *** 126,133 **** pass else: - import aliases for alias in codecaliases: ! if not aliases.aliases.has_key(alias): ! aliases.aliases[alias] = modname # Return the registry entry --- 135,141 ---- pass else: for alias in codecaliases: ! if not _aliases.has_key(alias): ! _aliases[alias] = modname # Return the registry entry From niemeyer at users.sourceforge.net Tue Jan 20 10:14:58 2004 From: niemeyer at users.sourceforge.net (niemeyer@users.sourceforge.net) Date: Tue Jan 20 10:15:01 2004 Subject: [Python-checkins] python/dist/src/Modules _bsddb.c,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv18424 Modified Files: _bsddb.c Log Message: Fixing #880531: raise TypeError when trying to use a None key with RECNO or QUEUE database. Index: _bsddb.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_bsddb.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** _bsddb.c 3 Nov 2003 21:35:31 -0000 1.25 --- _bsddb.c 20 Jan 2004 15:14:55 -0000 1.26 *************** *** 350,353 **** --- 350,360 ---- CLEAR_DBT(*key); if (keyobj == Py_None) { /* TODO: is None really okay for keys? */ + type = _DB_get_type(self); + if (type == DB_RECNO || type == DB_QUEUE) { + PyErr_SetString( + PyExc_TypeError, + "None keys not allowed for Recno and Queue DB's"); + return 0; + } /* no need to do anything, the structure has already been zeroed */ } From niemeyer at users.sourceforge.net Tue Jan 20 10:20:05 2004 From: niemeyer at users.sourceforge.net (niemeyer@users.sourceforge.net) Date: Tue Jan 20 10:20:08 2004 Subject: [Python-checkins] python/dist/src/Modules _bsddb.c,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv19385 Modified Files: _bsddb.c Log Message: When key is None, give up if _DB_get_type() returns -1 as well. Index: _bsddb.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_bsddb.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** _bsddb.c 20 Jan 2004 15:14:55 -0000 1.26 --- _bsddb.c 20 Jan 2004 15:20:03 -0000 1.27 *************** *** 351,354 **** --- 351,356 ---- if (keyobj == Py_None) { /* TODO: is None really okay for keys? */ type = _DB_get_type(self); + if (type == -1) + return 0; if (type == DB_RECNO || type == DB_QUEUE) { PyErr_SetString( From niemeyer at users.sourceforge.net Tue Jan 20 10:24:32 2004 From: niemeyer at users.sourceforge.net (niemeyer@users.sourceforge.net) Date: Tue Jan 20 10:24:34 2004 Subject: [Python-checkins] python/dist/src/Modules _bsddb.c,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv20601 Modified Files: _bsddb.c Log Message: Removing TODO comment for None keys, as suggested by Neal Norwitz. Index: _bsddb.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_bsddb.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** _bsddb.c 20 Jan 2004 15:20:03 -0000 1.27 --- _bsddb.c 20 Jan 2004 15:24:29 -0000 1.28 *************** *** 349,353 **** CLEAR_DBT(*key); ! if (keyobj == Py_None) { /* TODO: is None really okay for keys? */ type = _DB_get_type(self); if (type == -1) --- 349,353 ---- CLEAR_DBT(*key); ! if (keyobj == Py_None) { type = _DB_get_type(self); if (type == -1) From lemburg at users.sourceforge.net Tue Jan 20 13:24:37 2004 From: lemburg at users.sourceforge.net (lemburg@users.sourceforge.net) Date: Tue Jan 20 13:24:40 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.921,1.922 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1:/tmp/cvs-serv27701/Misc Modified Files: NEWS Log Message: Add news item about change in encodings search function. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.921 retrieving revision 1.922 diff -C2 -d -r1.921 -r1.922 *** NEWS 17 Jan 2004 14:59:36 -0000 1.921 --- NEWS 20 Jan 2004 18:24:34 -0000 1.922 *************** *** 183,186 **** --- 183,193 ---- ------- + - The encodings package will now applies codec name aliases + first before starting to try the import of the codec module. + This simplifies overriding built-in codecs with external + packages, e.g. the included CJK codecs with the JapaneseCodecs + package, by adjusting the aliases dictionary in encodings.aliases + accordingly. + - base64 now supports RFC 3548 Base16, Base32, and Base64 encoding and decoding standards. From rhettinger at users.sourceforge.net Tue Jan 20 15:04:42 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Jan 20 15:04:45 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_itertools.py, 1.27, 1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1:/tmp/cvs-serv20952/lib/test Modified Files: test_itertools.py Log Message: Add a Guido inspired example for groupby(). Index: test_itertools.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_itertools.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** test_itertools.py 17 Dec 2003 20:43:32 -0000 1.27 --- test_itertools.py 20 Jan 2004 20:04:31 -0000 1.28 *************** *** 678,681 **** --- 678,695 ---- 3 ['g'] + # Find runs of consecutive numbers using groupby. The key to the solution + # is differencing with a range so that consecutive numbers all appear in + # same group. + >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] + >>> for k, g in groupby(enumerate(data), lambda (i,x):i-x): + ... print map(operator.itemgetter(1), g) + ... + [1] + [4, 5, 6] + [10] + [15, 16, 17, 18] + [22] + [25, 26, 27, 28] + >>> def take(n, seq): ... return list(islice(seq, n)) From rhettinger at users.sourceforge.net Tue Jan 20 15:04:42 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Tue Jan 20 15:04:48 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libitertools.tex, 1.27, 1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv20952/doc/lib Modified Files: libitertools.tex Log Message: Add a Guido inspired example for groupby(). Index: libitertools.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libitertools.tex,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** libitertools.tex 18 Dec 2003 13:28:35 -0000 1.27 --- libitertools.tex 20 Jan 2004 20:04:40 -0000 1.28 *************** *** 407,410 **** --- 407,423 ---- 3 ['g'] + # Find runs of consecutive numbers using groupby. The key to the solution + # is differencing with a range so that consecutive numbers all appear in + # same group. + >>> data = [ 1, 4,5,6, 10, 15,16,17,18, 22, 25,26,27,28] + >>> for k, g in groupby(enumerate(data), lambda (i,x):i-x): + ... print map(operator.itemgetter(1), g) + ... + [1] + [4, 5, 6] + [10] + [15, 16, 17, 18] + [22] + [25, 26, 27, 28] \end{verbatim} *************** *** 412,416 **** This section shows how itertools can be combined to create other more powerful itertools. Note that \function{enumerate()} and \method{iteritems()} ! already have efficient implementations in Python. They are only included here to illustrate how higher level tools can be created from building blocks. --- 425,429 ---- This section shows how itertools can be combined to create other more powerful itertools. Note that \function{enumerate()} and \method{iteritems()} ! already have efficient implementations. They are included here to illustrate how higher level tools can be created from building blocks. From barry at python.org Tue Jan 20 15:16:04 2004 From: barry at python.org (Barry Warsaw) Date: Tue Jan 20 15:16:18 2004 Subject: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5 In-Reply-To: <400AF97C.7060609@v.loewis.de> References: <20040118122633.F068625AF47@bonanza.off.ekorp.com> <400A9EB3.6030602@v.loewis.de> <20040118152616.GA56270@i18n.org> <400AF97C.7060609@v.loewis.de> Message-ID: <1074629763.15390.60.camel@anthem> On Sun, 2004-01-18 at 16:24, "Martin v. L?wis" wrote: > Of course, users may have installed JapaneseCodecs with > --without-aliases, in which case the aliases won't be there > (neither automatically, nor after explicitly importing japanese). > I believe mailman use it that way > So people who currently do Actually Mailman 2.1 does this: import japanese import korean import korean.aliases It also does not install the codec packages --without-aliases. -Barry From barry at python.org Tue Jan 20 15:34:22 2004 From: barry at python.org (Barry Warsaw) Date: Tue Jan 20 15:34:34 2004 Subject: Changing codec lookup order. (was: Re: [Python-Dev] Re: [Python-checkins] python/dist/src/Lib/email/test test_email_codecs.py, 1.4, 1.5) In-Reply-To: <20040118220108.GA75991@i18n.org> References: <20040118122633.F068625AF47@bonanza.off.ekorp.com> <400A9EB3.6030602@v.loewis.de> <20040118152616.GA56270@i18n.org> <400AF97C.7060609@v.loewis.de> <20040118220108.GA75991@i18n.org> Message-ID: <1074630862.15390.78.camel@anthem> On Sun, 2004-01-18 at 17:01, Hye-Shik Chang wrote: > Now, I admit that CJK codecs are obviously un-backportable to 2.3 > due to this change. ;-) Hmm, sounds like trying to make those changes to the email package for 2.3 is doomed, or at least not worth it if CJK won't work well with 2.3. -Barry From bwarsaw at users.sourceforge.net Tue Jan 20 16:06:03 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Jan 20 16:13:53 2004 Subject: [Python-checkins] python/dist/src/Modules grpmodule.c,2.21,2.22 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv1503 Modified Files: grpmodule.c Log Message: grp_getgrgid(), grp_getgrnam(): Patch # 868499, improvement to the error messages. Index: grpmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/grpmodule.c,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -d -r2.21 -r2.22 *** grpmodule.c 3 May 2003 09:14:53 -0000 2.21 --- grpmodule.c 20 Jan 2004 21:06:00 -0000 2.22 *************** *** 91,95 **** return NULL; if ((p = getgrgid(gid)) == NULL) { ! PyErr_SetString(PyExc_KeyError, "getgrgid(): gid not found"); return NULL; } --- 91,95 ---- return NULL; if ((p = getgrgid(gid)) == NULL) { ! PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %d", gid); return NULL; } *************** *** 105,109 **** return NULL; if ((p = getgrnam(name)) == NULL) { ! PyErr_SetString(PyExc_KeyError, "getgrnam(): name not found"); return NULL; } --- 105,109 ---- return NULL; if ((p = getgrnam(name)) == NULL) { ! PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %s", name); return NULL; } From bwarsaw at users.sourceforge.net Tue Jan 20 16:23:01 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Jan 20 16:23:05 2004 Subject: [Python-checkins] python/dist/src/Modules grpmodule.c, 2.21, 2.21.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv5282 Modified Files: Tag: release23-maint grpmodule.c Log Message: grp_getgrgid(), grp_getgrnam(): Patch # 868499, improvement to the error messages. Index: grpmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/grpmodule.c,v retrieving revision 2.21 retrieving revision 2.21.8.1 diff -C2 -d -r2.21 -r2.21.8.1 *** grpmodule.c 3 May 2003 09:14:53 -0000 2.21 --- grpmodule.c 20 Jan 2004 21:22:59 -0000 2.21.8.1 *************** *** 91,95 **** return NULL; if ((p = getgrgid(gid)) == NULL) { ! PyErr_SetString(PyExc_KeyError, "getgrgid(): gid not found"); return NULL; } --- 91,95 ---- return NULL; if ((p = getgrgid(gid)) == NULL) { ! PyErr_Format(PyExc_KeyError, "getgrgid(): gid not found: %d", gid); return NULL; } *************** *** 105,109 **** return NULL; if ((p = getgrnam(name)) == NULL) { ! PyErr_SetString(PyExc_KeyError, "getgrnam(): name not found"); return NULL; } --- 105,109 ---- return NULL; if ((p = getgrnam(name)) == NULL) { ! PyErr_Format(PyExc_KeyError, "getgrnam(): name not found: %s", name); return NULL; } From bwarsaw at users.sourceforge.net Tue Jan 20 16:23:48 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Jan 20 16:23:51 2004 Subject: [Python-checkins] python/dist/src/Modules pwdmodule.c, 1.37, 1.37.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv5483 Modified Files: Tag: release23-maint pwdmodule.c Log Message: pwd_getpwuid(), pwd_getpwnam(): Patch # 868499, improvement to the error messages. Index: pwdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pwdmodule.c,v retrieving revision 1.37 retrieving revision 1.37.14.1 diff -C2 -d -r1.37 -r1.37.14.1 *** pwdmodule.c 6 Dec 2002 12:48:51 -0000 1.37 --- pwdmodule.c 20 Jan 2004 21:23:46 -0000 1.37.14.1 *************** *** 108,112 **** return NULL; if ((p = getpwuid(uid)) == NULL) { ! PyErr_SetString(PyExc_KeyError, "getpwuid(): uid not found"); return NULL; } --- 108,113 ---- return NULL; if ((p = getpwuid(uid)) == NULL) { ! PyErr_Format(PyExc_KeyError, ! "getpwuid(): uid not found: %d", uid); return NULL; } *************** *** 128,132 **** return NULL; if ((p = getpwnam(name)) == NULL) { ! PyErr_SetString(PyExc_KeyError, "getpwnam(): name not found"); return NULL; } --- 129,134 ---- return NULL; if ((p = getpwnam(name)) == NULL) { ! PyErr_Format(PyExc_KeyError, ! "getpwnam(): name not found: %s", name); return NULL; } From bwarsaw at users.sourceforge.net Tue Jan 20 16:07:25 2004 From: bwarsaw at users.sourceforge.net (bwarsaw@users.sourceforge.net) Date: Tue Jan 20 16:25:57 2004 Subject: [Python-checkins] python/dist/src/Modules pwdmodule.c,1.38,1.39 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1:/tmp/cvs-serv1755 Modified Files: pwdmodule.c Log Message: pwd_getpwuid(), pwd_getpwnam(): Patch # 868499, improvement to the error messages. Index: pwdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pwdmodule.c,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** pwdmodule.c 23 Oct 2003 23:54:57 -0000 1.38 --- pwdmodule.c 20 Jan 2004 21:07:23 -0000 1.39 *************** *** 108,112 **** return NULL; if ((p = getpwuid(uid)) == NULL) { ! PyErr_SetString(PyExc_KeyError, "getpwuid(): uid not found"); return NULL; } --- 108,113 ---- return NULL; if ((p = getpwuid(uid)) == NULL) { ! PyErr_Format(PyExc_KeyError, ! "getpwuid(): uid not found: %d", uid); return NULL; } *************** *** 128,132 **** return NULL; if ((p = getpwnam(name)) == NULL) { ! PyErr_SetString(PyExc_KeyError, "getpwnam(): name not found"); return NULL; } --- 129,134 ---- return NULL; if ((p = getpwnam(name)) == NULL) { ! PyErr_Format(PyExc_KeyError, ! "getpwnam(): name not found: %s", name); return NULL; } From loewis at users.sourceforge.net Wed Jan 21 02:54:04 2004 From: loewis at users.sourceforge.net (loewis@users.sourceforge.net) Date: Wed Jan 21 02:54:07 2004 Subject: [Python-checkins] python/dist/src/PCbuild pythoncore.vcproj, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory sc8-pr-cvs1:/tmp/cvs-serv17068/PCbuild Modified Files: pythoncore.vcproj Log Message: Add cjkcodecs to build process Index: pythoncore.vcproj =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.vcproj,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pythoncore.vcproj 6 Jan 2004 19:27:38 -0000 1.3 --- pythoncore.vcproj 21 Jan 2004 07:54:02 -0000 1.4 *************** *** 155,158 **** --- 155,161 ---- + + *************** *** 177,183 **** --- 180,213 ----
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + *************** *** 1367,1370 **** --- 1427,1442 ---- + + + + + + + + + + Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1:/tmp/cvs-serv17068/PC Modified Files: config.c Log Message: Add cjkcodecs to build process Index: config.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/config.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** config.c 5 Jan 2004 10:13:35 -0000 1.42 --- config.c 21 Jan 2004 07:54:02 -0000 1.43 *************** *** 57,60 **** --- 57,86 ---- extern void initdatetime(void); + extern void init_multibytecodec(void); + extern void init_codecs_mapdata_ja_JP(void); + extern void init_codecs_mapdata_ko_KR(void); + extern void init_codecs_mapdata_zh_CN(void); + extern void init_codecs_mapdata_zh_TW(void); + extern void init_codecs_shift_jis(void); + extern void init_codecs_cp932(void); + extern void init_codecs_euc_jp(void); + extern void init_codecs_iso2022_jp(void); + extern void init_codecs_iso2022_jp_1(void); + extern void init_codecs_iso2022_jp_2(void); + extern void init_codecs_iso2022_jp_3(void); + extern void init_codecs_iso2022_jp_ext(void); + extern void init_codecs_shift_jisx0213(void); + extern void init_codecs_euc_jisx0213(void); + extern void init_codecs_euc_kr(void); + extern void init_codecs_cp949(void); + extern void init_codecs_johab(void); + extern void init_codecs_iso2022_kr(void); + extern void init_codecs_gb2312(void); + extern void init_codecs_gbk(void); + extern void init_codecs_gb18030(void); + extern void init_codecs_hz(void); + extern void init_codecs_big5(void); + extern void init_codecs_cp950(void); + /* tools/freeze/makeconfig.py marker for additional "extern" */ /* -- ADDMODULE MARKER 1 -- */ *************** *** 122,125 **** --- 148,178 ---- {"zipimport", initzipimport}, + /* CJK codecs */ + {"_multibytecodec", init_multibytecodec}, + {"_codecs_mapdata_ja_JP", init_codecs_mapdata_ja_JP}, + {"_codecs_mapdata_ko_KR", init_codecs_mapdata_ko_KR}, + {"_codecs_mapdata_zh_CN", init_codecs_mapdata_zh_CN}, + {"_codecs_mapdata_zh_TW", init_codecs_mapdata_zh_TW}, + {"_codecs_shift_jis", init_codecs_shift_jis}, + {"_codecs_cp932", init_codecs_cp932}, + {"_codecs_euc_jp", init_codecs_euc_jp}, + {"_codecs_iso2022_jp", init_codecs_iso2022_jp}, + {"_codecs_iso2022_jp_1", init_codecs_iso2022_jp_1}, + {"_codecs_iso2022_jp_2", init_codecs_iso2022_jp_2}, + {"_codecs_iso2022_jp_3", init_codecs_iso2022_jp_3}, + {"_codecs_iso2022_jp_ext", init_codecs_iso2022_jp_ext}, + {"_codecs_shift_jisx0213", init_codecs_shift_jisx0213}, + {"_codecs_euc_jisx0213", init_codecs_euc_jisx0213}, + {"_codecs_euc_kr", init_codecs_euc_kr}, + {"_codecs_cp949", init_codecs_cp949}, + {"_codecs_johab", init_codecs_johab}, + {"_codecs_iso2022_kr", init_codecs_iso2022_kr}, + {"_codecs_gb2312", init_codecs_gb2312}, + {"_codecs_gbk", init_codecs_gbk}, + {"_codecs_gb18030", init_codecs_gb18030}, + {"_codecs_hz", init_codecs_hz}, + {"_codecs_big5", init_codecs_big5}, + {"_codecs_cp950", init_codecs_cp950}, + /* tools/freeze/makeconfig.py marker for additional "_inittab" entries */ /* -- ADDMODULE MARKER 2 -- */ From montanaro at users.sourceforge.net Wed Jan 21 08:34:37 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Wed Jan 21 08:34:40 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcsv.tex,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9647 Modified Files: libcsv.tex Log Message: typo Index: libcsv.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcsv.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** libcsv.tex 3 Oct 2003 14:03:01 -0000 1.10 --- libcsv.tex 21 Jan 2004 13:34:35 -0000 1.11 *************** *** 240,244 **** \begin{memberdesc}[Dialect]{doublequote} Controls how instances of \var{quotechar} appearing inside a field should be ! themselves be quoted. When \constant{True}, the character is doubledd. When \constant{False}, the \var{escapechar} must be a one-character string which is used as a prefix to the \var{quotechar}. It defaults to --- 240,244 ---- \begin{memberdesc}[Dialect]{doublequote} Controls how instances of \var{quotechar} appearing inside a field should be ! themselves be quoted. When \constant{True}, the character is doubled. When \constant{False}, the \var{escapechar} must be a one-character string which is used as a prefix to the \var{quotechar}. It defaults to From montanaro at users.sourceforge.net Wed Jan 21 08:47:06 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Wed Jan 21 08:47:10 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcsv.tex,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv12613 Modified Files: libcsv.tex Log Message: expand on notion of row object type Index: libcsv.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcsv.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** libcsv.tex 21 Jan 2004 13:34:35 -0000 1.11 --- libcsv.tex 21 Jan 2004 13:47:04 -0000 1.12 *************** *** 286,291 **** \subsection{Writer Objects} ! Writer objects (\class{DictWriter} instances and objects returned by ! the \function{writer()} function) have the following public methods: \begin{methoddesc}[csv writer]{writerow}{row} --- 286,297 ---- \subsection{Writer Objects} ! \class{Writer} objects (\class{DictWriter} instances and objects returned by ! the \function{writer()} function) have the following public methods. A ! {}\var{row} must be a sequence of strings or numbers for \class{Writer} ! objects and a dictionary mapping fieldnames to strings or numbers (by ! passing them through \function{str()} first) for {}\class{DictWriter} ! objects. Note that complex numbers are written out surrounded by parens. ! This may cause some problems for other programs which read CSV files ! (assuming they support complex numbers at all). \begin{methoddesc}[csv writer]{writerow}{row} *************** *** 295,299 **** \begin{methoddesc}[csv writer]{writerows}{rows} ! Write all the \var{rows} parameters to the writer's file object, formatted according to the current dialect. \end{methoddesc} --- 301,306 ---- \begin{methoddesc}[csv writer]{writerows}{rows} ! Write all the \var{rows} parameters (a list of \var{row} objects as ! described above) to the writer's file object, formatted according to the current dialect. \end{methoddesc} From montanaro at users.sourceforge.net Wed Jan 21 08:49:45 2004 From: montanaro at users.sourceforge.net (montanaro@users.sourceforge.net) Date: Wed Jan 21 08:49:48 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcsv.tex, 1.7.8.2, 1.7.8.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv13086a Modified Files: Tag: release23-maint libcsv.tex Log Message: backport some doc fixes Index: libcsv.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcsv.tex,v retrieving revision 1.7.8.2 retrieving revision 1.7.8.3 diff -C2 -d -r1.7.8.2 -r1.7.8.3 *** libcsv.tex 10 Sep 2003 18:57:04 -0000 1.7.8.2 --- libcsv.tex 21 Jan 2004 13:49:43 -0000 1.7.8.3 *************** *** 229,233 **** \begin{memberdesc}[Dialect]{doublequote} Controls how instances of \var{quotechar} appearing inside a field should be ! themselves be quoted. When \constant{True}, the character is doubledd. When \constant{False}, the \var{escapechar} must be a one-character string which is used as a prefix to the \var{quotechar}. It defaults to --- 229,233 ---- \begin{memberdesc}[Dialect]{doublequote} Controls how instances of \var{quotechar} appearing inside a field should be ! themselves be quoted. When \constant{True}, the character is doubled. When \constant{False}, the \var{escapechar} must be a one-character string which is used as a prefix to the \var{quotechar}. It defaults to *************** *** 275,280 **** \subsection{Writer Objects} ! Writer objects (\class{DictWriter} instances and objects returned by ! the \function{writer()} function) have the following public methods: \begin{methoddesc}[csv writer]{writerow}{row} --- 275,286 ---- \subsection{Writer Objects} ! \class{Writer} objects (\class{DictWriter} instances and objects returned by ! the \function{writer()} function) have the following public methods. A ! {}\var{row} must be a sequence of strings or numbers for \class{Writer} ! objects and a dictionary mapping fieldnames to strings or numbers (by ! passing them through \function{str()} first) for {}\class{DictWriter} ! objects. Note that complex numbers are written out surrounded by parens. ! This may cause some problems for other programs which read CSV files ! (assuming they support complex numbers at all). \begin{methoddesc}[csv writer]{writerow}{row} *************** *** 284,288 **** \begin{methoddesc}[csv writer]{writerows}{rows} ! Write all the \var{rows} parameters to the writer's file object, formatted according to the current dialect. \end{methoddesc} --- 290,295 ---- \begin{methoddesc}[csv writer]{writerows}{rows} ! Write all the \var{rows} parameters (a list of \var{row} objects as ! described above) to the writer's file object, formatted according to the current dialect. \end{methoddesc} From rhettinger at users.sourceforge.net Wed Jan 21 10:28:44 2004 From: rhettinger at users.sourceforge.net (rhettinger@users.sourceforge.net) Date: Wed Jan 21 10:28:49 2004 Subject: [Python-checkins] python/nondist/sandbox/setobj automata.py, 1.2, NONE cube.py, 1.2, NONE setobject.c, 1.24, NONE setup.py, 1.1, NONE test_set.py, 1.22, NONE Message-ID: Update of /cvsroot/python/python/nondist/sandbox/setobj In directory sc8-pr-cvs1:/tmp/cvs-serv1678/setobj Removed Files: automata.py cube.py setobject.c setup.py test_set.py Log Message: Cleanup old sandbox work. --- automata.py DELETED --- --- cube.py DELETED --- --- setobject.c DELETED --- --- setup.py DELETED --- --- test_set.py DELETED --- From mwh at users.sourceforge.net Wed Jan 21 13:11:27 2004 From: mwh at users.sourceforge.net (mwh@users.sourceforge.net) Date: Wed Jan 21 13:11:29 2004 Subject: [Python-checkins] python/nondist/peps pep-0306.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1:/tmp/cvs-serv5664 Modified Files: pep-0306.txt Log Message: add need for documentation. Index: pep-0306.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0306.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pep-0306.txt 10 Feb 2003 14:54:10 -0000 1.4 --- pep-0306.txt 21 Jan 2004 18:11:25 -0000 1.5 *************** *** 61,64 **** --- 61,66 ---- gratefully received. + __ Documentation must be written! + References From fdrake at users.sourceforge.net Wed Jan 21 13:30:30 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Jan 21 13:30:34 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libdifflib.tex,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv9843 Modified Files: libdifflib.tex Log Message: add direct link to the article in DDJ closes SF bug #871402 Index: libdifflib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdifflib.tex,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** libdifflib.tex 30 Dec 2003 16:12:27 -0000 1.16 --- libdifflib.tex 21 Jan 2004 18:30:28 -0000 1.17 *************** *** 235,239 **** \begin{seealso} ! \seetitle{Pattern Matching: The Gestalt Approach}{Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. This was published in --- 235,240 ---- \begin{seealso} ! \seetitle[http://www.ddj.com/documents/s=1103/ddj8807c/] ! {Pattern Matching: The Gestalt Approach}{Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. This was published in From fdrake at users.sourceforge.net Wed Jan 21 13:31:18 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Wed Jan 21 13:31:21 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libdifflib.tex, 1.15, 1.15.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1:/tmp/cvs-serv10042 Modified Files: Tag: release23-maint libdifflib.tex Log Message: add direct link to the article in DDJ closes SF bug #871402 Index: libdifflib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdifflib.tex,v retrieving revision 1.15 retrieving revision 1.15.10.1 diff -C2 -d -r1.15 -r1.15.10.1 *** libdifflib.tex 11 Jun 2003 07:50:44 -0000 1.15 --- libdifflib.tex 21 Jan 2004 18:31:16 -0000 1.15.10.1 *************** *** 237,241 **** \begin{seealso} ! \seetitle{Pattern Matching: The Gestalt Approach}{Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. This was published in --- 237,242 ---- \begin{seealso} ! \seetitle[http://www.ddj.com/documents/s=1103/ddj8807c/] ! {Pattern Matching: The Gestalt Approach}{Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. This was published in From kbk at users.sourceforge.net Wed Jan 21 13:54:32 2004 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Wed Jan 21 13:54:36 2004 Subject: [Python-checkins] python/dist/src/Lib/idlelib NEWS.txt, 1.28, 1.29 PyShell.py, 1.83, 1.84 ScriptBinding.py, 1.25, 1.26 run.py, 1.27, 1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv15527 Modified Files: NEWS.txt PyShell.py ScriptBinding.py run.py Log Message: Added a Tk error dialog to run.py inform the user if the subprocess can't connect to the user GUI process. Added a timeout to the GUI's listening socket. Added Tk error dialogs to PyShell.py to announce a failure to bind the port or connect to the subprocess. Clean up error handling during connection initiation phase. This is an update of Python Patch 778323. M NEWS.txt M PyShell.py M ScriptBinding.py M run.py Backport candidate. Index: NEWS.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** NEWS.txt 2 Jan 2004 04:04:04 -0000 1.28 --- NEWS.txt 21 Jan 2004 18:54:30 -0000 1.29 *************** *** 4,7 **** --- 4,13 ---- *Release date: XX-XXX-2004* + - Added a Tk error dialog to run.py inform the user if the subprocess can't + connect to the user GUI process. Added a timeout to the GUI's listening + socket. Added Tk error dialogs to PyShell.py to announce a failure to bind + the port or connect to the subprocess. Clean up error handling during + connection initiation phase. This is an update of Python Patch 778323. + - Print correct exception even if source file changed since shell was restarted. IDLEfork Patch 869012 Noam Raphael Index: PyShell.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/PyShell.py,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** PyShell.py 24 Nov 2003 05:26:16 -0000 1.83 --- PyShell.py 21 Jan 2004 18:54:30 -0000 1.84 *************** *** 252,256 **** else: self.pyshell = PyShell(self) ! self.pyshell.begin() return self.pyshell --- 252,258 ---- else: self.pyshell = PyShell(self) ! if self.pyshell: ! if not self.pyshell.begin(): ! return None return self.pyshell *************** *** 345,348 **** --- 347,353 ---- def start_subprocess(self): + # spawning first avoids passing a listening socket to the subprocess + self.spawn_subprocess() + #time.sleep(20) # test to simulate GUI not accepting connection addr = (LOCALHOST, self.port) # Idle starts listening for connection on localhost *************** *** 353,364 **** break except socket.error, err: ! print>>sys.__stderr__,"IDLE socket error: " + err[1]\ ! + ", retrying..." else: ! display_port_binding_error() ! sys.exit() ! self.spawn_subprocess() # Accept the connection from the Python execution server ! self.rpcclt.accept() self.rpcclt.register("stdin", self.tkconsole) self.rpcclt.register("stdout", self.tkconsole.stdout) --- 358,372 ---- break except socket.error, err: ! pass else: ! self.display_port_binding_error() ! return None # Accept the connection from the Python execution server ! self.rpcclt.listening_sock.settimeout(10) ! try: ! self.rpcclt.accept() ! except socket.timeout, err: ! self.display_no_subprocess_error() ! return None self.rpcclt.register("stdin", self.tkconsole) self.rpcclt.register("stdout", self.tkconsole.stdout) *************** *** 369,376 **** self.transfer_path() self.poll_subprocess() def restart_subprocess(self): if self.restarting: ! return self.restarting = True # close only the subprocess debugger --- 377,385 ---- self.transfer_path() self.poll_subprocess() + return self.rpcclt def restart_subprocess(self): if self.restarting: ! return self.rpcclt self.restarting = True # close only the subprocess debugger *************** *** 389,393 **** console.executing = False self.spawn_subprocess() ! self.rpcclt.accept() self.transfer_path() # annotate restart in shell window and mark it --- 398,406 ---- console.executing = False self.spawn_subprocess() ! try: ! self.rpcclt.accept() ! except socket.timeout, err: ! self.display_no_subprocess_error() ! return None self.transfer_path() # annotate restart in shell window and mark it *************** *** 408,411 **** --- 421,425 ---- debug.load_breakpoints() self.restarting = False + return self.rpcclt def __request_interrupt(self): *************** *** 416,420 **** def kill_subprocess(self): ! self.rpcclt.close() self.unix_terminate() self.tkconsole.executing = False --- 430,437 ---- def kill_subprocess(self): ! try: ! self.rpcclt.close() ! except AttributeError: # no socket ! pass self.unix_terminate() self.tkconsole.executing = False *************** *** 639,649 **** del c[key] - def display_executing_dialog(self): - tkMessageBox.showerror( - "Already executing", - "The Python Shell window is already executing a command; " - "please wait until it is finished.", - master=self.tkconsole.text) - def runcommand(self, code): "Run the code without invoking the debugger" --- 656,659 ---- *************** *** 696,699 **** --- 706,737 ---- self.tkconsole.stderr.write(s) + def display_port_binding_error(self): + tkMessageBox.showerror( + "Port Binding Error", + "IDLE can't bind TCP/IP port 8833, which is necessary to " + "communicate with its Python execution server. Either " + "no networking is installed on this computer or another " + "process (another IDLE?) is using the port. Run IDLE with the -n " + "command line switch to start without a subprocess and refer to " + "Help/IDLE Help 'Running without a subprocess' for further " + "details.", + master=self.tkconsole.text) + + def display_no_subprocess_error(self): + tkMessageBox.showerror( + "Subprocess Startup Error", + "IDLE's subprocess didn't make connection. Either IDLE can't " + "start a subprocess or personal firewall software is blocking " + "the connection.", + master=self.tkconsole.text) + + def display_executing_dialog(self): + tkMessageBox.showerror( + "Already executing", + "The Python Shell window is already executing a command; " + "please wait until it is finished.", + master=self.tkconsole.text) + + class PyShell(OutputWindow): *************** *** 766,771 **** # self.pollinterval = 50 # millisec - if use_subprocess: - self.interp.start_subprocess() reading = False --- 804,807 ---- *************** *** 888,891 **** --- 924,931 ---- if use_subprocess: nosub = '' + client = self.interp.start_subprocess() + if not client: + self.close() + return None else: nosub = "==== No Subprocess ====" *************** *** 895,903 **** self.showprompt() import Tkinter ! Tkinter._default_root = None ! ! def interact(self): ! self.begin() ! self.top.mainloop() def readline(self): --- 935,940 ---- self.showprompt() import Tkinter ! Tkinter._default_root = None # 03Jan04 KBK What's this? ! return client def readline(self): *************** *** 1282,1290 **** if not args: flist.new() ! if enable_shell: ! flist.open_shell() ! elif enable_shell: ! flist.pyshell = PyShell(flist) ! flist.pyshell.begin() shell = flist.pyshell # handle remaining options: --- 1319,1325 ---- if not args: flist.new() ! if enable_shell: ! if not flist.open_shell(): ! return # couldn't open shell shell = flist.pyshell # handle remaining options: *************** *** 1296,1300 **** if filename and os.path.isfile(filename): shell.interp.execfile(filename) ! if cmd or script: shell.interp.runcommand("""if 1: import sys as _sys --- 1331,1335 ---- if filename and os.path.isfile(filename): shell.interp.execfile(filename) ! if shell and cmd or script: shell.interp.runcommand("""if 1: import sys as _sys *************** *** 1310,1331 **** root.destroy() - - def display_port_binding_error(): - print """\ - \nIDLE cannot run. - - IDLE needs to use a specific TCP/IP port (8833) in order to communicate with - its Python execution server. IDLE is unable to bind to this port, and so - cannot start. Here are some possible causes of this problem: - - 1. TCP/IP networking is not installed or not working on this computer - 2. Another program (another IDLE?) is running that uses this port - 3. Personal firewall software is preventing IDLE from using this port - - Run IDLE with the -n command line switch to start without a subprocess - and refer to Help/IDLE Help "Running without a subprocess" for further - details. - """ - if __name__ == "__main__": sys.modules['PyShell'] = sys.modules['__main__'] --- 1345,1348 ---- Index: ScriptBinding.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/ScriptBinding.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** ScriptBinding.py 5 Jun 2003 02:38:32 -0000 1.25 --- ScriptBinding.py 21 Jan 2004 18:54:30 -0000 1.26 *************** *** 138,141 **** --- 138,143 ---- flist = self.editwin.flist shell = flist.open_shell() + if not shell: + return # couldn't open the shell interp = shell.interp if PyShell.use_subprocess: Index: run.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/run.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** run.py 2 Jan 2004 04:04:04 -0000 1.27 --- run.py 21 Jan 2004 18:54:30 -0000 1.28 *************** *** 48,51 **** --- 48,52 ---- no_exitfunc = del_exitfunc port = 8833 + #time.sleep(15) # test subprocess not responding if sys.argv[1:]: port = int(sys.argv[1]) *************** *** 91,95 **** def manage_socket(address): ! for i in range(6): time.sleep(i) try: --- 92,96 ---- def manage_socket(address): ! for i in range(3): time.sleep(i) try: *************** *** 97,107 **** break except socket.error, err: ! if i < 3: ! print>>sys.__stderr__, ".. ", ! else: ! print>>sys.__stderr__,"\nPython subprocess socket error: "\ ! + err[1] + ", retrying...." else: ! print>>sys.__stderr__, "\nConnection to Idle failed, exiting." global exit_now exit_now = True --- 98,107 ---- break except socket.error, err: ! print>>sys.__stderr__,"IDLE Subprocess: socket error: "\ ! + err[1] + ", retrying...." else: ! print>>sys.__stderr__, "IDLE Subprocess: Connection to "\ ! "IDLE GUI failed, exiting." ! show_socket_error(err, address) global exit_now exit_now = True *************** *** 109,112 **** --- 109,127 ---- server.handle_request() # A single request only + def show_socket_error(err, address): + import Tkinter + import tkMessageBox + root = Tkinter.Tk() + root.withdraw() + if err[0] == 61: # connection refused + msg = "IDLE's subprocess can't connect to %s:%d. This may be due "\ + "to your personal firewall configuration. It is safe to "\ + "allow this internal connection because no data is visible on "\ + "external ports." % address + tkMessageBox.showerror("IDLE Subprocess Error", msg, parent=root) + else: + tkMessageBox.showerror("IDLE Subprocess Error", "Socket Error: %s" % err[1]) + root.destroy() + def print_exception(): import linecache *************** *** 117,121 **** sys.last_type, sys.last_value, sys.last_traceback = excinfo tbe = traceback.extract_tb(tb) ! print >>efile, '\nTraceback (most recent call last):' exclude = ("run.py", "rpc.py", "threading.py", "Queue.py", "RemoteDebugger.py", "bdb.py") --- 132,136 ---- sys.last_type, sys.last_value, sys.last_traceback = excinfo tbe = traceback.extract_tb(tb) ! print>>efile, '\nTraceback (most recent call last):' exclude = ("run.py", "rpc.py", "threading.py", "Queue.py", "RemoteDebugger.py", "bdb.py") From kbk at users.sourceforge.net Wed Jan 21 14:21:13 2004 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Wed Jan 21 14:21:17 2004 Subject: [Python-checkins] python/dist/src/Lib/idlelib NEWS.txt, 1.29, 1.30 rpc.py, 1.27, 1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv20669 Modified Files: NEWS.txt rpc.py Log Message: rpc.py:SocketIO - Large modules were generating large pickles when downloaded to the execution server. The return of the OK response from the subprocess initialization was interfering and causing the sending socket to be not ready. Add an IO ready test to fix this. Moved the polling IO ready test into pollpacket(). M NEWS.txt M rpc.py Backport candidate. Index: NEWS.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/NEWS.txt,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** NEWS.txt 21 Jan 2004 18:54:30 -0000 1.29 --- NEWS.txt 21 Jan 2004 19:21:11 -0000 1.30 *************** *** 4,7 **** --- 4,15 ---- *Release date: XX-XXX-2004* + - rpc.py:SocketIO - Large modules were generating large pickles when downloaded + to the execution server. The return of the OK response from the subprocess + initialization was interfering and causing the sending socket to be not + ready. Add an IO ready test to fix this. Moved the polling IO ready test + into pollpacket(). + + - Fix typo in rpc.py, s/b "pickle.PicklingError" not "pickle.UnpicklingError". + - Added a Tk error dialog to run.py inform the user if the subprocess can't connect to the user GUI process. Added a timeout to the GUI's listening Index: rpc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/rpc.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** rpc.py 10 Sep 2003 02:42:18 -0000 1.27 --- rpc.py 21 Jan 2004 19:21:11 -0000 1.28 *************** *** 321,325 **** try: s = pickle.dumps(message) ! except pickle.UnpicklingError: print >>sys.__stderr__, "Cannot pickle:", `message` raise --- 321,325 ---- try: s = pickle.dumps(message) ! except pickle.PicklingError: print >>sys.__stderr__, "Cannot pickle:", `message` raise *************** *** 327,331 **** while len(s) > 0: try: ! n = self.sock.send(s) except (AttributeError, socket.error): # socket was closed --- 327,332 ---- while len(s) > 0: try: ! r, w, x = select.select([], [self.sock], []) ! n = self.sock.send(s[:BUFSIZE]) except (AttributeError, socket.error): # socket was closed *************** *** 334,341 **** s = s[n:] - def ioready(self, wait): - r, w, x = select.select([self.sock.fileno()], [], [], wait) - return len(r) - buffer = "" bufneed = 4 --- 335,338 ---- *************** *** 345,349 **** self._stage0() if len(self.buffer) < self.bufneed: ! if not self.ioready(wait): return None try: --- 342,347 ---- self._stage0() if len(self.buffer) < self.bufneed: ! r, w, x = select.select([self.sock.fileno()], [], [], wait) ! if len(r) == 0: return None try: *************** *** 378,382 **** try: message = pickle.loads(packet) ! except: print >>sys.__stderr__, "-----------------------" print >>sys.__stderr__, "cannot unpickle packet:", `packet` --- 376,380 ---- try: message = pickle.loads(packet) ! except pickle.UnpicklingError: print >>sys.__stderr__, "-----------------------" print >>sys.__stderr__, "cannot unpickle packet:", `packet` From kbk at users.sourceforge.net Wed Jan 21 17:10:03 2004 From: kbk at users.sourceforge.net (kbk@users.sourceforge.net) Date: Wed Jan 21 17:10:06 2004 Subject: [Python-checkins] python/dist/src/Lib/idlelib PyShell.py,1.84,1.85 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/idlelib In directory sc8-pr-cvs1:/tmp/cvs-serv29955 Modified Files: PyShell.py Log Message: There was an error in the Tk error dialog fix at Rev 1.84 which caused starting w/o the subprocess to fail. Check in a fix to IDLE and IDLEfork. M PyShell.py Backport candidate, combine with previous. Index: PyShell.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/idlelib/PyShell.py,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** PyShell.py 21 Jan 2004 18:54:30 -0000 1.84 --- PyShell.py 21 Jan 2004 22:10:01 -0000 1.85 *************** *** 927,931 **** if not client: self.close() ! return None else: nosub = "==== No Subprocess ====" --- 927,931 ---- if not client: self.close() ! return False else: nosub = "==== No Subprocess ====" *************** *** 936,940 **** import Tkinter Tkinter._default_root = None # 03Jan04 KBK What's this? ! return client def readline(self): --- 936,940 ---- import Tkinter Tkinter._default_root = None # 03Jan04 KBK What's this? ! return True def readline(self): From fdrake at users.sourceforge.net Fri Jan 23 10:24:25 2004 From: fdrake at users.sourceforge.net (fdrake@users.sourceforge.net) Date: Fri Jan 23 10:24:43 2004 Subject: [Python-checkins] python/dist/src/Doc/dist dist.tex,1.61,1.62 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/dist In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24460/dist Modified Files: dist.tex Log Message: no reason not to use boilerplate.tex now that it names the PSF Index: dist.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/dist/dist.tex,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** dist.tex 2 Jan 2004 06:57:49 -0000 1.61 --- dist.tex 23 Jan 2004 15:23:49 -0000 1.62 *************** *** 11,14 **** --- 11,16 ---- \title{Distributing Python Modules} + \input{boilerplate} + \author{Greg Ward} \authoraddress{ From nnorwitz at users.sourceforge.net Fri Jan 23 11:04:49 2004 From: nnorwitz at users.sourceforge.net (nnorwitz@users.sourceforge.net) Date: Fri Jan 23 11:05:24 2004 Subject: [Python-checkins] python/dist/src/Python ast.c,1.1.2.42,1.1.2.43 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28991/Python Modified Files: Tag: ast-branch ast.c Log Message: Fix mem leak on error, refactor/simplify code for exec stmt Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.42 retrieving revision 1.1.2.43 diff -C2 -d -r1.1.2.42 -r1.1.2.43 *** ast.c 23 Jan 2004 04:22:45 -0000 1.1.2.42 --- ast.c 23 Jan 2004 16:03:25 -0000 1.1.2.43 *************** *** 1624,1627 **** --- 1624,1628 ---- if (!import_alias) { asdl_seq_free(aliases); + free(mod); return NULL; } *************** *** 1664,1706 **** ast_for_exec_stmt(const node *n) { /* exec_stmt: 'exec' expr ['in' test [',' test]] */ REQ(n, exec_stmt); ! if (NCH(n) == 2) { ! expr_ty expression = ast_for_expr(CHILD(n, 1)); ! if (!expression) return NULL; - return Exec(expression, NULL, NULL, LINENO(n)); } ! else if (NCH(n) == 4) { ! expr_ty expr1, expr2; ! ! expr1 = ast_for_expr(CHILD(n, 1)); ! if (!expr1) ! return NULL; ! expr2 = ast_for_expr(CHILD(n, 3)); ! if (!expr2) return NULL; - - return Exec(expr1, expr2, NULL, LINENO(n)); } - else if (NCH(n) == 6) { - expr_ty expr1, expr2, expr3; - - expr1 = ast_for_expr(CHILD(n, 1)); - if (!expr1) - return NULL; - expr2 = ast_for_expr(CHILD(n, 3)); - if (!expr2) - return NULL; - expr3 = ast_for_expr(CHILD(n, 5)); - if (!expr3) - return NULL; ! return Exec(expr1, expr2, expr3, LINENO(n)); ! } ! PyErr_Format(PyExc_Exception, ! "poorly formed 'exec' statement: %d parts to statement", ! NCH(n)); ! return NULL; } --- 1665,1694 ---- ast_for_exec_stmt(const node *n) { + expr_ty expr1, globals = NULL, locals = NULL; + int n_children = NCH(n); + if (n_children != 2 && n_children != 4 && n_children != 6) { + PyErr_Format(PyExc_Exception, + "poorly formed 'exec' statement: %d parts to statement", + n_children); + return NULL; + } + /* exec_stmt: 'exec' expr ['in' test [',' test]] */ REQ(n, exec_stmt); ! expr1 = ast_for_expr(CHILD(n, 1)); ! if (!expr1) ! return NULL; ! if (n_children >= 4) { ! globals = ast_for_expr(CHILD(n, 3)); ! if (!globals) return NULL; } ! if (n_children == 6) { ! locals = ast_for_expr(CHILD(n, 5)); ! if (!locals) return NULL; } ! return Exec(expr1, globals, locals, LINENO(n)); } From nnorwitz at projects.sourceforge.net Sat Jan 24 13:34:55 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Sat Jan 24 13:35:38 2004 Subject: [Python-checkins] python/dist/src/Python symtable.c, 2.10.8.17, 2.10.8.18 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13830/Python Modified Files: Tag: ast-branch symtable.c Log Message: Make several internal functions static, start supporting nested function params Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.10.8.17 retrieving revision 2.10.8.18 diff -C2 -d -r2.10.8.17 -r2.10.8.18 *** symtable.c 26 Dec 2003 21:08:43 -0000 2.10.8.17 --- symtable.c 24 Jan 2004 18:33:38 -0000 2.10.8.18 *************** *** 336,340 **** */ ! int analyze_name(PyObject *dict, PyObject *name, int flags, PyObject *bound, PyObject *local, PyObject *free, int nested) --- 336,340 ---- */ ! static int analyze_name(PyObject *dict, PyObject *name, int flags, PyObject *bound, PyObject *local, PyObject *free, int nested) *************** *** 408,412 **** /* Enter the final scope information into the st_symbols dict. */ ! int update_symbols(PyObject *symbols, PyObject *scope) { --- 408,412 ---- /* Enter the final scope information into the st_symbols dict. */ ! static int update_symbols(PyObject *symbols, PyObject *scope) { *************** *** 431,435 **** } ! int analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free) { --- 431,435 ---- } ! static int analyze_block(PySTEntryObject *ste, PyObject *bound, PyObject *free) { *************** *** 487,491 **** } ! int symtable_analyze(struct symtable *st) { --- 487,491 ---- } ! static int symtable_analyze(struct symtable *st) { *************** *** 529,534 **** PySTEntryObject *prev = NULL; ! fprintf(stderr, "enter block %s %d\n", ! PyString_AS_STRING(name), lineno); if (st->st_cur) { --- 529,533 ---- PySTEntryObject *prev = NULL; ! // fprintf(stderr, "enter block %s %d\n", PyString_AS_STRING(name), lineno); if (st->st_cur) { *************** *** 859,868 **** expr_ty arg = asdl_seq_GET(args, i); if (arg->kind == Name_kind) { ! assert(arg->v.Name.ctx == Param); if (!symtable_add_def(st, arg->v.Name.id, DEF_PARAM)) return 0; } else if (arg->kind == Tuple_kind) { ! assert(arg->v.Tuple.ctx == Load); if (toplevel) { if (!symtable_implicit_arg(st, i)) --- 858,868 ---- expr_ty arg = asdl_seq_GET(args, i); if (arg->kind == Name_kind) { ! assert(arg->v.Name.ctx == Param || ! arg->v.Name.ctx == Store); if (!symtable_add_def(st, arg->v.Name.id, DEF_PARAM)) return 0; } else if (arg->kind == Tuple_kind) { ! assert(arg->v.Tuple.ctx == Store); if (toplevel) { if (!symtable_implicit_arg(st, i)) From nnorwitz at projects.sourceforge.net Sat Jan 24 14:46:29 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Sat Jan 24 14:47:01 2004 Subject: [Python-checkins] python/dist/src/Python symtable.c, 2.10.8.18, 2.10.8.19 ast.c, 1.1.2.43, 1.1.2.44 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23106/Python Modified Files: Tag: ast-branch symtable.c ast.c Log Message: handle nested tuple arguments Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.10.8.18 retrieving revision 2.10.8.19 diff -C2 -d -r2.10.8.18 -r2.10.8.19 *** symtable.c 24 Jan 2004 18:33:38 -0000 2.10.8.18 --- symtable.c 24 Jan 2004 19:43:46 -0000 2.10.8.19 *************** *** 853,863 **** symtable_visit_params(struct symtable *st, asdl_seq *args, int toplevel) { ! int i; for (i = 0; i < asdl_seq_LEN(args); i++) { expr_ty arg = asdl_seq_GET(args, i); if (arg->kind == Name_kind) { assert(arg->v.Name.ctx == Param || ! arg->v.Name.ctx == Store); if (!symtable_add_def(st, arg->v.Name.id, DEF_PARAM)) return 0; --- 853,864 ---- symtable_visit_params(struct symtable *st, asdl_seq *args, int toplevel) { ! int i, complex = 0; + /* go through all the toplevel arguments first */ for (i = 0; i < asdl_seq_LEN(args); i++) { expr_ty arg = asdl_seq_GET(args, i); if (arg->kind == Name_kind) { assert(arg->v.Name.ctx == Param || ! (arg->v.Name.ctx == Store && !toplevel)); if (!symtable_add_def(st, arg->v.Name.id, DEF_PARAM)) return 0; *************** *** 865,874 **** else if (arg->kind == Tuple_kind) { assert(arg->v.Tuple.ctx == Store); if (toplevel) { if (!symtable_implicit_arg(st, i)) return 0; } - if (!symtable_visit_params(st, arg->v.Tuple.elts, 0)) - return 0; } else { --- 866,874 ---- else if (arg->kind == Tuple_kind) { assert(arg->v.Tuple.ctx == Store); + complex = 1; if (toplevel) { if (!symtable_implicit_arg(st, i)) return 0; } } else { *************** *** 878,881 **** --- 878,891 ---- } } + + /* visit all the nested arguments */ + if (complex) { + for (i = 0; i < asdl_seq_LEN(args); i++) { + expr_ty arg = asdl_seq_GET(args, i); + if (arg->kind == Tuple_kind && + !symtable_visit_params(st, arg->v.Tuple.elts, 0)) + return 0; + } + } return 1; Index: ast.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/ast.c,v retrieving revision 1.1.2.43 retrieving revision 1.1.2.44 diff -C2 -d -r1.1.2.43 -r1.1.2.44 *** ast.c 23 Jan 2004 16:03:25 -0000 1.1.2.43 --- ast.c 24 Jan 2004 19:44:12 -0000 1.1.2.44 *************** *** 181,185 **** } case encoding_decl: ! /* XXX need to handle properlyi, ignore for now */ stmts = asdl_seq_new(1); if (!stmts) --- 181,185 ---- } case encoding_decl: ! /* XXX need to handle properly, ignore for now */ stmts = asdl_seq_new(1); if (!stmts) *************** *** 428,437 **** } /* Create AST for argument list. XXX TO DO: - check for invalid argument lists like normal after default - - handle nested tuple arguments - - handle default arguments properly (might be problem somewhere else) */ --- 428,456 ---- } + static expr_ty + compiler_complex_args(const node *n) + { + int i, len = (NCH(n) + 1) / 2; + asdl_seq *args = asdl_seq_new(len); + if (!args) + return NULL; + + for (i = 0; i < len; i++) { + const node *child = CHILD(CHILD(n, 2*i), 0); + expr_ty arg; + if (TYPE(child) == NAME) + arg = Name(NEW_IDENTIFIER(child), Store); + else + arg = compiler_complex_args(child); + asdl_seq_SET(args, i, arg); + } + + return Tuple(args, Store); + } + /* Create AST for argument list. XXX TO DO: - check for invalid argument lists like normal after default */ *************** *** 479,485 **** case fpdef: if (NCH(ch) == 3) ! /* XXX don't handle fplist yet */ ! goto error; ! if (TYPE(CHILD(ch, 0)) == NAME) /* XXX check return value of Name call */ asdl_seq_APPEND(args, Name(NEW_IDENTIFIER(CHILD(ch, 0)), --- 498,504 ---- case fpdef: if (NCH(ch) == 3) ! asdl_seq_APPEND(args, ! compiler_complex_args(CHILD(ch, 1))); ! else if (TYPE(CHILD(ch, 0)) == NAME) /* XXX check return value of Name call */ asdl_seq_APPEND(args, Name(NEW_IDENTIFIER(CHILD(ch, 0)), From nnorwitz at projects.sourceforge.net Sat Jan 24 14:53:19 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Sat Jan 24 14:53:50 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.62, 1.1.2.63 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24104/Python Modified Files: Tag: ast-branch newcompile.c Log Message: update known bugs, group by symptoms handle nested tuple arguments to functions store __module__ when compiling class fix crash on nested listcomps increase stackdepth so test_errno passes Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.62 retrieving revision 1.1.2.63 diff -C2 -d -r1.1.2.62 -r1.1.2.63 *** newcompile.c 23 Jan 2004 04:13:25 -0000 1.1.2.62 --- newcompile.c 24 Jan 2004 19:51:32 -0000 1.1.2.63 *************** *** 16,53 **** KNOWN BUGS: ! 1: ! using coding statement, such as in getopt: # -*- coding: iso-8859-1 -*- ! needs to be implemented (see also Python/ast.c encoding_decl) ! ! 2: ! Get this err msg: XXX rd_object called with exception set ! From Python/marshal.c::PyMarshal_ReadLastObjectFromFile() ! This looks like it may be related to #1. ! ! 3: ! LOAD_NAME is output instead of LOAD_GLOBAL ! ! 4: ! line numbers are off a bit (may just need to add calls to set lineno) ! ! 5: ! Modules/parsermodule.c:496: warning: implicit declaration ! of function `PyParser_SimpleParseString' ! ! 6: ! compile.h::b_return is only set, never used ! ! 7: ! compound arguments cause seg fault (def f5((compound, first), two):) ! ! 8: ! exec ... in ... seg faults (exec w/o in works) ! 9: ! vars() doesn't return local variables ! 10: ! problem with cell objects (see test_builtins::test_map) */ --- 16,47 ---- KNOWN BUGS: ! Seg Faults: ! #: using coding statement, such as in getopt: # -*- coding: iso-8859-1 -*- ! needs to be implemented (see also Python/ast.c encoding_decl) ! #: exec 'from __future__ import division' seg faults ! exec generally still has problems ! #: test_errno fails because stackdepth() isn't implemented (assert'ed) ! Inappropriate Exceptions: ! #: problem with cell objects (see test_builtins::test_map) ! #: x = [1] ; x[0] += 1 ! raises TypeError: object does not support item assignment ! #: Get this err msg: XXX rd_object called with exception set ! From Python/marshal.c::PyMarshal_ReadLastObjectFromFile() ! This looks like it may be related to encoding not being implemented. ! Invalid behaviour: ! #: vars() doesn't return local variables ! #: co_names doesn't contain any names ! #: doc strings at class scope are POPed, not stored ! In interactive mode, they are printed. :-) ! #: ref leaks in interpreter when press return on empty line ! #: yield or return outside a function don't raise a SyntaxError ! #: LOAD_NAME is output instead of LOAD_GLOBAL ! #: line numbers are off a bit (may just need to add calls to set lineno) ! #: Modules/parsermodule.c:496: warning: implicit declaration ! of function `PyParser_SimpleParseString' ! #: compile.h::b_return is only set, never used */ *************** *** 746,750 **** if (!compiler_enter_scope(c, s->v.FunctionDef.name, (void *)s)) return 0; ! c->u->u_argcount = asdl_seq_LEN(s->v.FunctionDef.args->args); n = asdl_seq_LEN(s->v.FunctionDef.body); for (i = 0; i < n; i++) { --- 740,755 ---- if (!compiler_enter_scope(c, s->v.FunctionDef.name, (void *)s)) return 0; ! /* unpack nested arguments */ ! for (i = 0; i < asdl_seq_LEN(args->args); i++) { ! expr_ty arg = asdl_seq_GET(args->args, i); ! if (arg->kind == Tuple_kind) { ! PyObject *id = PyString_FromFormat(".%d", i); ! if (id == NULL || !compiler_nameop(c, id, Load)) ! return 0; ! VISIT(c, expr, arg); ! } ! } ! ! c->u->u_argcount = asdl_seq_LEN(args->args); n = asdl_seq_LEN(s->v.FunctionDef.body); for (i = 0; i < n; i++) { *************** *** 774,777 **** --- 779,783 ---- int n; PyCodeObject *co; + PyObject *str; /* push class name on stack, needed by BUILD_CLASS */ ADDOP_O(c, LOAD_CONST, s->v.ClassDef.name, consts); *************** *** 783,786 **** --- 789,807 ---- if (!compiler_enter_scope(c, s->v.ClassDef.name, (void *)s)) return 0; + str = PyString_InternFromString("__name__"); + if (!str || !compiler_nameop(c, str, Load)) { + Py_XDECREF(str); + return 0; + } + + Py_DECREF(str); + str = PyString_InternFromString("__module__"); + if (!str || !compiler_nameop(c, str, Store)) { + Py_XDECREF(str); + return 0; + } + Py_DECREF(str); + + /* XXX: doc strings go POP_TOP, instead of STORE_NAME (__doc__) */ VISIT_SEQ(c, stmt, s->v.ClassDef.body); ADDOP(c, LOAD_LOCALS); *************** *** 1537,1541 **** break; case Param: ! assert(0); /* impossible */ } ADDOP_O(c, op, name, varnames); --- 1558,1562 ---- break; case Param: ! assert(0); /* impossible */ } ADDOP_O(c, op, name, varnames); *************** *** 1714,1720 **** expr_ty elt) { /* generate code for the iterator, then each of the ifs, and then write to the element */ ! listcomp_ty l; int start, anchor, skip, if_cleanup, i, n; --- 1735,1745 ---- expr_ty elt) { + /* need to capture u_tmp here for nested list comps, + u_tmp is set to NULL in compiler_listcomp */ + PyObject *u_tmp = c->u->u_tmp; + /* generate code for the iterator, then each of the ifs, and then write to the element */ ! listcomp_ty l; int start, anchor, skip, if_cleanup, i, n; *************** *** 1752,1756 **** /* only append after the last for generator */ if (gen_index >= asdl_seq_LEN(generators)) { ! if (!compiler_nameop(c, c->u->u_tmp, Load)) return 0; VISIT(c, expr, elt); --- 1777,1781 ---- /* only append after the last for generator */ if (gen_index >= asdl_seq_LEN(generators)) { ! if (!compiler_nameop(c, u_tmp, Load)) return 0; VISIT(c, expr, elt); *************** *** 1770,1774 **** /* delete the append method added to locals */ if (gen_index == 1) ! if (!compiler_nameop(c, c->u->u_tmp, Del)) return 0; --- 1795,1799 ---- /* delete the append method added to locals */ if (gen_index == 1) ! if (!compiler_nameop(c, u_tmp, Del)) return 0; *************** *** 1790,1795 **** return 0; } ! PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ! ++c->u->u_tmpname); tmp = PyString_FromString(tmpname); if (!tmp) --- 1815,1819 ---- return 0; } ! PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ++c->u->u_tmpname); tmp = PyString_FromString(tmpname); if (!tmp) *************** *** 2166,2170 **** { /* XXX need to do this */ ! return 100; } --- 2190,2194 ---- { /* XXX need to do this */ ! return 1000; } From tim_one at projects.sourceforge.net Sat Jan 24 22:25:48 2004 From: tim_one at projects.sourceforge.net (tim_one@projects.sourceforge.net) Date: Sat Jan 24 22:26:20 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 pythoncore.dsp,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13382 Modified Files: pythoncore.dsp Log Message: Added the cjkcodecs files to the MSVC 6 build. Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/pythoncore.dsp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pythoncore.dsp 5 Jan 2004 10:13:35 -0000 1.4 --- pythoncore.dsp 25 Jan 2004 03:25:40 -0000 1.5 *************** *** 94,97 **** --- 94,101 ---- # Begin Source File + SOURCE=..\..\Modules\cjkcodecs\_big5.c + # End Source File + # Begin Source File + SOURCE=..\..\Modules\_bisectmodule.c # End Source File *************** *** 102,113 **** --- 106,185 ---- # Begin Source File + SOURCE=..\..\Modules\cjkcodecs\_cp932.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_cp949.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_cp950.c + # End Source File + # Begin Source File + SOURCE=..\..\Modules\_csv.c # End Source File # Begin Source File + SOURCE=..\..\Modules\cjkcodecs\_euc_jisx0213.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_euc_jp.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_euc_kr.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_gb18030.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_gb2312.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_gbk.c + # End Source File + # Begin Source File + SOURCE=..\..\Modules\_hotshot.c # End Source File # Begin Source File + SOURCE=..\..\Modules\cjkcodecs\_hz.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_iso2022_jp.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_iso2022_jp_1.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_iso2022_jp_2.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_iso2022_jp_3.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_iso2022_jp_ext.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_iso2022_kr.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_johab.c + # End Source File + # Begin Source File + SOURCE=..\..\Modules\_localemodule.c # End Source File *************** *** 118,121 **** --- 190,201 ---- # Begin Source File + SOURCE=..\..\Modules\cjkcodecs\_shift_jis.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\_shift_jisx0213.c + # End Source File + # Begin Source File + SOURCE=..\..\Modules\_sre.c # End Source File *************** *** 368,371 **** --- 448,467 ---- # Begin Source File + SOURCE=..\..\Modules\cjkcodecs\mapdata_ja_JP.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\mapdata_ko_KR.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\mapdata_zh_CN.c + # End Source File + # Begin Source File + + SOURCE=..\..\Modules\cjkcodecs\mapdata_zh_TW.c + # End Source File + # Begin Source File + SOURCE=..\..\Python\marshal.c # End Source File *************** *** 408,411 **** --- 504,511 ---- # Begin Source File + SOURCE=..\..\Modules\cjkcodecs\multibytecodec.c + # End Source File + # Begin Source File + SOURCE=..\..\Parser\myreadline.c # End Source File From rhettinger at projects.sourceforge.net Mon Jan 26 00:23:13 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Mon Jan 26 00:24:00 2004 Subject: [Python-checkins] python/nondist/sandbox/collections - New directory Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12606/collections Log Message: Directory /cvsroot/python/python/nondist/sandbox/collections added to the repository From rhettinger at projects.sourceforge.net Mon Jan 26 00:25:41 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Mon Jan 26 00:26:25 2004 Subject: [Python-checkins] python/nondist/sandbox/collections dequemodule.c, NONE, 1.1 setup.py, NONE, 1.1 test_deque.py, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12759/collections Added Files: dequemodule.c setup.py test_deque.py Log Message: * Start a sandbox area for collections. * Add a module for high-speed deque implementation. --- NEW FILE: dequemodule.c --- #include "Python.h" /* deque module implementation Written and maintained by Raymond D. Hettinger Copyright (c) 2004 Python Software Foundation. All rights reserved. */ #define BLOCKLEN 30 typedef struct BLOCK { struct BLOCK *leftlink; struct BLOCK *rightlink; PyObject *data[BLOCKLEN]; } block; static block *newblock(block *leftlink, block *rightlink){ block *b = PyMem_Malloc(sizeof(block)); if (b == NULL) { PyErr_NoMemory(); return NULL; } b->leftlink = leftlink; b->rightlink = rightlink; return b; } typedef struct { PyObject_HEAD block *leftblock; block *rightblock; int leftindex; int rightindex; int len; } dequeobject; static PyObject * deque_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { dequeobject *deque; block *b; /* create dequeobject structure */ deque = (dequeobject *)type->tp_alloc(type, 0); if (deque == NULL) return NULL; b = newblock(NULL, NULL); if (b == NULL) { Py_DECREF(deque); return NULL; } deque->leftblock = b; deque->rightblock = b; deque->leftindex = BLOCKLEN / 2 + 1; deque->rightindex = BLOCKLEN / 2; deque->len = 0; return (PyObject *)deque; } static PyObject * deque_append(dequeobject *deque, PyObject *item) { deque->rightindex++; deque->len++; if (deque->rightindex == BLOCKLEN) { block *b = newblock(deque->rightblock, NULL); if (b == NULL) return NULL; deque->rightblock->rightlink = b; deque->rightblock = b; deque->rightindex = 0; } Py_INCREF(item); deque->rightblock->data[deque->rightindex] = item; Py_RETURN_NONE; } PyDoc_STRVAR(append_doc, "Add an element to the right side of the deque."); static PyObject * deque_appendleft(dequeobject *deque, PyObject *item) { deque->leftindex--; deque->len++; if (deque->leftindex == -1) { block *b = newblock(NULL, deque->leftblock); if (b == NULL) return NULL; deque->leftblock->leftlink = b; deque->leftblock = b; deque->leftindex = BLOCKLEN - 1; } Py_INCREF(item); deque->leftblock->data[deque->leftindex] = item; Py_RETURN_NONE; } PyDoc_STRVAR(appendleft_doc, "Add an element to the left side of the deque."); static PyObject * deque_pop(dequeobject *deque, PyObject *unused) { PyObject *item; block *prevblock; if (deque->leftblock == deque->rightblock && deque->leftindex > deque->rightindex) { PyErr_SetString(PyExc_IndexError, "pop from an emtpy deque"); return NULL; } item = deque->rightblock->data[deque->rightindex]; deque->rightindex--; deque->len--; if (deque->rightindex == -1) { prevblock = deque->rightblock->leftlink; PyMem_Free(deque->rightblock); prevblock->rightlink = NULL; deque->rightblock = prevblock; deque->rightindex = BLOCKLEN - 1; } return item; } PyDoc_STRVAR(pop_doc, "Remove and return the rightmost element."); static PyObject * deque_popleft(dequeobject *deque, PyObject *unused) { PyObject *item; block *prevblock; if (deque->leftblock == deque->rightblock && deque->leftindex > deque->rightindex) { PyErr_SetString(PyExc_IndexError, "pop from an emtpy deque"); return NULL; } item = deque->leftblock->data[deque->leftindex]; deque->leftindex++; deque->len--; if (deque->leftindex == BLOCKLEN) { prevblock = deque->leftblock->rightlink; PyMem_Free(deque->leftblock); prevblock->leftlink = NULL; deque->leftblock = prevblock; deque->leftindex = 0; } return item; } PyDoc_STRVAR(popleft_doc, "Remove and return the leftmost element."); static int deque_len(dequeobject *deque) { return deque->len; } static int deque_clear(dequeobject *deque) { PyObject *item; while (deque_len(deque)) { item = deque_pop(deque, NULL); Py_DECREF(item); } return 0; } static PyObject * deque_clearmethod(dequeobject *deque) { if (deque_clear(deque) == -1) return NULL; Py_RETURN_NONE; } PyDoc_STRVAR(clear_doc, "Remove all elements from the deque."); static void deque_dealloc(dequeobject *deque) // XXX ? any uncomfortable assumptions { PyObject_GC_UnTrack(deque); deque_clear(deque); PyMem_Free(deque->leftblock); deque->leftblock = NULL; deque->rightblock = NULL; deque->ob_type->tp_free(deque); } static int set_traverse(dequeobject *deque, visitproc visit, void *arg) { block * b = deque->leftblock; int index = deque->leftindex; int err; PyObject *item; while (b != deque->rightblock || index <= deque->rightindex) { item = b->data[index]; index++; if (index == BLOCKLEN && b->rightlink != NULL) { b = b->rightlink; index = 0; } err = visit(item, arg); if (err) return err; } return 0; } static long deque_nohash(PyObject *self) { PyErr_SetString(PyExc_TypeError, "deque objects are unhashable"); return -1; } static PyObject * deque_copy(PyObject *deque) { return PyObject_CallFunctionObjArgs((PyObject *)(deque->ob_type), deque, NULL); } PyDoc_STRVAR(copy_doc, "Return a shallow copy of a deque."); static PyObject * deque_reduce(dequeobject *deque) { PyObject *seq, *args, *result; seq = PySequence_Tuple((PyObject *)deque); if (seq == NULL) return NULL; args = PyTuple_Pack(1, seq); result = PyTuple_Pack(2, deque->ob_type, args); Py_DECREF(seq); Py_DECREF(args); return result; } PyDoc_STRVAR(reduce_doc, "Return state information for pickling."); static PyObject * deque_repr(PyObject *deque) { PyObject *aslist, *result, *fmt; int i; i = Py_ReprEnter(deque); if (i != 0) { if (i < 0) return NULL; return PyString_FromString("[...]"); } aslist = PySequence_List(deque); if (aslist == NULL) { Py_ReprLeave(deque); return NULL; } fmt = PyString_FromString("deque(%r)"); if (fmt == NULL) { Py_DECREF(aslist); Py_ReprLeave(deque); return NULL; } result = PyString_Format(fmt, aslist); Py_DECREF(fmt); Py_DECREF(aslist); Py_ReprLeave(deque); return result; } static int deque_tp_print(PyObject *deque, FILE *fp, int flags) { PyObject *it, *item; int pos=0; char *emit = ""; /* No separator emitted on first pass */ char *separator = ", "; int i; i = Py_ReprEnter(deque); if (i != 0) { if (i < 0) return i; fputs("[...]", fp); return 0; } it = PyObject_GetIter(deque); if (it == NULL) return -1; fputs("deque([", fp); while ((item = PyIter_Next(it)) != NULL) { fputs(emit, fp); emit = separator; if (PyObject_Print(item, fp, 0) != 0) { Py_DECREF(item); Py_DECREF(it); Py_ReprLeave(deque); return -1; } Py_DECREF(item); } Py_ReprLeave(deque); Py_DECREF(it); if (PyErr_Occurred()) return -1; fputs("])", fp); return 0; } static int deque_init(dequeobject *deque, PyObject *args, PyObject *kwds) { PyObject *iterable = NULL, *it, *item, *rv; if (!PyArg_UnpackTuple(args, "deque", 0, 1, &iterable)) return -1; if (iterable != NULL) { it = PyObject_GetIter(iterable); if (it == NULL) return -1; while ((item = PyIter_Next(it)) != NULL) { assert (item != NULL); rv = deque_append(deque, item); Py_DECREF(item); if (rv == NULL) return -1; Py_DECREF(rv); } Py_DECREF(it); if (PyErr_Occurred()) return -1; } return 0; } static PySequenceMethods deque_as_sequence = { (inquiry)deque_len, /* sq_length */ 0, /* sq_concat */ }; /* deque object ********************************************************/ static PyObject *deque_iter(dequeobject *deque); static PyMethodDef deque_methods[] = { {"append", (PyCFunction)deque_append, METH_O, append_doc}, {"appendleft", (PyCFunction)deque_appendleft, METH_O, appendleft_doc}, {"clear", (PyCFunction)deque_clearmethod, METH_NOARGS, clear_doc}, {"__copy__", (PyCFunction)deque_copy, METH_NOARGS, copy_doc}, {"pop", (PyCFunction)deque_pop, METH_NOARGS, pop_doc}, {"popleft", (PyCFunction)deque_popleft, METH_NOARGS, pop_doc}, {"__reduce__", (PyCFunction)deque_reduce, METH_NOARGS, reduce_doc}, {NULL, NULL} /* sentinel */ }; PyDoc_STRVAR(deque_doc, "deque(iterable) --> deque object\n\ \n\ Build an ordered collection accessible from endpoints only."); PyTypeObject deque_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ "deque.deque", /* tp_name */ sizeof(dequeobject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ (destructor)deque_dealloc, /* tp_dealloc */ (printfunc)deque_tp_print, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ (reprfunc)deque_repr, /* tp_repr */ 0, /* tp_as_number */ &deque_as_sequence, /* tp_as_sequence */ 0, /* tp_as_mapping */ deque_nohash, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */ deque_doc, /* tp_doc */ (traverseproc)set_traverse, /* tp_traverse */ (inquiry)deque_clear, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset*/ (getiterfunc)deque_iter, /* tp_iter */ 0, /* tp_iternext */ deque_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ (initproc)deque_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ deque_new, /* tp_new */ PyObject_GC_Del, /* tp_free */ }; /*********************** Deque Iterator **************************/ typedef struct { PyObject_HEAD int index; block *b; dequeobject *deque; } dequeiterobject; PyTypeObject dequeiter_type; static PyObject * deque_iter(dequeobject *deque) { dequeiterobject *it; it = PyObject_New(dequeiterobject, &dequeiter_type); if (it == NULL) return NULL; it->b = deque->leftblock; it->index = deque->leftindex; Py_INCREF(deque); it->deque = deque; return (PyObject *)it; } static void dequeiter_dealloc(dequeiterobject *dio) { Py_XDECREF(dio->deque); dio->ob_type->tp_free(dio); } static PyObject * dequeiter_next(dequeiterobject *it) { PyObject *item; if (it->b == it->deque->rightblock && it->index > it->deque->rightindex) return NULL; item = it->b->data[it->index]; it->index++; if (it->index == BLOCKLEN && it->b->rightlink != NULL) { it->b = it->b->rightlink; it->index = 0; } Py_INCREF(item); return item; } PyTypeObject dequeiter_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ "dequeerseiterator", /* tp_name */ sizeof(dequeiterobject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ (destructor)dequeiter_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* 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 */ 0, /* tp_call */ 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ 0, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ PyObject_SelfIter, /* tp_iter */ (iternextfunc)dequeiter_next, /* tp_iternext */ 0, }; /* module level code ********************************************************/ PyDoc_STRVAR(module_doc, "deque collection type.\n\ "); PyMODINIT_FUNC initdeque(void) { PyObject *m; m = Py_InitModule3("deque", NULL, module_doc); if (PyType_Ready(&deque_type) < 0) return; Py_INCREF(&deque_type); PyModule_AddObject(m, "deque", (PyObject *)&deque_type); if (PyType_Ready(&dequeiter_type) < 0) return; return; } --- NEW FILE: setup.py --- from distutils.core import setup, Extension setup(name="deque", ext_modules=[Extension("deque", ["dequemodule.c"])]) --- NEW FILE: test_deque.py --- from deque import deque import unittest from test import test_support import copy import cPickle as pickle from cStringIO import StringIO BIG = 100000 class TestBasic(unittest.TestCase): def test_exercise_basics(self): d = deque(xrange(100)) d.__init__(xrange(100, 200)) for i in xrange(200, 400): d.append(i) for i in reversed(xrange(-200, 0)): d.appendleft(i) self.assertEqual(list(d), range(-200, 400)) self.assertEqual(len(d), 600) left = [d.popleft() for i in xrange(250)] self.assertEqual(left, range(-200, 50)) self.assertEqual(list(d), range(50, 400)) right = [d.pop() for i in xrange(250)] right.reverse() self.assertEqual(right, range(150, 400)) self.assertEqual(list(d), range(50, 150)) def test_underflow(self): d = deque() self.assertRaises(IndexError, d.pop) ## XXX should be lookuperror? self.assertRaises(IndexError, d.popleft) def test_clear(self): d = deque(xrange(100)) self.assertEqual(len(d), 100) d.clear() self.assertEqual(len(d), 0) self.assertEqual(list(d), []) def test_repr(self): d = deque(xrange(200)) e = eval(repr(d)) self.assertEqual(list(d), list(e)) d.append(d) self.assert_('...' in repr(d)) def test_print(self): d = deque(xrange(200)) d.append(d) f = StringIO() print >> f, d, self.assertEqual(f.getvalue(), repr(d)) f.close() def test_hash(self): self.assertRaises(TypeError, hash, deque('abc')) def test_long_steadystate_queue_popleft(self): d = deque(xrange(100)) append, pop = d.append, d.popleft for i in xrange(100, BIG): append(i) x = pop() if x != i - 100: self.assertEqual(x, i-100) self.assertEqual(list(d), range(BIG-100, BIG)) def test_long_steadystate_queue_popright(self): d = deque(reversed(xrange(100))) append, pop = d.appendleft, d.pop for i in xrange(100, BIG): append(i) x = pop() if x != i - 100: self.assertEqual(x, i-100) self.assertEqual(list(reversed(list(d))), range(BIG-100, BIG)) def test_big_queue_popleft(self): pass d = deque() append, pop = d.append, d.popleft for i in xrange(BIG): append(i) for i in xrange(BIG): x = pop() if x != i: self.assertEqual(x, i) def test_big_queue_popright(self): d = deque() append, pop = d.appendleft, d.pop for i in xrange(BIG): append(i) for i in xrange(BIG): x = pop() if x != i: self.assertEqual(x, i) def test_big_stack_right(self): d = deque() append, pop = d.append, d.pop for i in xrange(BIG): append(i) for i in reversed(xrange(BIG)): x = pop() if x != i: self.assertEqual(x, i) self.assertEqual(len(d), 0) def test_big_stack_left(self): d = deque() append, pop = d.appendleft, d.popleft for i in xrange(BIG): append(i) for i in reversed(xrange(BIG)): x = pop() if x != i: self.assertEqual(x, i) self.assertEqual(len(d), 0) def test_roundtrip_iter_init(self): d = deque(xrange(200)) e = deque(d) self.assertNotEqual(id(d), id(e)) self.assertEqual(list(d), list(e)) def test_pickle(self): d = deque(xrange(200)) s = pickle.dumps(d) e = pickle.loads(s) self.assertNotEqual(id(d), id(e)) self.assertEqual(list(d), list(e)) def test_deepcopy(self): mut = [10] d = deque([mut]) e = copy.deepcopy(d) self.assertEqual(list(d), list(e)) mut[0] = 11 self.assertNotEqual(id(d), id(e)) self.assertNotEqual(list(d), list(e)) def test_copy(self): mut = [10] d = deque([mut]) e = copy.copy(d) self.assertEqual(list(d), list(e)) mut[0] = 11 self.assertNotEqual(id(d), id(e)) self.assertEqual(list(d), list(e)) #============================================================================== def test_main(verbose=None): import sys from test import test_sets test_classes = ( TestBasic, ) test_support.run_unittest(*test_classes) # verify reference counting if verbose and hasattr(sys, "gettotalrefcount"): import gc counts = [None] * 5 for i in xrange(len(counts)): test_support.run_unittest(*test_classes) gc.collect() counts[i] = sys.gettotalrefcount() print counts if __name__ == "__main__": test_main(verbose=True) From OCRVEPNIW at hotmail.com Mon Jan 26 01:42:54 2004 From: OCRVEPNIW at hotmail.com (Issac Pineda) Date: Mon Jan 26 01:50:03 2004 Subject: [Python-checkins] emplace christianson Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/python-checkins/attachments/20040126/5bebd219/attachment.html From nnorwitz at projects.sourceforge.net Mon Jan 26 09:35:48 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Mon Jan 26 09:36:35 2004 Subject: [Python-checkins] python/dist/src/Lib os.py,1.58.2.1,1.58.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7495/Lib Modified Files: Tag: ast-branch os.py Log Message: Remove debug print Index: os.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/os.py,v retrieving revision 1.58.2.1 retrieving revision 1.58.2.2 diff -C2 -d -r1.58.2.1 -r1.58.2.2 *** os.py 28 Apr 2003 17:32:16 -0000 1.58.2.1 --- os.py 26 Jan 2004 14:35:45 -0000 1.58.2.2 *************** *** 37,41 **** if 'posix' in _names: - print "hello" name = 'posix' linesep = '\n' --- 37,40 ---- From nnorwitz at projects.sourceforge.net Mon Jan 26 09:39:02 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Mon Jan 26 09:39:50 2004 Subject: [Python-checkins] python/dist/src/Python future.c, 2.12.2.4, 2.12.2.5 newcompile.c, 1.1.2.63, 1.1.2.64 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8105/Python Modified Files: Tag: ast-branch future.c newcompile.c Log Message: Stop exec "from __future__ import ..." from crashing, update known bugs Index: future.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/future.c,v retrieving revision 2.12.2.4 retrieving revision 2.12.2.5 diff -C2 -d -r2.12.2.4 -r2.12.2.5 *** future.c 30 Aug 2002 20:15:55 -0000 2.12.2.4 --- future.c 26 Jan 2004 14:38:58 -0000 2.12.2.5 *************** *** 22,26 **** names = s->v.ImportFrom.names; for (i = 0; i < asdl_seq_LEN(names); i++) { ! feature = PyString_AsString(asdl_seq_GET(names, i)); if (!feature) return 0; --- 22,27 ---- names = s->v.ImportFrom.names; for (i = 0; i < asdl_seq_LEN(names); i++) { ! alias_ty name = asdl_seq_GET(names, i); ! feature = PyString_AsString(name->name); if (!feature) return 0; Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.63 retrieving revision 1.1.2.64 diff -C2 -d -r1.1.2.63 -r1.1.2.64 *** newcompile.c 24 Jan 2004 19:51:32 -0000 1.1.2.63 --- newcompile.c 26 Jan 2004 14:38:58 -0000 1.1.2.64 *************** *** 20,29 **** # -*- coding: iso-8859-1 -*- needs to be implemented (see also Python/ast.c encoding_decl) ! #: exec 'from __future__ import division' seg faults ! exec generally still has problems #: test_errno fails because stackdepth() isn't implemented (assert'ed) Inappropriate Exceptions: #: problem with cell objects (see test_builtins::test_map) #: x = [1] ; x[0] += 1 raises TypeError: object does not support item assignment --- 20,29 ---- # -*- coding: iso-8859-1 -*- needs to be implemented (see also Python/ast.c encoding_decl) ! #: exec generally still has problems #: test_errno fails because stackdepth() isn't implemented (assert'ed) Inappropriate Exceptions: #: problem with cell objects (see test_builtins::test_map) + (closures need to be fully implemented) #: x = [1] ; x[0] += 1 raises TypeError: object does not support item assignment *************** *** 33,38 **** Invalid behaviour: #: vars() doesn't return local variables ! #: co_names doesn't contain any names #: doc strings at class scope are POPed, not stored In interactive mode, they are printed. :-) --- 33,42 ---- Invalid behaviour: + #: name mangling in classes (__vars) doesn't work + #: doing from __future__ import division doesn't work + doesn't output BINARY_TRUE_DIVISION #: vars() doesn't return local variables ! #: co_names & co_varnames don't contain the correct names ! u_names & u_varnames are not used properly #: doc strings at class scope are POPed, not stored In interactive mode, they are printed. :-) From fdrake at projects.sourceforge.net Mon Jan 26 10:07:33 2004 From: fdrake at projects.sourceforge.net (fdrake@projects.sourceforge.net) Date: Mon Jan 26 10:08:24 2004 Subject: [Python-checkins] python/dist/src/Doc/inst inst.tex,1.52,1.53 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/inst In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16779 Modified Files: inst.tex Log Message: make this distutils doc match the other in using boilerplate.tex Index: inst.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/inst/inst.tex,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** inst.tex 2 Jan 2004 06:57:49 -0000 1.52 --- inst.tex 26 Jan 2004 15:07:31 -0000 1.53 *************** *** 17,20 **** --- 17,22 ---- % and Feeding of a Python Installation" talk in here somewhere. Yow! + \input{boilerplate} + \author{Greg Ward} \authoraddress{ From rhettinger at projects.sourceforge.net Mon Jan 26 11:23:20 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Mon Jan 26 11:24:10 2004 Subject: [Python-checkins] python/nondist/sandbox/collections timedeque.py, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8098 Added Files: timedeque.py Log Message: Measure performance of deques --- NEW FILE: timedeque.py --- from timeit import Timer setup = """ from deque import deque init = range(100) d = deque(init) l = list(init) da = d.append la = l.append dp = d.pop lp = l.pop dpl = d.popleft dal = d.appendleft from itertools import chain def irange(x): for i in xrange(x): yield i big = irange(1000) """ tests = [ 'la(1)', # Buildup through appends 'da(1)', 'la(1); lp()', # Steady state stack 'da(1); dp()', 'dal(1); dpl()', 'la(1); lp(0)', # Steady state queue 'da(1); dpl()', 'dal(l); dp()', ] longtests = [ 'list(xrange(1000))',# Constructor source len known 'deque(xrange(1000))', 'list(irange(100))',# Constructor source len unknown 'deque(irange(100))', 'min(l)', # iter 'min(d)', ] for test in tests: t = min(Timer(test, setup).repeat(5)) print '%.3f\t%s' % (t, test) for test in longtests: t = min(Timer(test, setup).repeat(5, 10000)) print '%.3f\t%s' % (t, test) From rhettinger at projects.sourceforge.net Mon Jan 26 11:28:03 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Mon Jan 26 11:28:50 2004 Subject: [Python-checkins] python/nondist/sandbox/collections dequemodule.c, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9728 Modified Files: dequemodule.c Log Message: Inline the append operation for the constructor (20% speedup). Index: dequemodule.c =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/dequemodule.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dequemodule.c 26 Jan 2004 05:25:38 -0000 1.1 --- dequemodule.c 26 Jan 2004 16:28:01 -0000 1.2 *************** *** 325,329 **** deque_init(dequeobject *deque, PyObject *args, PyObject *kwds) { ! PyObject *iterable = NULL, *it, *item, *rv; if (!PyArg_UnpackTuple(args, "deque", 0, 1, &iterable)) --- 325,329 ---- deque_init(dequeobject *deque, PyObject *args, PyObject *kwds) { ! PyObject *iterable = NULL, *it, *item; if (!PyArg_UnpackTuple(args, "deque", 0, 1, &iterable)) *************** *** 336,345 **** while ((item = PyIter_Next(it)) != NULL) { ! assert (item != NULL); ! rv = deque_append(deque, item); ! Py_DECREF(item); ! if (rv == NULL) ! return -1; ! Py_DECREF(rv); } Py_DECREF(it); --- 336,353 ---- while ((item = PyIter_Next(it)) != NULL) { ! deque->rightindex++; ! deque->len++; ! if (deque->rightindex == BLOCKLEN) { ! block *b = newblock(deque->rightblock, NULL); ! if (b == NULL) { ! Py_DECREF(it); ! Py_DECREF(item); ! return -1; ! } ! deque->rightblock->rightlink = b; ! deque->rightblock = b; ! deque->rightindex = 0; ! } ! deque->rightblock->data[deque->rightindex] = item; } Py_DECREF(it); From fdrake at projects.sourceforge.net Mon Jan 26 11:42:36 2004 From: fdrake at projects.sourceforge.net (fdrake@projects.sourceforge.net) Date: Mon Jan 26 11:43:26 2004 Subject: [Python-checkins] python/dist/src/Lib optparse.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14137 Modified Files: optparse.py Log Message: don't wrap lines too late by default closes SF bug #842213 Index: optparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/optparse.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** optparse.py 8 May 2003 01:38:52 -0000 1.5 --- optparse.py 26 Jan 2004 16:42:30 -0000 1.6 *************** *** 248,252 **** indent_increment=2, max_help_position=24, ! width=80, short_first=1): HelpFormatter.__init__( --- 248,252 ---- indent_increment=2, max_help_position=24, ! width=79, short_first=1): HelpFormatter.__init__( *************** *** 267,271 **** indent_increment=0, max_help_position=24, ! width=80, short_first=0): HelpFormatter.__init__ ( --- 267,271 ---- indent_increment=0, max_help_position=24, ! width=79, short_first=0): HelpFormatter.__init__ ( From barry at python.org Mon Jan 26 11:57:53 2004 From: barry at python.org (Barry Warsaw) Date: Mon Jan 26 11:58:05 2004 Subject: [Python-checkins] python/dist/src/Lib optparse.py,1.5,1.6 In-Reply-To: References: Message-ID: <1075136273.20208.8.camel@anthem> On Mon, 2004-01-26 at 11:42, fdrake@projects.sourceforge.net wrote: > Update of /cvsroot/python/python/dist/src/Lib > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14137 > > Modified Files: > optparse.py > Log Message: > don't wrap lines too late by default > closes SF bug #842213 Were you going to back port this to 2.3? -Barry From fdrake at acm.org Mon Jan 26 12:10:08 2004 From: fdrake at acm.org (Fred L. Drake, Jr.) Date: Mon Jan 26 12:22:01 2004 Subject: [Python-checkins] python/dist/src/Lib optparse.py,1.5,1.6 In-Reply-To: <1075136273.20208.8.camel@anthem> References: <1075136273.20208.8.camel@anthem> Message-ID: <16405.18928.55314.169376@sftp.fdrake.net> Barry Warsaw writes: > Were you going to back port this to 2.3? No, but I've no objection if you do. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From rhettinger at projects.sourceforge.net Mon Jan 26 12:49:37 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Mon Jan 26 12:50:28 2004 Subject: [Python-checkins] python/nondist/sandbox/collections pydeque.py, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3186 Added Files: pydeque.py Log Message: Add pure python version to aid review. --- NEW FILE: pydeque.py --- n = 30 LFTLNK = n RGTLNK = n+1 BLOCKSIZ = n+2 class deque(object): def __init__(self, iterable=()): self.right = self.left = [None] * BLOCKSIZ self.rightndx = n//2 # points to last written element self.leftndx = n//2+1 add = self.append for elem in iterable: add(elem) def append(self, x): self.rightndx += 1 if self.rightndx == n: newblock = [None] * BLOCKSIZ self.right[RGTLNK] = newblock newblock[LFTLNK] = self.right self.right = newblock self.rightndx = 0 self.right[self.rightndx] = x def appendleft(self, x): self.leftndx -= 1 if self.leftndx == -1: newblock = [None] * BLOCKSIZ self.left[LFTLNK] = newblock newblock[RGTLNK] = self.left self.left = newblock self.leftndx = n-1 self.left[self.leftndx] = x def pop(self): if self.left is self.right and self.leftndx > self.rightndx: raise IndexError x = self.right[self.rightndx] self.right[self.rightndx] = None self.rightndx -= 1 if self.rightndx == -1: prevblock = self.right[LFTLNK] prevblock[RGTLNK] = None self.right[LFTLNK] = None self.right = prevblock self.rightndx = n-1 return x def popleft(self): if self.left is self.right and self.leftndx > self.rightndx: raise IndexError x = self.left[self.leftndx] self.left[self.leftndx] = None self.leftndx += 1 if self.leftndx == n: prevblock = self.left[RGTLNK] prevblock[LFTLNK] = None self.left[RGTLNK] = None self.left = prevblock self.leftndx = 0 return x def __repr__(self): return 'deque(%r)' % (list(self),) def __iter__(self): block = self.left while block: l, r = 0, n if block is self.left: l = self.leftndx if block is self.right: r = self.rightndx + 1 for elem in block[l:r]: yield elem block = block[RGTLNK] def __len__(self): sum = 0 block = self.left while block: sum += n block = block[RGTLNK] return sum + self.rightndx - self.leftndx + 1 - n def __reduce__(self): return (type(self), tuple(self)) def __hash__(self): raise TypeError def __copy__(self): return self.__class__(self) if __name__ == '__main__': a = deque() for i in xrange(10): a.append(i) for i in [-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11]: a.appendleft(i) print a, len(a) print list(a) b = deque(a) for i in xrange(18): print a.popleft() print a, len(a) print b, len(b) From rhettinger at projects.sourceforge.net Mon Jan 26 12:54:34 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Mon Jan 26 12:55:21 2004 Subject: [Python-checkins] python/nondist/sandbox/collections timedeque.py, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4997 Modified Files: timedeque.py Log Message: One more timing Index: timedeque.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/timedeque.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** timedeque.py 26 Jan 2004 16:23:16 -0000 1.1 --- timedeque.py 26 Jan 2004 17:54:31 -0000 1.2 *************** *** 22,25 **** --- 22,26 ---- 'la(1)', # Buildup through appends 'da(1)', + 'dal(1)', 'la(1); lp()', # Steady state stack 'da(1); dp()', From rhettinger at projects.sourceforge.net Mon Jan 26 13:08:13 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Mon Jan 26 13:09:01 2004 Subject: [Python-checkins] python/nondist/sandbox/collections dequemodule.c, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9172 Modified Files: dequemodule.c Log Message: Fix nits Index: dequemodule.c =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/dequemodule.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dequemodule.c 26 Jan 2004 16:28:01 -0000 1.2 --- dequemodule.c 26 Jan 2004 18:08:10 -0000 1.3 *************** *** 379,383 **** METH_NOARGS, pop_doc}, {"popleft", (PyCFunction)deque_popleft, ! METH_NOARGS, pop_doc}, {"__reduce__", (PyCFunction)deque_reduce, METH_NOARGS, reduce_doc}, --- 379,383 ---- METH_NOARGS, pop_doc}, {"popleft", (PyCFunction)deque_popleft, ! METH_NOARGS, popleft_doc}, {"__reduce__", (PyCFunction)deque_reduce, METH_NOARGS, reduce_doc}, *************** *** 487,491 **** PyObject_HEAD_INIT(NULL) 0, /* ob_size */ ! "dequeerseiterator", /* tp_name */ sizeof(dequeiterobject), /* tp_basicsize */ 0, /* tp_itemsize */ --- 487,491 ---- PyObject_HEAD_INIT(NULL) 0, /* ob_size */ ! "deque_iterator", /* tp_name */ sizeof(dequeiterobject), /* tp_basicsize */ 0, /* tp_itemsize */ From bwarsaw at projects.sourceforge.net Mon Jan 26 13:40:52 2004 From: bwarsaw at projects.sourceforge.net (bwarsaw@projects.sourceforge.net) Date: Mon Jan 26 13:41:40 2004 Subject: [Python-checkins] python/dist/src/Lib optparse.py,1.5,1.5.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17755 Modified Files: Tag: release23-maint optparse.py Log Message: Backporting revision 1.6: don't wrap lines too late by default closes SF bug #842213 But I think Fred meant "too long" :) Index: optparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/optparse.py,v retrieving revision 1.5 retrieving revision 1.5.8.1 diff -C2 -d -r1.5 -r1.5.8.1 *** optparse.py 8 May 2003 01:38:52 -0000 1.5 --- optparse.py 26 Jan 2004 18:40:49 -0000 1.5.8.1 *************** *** 248,252 **** indent_increment=2, max_help_position=24, ! width=80, short_first=1): HelpFormatter.__init__( --- 248,252 ---- indent_increment=2, max_help_position=24, ! width=79, short_first=1): HelpFormatter.__init__( *************** *** 267,271 **** indent_increment=0, max_help_position=24, ! width=80, short_first=0): HelpFormatter.__init__ ( --- 267,271 ---- indent_increment=0, max_help_position=24, ! width=79, short_first=0): HelpFormatter.__init__ ( From barry at python.org Mon Jan 26 13:42:30 2004 From: barry at python.org (Barry Warsaw) Date: Mon Jan 26 13:42:37 2004 Subject: [Python-checkins] python/dist/src/Lib optparse.py,1.5,1.6 In-Reply-To: <16405.18928.55314.169376@sftp.fdrake.net> References: <1075136273.20208.8.camel@anthem> <16405.18928.55314.169376@sftp.fdrake.net> Message-ID: <1075142549.20208.18.camel@anthem> On Mon, 2004-01-26 at 12:10, Fred L. Drake, Jr. wrote: > Barry Warsaw writes: > > Were you going to back port this to 2.3? > > No, but I've no objection if you do. Cool, done. I just didn't want to step on your toes. -Barry From montanaro at projects.sourceforge.net Mon Jan 26 14:30:23 2004 From: montanaro at projects.sourceforge.net (montanaro@projects.sourceforge.net) Date: Mon Jan 26 14:31:13 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libgetopt.tex, 1.21, 1.22 liboptparse.tex, 1.10, 1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv530 Modified Files: libgetopt.tex liboptparse.tex Log Message: add references between getopt and optparse docs Index: libgetopt.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgetopt.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libgetopt.tex 29 Apr 2003 04:35:36 -0000 1.21 --- libgetopt.tex 26 Jan 2004 19:30:21 -0000 1.22 *************** *** 144,145 **** --- 144,149 ---- main() \end{verbatim} + + \begin{seealso} + \seemodule{optparse}{More object-oriented command line option parsing} + \end{seealso} Index: liboptparse.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liboptparse.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** liboptparse.tex 16 Jul 2003 17:58:38 -0000 1.10 --- liboptparse.tex 26 Jan 2004 19:30:21 -0000 1.11 *************** *** 1710,1711 **** --- 1710,1715 ---- \verbatiminput{required_2.py} + + \begin{seealso} + \seemodule{getopt}{More traditional Unix-style command line option parsing} + \end{seealso} From fdrake at projects.sourceforge.net Mon Jan 26 14:39:18 2004 From: fdrake at projects.sourceforge.net (fdrake@projects.sourceforge.net) Date: Mon Jan 26 14:40:06 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liboptparse.tex, 1.11, 1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2707 Modified Files: liboptparse.tex Log Message: fix markup Index: liboptparse.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liboptparse.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** liboptparse.tex 26 Jan 2004 19:30:21 -0000 1.11 --- liboptparse.tex 26 Jan 2004 19:39:13 -0000 1.12 *************** *** 1712,1715 **** \begin{seealso} ! \seemodule{getopt}{More traditional Unix-style command line option parsing} \end{seealso} --- 1712,1715 ---- \begin{seealso} ! \seemodule{getopt}{More traditional \UNIX-style command line option parsing.} \end{seealso} From fdrake at projects.sourceforge.net Mon Jan 26 14:40:28 2004 From: fdrake at projects.sourceforge.net (fdrake@projects.sourceforge.net) Date: Mon Jan 26 14:41:19 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libgetopt.tex,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2999 Modified Files: libgetopt.tex Log Message: add missing period Index: libgetopt.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgetopt.tex,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** libgetopt.tex 26 Jan 2004 19:30:21 -0000 1.22 --- libgetopt.tex 26 Jan 2004 19:40:18 -0000 1.23 *************** *** 146,149 **** \begin{seealso} ! \seemodule{optparse}{More object-oriented command line option parsing} \end{seealso} --- 146,149 ---- \begin{seealso} ! \seemodule{optparse}{More object-oriented command line option parsing.} \end{seealso} From montanaro at projects.sourceforge.net Mon Jan 26 14:44:51 2004 From: montanaro at projects.sourceforge.net (montanaro@projects.sourceforge.net) Date: Mon Jan 26 14:45:40 2004 Subject: [Python-checkins] python/dist/src/Tools/scripts hotshotmain.py, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3865 Added Files: hotshotmain.py Log Message: The bagpipe didn't say "no" (*), so here's a main program script useful for running an application under hotshot's control. Only slightly embellished from what Walter Dörwald posted to python-dev. (*) http://www.icdc.com/~roadkill/silverstein/turtle.html --- NEW FILE: hotshotmain.py --- #!/usr/bin/env python # -*- coding: iso-8859-1 -*- """ Run a Python script under hotshot's control. Adapted from a posting on python-dev by Walter Dörwald usage %prog [ %prog args ] filename [ filename args ] Any arguments after the filename are used as sys.argv for the filename. """ import sys import optparse import os import hotshot import hotshot.stats PROFILE = "hotshot.prof" def run_hotshot(filename, profile, args): prof = hotshot.Profile(profile) sys.path.insert(0, os.path.dirname(filename)) sys.argv = [filename] + args prof.run("execfile(%r)" % filename) prof.close() stats = hotshot.stats.load(profile) stats.sort_stats("time", "calls") # print_stats uses unadorned print statements, so the only way # to force output to stderr is to reassign sys.stdout temporarily save_stdout = sys.stdout sys.stdout = sys.stderr stats.print_stats() sys.stdout = save_stdout return 0 def main(args): parser = optparse.OptionParser(__doc__) parser.add_option("-p", "--profile", action="store", default=PROFILE, dest="profile", help='Specify profile file to use') (options, args) = parser.parse_args(args) if len(args) == 0: parser.print_help("missing script to execute") return 1 filename = args[0] return run_hotshot(filename, options.profile, args[1:]) if __name__ == "__main__": sys.exit(main(sys.argv[1:])) From rhettinger at projects.sourceforge.net Mon Jan 26 20:49:28 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Mon Jan 26 20:50:19 2004 Subject: [Python-checkins] python/nondist/sandbox/collections dequemodule.c, 1.3, 1.4 setup.py, 1.1, 1.2 test_deque.py, 1.1, 1.2 timedeque.py, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25190 Modified Files: dequemodule.c setup.py test_deque.py timedeque.py Log Message: * Rename the module to "collections". * When moving to the trunk, will also rename the sourcefile to collectionsmodule.c Index: dequemodule.c =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/dequemodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dequemodule.c 26 Jan 2004 18:08:10 -0000 1.3 --- dequemodule.c 27 Jan 2004 01:49:25 -0000 1.4 *************** *** 393,397 **** PyObject_HEAD_INIT(NULL) 0, /* ob_size */ ! "deque.deque", /* tp_name */ sizeof(dequeobject), /* tp_basicsize */ 0, /* tp_itemsize */ --- 393,397 ---- PyObject_HEAD_INIT(NULL) 0, /* ob_size */ ! "collections.deque", /* tp_name */ sizeof(dequeobject), /* tp_basicsize */ 0, /* tp_itemsize */ *************** *** 520,532 **** PyDoc_STRVAR(module_doc, ! "deque collection type.\n\ "); PyMODINIT_FUNC ! initdeque(void) { PyObject *m; ! m = Py_InitModule3("deque", NULL, module_doc); if (PyType_Ready(&deque_type) < 0) --- 520,532 ---- PyDoc_STRVAR(module_doc, ! "High performance data structures\n\ "); PyMODINIT_FUNC ! initcollections(void) { PyObject *m; ! m = Py_InitModule3("collections", NULL, module_doc); if (PyType_Ready(&deque_type) < 0) *************** *** 538,541 **** --- 538,551 ---- return; + /* Note, other types or functions may be added to collections + by importing them from a separate sourcefile module. + For example, to include itertools.izip() in this module: + + othermod = PyImport_ImportModule("itertools"); + otherdict = PyModule_GetDict(othermod); + othertype = PyDict_GetItemString(otherdict, "izip"); + PyModule_AddObject(m, "izip", othertype); + */ + return; } Index: setup.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/setup.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** setup.py 26 Jan 2004 05:25:39 -0000 1.1 --- setup.py 27 Jan 2004 01:49:25 -0000 1.2 *************** *** 1,4 **** from distutils.core import setup, Extension ! setup(name="deque", ! ext_modules=[Extension("deque", ["dequemodule.c"])]) --- 1,4 ---- from distutils.core import setup, Extension ! setup(name="collections", ! ext_modules=[Extension("collections", ["dequemodule.c"])]) Index: test_deque.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/test_deque.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_deque.py 26 Jan 2004 05:25:39 -0000 1.1 --- test_deque.py 27 Jan 2004 01:49:25 -0000 1.2 *************** *** 1,3 **** ! from deque import deque import unittest from test import test_support --- 1,3 ---- ! from collections import deque import unittest from test import test_support Index: timedeque.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/timedeque.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** timedeque.py 26 Jan 2004 17:54:31 -0000 1.2 --- timedeque.py 27 Jan 2004 01:49:25 -0000 1.3 *************** *** 2,6 **** setup = """ ! from deque import deque init = range(100) d = deque(init) --- 2,6 ---- setup = """ ! from collections import deque init = range(100) d = deque(init) From rhettinger at projects.sourceforge.net Tue Jan 27 09:41:32 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Tue Jan 27 09:42:32 2004 Subject: [Python-checkins] python/nondist/sandbox/collections dequemodule.c, 1.4, 1.5 test_deque.py, 1.2, 1.3 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24657 Modified Files: dequemodule.c test_deque.py Log Message: * Change IndexError to LookupError * Add more tests Index: dequemodule.c =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/dequemodule.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** dequemodule.c 27 Jan 2004 01:49:25 -0000 1.4 --- dequemodule.c 27 Jan 2004 14:41:30 -0000 1.5 *************** *** 15,19 **** } block; ! static block *newblock(block *leftlink, block *rightlink){ block *b = PyMem_Malloc(sizeof(block)); if (b == NULL) { --- 15,19 ---- } block; ! static block *newblock(block *leftlink, block *rightlink) { block *b = PyMem_Malloc(sizeof(block)); if (b == NULL) { *************** *** 109,113 **** if (deque->leftblock == deque->rightblock && deque->leftindex > deque->rightindex) { ! PyErr_SetString(PyExc_IndexError, "pop from an emtpy deque"); return NULL; } --- 109,113 ---- if (deque->leftblock == deque->rightblock && deque->leftindex > deque->rightindex) { ! PyErr_SetString(PyExc_LookupError, "pop from an emtpy deque"); return NULL; } *************** *** 136,140 **** if (deque->leftblock == deque->rightblock && deque->leftindex > deque->rightindex) { ! PyErr_SetString(PyExc_IndexError, "pop from an emtpy deque"); return NULL; } --- 136,140 ---- if (deque->leftblock == deque->rightblock && deque->leftindex > deque->rightindex) { ! PyErr_SetString(PyExc_LookupError, "pop from an emtpy deque"); return NULL; } Index: test_deque.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/test_deque.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_deque.py 27 Jan 2004 01:49:25 -0000 1.2 --- test_deque.py 27 Jan 2004 14:41:30 -0000 1.3 *************** *** 10,14 **** class TestBasic(unittest.TestCase): ! def test_exercise_basics(self): d = deque(xrange(100)) d.__init__(xrange(100, 200)) --- 10,14 ---- class TestBasic(unittest.TestCase): ! def test_basics(self): d = deque(xrange(100)) d.__init__(xrange(100, 200)) *************** *** 29,36 **** self.assertEqual(list(d), range(50, 150)) def test_underflow(self): d = deque() ! self.assertRaises(IndexError, d.pop) ## XXX should be lookuperror? ! self.assertRaises(IndexError, d.popleft) def test_clear(self): --- 29,52 ---- self.assertEqual(list(d), range(50, 150)) + def test_len(self): + d = deque('ab') + self.assertEqual(len(d), 2) + d.popleft() + self.assertEqual(len(d), 1) + d.pop() + self.assertEqual(len(d), 0) + self.assertRaises(LookupError, d.pop) + self.assertEqual(len(d), 0) + d.append('c') + self.assertEqual(len(d), 1) + d.appendleft('d') + self.assertEqual(len(d), 2) + d.clear() + self.assertEqual(len(d), 0) + def test_underflow(self): d = deque() ! self.assertRaises(LookupError, d.pop) ! self.assertRaises(LookupError, d.popleft) def test_clear(self): *************** *** 153,156 **** --- 169,306 ---- self.assertEqual(list(d), list(e)) + def R(seqn): + 'Regular generator' + for i in seqn: + yield i + + class G: + 'Sequence using __getitem__' + def __init__(self, seqn): + self.seqn = seqn + def __getitem__(self, i): + return self.seqn[i] + + class I: + 'Sequence using iterator protocol' + def __init__(self, seqn): + self.seqn = seqn + self.i = 0 + def __iter__(self): + return self + def next(self): + if self.i >= len(self.seqn): raise StopIteration + v = self.seqn[self.i] + self.i += 1 + return v + + class Ig: + 'Sequence using iterator protocol defined with a generator' + def __init__(self, seqn): + self.seqn = seqn + self.i = 0 + def __iter__(self): + for val in self.seqn: + yield val + + class X: + 'Missing __getitem__ and __iter__' + def __init__(self, seqn): + self.seqn = seqn + self.i = 0 + def next(self): + if self.i >= len(self.seqn): raise StopIteration + v = self.seqn[self.i] + self.i += 1 + return v + + class N: + 'Iterator missing next()' + def __init__(self, seqn): + self.seqn = seqn + self.i = 0 + def __iter__(self): + return self + + class E: + 'Test propagation of exceptions' + def __init__(self, seqn): + self.seqn = seqn + self.i = 0 + def __iter__(self): + return self + def next(self): + 3/0 + + class S: + 'Test immediate stop' + def __init__(self, seqn): + pass + def __iter__(self): + return self + def next(self): + raise StopIteration + + from itertools import chain, imap + def L(seqn): + 'Test multiple tiers of iterators' + return chain(imap(lambda x:x, R(Ig(G(seqn))))) + + + class TestVariousIteratorArgs(unittest.TestCase): + + def test_constructor(self): + for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)): + for g in (G, I, Ig, S, L, R): + self.assertEqual(list(deque(g(s))), list(g(s))) + self.assertRaises(TypeError, deque, X(s)) + self.assertRaises(TypeError, deque, N(s)) + self.assertRaises(ZeroDivisionError, deque, E(s)) + + class Deque(deque): + pass + + class TestSubclass(unittest.TestCase): + + def test_basics(self): + d = Deque(xrange(100)) + d.__init__(xrange(100, 200)) + for i in xrange(200, 400): + d.append(i) + for i in reversed(xrange(-200, 0)): + d.appendleft(i) + self.assertEqual(list(d), range(-200, 400)) + self.assertEqual(len(d), 600) + + left = [d.popleft() for i in xrange(250)] + self.assertEqual(left, range(-200, 50)) + self.assertEqual(list(d), range(50, 400)) + + right = [d.pop() for i in xrange(250)] + right.reverse() + self.assertEqual(right, range(150, 400)) + self.assertEqual(list(d), range(50, 150)) + + d.clear() + self.assertEqual(len(d), 0) + + def test_copy_pickle(self): + + d = Deque('abc') + + e = d.__copy__() + self.assertEqual(type(d), type(e)) + self.assertEqual(list(d), list(e)) + + e = Deque(d) + self.assertEqual(type(d), type(e)) + self.assertEqual(list(d), list(e)) + + s = pickle.dumps(d) + e = pickle.loads(s) + self.assertNotEqual(id(d), id(e)) + self.assertEqual(type(d), type(e)) + self.assertEqual(list(d), list(e)) + + #============================================================================== *************** *** 160,163 **** --- 310,315 ---- test_classes = ( TestBasic, + TestVariousIteratorArgs, + TestSubclass, ) From montanaro at projects.sourceforge.net Tue Jan 27 09:47:25 2004 From: montanaro at projects.sourceforge.net (montanaro@projects.sourceforge.net) Date: Tue Jan 27 09:48:22 2004 Subject: [Python-checkins] python/dist/src/Tools/scripts README,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26250 Modified Files: README Log Message: add hotshotmain.py ref Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/README,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** README 13 Jun 2003 20:34:27 -0000 1.14 --- README 27 Jan 2004 14:47:23 -0000 1.15 *************** *** 31,34 **** --- 31,35 ---- gprof2html.py Transform gprof(1) output into useful HTML. h2py.py Translate #define's into Python assignments + hotshotmain.py Main program to run script under control of hotshot idle Main program to start IDLE ifdef.py Remove #if(n)def groups from C sources From montanaro at projects.sourceforge.net Tue Jan 27 09:49:07 2004 From: montanaro at projects.sourceforge.net (montanaro@projects.sourceforge.net) Date: Tue Jan 27 09:50:04 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.922,1.923 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26574 Modified Files: NEWS Log Message: add hotshotmain ref Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.922 retrieving revision 1.923 diff -C2 -d -r1.922 -r1.923 *** NEWS 20 Jan 2004 18:24:34 -0000 1.922 --- NEWS 27 Jan 2004 14:49:04 -0000 1.923 *************** *** 273,276 **** --- 273,279 ---- ----------- + - A hotshotmain script was added to the Tools/scripts directory that + makes it easy to run a script under control of the hotshot profiler. + - The db2pickle and pickle2db scripts can now dump/load gdbm files. From rhettinger at projects.sourceforge.net Tue Jan 27 10:04:26 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Tue Jan 27 10:05:27 2004 Subject: [Python-checkins] python/nondist/sandbox/collections dequemodule.c, 1.5, 1.6 test_deque.py, 1.3, 1.4 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29890 Modified Files: dequemodule.c test_deque.py Log Message: Protect the iterator from changes in the underlying data. Index: dequemodule.c =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/dequemodule.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dequemodule.c 27 Jan 2004 14:41:30 -0000 1.5 --- dequemodule.c 27 Jan 2004 15:04:24 -0000 1.6 *************** *** 441,444 **** --- 441,445 ---- block *b; dequeobject *deque; + int len; } dequeiterobject; *************** *** 457,460 **** --- 458,462 ---- Py_INCREF(deque); it->deque = deque; + it->len = deque->len; return (PyObject *)it; } *************** *** 474,477 **** --- 476,486 ---- return NULL; + if (it->len != it->deque->len) { + it->len = -1; /* Make this state sticky */ + PyErr_SetString(PyExc_RuntimeError, + "deque changed size during iteration"); + return NULL; + } + item = it->b->data[it->index]; it->index++; Index: test_deque.py =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/test_deque.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_deque.py 27 Jan 2004 14:41:30 -0000 1.3 --- test_deque.py 27 Jan 2004 15:04:24 -0000 1.4 *************** *** 257,260 **** --- 257,266 ---- self.assertRaises(ZeroDivisionError, deque, E(s)) + def test_iter_with_altered_data(self): + d = deque('abcdefg') + it = iter(d) + d.pop() + self.assertRaises(RuntimeError, it.next) + class Deque(deque): pass From rhettinger at projects.sourceforge.net Tue Jan 27 10:57:35 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Tue Jan 27 10:58:33 2004 Subject: [Python-checkins] python/nondist/sandbox/collections dequemodule.c, 1.6, 1.7 Message-ID: Update of /cvsroot/python/python/nondist/sandbox/collections In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11864 Modified Files: dequemodule.c Log Message: Strengthen error checking Index: dequemodule.c =================================================================== RCS file: /cvsroot/python/python/nondist/sandbox/collections/dequemodule.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** dequemodule.c 27 Jan 2004 15:04:24 -0000 1.6 --- dequemodule.c 27 Jan 2004 15:57:31 -0000 1.7 *************** *** 168,173 **** --- 168,177 ---- while (deque_len(deque)) { item = deque_pop(deque, NULL); + if (item == NULL) + return -1; Py_DECREF(item); } + assert(deque->leftblock == deque->rightblock && + deque->leftindex > deque->rightindex); return 0; } *************** *** 184,192 **** static void ! deque_dealloc(dequeobject *deque) // XXX ? any uncomfortable assumptions { PyObject_GC_UnTrack(deque); ! deque_clear(deque); ! PyMem_Free(deque->leftblock); deque->leftblock = NULL; deque->rightblock = NULL; --- 188,199 ---- static void ! deque_dealloc(dequeobject *deque) { PyObject_GC_UnTrack(deque); ! if (deque->leftblock != NULL) { ! int err = deque_clear(deque); ! assert(err == 0); ! PyMem_Free(deque->leftblock); ! } deque->leftblock = NULL; deque->rightblock = NULL; *************** *** 241,244 **** --- 248,255 ---- return NULL; args = PyTuple_Pack(1, seq); + if (args == NULL) { + Py_DECREF(seq); + return NULL; + } result = PyTuple_Pack(2, deque->ob_type, args); Py_DECREF(seq); From arigo at projects.sourceforge.net Tue Jan 27 11:08:17 2004 From: arigo at projects.sourceforge.net (arigo@projects.sourceforge.net) Date: Tue Jan 27 11:09:17 2004 Subject: [Python-checkins] python/dist/src/Objects frameobject.c,2.76,2.77 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14485 Modified Files: frameobject.c Log Message: Two forgotten Py_DECREF() for two out-of-memory conditions. Index: frameobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v retrieving revision 2.76 retrieving revision 2.77 diff -C2 -d -r2.76 -r2.77 *** frameobject.c 21 Oct 2003 18:14:20 -0000 2.76 --- frameobject.c 27 Jan 2004 16:08:07 -0000 2.77 *************** *** 585,590 **** if (free_list == NULL) { f = PyObject_GC_NewVar(PyFrameObject, &PyFrame_Type, extras); ! if (f == NULL) return NULL; } else { --- 585,592 ---- if (free_list == NULL) { f = PyObject_GC_NewVar(PyFrameObject, &PyFrame_Type, extras); ! if (f == NULL) { ! Py_DECREF(builtins); return NULL; + } } else { *************** *** 595,600 **** if (f->ob_size < extras) { f = PyObject_GC_Resize(PyFrameObject, f, extras); ! if (f == NULL) return NULL; } _Py_NewReference((PyObject *)f); --- 597,604 ---- if (f->ob_size < extras) { f = PyObject_GC_Resize(PyFrameObject, f, extras); ! if (f == NULL) { ! Py_DECREF(builtins); return NULL; + } } _Py_NewReference((PyObject *)f); From nnorwitz at projects.sourceforge.net Tue Jan 27 11:36:32 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Tue Jan 27 11:37:37 2004 Subject: [Python-checkins] python/dist/src/Python symtable.c, 2.10.8.19, 2.10.8.20 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21985/Python Modified Files: Tag: ast-branch symtable.c Log Message: Cleanup a bit and add some error checking Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.10.8.19 retrieving revision 2.10.8.20 diff -C2 -d -r2.10.8.19 -r2.10.8.20 *** symtable.c 24 Jan 2004 19:43:46 -0000 2.10.8.19 --- symtable.c 27 Jan 2004 16:36:30 -0000 2.10.8.20 *************** *** 47,57 **** ste->ste_lineno = lineno; ! if (st->st_cur == NULL) ! ste->ste_nested = 0; ! else if (st->st_cur->ste_nested ! || st->st_cur->ste_type == FunctionBlock) ste->ste_nested = 1; - else - ste->ste_nested = 0; ste->ste_child_free = 0; ste->ste_generator = 0; --- 47,55 ---- ste->ste_lineno = lineno; ! ste->ste_nested = 0; ! if (st->st_cur != NULL && ! (st->st_cur->ste_nested || ! st->st_cur->ste_type == FunctionBlock)) ste->ste_nested = 1; ste->ste_child_free = 0; ste->ste_generator = 0; *************** *** 193,196 **** --- 191,196 ---- { struct symtable *st = symtable_new(); + asdl_seq *seq; + int i; if (st == NULL) *************** *** 203,226 **** /* Any other top-level initialization? */ switch (mod->kind) { ! case Module_kind: { ! int i; ! asdl_seq *seq = mod->v.Module.body; for (i = 0; i < asdl_seq_LEN(seq); i++) if (!symtable_visit_stmt(st, asdl_seq_GET(seq, i))) goto error; break; - } case Expression_kind: if (!symtable_visit_expr(st, mod->v.Expression.body)) goto error; break; ! case Interactive_kind: { ! int i; ! asdl_seq *seq = mod->v.Interactive.body; for (i = 0; i < asdl_seq_LEN(seq); i++) if (!symtable_visit_stmt(st, asdl_seq_GET(seq, i))) goto error; break; - } case Suite_kind: PyErr_SetString(PyExc_RuntimeError, --- 203,222 ---- /* Any other top-level initialization? */ switch (mod->kind) { ! case Module_kind: ! seq = mod->v.Module.body; for (i = 0; i < asdl_seq_LEN(seq); i++) if (!symtable_visit_stmt(st, asdl_seq_GET(seq, i))) goto error; break; case Expression_kind: if (!symtable_visit_expr(st, mod->v.Expression.body)) goto error; break; ! case Interactive_kind: ! seq = mod->v.Interactive.body; for (i = 0; i < asdl_seq_LEN(seq); i++) if (!symtable_visit_stmt(st, asdl_seq_GET(seq, i))) goto error; break; case Suite_kind: PyErr_SetString(PyExc_RuntimeError, *************** *** 229,235 **** } symtable_exit_block(st, (void *)mod); ! if (!symtable_analyze(st)) ! goto error; ! return st; error: PySymtable_Free(st); --- 225,230 ---- } symtable_exit_block(st, (void *)mod); ! if (symtable_analyze(st)) ! return st; error: PySymtable_Free(st); *************** *** 270,283 **** PyST_GetScope(PySTEntryObject *ste, PyObject *name) { ! PyObject *v; ! int flags; ! ! v = PyDict_GetItem(ste->ste_symbols, name); if (!v) return 0; assert(PyInt_Check(v)); ! flags = PyInt_AS_LONG(v); ! flags = (flags >> SCOPE_OFF) & SCOPE_MASK; ! return flags; } --- 265,273 ---- PyST_GetScope(PySTEntryObject *ste, PyObject *name) { ! PyObject *v = PyDict_GetItem(ste->ste_symbols, name); if (!v) return 0; assert(PyInt_Check(v)); ! return (PyInt_AS_LONG(v) >> SCOPE_OFF) & SCOPE_MASK; } *************** *** 376,380 **** */ ! int analyze_cells(PyObject *scope, PyObject *free) { --- 366,370 ---- */ ! static int analyze_cells(PyObject *scope, PyObject *free) { *************** *** 573,576 **** --- 563,568 ---- val = flag; o = PyInt_FromLong(val); + if (o == NULL) + return 0; if (PyDict_SetItem(dict, name, o) < 0) { Py_DECREF(o); *************** *** 585,594 **** /* XXX need to update DEF_GLOBAL for other flags too; perhaps only DEF_FREE_GLOBAL */ if ((o = PyDict_GetItem(st->st_global, name))) { ! val = PyInt_AS_LONG(o); ! val |= flag; ! } else ! val = flag; o = PyInt_FromLong(val); if (PyDict_SetItem(st->st_global, name, o) < 0) { Py_DECREF(o); --- 577,587 ---- /* XXX need to update DEF_GLOBAL for other flags too; perhaps only DEF_FREE_GLOBAL */ + val = flag; if ((o = PyDict_GetItem(st->st_global, name))) { ! val |= PyInt_AS_LONG(o); ! } o = PyInt_FromLong(val); + if (o == NULL) + return 0; if (PyDict_SetItem(st->st_global, name, o) < 0) { Py_DECREF(o); *************** *** 899,903 **** */ if (a->args && !symtable_visit_params(st, a->args, 1)) ! return 0; if (a->vararg) { if (!symtable_add_def(st, a->vararg, DEF_PARAM)) --- 892,896 ---- */ if (a->args && !symtable_visit_params(st, a->args, 1)) ! return 0; if (a->vararg) { if (!symtable_add_def(st, a->vararg, DEF_PARAM)) *************** *** 929,940 **** symtable_visit_alias(struct symtable *st, alias_ty a) { ! if (a->asname) { ! if (!symtable_add_def(st, a->asname, DEF_IMPORT)) ! return 0; ! } ! else if (!symtable_add_def(st, a->name, DEF_IMPORT)) ! return 0; ! ! return 1; } --- 922,927 ---- symtable_visit_alias(struct symtable *st, alias_ty a) { ! PyObject *name = (a->asname == NULL) ? a->name : a->asname; ! return symtable_add_def(st, name, DEF_IMPORT); } From fdrake at projects.sourceforge.net Tue Jan 27 13:21:29 2004 From: fdrake at projects.sourceforge.net (fdrake@projects.sourceforge.net) Date: Tue Jan 27 13:22:29 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libsocket.tex,1.79,1.80 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15923 Modified Files: libsocket.tex Log Message: update signature of the socket constructor (could someone backport this to Python 2.3.x please?) Index: libsocket.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsocket.tex,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** libsocket.tex 13 Dec 2003 22:12:53 -0000 1.79 --- libsocket.tex 27 Jan 2004 18:21:26 -0000 1.80 *************** *** 277,286 **** \end{funcdesc} ! \begin{funcdesc}{socket}{family, type\optional{, proto}} Create a new socket using the given address family, socket type and ! protocol number. The address family should be \constant{AF_INET}, \constant{AF_INET6} or ! \constant{AF_UNIX}. The socket type should be \constant{SOCK_STREAM}, ! \constant{SOCK_DGRAM} or perhaps one of the other \samp{SOCK_} constants. ! The protocol number is usually zero and may be omitted in that case. \end{funcdesc} --- 277,288 ---- \end{funcdesc} ! \begin{funcdesc}{socket}{\optional{family\optional{, ! type\optional{, proto}}}} Create a new socket using the given address family, socket type and ! protocol number. The address family should be \constant{AF_INET} (the ! default), \constant{AF_INET6} or \constant{AF_UNIX}. The socket type ! should be \constant{SOCK_STREAM} (the default), \constant{SOCK_DGRAM} ! or perhaps one of the other \samp{SOCK_} constants. The protocol ! number is usually zero and may be omitted in that case. \end{funcdesc} From nnorwitz at projects.sourceforge.net Tue Jan 27 14:05:46 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Tue Jan 27 14:06:50 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.64, 1.1.2.65 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26950/Python Modified Files: Tag: ast-branch newcompile.c Log Message: Start implementing closures Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.64 retrieving revision 1.1.2.65 diff -C2 -d -r1.1.2.64 -r1.1.2.65 *** newcompile.c 26 Jan 2004 14:38:58 -0000 1.1.2.64 --- newcompile.c 27 Jan 2004 19:05:43 -0000 1.1.2.65 *************** *** 78,81 **** --- 78,83 ---- PyObject *u_names; /* all names */ PyObject *u_varnames; /* local variables */ + PyObject *u_cellvars; /* cell variables */ + PyObject *u_freevars; /* free variables */ int u_argcount; /* number of arguments for block */ *************** *** 275,278 **** --- 277,311 ---- } + static PyObject * + dictbytype(PyObject *src, int scope_type) + { + int pos = 0, i = 0, scope; + PyObject *k, *v, *dest = PyDict_New(); + + if (dest == NULL) + return NULL; + + while (PyDict_Next(src, &pos, &k, &v)) { + /* XXX this should probably be a macro in symtable.h */ + assert(PyInt_Check(v)); + scope = (PyInt_AS_LONG(v) >> SCOPE_OFF) & SCOPE_MASK; + + if (scope == scope_type) { + PyObject *item = PyInt_FromLong(i); + if (item == NULL) { + Py_DECREF(dest); + return NULL; + } + if (PyDict_SetItem(dest, k, item) < 0) { + Py_DECREF(item); + Py_DECREF(dest); + return NULL; + } + Py_DECREF(item); + } + } + return dest; + } + static void compiler_display_symbols(PyObject *name, PyObject *symbols) *************** *** 324,328 **** u->u_name = name; u->u_varnames = list2dict(u->u_ste->ste_varnames); ! Py_INCREF(u->u_varnames); u->u_nblocks = 0; u->u_nalloc = DEFAULT_BLOCKS; --- 357,362 ---- u->u_name = name; u->u_varnames = list2dict(u->u_ste->ste_varnames); ! u->u_cellvars = dictbytype(u->u_ste->ste_symbols, CELL); ! u->u_freevars = dictbytype(u->u_ste->ste_symbols, FREE); u->u_nblocks = 0; u->u_nalloc = DEFAULT_BLOCKS; *************** *** 334,338 **** u->u_nfblocks = 0; u->u_lineno = 0; ! u->u_lineno_set = true; memset(u->u_blocks, 0, sizeof(struct basicblock *) * DEFAULT_BLOCKS); u->u_consts = PyDict_New(); --- 368,372 ---- u->u_nfblocks = 0; u->u_lineno = 0; ! u->u_lineno_set = false; memset(u->u_blocks, 0, sizeof(struct basicblock *) * DEFAULT_BLOCKS); u->u_consts = PyDict_New(); *************** *** 393,396 **** --- 427,432 ---- Py_XDECREF(u->u_names); Py_XDECREF(u->u_varnames); + Py_XDECREF(u->u_freevars); + Py_XDECREF(u->u_cellvars); PyObject_Free(u); } *************** *** 732,735 **** --- 768,852 ---- } + /* The test for LOCAL must come before the test for FREE in order to + handle classes where name is both local and free. The local var is + a method and the free var is a free var referenced within a method. + */ + + static int + get_ref_type(struct compiler *c, PyObject *name) + { + int scope = PyST_GetScope(c->u->u_ste, name); + if (scope == 0) { + char buf[350]; + PyOS_snprintf(buf, sizeof(buf), + "unknown scope for %.100s in %.100s(%s) in %s\n" + "symbols: %s\nlocals: %s\nglobals: %s\n", + PyString_AS_STRING(name), + PyString_AS_STRING(c->u->u_name), + PyObject_REPR(c->c_st->st_cur->ste_id), + c->c_filename, + PyObject_REPR(c->c_st->st_cur->ste_symbols), + PyObject_REPR(c->u->u_varnames), + PyObject_REPR(c->u->u_names) + ); + Py_FatalError(buf); + } + + return scope; + } + + static int + compiler_lookup_arg(PyObject *dict, PyObject *name) + { + PyObject *v = PyDict_GetItem(dict, name); + if (v == NULL) + return -1; + return PyInt_AS_LONG(v); + } + + static int + compiler_make_closure(struct compiler *c, PyCodeObject *co, int args) + { + int i, free = PyCode_GetNumFree(co); + if (free == 0) { + ADDOP_O(c, LOAD_CONST, (PyObject*)co, consts); + ADDOP_I(c, MAKE_FUNCTION, args); + return 1; + } + for (i = 0; i < free; ++i) { + /* Bypass com_addop_varname because it will generate + LOAD_DEREF but LOAD_CLOSURE is needed. + */ + PyObject *name = PyTuple_GET_ITEM(co->co_freevars, i); + int arg, reftype; + + /* Special case: If a class contains a method with a + free variable that has the same name as a method, + the name will be considered free *and* local in the + class. It should be handled by the closure, as + well as by the normal name loookup logic. + */ + reftype = get_ref_type(c, name); + if (reftype == CELL) + arg = compiler_lookup_arg(c->u->u_cellvars, name); + else /* (reftype == FREE) */ + arg = compiler_lookup_arg(c->u->u_freevars, name); + if (arg == -1) { + fprintf(stderr, "lookup %s in %s %d %d\n" + "freevars of %s: %s\n", + PyObject_REPR(name), + PyString_AS_STRING(c->u->u_name), + reftype, arg, + PyString_AS_STRING(co->co_name), + PyObject_REPR(co->co_freevars)); + Py_FatalError("compiler_make_closure()"); + } + ADDOP_I(c, LOAD_CLOSURE, arg); + } + ADDOP_O(c, LOAD_CONST, (PyObject*)co, consts); + ADDOP_I(c, MAKE_CLOSURE, args); + return 1; + } + static int compiler_function(struct compiler *c, stmt_ty s) *************** *** 769,775 **** compiler_exit_scope(c); ! /* XXX closure */ ! ADDOP_O(c, LOAD_CONST, (PyObject *)co, consts); ! ADDOP_I(c, MAKE_FUNCTION, asdl_seq_LEN(args->defaults)); if (!compiler_nameop(c, s->v.FunctionDef.name, Store)) return 0; --- 886,890 ---- compiler_exit_scope(c); ! compiler_make_closure(c, co, asdl_seq_LEN(args->defaults)); if (!compiler_nameop(c, s->v.FunctionDef.name, Store)) return 0; *************** *** 816,822 **** compiler_exit_scope(c); ! /* XXX closure */ ! ADDOP_O(c, LOAD_CONST, (PyObject *)co, consts); ! ADDOP_I(c, MAKE_FUNCTION, 0); ADDOP_I(c, CALL_FUNCTION, 0); ADDOP(c, BUILD_CLASS); --- 931,935 ---- compiler_exit_scope(c); ! compiler_make_closure(c, co, 0); ADDOP_I(c, CALL_FUNCTION, 0); ADDOP(c, BUILD_CLASS); *************** *** 842,846 **** if (!compiler_enter_scope(c, name, (void *)e)) return 0; ! c->u->u_argcount = asdl_seq_LEN(e->v.Lambda.args->args); VISIT(c, expr, e->v.Lambda.body); ADDOP(c, RETURN_VALUE); --- 955,959 ---- if (!compiler_enter_scope(c, name, (void *)e)) return 0; ! c->u->u_argcount = asdl_seq_LEN(args->args); VISIT(c, expr, e->v.Lambda.body); ADDOP(c, RETURN_VALUE); *************** *** 850,857 **** compiler_exit_scope(c); ! /* XXX closure */ ! ADDOP_O(c, LOAD_CONST, (PyObject *)co, consts); ! ADDOP_I(c, MAKE_FUNCTION, asdl_seq_LEN(args->defaults)); ! Py_DECREF(name); --- 963,967 ---- compiler_exit_scope(c); ! compiler_make_closure(c, co, asdl_seq_LEN(args->defaults)); Py_DECREF(name); *************** *** 2522,2526 **** PyObject *filename = NULL; PyObject *name = NULL; ! PyObject *nil = PyTuple_New(0); int nlocals; --- 2632,2637 ---- PyObject *filename = NULL; PyObject *name = NULL; ! PyObject *freevars = NULL; ! PyObject *cellvars = NULL; int nlocals; *************** *** 2532,2546 **** goto error; varnames = PySequence_Tuple(c->u->u_ste->ste_varnames); ! if (!varnames) ! goto error; filename = PyString_FromString(c->c_filename); if (!filename) goto error; ! nlocals = PyList_GET_SIZE(c->u->u_varnames); co = PyCode_New(c->u->u_argcount, nlocals, stackdepth(c), compute_code_flags(c), a->a_bytecode, consts, names, varnames, ! nil, nil, filename, c->u->u_name, a->a_firstlineno, --- 2643,2660 ---- goto error; varnames = PySequence_Tuple(c->u->u_ste->ste_varnames); ! freevars = PySequence_Tuple(c->u->u_freevars); ! cellvars = PySequence_Tuple(c->u->u_cellvars); ! if (!varnames || !freevars || !cellvars) ! goto error; ! filename = PyString_FromString(c->c_filename); if (!filename) goto error; ! nlocals = PyDict_Size(c->u->u_varnames); co = PyCode_New(c->u->u_argcount, nlocals, stackdepth(c), compute_code_flags(c), a->a_bytecode, consts, names, varnames, ! freevars, cellvars, filename, c->u->u_name, a->a_firstlineno, *************** *** 2552,2557 **** Py_XDECREF(filename); Py_XDECREF(name); return co; - } --- 2666,2672 ---- Py_XDECREF(filename); Py_XDECREF(name); + Py_XDECREF(freevars); + Py_XDECREF(cellvars); return co; } From nnorwitz at projects.sourceforge.net Tue Jan 27 14:14:36 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Tue Jan 27 14:15:42 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.65, 1.1.2.66 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29504/Python Modified Files: Tag: ast-branch newcompile.c Log Message: Fix problem if two consts, 100 and 100L are stored. Putting both into a dict overwrites the first. Store the value and type, like in original compile. Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.65 retrieving revision 1.1.2.66 diff -C2 -d -r1.1.2.65 -r1.1.2.66 *** newcompile.c 27 Jan 2004 19:05:43 -0000 1.1.2.65 --- newcompile.c 27 Jan 2004 19:14:33 -0000 1.1.2.66 *************** *** 258,262 **** { int i, n; ! PyObject *v, *dict = PyDict_New(); n = PyList_Size(list); --- 258,262 ---- { int i, n; ! PyObject *v, *k, *dict = PyDict_New(); n = PyList_Size(list); *************** *** 267,271 **** return NULL; } ! if (PyDict_SetItem(dict, PyList_GET_ITEM(list, i), v) < 0) { Py_DECREF(v); Py_DECREF(dict); --- 267,274 ---- return NULL; } ! k = PyList_GET_ITEM(list, i); ! k = Py_BuildValue("(OO)", k, k->ob_type); ! if (k == NULL || PyDict_SetItem(dict, k, v) < 0) { ! Py_XDECREF(k); Py_DECREF(v); Py_DECREF(dict); *************** *** 603,616 **** PyObject *o) { ! PyObject *v; int arg; ! v = PyDict_GetItem(dict, o); if (!v) { arg = PyDict_Size(dict); v = PyInt_FromLong(arg); ! if (!v) return 0; ! if (PyDict_SetItem(dict, o, v) < 0) { Py_DECREF(v); return 0; --- 606,628 ---- PyObject *o) { ! PyObject *t, *v; int arg; ! /* necessary to make sure types aren't coerced (e.g., int and long) */ ! /* XXX should use: t = PyTuple_Pack(2, o, o->ob_type); */ ! t = Py_BuildValue("(OO)", o, o->ob_type); ! if (t == NULL) ! return 0; ! ! v = PyDict_GetItem(dict, t); if (!v) { arg = PyDict_Size(dict); v = PyInt_FromLong(arg); ! if (!v) { ! Py_DECREF(t); return 0; ! } ! if (PyDict_SetItem(dict, t, v) < 0) { ! Py_DECREF(t); Py_DECREF(v); return 0; *************** *** 620,623 **** --- 632,636 ---- else arg = PyInt_AsLong(v); + Py_DECREF(t); return compiler_addop_i(c, opcode, arg); } *************** *** 2594,2597 **** --- 2607,2611 ---- while (PyDict_Next(dict, &pos, &k, &v)) { i = PyInt_AS_LONG(v); + k = PyTuple_GET_ITEM(k, 0); Py_INCREF(k); assert((i - offset) < size); From nnorwitz at projects.sourceforge.net Tue Jan 27 14:40:20 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Tue Jan 27 14:41:20 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.66, 1.1.2.67 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3640/Python Modified Files: Tag: ast-branch newcompile.c Log Message: fix dir()/vars()/co_varnames so they contain local variables Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.66 retrieving revision 1.1.2.67 diff -C2 -d -r1.1.2.66 -r1.1.2.67 *** newcompile.c 27 Jan 2004 19:14:33 -0000 1.1.2.66 --- newcompile.c 27 Jan 2004 19:40:18 -0000 1.1.2.67 *************** *** 36,42 **** #: doing from __future__ import division doesn't work doesn't output BINARY_TRUE_DIVISION ! #: vars() doesn't return local variables ! #: co_names & co_varnames don't contain the correct names ! u_names & u_varnames are not used properly #: doc strings at class scope are POPed, not stored In interactive mode, they are printed. :-) --- 36,40 ---- #: doing from __future__ import division doesn't work doesn't output BINARY_TRUE_DIVISION ! #: co_names doesn't contain locals, only globals, co_varnames may work #: doc strings at class scope are POPed, not stored In interactive mode, they are printed. :-) *************** *** 2651,2660 **** consts = dict_keys_inorder(c->u->u_consts, 0); - if (!consts) - goto error; names = dict_keys_inorder(c->u->u_names, 0); ! if (!names) goto error; - varnames = PySequence_Tuple(c->u->u_ste->ste_varnames); freevars = PySequence_Tuple(c->u->u_freevars); cellvars = PySequence_Tuple(c->u->u_cellvars); --- 2649,2656 ---- consts = dict_keys_inorder(c->u->u_consts, 0); names = dict_keys_inorder(c->u->u_names, 0); ! varnames = dict_keys_inorder(c->u->u_varnames, 0); ! if (!consts || !names || !varnames) goto error; freevars = PySequence_Tuple(c->u->u_freevars); cellvars = PySequence_Tuple(c->u->u_cellvars); From bcannon at projects.sourceforge.net Tue Jan 27 15:17:58 2004 From: bcannon at projects.sourceforge.net (bcannon@projects.sourceforge.net) Date: Tue Jan 27 15:18:57 2004 Subject: [Python-checkins] python/dist/src/Objects object.c,2.213,2.214 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12911/Objects Modified Files: object.c Log Message: Removed two unneeded lines from PyObject_Compare(). Closes bug #885293 (thanks, Josiah Carlson). Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.213 retrieving revision 2.214 diff -C2 -d -r2.213 -r2.214 *** object.c 20 Nov 2003 01:44:58 -0000 2.213 --- object.c 27 Jan 2004 20:17:54 -0000 2.214 *************** *** 747,751 **** PyObject_Compare(PyObject *v, PyObject *w) { - PyTypeObject *vtp; int result; --- 747,750 ---- *************** *** 756,760 **** if (v == w) return 0; - vtp = v->ob_type; if (Py_EnterRecursiveCall(" in cmp")) return -1; --- 755,758 ---- From fdrake at projects.sourceforge.net Tue Jan 27 16:08:08 2004 From: fdrake at projects.sourceforge.net (fdrake@projects.sourceforge.net) Date: Tue Jan 27 16:09:09 2004 Subject: [Python-checkins] python/dist/src/Doc/lib liboptparse.tex, 1.12, 1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28918a Modified Files: liboptparse.tex Log Message: fix whitespace style (inconsistent with the rest of the docs) Index: liboptparse.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liboptparse.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** liboptparse.tex 26 Jan 2004 19:39:13 -0000 1.12 --- liboptparse.tex 27 Jan 2004 21:08:04 -0000 1.13 *************** *** 30,34 **** help="don't print status messages to stdout") ! (options, args) = parser.parse_args() \end{verbatim} --- 30,34 ---- help="don't print status messages to stdout") ! options, args = parser.parse_args() \end{verbatim} *************** *** 303,307 **** \begin{verbatim} args = ["-f", "foo.txt"] ! (options, args) = parser.parse_args(args) \end{verbatim} --- 303,307 ---- \begin{verbatim} args = ["-f", "foo.txt"] ! options, args = parser.parse_args(args) \end{verbatim} *************** *** 336,340 **** \begin{verbatim} ! (options, args) = parser.parse_args(["-n42"]) print options.num \end{verbatim} --- 336,340 ---- \begin{verbatim} ! options, args = parser.parse_args(["-n42"]) print options.num \end{verbatim} *************** *** 606,610 **** action="store_false", dest="verbose") ! (options, args) = parser.parse_args() if len(args) != 1: parser.error("incorrect number of arguments") --- 606,610 ---- action="store_false", dest="verbose") ! options, args = parser.parse_args() if len(args) != 1: parser.error("incorrect number of arguments") *************** *** 1272,1276 **** \begin{verbatim} ! def my_callback (option, opt, value, parser): pass \end{verbatim} --- 1272,1276 ---- \begin{verbatim} ! def my_callback(option, opt, value, parser): pass \end{verbatim} *************** *** 1292,1296 **** \begin{verbatim} ! def record_foo_seen (option, opt, value, parser): parser.saw_foo = 1 --- 1292,1296 ---- \begin{verbatim} ! def record_foo_seen(option, opt, value, parser): parser.saw_foo = 1 *************** *** 1304,1308 **** \begin{verbatim} ! def check_order (option, opt, value, parser): if parser.values.b: raise OptionValueError("can't use -a after -b") --- 1304,1308 ---- \begin{verbatim} ! def check_order(option, opt, value, parser): if parser.values.b: raise OptionValueError("can't use -a after -b") *************** *** 1319,1323 **** \begin{verbatim} ! def check_order (option, opt, value, parser): if parser.values.b: raise OptionValueError("can't use %s after -b" % opt) --- 1319,1323 ---- \begin{verbatim} ! def check_order(option, opt, value, parser): if parser.values.b: raise OptionValueError("can't use %s after -b" % opt) *************** *** 1335,1339 **** \begin{verbatim} ! def check_moon (option, opt, value, parser): if is_full_moon(): raise OptionValueError("%s option invalid when moon full" % opt) --- 1335,1339 ---- \begin{verbatim} ! def check_moon(option, opt, value, parser): if is_full_moon(): raise OptionValueError("%s option invalid when moon full" % opt) *************** *** 1359,1363 **** \begin{verbatim} ! def store_value (option, opt, value, parser): setattr(parser.values, option.dest, value) ... --- 1359,1363 ---- \begin{verbatim} ! def store_value(option, opt, value, parser): setattr(parser.values, option.dest, value) ... *************** *** 1406,1410 **** \begin{verbatim} ! def varargs (option, opt, value, parser): assert value is None done = 0 --- 1406,1410 ---- \begin{verbatim} ! def varargs(option, opt, value, parser): assert value is None done = 0 *************** *** 1464,1469 **** \begin{verbatim} ! def check_foo (option : Option, opt : string, value : string) ! -> foo \end{verbatim} --- 1464,1469 ---- \begin{verbatim} ! def check_foo(option : Option, opt : string, value : string) ! -> foo \end{verbatim} *************** *** 1499,1503 **** \begin{verbatim} ! def check_complex (option, opt, value): try: return complex(value) --- 1499,1503 ---- \begin{verbatim} ! def check_complex(option, opt, value): try: return complex(value) *************** *** 1510,1514 **** \begin{verbatim} ! class MyOption (Option): TYPES = Option.TYPES + ("complex",) TYPE_CHECKER = copy(Option.TYPE_CHECKER) --- 1510,1514 ---- \begin{verbatim} ! class MyOption(Option): TYPES = Option.TYPES + ("complex",) TYPE_CHECKER = copy(Option.TYPE_CHECKER) *************** *** 1601,1605 **** \begin{verbatim} ! class MyOption (Option): ACTIONS = Option.ACTIONS + ("extend",) --- 1601,1605 ---- \begin{verbatim} ! class MyOption(Option): ACTIONS = Option.ACTIONS + ("extend",) *************** *** 1607,1611 **** TYPED_ACTIONS = Option.TYPED_ACTIONS + ("extend",) ! def take_action (self, action, dest, opt, value, values, parser): if action == "extend": lvalue = value.split(",") --- 1607,1611 ---- TYPED_ACTIONS = Option.TYPED_ACTIONS + ("extend",) ! def take_action(self, action, dest, opt, value, values, parser): if action == "extend": lvalue = value.split(",") From nnorwitz at projects.sourceforge.net Tue Jan 27 17:49:08 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Tue Jan 27 17:50:30 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.67, 1.1.2.68 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23400/Python Modified Files: Tag: ast-branch newcompile.c Log Message: Cleanup, remove unused u_exit and unneeded u_tmp Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.67 retrieving revision 1.1.2.68 diff -C2 -d -r1.1.2.67 -r1.1.2.68 *** newcompile.c 27 Jan 2004 19:40:18 -0000 1.1.2.67 --- newcompile.c 27 Jan 2004 22:49:04 -0000 1.1.2.68 *************** *** 24,29 **** Inappropriate Exceptions: ! #: problem with cell objects (see test_builtins::test_map) ! (closures need to be fully implemented) #: x = [1] ; x[0] += 1 raises TypeError: object does not support item assignment --- 24,28 ---- Inappropriate Exceptions: ! #: problem with cell objects (closures still have bugs) #: x = [1] ; x[0] += 1 raises TypeError: object does not support item assignment *************** *** 85,90 **** int u_curblock; /* index of current block in u_blocks */ int u_tmpname; /* temporary variables for list comps */ - identifier u_tmp; /* name for u_tmpname */ - struct basicblock u_exit; struct basicblock **u_blocks; --- 84,87 ---- *************** *** 1127,1131 **** case EXCEPT: case FINALLY_TRY: ! while (--i > 0 && c->u->u_fblock[i].fb_type != LOOP) ; if (i == -1) --- 1124,1128 ---- case EXCEPT: case FINALLY_TRY: ! while (--i >= 0 && c->u->u_fblock[i].fb_type != LOOP) ; if (i == -1) *************** *** 1856,1867 **** static int ! compiler_listcomp_generator(struct compiler *c, asdl_seq *generators, int gen_index, expr_ty elt) { - /* need to capture u_tmp here for nested list comps, - u_tmp is set to NULL in compiler_listcomp */ - PyObject *u_tmp = c->u->u_tmp; - /* generate code for the iterator, then each of the ifs, and then write to the element */ --- 1853,1860 ---- static int ! compiler_listcomp_generator(struct compiler *c, PyObject *tmpname, asdl_seq *generators, int gen_index, expr_ty elt) { /* generate code for the iterator, then each of the ifs, and then write to the element */ *************** *** 1897,1906 **** if (++gen_index < asdl_seq_LEN(generators)) ! if (!compiler_listcomp_generator(c, generators, gen_index, elt)) return 0; /* only append after the last for generator */ if (gen_index >= asdl_seq_LEN(generators)) { ! if (!compiler_nameop(c, u_tmp, Load)) return 0; VISIT(c, expr, elt); --- 1890,1900 ---- if (++gen_index < asdl_seq_LEN(generators)) ! if (!compiler_listcomp_generator(c, tmpname, ! generators, gen_index, elt)) return 0; /* only append after the last for generator */ if (gen_index >= asdl_seq_LEN(generators)) { ! if (!compiler_nameop(c, tmpname, Load)) return 0; VISIT(c, expr, elt); *************** *** 1920,1924 **** /* delete the append method added to locals */ if (gen_index == 1) ! if (!compiler_nameop(c, u_tmp, Del)) return 0; --- 1914,1918 ---- /* delete the append method added to locals */ if (gen_index == 1) ! if (!compiler_nameop(c, tmpname, Del)) return 0; *************** *** 1931,1934 **** --- 1925,1929 ---- char tmpname[256]; identifier tmp; + int rc = 0; static identifier append; asdl_seq *generators = e->v.ListComp.generators; *************** *** 1947,1957 **** ADDOP(c, DUP_TOP); ADDOP_O(c, LOAD_ATTR, append, names); ! if (!compiler_nameop(c, tmp, Store)) ! return 0; ! c->u->u_tmp = tmp; ! if (!compiler_listcomp_generator(c, generators, 0, e->v.ListComp.elt)) ! return 0; ! c->u->u_tmp = NULL; ! return 1; } --- 1942,1950 ---- ADDOP(c, DUP_TOP); ADDOP_O(c, LOAD_ATTR, append, names); ! if (compiler_nameop(c, tmp, Store)) ! rc = compiler_listcomp_generator(c, tmp, generators, 0, ! e->v.ListComp.elt); ! Py_DECREF(tmp); ! return rc; } From nnorwitz at projects.sourceforge.net Tue Jan 27 18:21:41 2004 From: nnorwitz at projects.sourceforge.net (nnorwitz@projects.sourceforge.net) Date: Tue Jan 27 18:22:40 2004 Subject: [Python-checkins] python/dist/src/Python newcompile.c, 1.1.2.68, 1.1.2.69 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv434/Python Modified Files: Tag: ast-branch newcompile.c Log Message: Get continue to work inside a try Index: newcompile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/Attic/newcompile.c,v retrieving revision 1.1.2.68 retrieving revision 1.1.2.69 diff -C2 -d -r1.1.2.68 -r1.1.2.69 *** newcompile.c 27 Jan 2004 22:49:04 -0000 1.1.2.68 --- newcompile.c 27 Jan 2004 23:21:38 -0000 1.1.2.69 *************** *** 30,33 **** --- 30,36 ---- From Python/marshal.c::PyMarshal_ReadLastObjectFromFile() This looks like it may be related to encoding not being implemented. + #: These don't work right (from test_grammar): + def f4(two, (compound, (argument, list))): pass + def v3(a, (b, c), *rest): return a, b, c, rest Invalid behaviour: *************** *** 1128,1132 **** if (i == -1) return compiler_error(c, LOOP_ERROR_MSG); ! ADDOP_I(c, CONTINUE_LOOP, c->u->u_fblock[i].fb_block); break; case FINALLY_END: --- 1131,1135 ---- if (i == -1) return compiler_error(c, LOOP_ERROR_MSG); ! ADDOP_JABS(c, CONTINUE_LOOP, c->u->u_fblock[i].fb_block); break; case FINALLY_END: *************** *** 1135,1140 **** } - /* If the continue wasn't an error, it will always end a block. */ - NEW_BLOCK(c); return 1; } --- 1138,1141 ---- From perky at projects.sourceforge.net Wed Jan 28 04:03:31 2004 From: perky at projects.sourceforge.net (perky@projects.sourceforge.net) Date: Wed Jan 28 04:04:39 2004 Subject: [Python-checkins] python/dist/src/Modules Setup.dist,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25829 Modified Files: Setup.dist Log Message: Add missed entry for cjkcodecs._iso_2022_kr. Index: Setup.dist =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/Setup.dist,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Setup.dist 17 Jan 2004 14:29:28 -0000 1.43 --- Setup.dist 28 Jan 2004 09:03:28 -0000 1.44 *************** *** 505,508 **** --- 505,509 ---- #_codecs_cp949 cjkcodecs/_cp949.c #_codecs_euc_kr cjkcodecs/_euc_kr.c + #_codecs_iso2022_kr cjkcodecs/_iso2022_kr.c #_codecs_johab cjkcodecs/_johab.c From rhettinger at projects.sourceforge.net Thu Jan 29 01:37:54 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 01:39:09 2004 Subject: [Python-checkins] python/dist/src/Modules collectionsmodule.c, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1631/Modules Added Files: collectionsmodule.c Log Message: * Move collections.deque() in from the sandbox * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming --- NEW FILE: collectionsmodule.c --- #include "Python.h" /* collections module implementation of a deque() datatype Written and maintained by Raymond D. Hettinger Copyright (c) 2004 Python Software Foundation. All rights reserved. */ #define BLOCKLEN 46 typedef struct BLOCK { struct BLOCK *leftlink; struct BLOCK *rightlink; PyObject *data[BLOCKLEN]; } block; static block *newblock(block *leftlink, block *rightlink) { block *b = PyMem_Malloc(sizeof(block)); if (b == NULL) { PyErr_NoMemory(); return NULL; } b->leftlink = leftlink; b->rightlink = rightlink; return b; } typedef struct { PyObject_HEAD block *leftblock; block *rightblock; int leftindex; int rightindex; int len; } dequeobject; static PyObject * deque_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { dequeobject *deque; block *b; /* create dequeobject structure */ deque = (dequeobject *)type->tp_alloc(type, 0); if (deque == NULL) return NULL; b = newblock(NULL, NULL); if (b == NULL) { Py_DECREF(deque); return NULL; } deque->leftblock = b; deque->rightblock = b; deque->leftindex = BLOCKLEN / 2 + 1; deque->rightindex = BLOCKLEN / 2; deque->len = 0; return (PyObject *)deque; } static PyObject * deque_append(dequeobject *deque, PyObject *item) { deque->rightindex++; deque->len++; if (deque->rightindex == BLOCKLEN) { block *b = newblock(deque->rightblock, NULL); if (b == NULL) return NULL; assert(deque->rightblock->rightlink == NULL); deque->rightblock->rightlink = b; deque->rightblock = b; deque->rightindex = 0; } Py_INCREF(item); deque->rightblock->data[deque->rightindex] = item; Py_RETURN_NONE; } PyDoc_STRVAR(append_doc, "Add an element to the right side of the deque."); static PyObject * deque_appendleft(dequeobject *deque, PyObject *item) { deque->leftindex--; deque->len++; if (deque->leftindex == -1) { block *b = newblock(NULL, deque->leftblock); if (b == NULL) return NULL; assert(deque->leftblock->leftlink == NULL); deque->leftblock->leftlink = b; deque->leftblock = b; deque->leftindex = BLOCKLEN - 1; } Py_INCREF(item); deque->leftblock->data[deque->leftindex] = item; Py_RETURN_NONE; } PyDoc_STRVAR(appendleft_doc, "Add an element to the left side of the deque."); static PyObject * deque_pop(dequeobject *deque, PyObject *unused) { PyObject *item; block *prevblock; if (deque->len == 0) { PyErr_SetString(PyExc_LookupError, "pop from an emtpy deque"); return NULL; } item = deque->rightblock->data[deque->rightindex]; deque->rightindex--; deque->len--; if (deque->rightindex == -1) { if (deque->len == 0) { assert(deque->leftblock == deque->rightblock); assert(deque->leftindex == deque->rightindex+1); /* re-center instead of freeing a block */ deque->leftindex = BLOCKLEN / 2 + 1; deque->rightindex = BLOCKLEN / 2; } else { prevblock = deque->rightblock->leftlink; assert(deque->leftblock != deque->rightblock); PyMem_Free(deque->rightblock); prevblock->rightlink = NULL; deque->rightblock = prevblock; deque->rightindex = BLOCKLEN - 1; } } return item; } PyDoc_STRVAR(pop_doc, "Remove and return the rightmost element."); static PyObject * deque_popleft(dequeobject *deque, PyObject *unused) { PyObject *item; block *prevblock; if (deque->len == 0) { PyErr_SetString(PyExc_LookupError, "pop from an emtpy deque"); return NULL; } item = deque->leftblock->data[deque->leftindex]; deque->leftindex++; deque->len--; if (deque->leftindex == BLOCKLEN) { if (deque->len == 0) { assert(deque->leftblock == deque->rightblock); assert(deque->leftindex == deque->rightindex+1); /* re-center instead of freeing a block */ deque->leftindex = BLOCKLEN / 2 + 1; deque->rightindex = BLOCKLEN / 2; } else { assert(deque->leftblock != deque->rightblock); prevblock = deque->leftblock->rightlink; assert(deque->leftblock != NULL); PyMem_Free(deque->leftblock); assert(prevblock != NULL); prevblock->leftlink = NULL; deque->leftblock = prevblock; deque->leftindex = 0; } } return item; } PyDoc_STRVAR(popleft_doc, "Remove and return the leftmost element."); static int deque_len(dequeobject *deque) { return deque->len; } static int deque_clear(dequeobject *deque) { PyObject *item; while (deque_len(deque)) { item = deque_pop(deque, NULL); if (item == NULL) return -1; Py_DECREF(item); } assert(deque->leftblock == deque->rightblock && deque->leftindex > deque->rightindex); return 0; } static PyObject * deque_clearmethod(dequeobject *deque) { if (deque_clear(deque) == -1) return NULL; Py_RETURN_NONE; } PyDoc_STRVAR(clear_doc, "Remove all elements from the deque."); static void deque_dealloc(dequeobject *deque) { PyObject_GC_UnTrack(deque); if (deque->leftblock != NULL) { int err = deque_clear(deque); assert(err == 0); assert(deque->leftblock != NULL); PyMem_Free(deque->leftblock); } deque->leftblock = NULL; deque->rightblock = NULL; deque->ob_type->tp_free(deque); } static int set_traverse(dequeobject *deque, visitproc visit, void *arg) { block * b = deque->leftblock; int index = deque->leftindex; int err; PyObject *item; while (b != deque->rightblock || index <= deque->rightindex) { item = b->data[index]; index++; if (index == BLOCKLEN && b->rightlink != NULL) { b = b->rightlink; index = 0; } err = visit(item, arg); if (err) return err; } return 0; } static long deque_nohash(PyObject *self) { PyErr_SetString(PyExc_TypeError, "deque objects are unhashable"); return -1; } static PyObject * deque_copy(PyObject *deque) { return PyObject_CallFunctionObjArgs((PyObject *)(deque->ob_type), deque, NULL); } PyDoc_STRVAR(copy_doc, "Return a shallow copy of a deque."); static PyObject * deque_reduce(dequeobject *deque) { PyObject *seq, *args, *result; seq = PySequence_Tuple((PyObject *)deque); if (seq == NULL) return NULL; args = PyTuple_Pack(1, seq); if (args == NULL) { Py_DECREF(seq); return NULL; } result = PyTuple_Pack(2, deque->ob_type, args); Py_DECREF(seq); Py_DECREF(args); return result; } PyDoc_STRVAR(reduce_doc, "Return state information for pickling."); static PyObject * deque_repr(PyObject *deque) { PyObject *aslist, *result, *fmt; int i; i = Py_ReprEnter(deque); if (i != 0) { if (i < 0) return NULL; return PyString_FromString("[...]"); } aslist = PySequence_List(deque); if (aslist == NULL) { Py_ReprLeave(deque); return NULL; } fmt = PyString_FromString("deque(%r)"); if (fmt == NULL) { Py_DECREF(aslist); Py_ReprLeave(deque); return NULL; } result = PyString_Format(fmt, aslist); Py_DECREF(fmt); Py_DECREF(aslist); Py_ReprLeave(deque); return result; } static int deque_tp_print(PyObject *deque, FILE *fp, int flags) { PyObject *it, *item; int pos=0; char *emit = ""; /* No separator emitted on first pass */ char *separator = ", "; int i; i = Py_ReprEnter(deque); if (i != 0) { if (i < 0) return i; fputs("[...]", fp); return 0; } it = PyObject_GetIter(deque); if (it == NULL) return -1; fputs("deque([", fp); while ((item = PyIter_Next(it)) != NULL) { fputs(emit, fp); emit = separator; if (PyObject_Print(item, fp, 0) != 0) { Py_DECREF(item); Py_DECREF(it); Py_ReprLeave(deque); return -1; } Py_DECREF(item); } Py_ReprLeave(deque); Py_DECREF(it); if (PyErr_Occurred()) return -1; fputs("])", fp); return 0; } static int deque_init(dequeobject *deque, PyObject *args, PyObject *kwds) { PyObject *iterable = NULL, *it, *item; if (!PyArg_UnpackTuple(args, "deque", 0, 1, &iterable)) return -1; if (iterable != NULL) { it = PyObject_GetIter(iterable); if (it == NULL) return -1; while ((item = PyIter_Next(it)) != NULL) { deque->rightindex++; deque->len++; if (deque->rightindex == BLOCKLEN) { block *b = newblock(deque->rightblock, NULL); if (b == NULL) { Py_DECREF(it); Py_DECREF(item); return -1; } deque->rightblock->rightlink = b; deque->rightblock = b; deque->rightindex = 0; } deque->rightblock->data[deque->rightindex] = item; } Py_DECREF(it); if (PyErr_Occurred()) return -1; } return 0; } static PySequenceMethods deque_as_sequence = { (inquiry)deque_len, /* sq_length */ 0, /* sq_concat */ }; /* deque object ********************************************************/ static PyObject *deque_iter(dequeobject *deque); static PyMethodDef deque_methods[] = { {"append", (PyCFunction)deque_append, METH_O, append_doc}, {"appendleft", (PyCFunction)deque_appendleft, METH_O, appendleft_doc}, {"clear", (PyCFunction)deque_clearmethod, METH_NOARGS, clear_doc}, {"__copy__", (PyCFunction)deque_copy, METH_NOARGS, copy_doc}, {"pop", (PyCFunction)deque_pop, METH_NOARGS, pop_doc}, {"popleft", (PyCFunction)deque_popleft, METH_NOARGS, popleft_doc}, {"__reduce__", (PyCFunction)deque_reduce, METH_NOARGS, reduce_doc}, {NULL, NULL} /* sentinel */ }; PyDoc_STRVAR(deque_doc, "deque(iterable) --> deque object\n\ \n\ Build an ordered collection accessible from endpoints only."); PyTypeObject deque_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ "collections.deque", /* tp_name */ sizeof(dequeobject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ (destructor)deque_dealloc, /* tp_dealloc */ (printfunc)deque_tp_print, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ (reprfunc)deque_repr, /* tp_repr */ 0, /* tp_as_number */ &deque_as_sequence, /* tp_as_sequence */ 0, /* tp_as_mapping */ deque_nohash, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, /* tp_flags */ deque_doc, /* tp_doc */ (traverseproc)set_traverse, /* tp_traverse */ (inquiry)deque_clear, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset*/ (getiterfunc)deque_iter, /* tp_iter */ 0, /* tp_iternext */ deque_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ (initproc)deque_init, /* tp_init */ PyType_GenericAlloc, /* tp_alloc */ deque_new, /* tp_new */ PyObject_GC_Del, /* tp_free */ }; /*********************** Deque Iterator **************************/ typedef struct { PyObject_HEAD int index; block *b; dequeobject *deque; int len; } dequeiterobject; PyTypeObject dequeiter_type; static PyObject * deque_iter(dequeobject *deque) { dequeiterobject *it; it = PyObject_New(dequeiterobject, &dequeiter_type); if (it == NULL) return NULL; it->b = deque->leftblock; it->index = deque->leftindex; Py_INCREF(deque); it->deque = deque; it->len = deque->len; return (PyObject *)it; } static void dequeiter_dealloc(dequeiterobject *dio) { Py_XDECREF(dio->deque); dio->ob_type->tp_free(dio); } static PyObject * dequeiter_next(dequeiterobject *it) { PyObject *item; if (it->b == it->deque->rightblock && it->index > it->deque->rightindex) return NULL; if (it->len != it->deque->len) { it->len = -1; /* Make this state sticky */ PyErr_SetString(PyExc_RuntimeError, "deque changed size during iteration"); return NULL; } item = it->b->data[it->index]; it->index++; if (it->index == BLOCKLEN && it->b->rightlink != NULL) { it->b = it->b->rightlink; it->index = 0; } Py_INCREF(item); return item; } PyTypeObject dequeiter_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ "deque_iterator", /* tp_name */ sizeof(dequeiterobject), /* tp_basicsize */ 0, /* tp_itemsize */ /* methods */ (destructor)dequeiter_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* 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 */ 0, /* tp_call */ 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ 0, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ PyObject_SelfIter, /* tp_iter */ (iternextfunc)dequeiter_next, /* tp_iternext */ 0, }; /* module level code ********************************************************/ PyDoc_STRVAR(module_doc, "High performance data structures\n\ "); PyMODINIT_FUNC initcollections(void) { PyObject *m; m = Py_InitModule3("collections", NULL, module_doc); if (PyType_Ready(&deque_type) < 0) return; Py_INCREF(&deque_type); PyModule_AddObject(m, "deque", (PyObject *)&deque_type); if (PyType_Ready(&dequeiter_type) < 0) return; return; } From rhettinger at projects.sourceforge.net Thu Jan 29 01:38:05 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 01:39:19 2004 Subject: [Python-checkins] python/dist/src/Misc NEWS,1.923,1.924 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1631/Misc Modified Files: NEWS Log Message: * Move collections.deque() in from the sandbox * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.923 retrieving revision 1.924 diff -C2 -d -r1.923 -r1.924 *** NEWS 27 Jan 2004 14:49:04 -0000 1.923 --- NEWS 29 Jan 2004 06:37:50 -0000 1.924 *************** *** 122,125 **** --- 122,132 ---- ----------------- + - Added a collections module containing a new datatype, deque(), + offering high-performance, thread-safe, memory friendly appends + and pops on either side of the deque. + + - Several modules now take advantage of collections.deque() for + improved performance: Queue, mutex, shlex, threading, and pydoc. + - The operator module has two new functions, attrgetter() and itemgetter() which are useful for creating fast data extractor From rhettinger at projects.sourceforge.net Thu Jan 29 01:38:21 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 01:39:34 2004 Subject: [Python-checkins] python/dist/src setup.py,1.181,1.182 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1631 Modified Files: setup.py Log Message: * Move collections.deque() in from the sandbox * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.181 retrieving revision 1.182 diff -C2 -d -r1.181 -r1.182 *** setup.py 17 Jan 2004 14:29:28 -0000 1.181 --- setup.py 29 Jan 2004 06:37:46 -0000 1.182 *************** *** 323,326 **** --- 323,328 ---- # fast iterator tools implemented in C exts.append( Extension("itertools", ["itertoolsmodule.c"]) ) + # high-performance collections + exts.append( Extension("collections", ["collectionsmodule.c"]) ) # bisect exts.append( Extension("_bisect", ["_bisectmodule.c"]) ) From rhettinger at projects.sourceforge.net Thu Jan 29 01:38:21 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 01:39:38 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libbisect.tex, 1.11, 1.12 libqueue.tex, 1.13, 1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1631/Doc/lib Modified Files: libbisect.tex libqueue.tex Log Message: * Move collections.deque() in from the sandbox * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming Index: libbisect.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libbisect.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** libbisect.tex 26 Jun 2002 05:07:28 -0000 1.11 --- libbisect.tex 29 Jan 2004 06:37:48 -0000 1.12 *************** *** 81,101 **** >>> map(grade, [33, 99, 77, 44, 12, 88]) ['E', 'A', 'B', 'D', 'F', 'A'] - \end{verbatim} - The bisect module can be used with the Queue module to implement a priority - queue (example courtesy of Fredrik Lundh): \index{Priority Queue} - - \begin{verbatim} - import Queue, bisect - - class PriorityQueue(Queue.Queue): - def _put(self, item): - bisect.insort(self.queue, item) - - # usage - queue = PriorityQueue(0) - queue.put((2, "second")) - queue.put((1, "first")) - queue.put((3, "third")) - priority, value = queue.get() \end{verbatim} --- 81,84 ---- Index: libqueue.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libqueue.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** libqueue.tex 15 Oct 2002 15:11:13 -0000 1.13 --- libqueue.tex 29 Jan 2004 06:37:48 -0000 1.14 *************** *** 13,20 **** Python. - \begin{seealso} - \seemodule{bisect}{PriorityQueue example using the Queue class} - \end{seealso} - The \module{Queue} module defines the following class and exception: --- 13,16 ---- From rhettinger at projects.sourceforge.net Thu Jan 29 01:38:22 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 01:39:43 2004 Subject: [Python-checkins] python/dist/src/Doc/whatsnew whatsnew24.tex, 1.28, 1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/whatsnew In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1631/Doc/whatsnew Modified Files: whatsnew24.tex Log Message: * Move collections.deque() in from the sandbox * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming Index: whatsnew24.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/whatsnew/whatsnew24.tex,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** whatsnew24.tex 18 Jan 2004 15:55:51 -0000 1.28 --- whatsnew24.tex 29 Jan 2004 06:37:48 -0000 1.29 *************** *** 323,326 **** --- 323,351 ---- \end{itemize} + \item There is a new \module{collections} module which currently offers + just one new datatype, \class{deque}, which offers high-performance, + thread-safe, memory friendly appends and pops on either side of the + deque resulting in efficient stacks and queues: + + \begin{verbatim} + >>> from collections import deque + >>> d = deque('ghi') # make a new deque with three items + >>> d.append('j') # add a new entry to the right side + >>> d.appendleft('f') # add a new entry to the left side + >>> d # show the representation of the deque + deque(['f', 'g', 'h', 'i', 'j']) + >>> d.pop() # return and remove the rightmost item + 'j' + >>> d.popleft() # return and remove the leftmost item + 'f' + >>> list(d) # list the contents of the deque + ['g', 'h', 'i'] + >>> 'h' in d # search the deque + True + \end{verbatim} + + Several modules now take advantage of \class{collections.deque()} for + improved performance: \module{Queue}, \module{mutex}, \module{shlex} + \module{threading}, and \module{pydoc}. \item The \module{heapq} module has been converted to C. The resulting From rhettinger at projects.sourceforge.net Thu Jan 29 01:38:22 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 01:39:47 2004 Subject: [Python-checkins] python/dist/src/Lib/test test_deque.py, NONE, 1.1 test_bisect.py, 1.10, 1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1631/Lib/test Modified Files: test_bisect.py Added Files: test_deque.py Log Message: * Move collections.deque() in from the sandbox * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming --- NEW FILE: test_deque.py --- from collections import deque import unittest from test import test_support import copy import cPickle as pickle from cStringIO import StringIO BIG = 100000 class TestBasic(unittest.TestCase): def test_basics(self): d = deque(xrange(100)) d.__init__(xrange(100, 200)) for i in xrange(200, 400): d.append(i) for i in reversed(xrange(-200, 0)): d.appendleft(i) self.assertEqual(list(d), range(-200, 400)) self.assertEqual(len(d), 600) left = [d.popleft() for i in xrange(250)] self.assertEqual(left, range(-200, 50)) self.assertEqual(list(d), range(50, 400)) right = [d.pop() for i in xrange(250)] right.reverse() self.assertEqual(right, range(150, 400)) self.assertEqual(list(d), range(50, 150)) def test_len(self): d = deque('ab') self.assertEqual(len(d), 2) d.popleft() self.assertEqual(len(d), 1) d.pop() self.assertEqual(len(d), 0) self.assertRaises(LookupError, d.pop) self.assertEqual(len(d), 0) d.append('c') self.assertEqual(len(d), 1) d.appendleft('d') self.assertEqual(len(d), 2) d.clear() self.assertEqual(len(d), 0) def test_underflow(self): d = deque() self.assertRaises(LookupError, d.pop) self.assertRaises(LookupError, d.popleft) def test_clear(self): d = deque(xrange(100)) self.assertEqual(len(d), 100) d.clear() self.assertEqual(len(d), 0) self.assertEqual(list(d), []) def test_repr(self): d = deque(xrange(200)) e = eval(repr(d)) self.assertEqual(list(d), list(e)) d.append(d) self.assert_('...' in repr(d)) def test_print(self): d = deque(xrange(200)) d.append(d) f = StringIO() print >> f, d, self.assertEqual(f.getvalue(), repr(d)) f.close() def test_hash(self): self.assertRaises(TypeError, hash, deque('abc')) def test_long_steadystate_queue_popleft(self): for size in (0, 1, 2, 100, 1000): d = deque(xrange(size)) append, pop = d.append, d.popleft for i in xrange(size, BIG): append(i) x = pop() if x != i - size: self.assertEqual(x, i-size) self.assertEqual(list(d), range(BIG-size, BIG)) def test_long_steadystate_queue_popright(self): for size in (0, 1, 2, 100, 1000): d = deque(reversed(xrange(size))) append, pop = d.appendleft, d.pop for i in xrange(size, BIG): append(i) x = pop() if x != i - size: self.assertEqual(x, i-size) self.assertEqual(list(reversed(list(d))), range(BIG-size, BIG)) def test_big_queue_popleft(self): pass d = deque() append, pop = d.append, d.popleft for i in xrange(BIG): append(i) for i in xrange(BIG): x = pop() if x != i: self.assertEqual(x, i) def test_big_queue_popright(self): d = deque() append, pop = d.appendleft, d.pop for i in xrange(BIG): append(i) for i in xrange(BIG): x = pop() if x != i: self.assertEqual(x, i) def test_big_stack_right(self): d = deque() append, pop = d.append, d.pop for i in xrange(BIG): append(i) for i in reversed(xrange(BIG)): x = pop() if x != i: self.assertEqual(x, i) self.assertEqual(len(d), 0) def test_big_stack_left(self): d = deque() append, pop = d.appendleft, d.popleft for i in xrange(BIG): append(i) for i in reversed(xrange(BIG)): x = pop() if x != i: self.assertEqual(x, i) self.assertEqual(len(d), 0) def test_roundtrip_iter_init(self): d = deque(xrange(200)) e = deque(d) self.assertNotEqual(id(d), id(e)) self.assertEqual(list(d), list(e)) def test_pickle(self): d = deque(xrange(200)) s = pickle.dumps(d) e = pickle.loads(s) self.assertNotEqual(id(d), id(e)) self.assertEqual(list(d), list(e)) def test_deepcopy(self): mut = [10] d = deque([mut]) e = copy.deepcopy(d) self.assertEqual(list(d), list(e)) mut[0] = 11 self.assertNotEqual(id(d), id(e)) self.assertNotEqual(list(d), list(e)) def test_copy(self): mut = [10] d = deque([mut]) e = copy.copy(d) self.assertEqual(list(d), list(e)) mut[0] = 11 self.assertNotEqual(id(d), id(e)) self.assertEqual(list(d), list(e)) def R(seqn): 'Regular generator' for i in seqn: yield i class G: 'Sequence using __getitem__' def __init__(self, seqn): self.seqn = seqn def __getitem__(self, i): return self.seqn[i] class I: 'Sequence using iterator protocol' def __init__(self, seqn): self.seqn = seqn self.i = 0 def __iter__(self): return self def next(self): if self.i >= len(self.seqn): raise StopIteration v = self.seqn[self.i] self.i += 1 return v class Ig: 'Sequence using iterator protocol defined with a generator' def __init__(self, seqn): self.seqn = seqn self.i = 0 def __iter__(self): for val in self.seqn: yield val class X: 'Missing __getitem__ and __iter__' def __init__(self, seqn): self.seqn = seqn self.i = 0 def next(self): if self.i >= len(self.seqn): raise StopIteration v = self.seqn[self.i] self.i += 1 return v class N: 'Iterator missing next()' def __init__(self, seqn): self.seqn = seqn self.i = 0 def __iter__(self): return self class E: 'Test propagation of exceptions' def __init__(self, seqn): self.seqn = seqn self.i = 0 def __iter__(self): return self def next(self): 3/0 class S: 'Test immediate stop' def __init__(self, seqn): pass def __iter__(self): return self def next(self): raise StopIteration from itertools import chain, imap def L(seqn): 'Test multiple tiers of iterators' return chain(imap(lambda x:x, R(Ig(G(seqn))))) class TestVariousIteratorArgs(unittest.TestCase): def test_constructor(self): for s in ("123", "", range(1000), ('do', 1.2), xrange(2000,2200,5)): for g in (G, I, Ig, S, L, R): self.assertEqual(list(deque(g(s))), list(g(s))) self.assertRaises(TypeError, deque, X(s)) self.assertRaises(TypeError, deque, N(s)) self.assertRaises(ZeroDivisionError, deque, E(s)) def test_iter_with_altered_data(self): d = deque('abcdefg') it = iter(d) d.pop() self.assertRaises(RuntimeError, it.next) class Deque(deque): pass class TestSubclass(unittest.TestCase): def test_basics(self): d = Deque(xrange(100)) d.__init__(xrange(100, 200)) for i in xrange(200, 400): d.append(i) for i in reversed(xrange(-200, 0)): d.appendleft(i) self.assertEqual(list(d), range(-200, 400)) self.assertEqual(len(d), 600) left = [d.popleft() for i in xrange(250)] self.assertEqual(left, range(-200, 50)) self.assertEqual(list(d), range(50, 400)) right = [d.pop() for i in xrange(250)] right.reverse() self.assertEqual(right, range(150, 400)) self.assertEqual(list(d), range(50, 150)) d.clear() self.assertEqual(len(d), 0) def test_copy_pickle(self): d = Deque('abc') e = d.__copy__() self.assertEqual(type(d), type(e)) self.assertEqual(list(d), list(e)) e = Deque(d) self.assertEqual(type(d), type(e)) self.assertEqual(list(d), list(e)) s = pickle.dumps(d) e = pickle.loads(s) self.assertNotEqual(id(d), id(e)) self.assertEqual(type(d), type(e)) self.assertEqual(list(d), list(e)) #============================================================================== def test_main(verbose=None): import sys from test import test_sets test_classes = ( TestBasic, TestVariousIteratorArgs, TestSubclass, ) test_support.run_unittest(*test_classes) # verify reference counting if verbose and hasattr(sys, "gettotalrefcount"): import gc counts = [None] * 5 for i in xrange(len(counts)): test_support.run_unittest(*test_classes) gc.collect() counts[i] = sys.gettotalrefcount() print counts if __name__ == "__main__": test_main(verbose=True) Index: test_bisect.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_bisect.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** test_bisect.py 5 Jan 2004 10:13:34 -0000 1.10 --- test_bisect.py 29 Jan 2004 06:37:49 -0000 1.11 *************** *** 171,191 **** ['E', 'A', 'B', 'D', 'F', 'A'] - The bisect module can be used with the Queue module to implement - a priority queue (example courtesy of Fredrik Lundh): - - >>> import Queue, bisect - >>> class PriorityQueue(Queue.Queue): - ... def _put(self, item): - ... bisect.insort(self.queue, item) - ... - >>> queue = PriorityQueue(0) - >>> queue.put((2, "second")) - >>> queue.put((1, "first")) - >>> queue.put((3, "third")) - >>> queue.get() - (1, 'first') - >>> queue.get() - (2, 'second') - """ --- 171,174 ---- From rhettinger at projects.sourceforge.net Thu Jan 29 01:38:24 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 01:39:50 2004 Subject: [Python-checkins] python/dist/src/Lib Queue.py, 1.19, 1.20 mutex.py, 1.11, 1.12 pydoc.py, 1.89, 1.90 shlex.py, 1.21, 1.22 threading.py, 1.39, 1.40 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1631/Lib Modified Files: Queue.py mutex.py pydoc.py shlex.py threading.py Log Message: * Move collections.deque() in from the sandbox * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming Index: Queue.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/Queue.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Queue.py 1 Jul 2003 05:34:27 -0000 1.19 --- Queue.py 29 Jan 2004 06:37:49 -0000 1.20 *************** *** 2,5 **** --- 2,6 ---- from time import time as _time, sleep as _sleep + from collections import deque __all__ = ['Empty', 'Full', 'Queue'] *************** *** 185,189 **** def _init(self, maxsize): self.maxsize = maxsize ! self.queue = [] def _qsize(self): --- 186,190 ---- def _init(self, maxsize): self.maxsize = maxsize ! self.queue = deque() def _qsize(self): *************** *** 204,206 **** # Get an item from the queue def _get(self): ! return self.queue.pop(0) --- 205,207 ---- # Get an item from the queue def _get(self): ! return self.queue.popleft() Index: mutex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/mutex.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** mutex.py 30 Jun 2002 03:39:14 -0000 1.11 --- mutex.py 29 Jan 2004 06:37:49 -0000 1.12 *************** *** 13,21 **** """ class mutex: def __init__(self): """Create a new mutex -- initially unlocked.""" self.locked = 0 ! self.queue = [] def test(self): --- 13,23 ---- """ + from collections import deque + class mutex: def __init__(self): """Create a new mutex -- initially unlocked.""" self.locked = 0 ! self.queue = deque() def test(self): *************** *** 45,49 **** function with its argument.""" if self.queue: ! function, argument = self.queue.pop(0) function(argument) else: --- 47,51 ---- function with its argument.""" if self.queue: ! function, argument = self.queue.popleft() function(argument) else: Index: pydoc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pydoc.py,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** pydoc.py 31 Oct 2003 13:05:21 -0000 1.89 --- pydoc.py 29 Jan 2004 06:37:49 -0000 1.90 *************** *** 56,59 **** --- 56,60 ---- from repr import Repr from string import expandtabs, find, join, lower, split, strip, rfind, rstrip + from collections import deque # --------------------------------------------------------- common routines *************** *** 686,690 **** # List the mro, if non-trivial. ! mro = list(inspect.getmro(object)) if len(mro) > 2: hr.maybe() --- 687,691 ---- # List the mro, if non-trivial. ! mro = deque(inspect.getmro(object)) if len(mro) > 2: hr.maybe() *************** *** 764,768 **** while attrs: if mro: ! thisclass = mro.pop(0) else: thisclass = attrs[0][2] --- 765,769 ---- while attrs: if mro: ! thisclass = mro.popleft() else: thisclass = attrs[0][2] *************** *** 1084,1088 **** # List the mro, if non-trivial. ! mro = list(inspect.getmro(object)) if len(mro) > 2: push("Method resolution order:") --- 1085,1089 ---- # List the mro, if non-trivial. ! mro = deque(inspect.getmro(object)) if len(mro) > 2: push("Method resolution order:") *************** *** 1153,1157 **** while attrs: if mro: ! thisclass = mro.pop(0) else: thisclass = attrs[0][2] --- 1154,1158 ---- while attrs: if mro: ! thisclass = mro.popleft() else: thisclass = attrs[0][2] Index: shlex.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/shlex.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** shlex.py 20 Apr 2003 01:57:02 -0000 1.21 --- shlex.py 29 Jan 2004 06:37:49 -0000 1.22 *************** *** 10,13 **** --- 10,14 ---- import os.path import sys + from collections import deque try: *************** *** 46,54 **** self.escapedquotes = '"' self.state = ' ' ! self.pushback = [] self.lineno = 1 self.debug = 0 self.token = '' ! self.filestack = [] self.source = None if self.debug: --- 47,55 ---- self.escapedquotes = '"' self.state = ' ' ! self.pushback = deque() self.lineno = 1 self.debug = 0 self.token = '' ! self.filestack = deque() self.source = None if self.debug: *************** *** 60,64 **** if self.debug >= 1: print "shlex: pushing token " + `tok` ! self.pushback.insert(0, tok) def push_source(self, newstream, newfile=None): --- 61,65 ---- if self.debug >= 1: print "shlex: pushing token " + `tok` ! self.pushback.appendleft(tok) def push_source(self, newstream, newfile=None): *************** *** 66,70 **** if isinstance(newstream, basestring): newstream = StringIO(newstream) ! self.filestack.insert(0, (self.infile, self.instream, self.lineno)) self.infile = newfile self.instream = newstream --- 67,71 ---- if isinstance(newstream, basestring): newstream = StringIO(newstream) ! self.filestack.appendleft((self.infile, self.instream, self.lineno)) self.infile = newfile self.instream = newstream *************** *** 79,84 **** "Pop the input source stack." self.instream.close() ! (self.infile, self.instream, self.lineno) = self.filestack[0] ! self.filestack = self.filestack[1:] if self.debug: print 'shlex: popping to %s, line %d' \ --- 80,84 ---- "Pop the input source stack." self.instream.close() ! (self.infile, self.instream, self.lineno) = self.filestack.popleft() if self.debug: print 'shlex: popping to %s, line %d' \ *************** *** 89,93 **** "Get a token from the input stream (or from stack if it's nonempty)" if self.pushback: ! tok = self.pushback.pop(0) if self.debug >= 1: print "shlex: popping token " + `tok` --- 89,93 ---- "Get a token from the input stream (or from stack if it's nonempty)" if self.pushback: ! tok = self.pushback.popleft() if self.debug >= 1: print "shlex: popping token " + `tok` *************** *** 227,231 **** self.token = self.token + nextchar else: ! self.pushback.insert(0, nextchar) if self.debug >= 2: print "shlex: I see punctuation in word state" --- 227,231 ---- self.token = self.token + nextchar else: ! self.pushback.appendleft(nextchar) if self.debug >= 2: print "shlex: I see punctuation in word state" Index: threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** threading.py 5 Nov 2003 23:02:59 -0000 1.39 --- threading.py 29 Jan 2004 06:37:49 -0000 1.40 *************** *** 11,14 **** --- 11,15 ---- from time import time as _time, sleep as _sleep from traceback import format_exc as _format_exc + from collections import deque # Rename some stuff so "from threading import *" is safe *************** *** 640,644 **** self.wc = Condition(self.mon) self.limit = limit ! self.queue = [] def put(self, item): --- 641,645 ---- self.wc = Condition(self.mon) self.limit = limit ! self.queue = deque() def put(self, item): *************** *** 658,662 **** self._note("get(): queue empty") self.rc.wait() ! item = self.queue.pop(0) self._note("get(): got %s, %d left", item, len(self.queue)) self.wc.notify() --- 659,663 ---- self._note("get(): queue empty") self.rc.wait() ! item = self.queue.popleft() self._note("get(): got %s, %d left", item, len(self.queue)) self.wc.notify() From rhettinger at projects.sourceforge.net Thu Jan 29 01:38:25 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 01:39:52 2004 Subject: [Python-checkins] python/dist/src/PC/VC6 pythoncore.dsp,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/PC/VC6 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1631/PC/VC6 Modified Files: pythoncore.dsp Log Message: * Move collections.deque() in from the sandbox * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/VC6/pythoncore.dsp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pythoncore.dsp 25 Jan 2004 03:25:40 -0000 1.5 --- pythoncore.dsp 29 Jan 2004 06:37:52 -0000 1.6 *************** *** 270,273 **** --- 270,277 ---- # Begin Source File + SOURCE=..\..\Modules\collectionsmodule.c + # End Source File + # Begin Source File + SOURCE=..\..\Python\compile.c # End Source File From rhettinger at projects.sourceforge.net Thu Jan 29 01:38:25 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 01:39:55 2004 Subject: [Python-checkins] python/dist/src/PC config.c,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1631/PC Modified Files: config.c Log Message: * Move collections.deque() in from the sandbox * Add unittests, newsitem, and whatsnew * Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py * Docs are forthcoming Index: config.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/config.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** config.c 21 Jan 2004 07:54:02 -0000 1.43 --- config.c 29 Jan 2004 06:37:52 -0000 1.44 *************** *** 47,50 **** --- 47,51 ---- extern void init_random(void); extern void inititertools(void); + extern void initcollections(void); extern void initheapq(void); extern void init_bisect(void); *************** *** 137,140 **** --- 138,142 ---- {"heapq", initheapq}, {"itertools", inititertools}, + {"collections", initcollections}, {"_symtable", init_symtable}, {"mmap", initmmap}, From rhettinger at projects.sourceforge.net Thu Jan 29 02:27:47 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 02:29:02 2004 Subject: [Python-checkins] python/dist/src/Doc/lib libcollections.tex, NONE, 1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9130 Added Files: libcollections.tex Log Message: Add documentation for collections.deque(). --- NEW FILE: libcollections.tex --- \section{\module{collections} --- High-performance datatypes} \declaremodule{standard}{collections} \modulesynopsis{High-performance datatypes} \moduleauthor{Raymond Hettinger}{python@rcn.com} \sectionauthor{Raymond Hettinger}{python@rcn.com} \versionadded{2.4} This module implements high-performance datatypes. Currently, the only datatype is a deque. Future additions may include B-trees and Fibonacci heaps. \begin{funcdesc}{deque}{\optional{iterable}} Returns a new deque objected initialized left-to-right (using \method{append()}) with data from \var{iterable}. If \var{iterable} is not specified, the new deque is empty. Deques are a generalization of stacks and queues. They support thread-safe, memory efficient appends and pops from either side of the deque with approximately the same performance in either direction. \versionadded{2.4} \end{funcdesc} Deque objects support the following methods: \begin{methoddesc}{append}{x} Add \var{x} to the right side of the deque. \end{methoddesc} \begin{methoddesc}{appendleft}{x} Add \var{x} to the left side of the deque. \end{methoddesc} \begin{methoddesc}{clear}{} Remove all elements from the deque leaving it with length 0. \end{methoddesc} \begin{methoddesc}{pop}{} Remove and return an element from the right side of the deque. If no elements are present, raises a \exception{LookupError}. \end{methoddesc} \begin{methoddesc}{popleft}{} Remove and return an element from the left side of the deque. If no elements are present, raises a \exception{LookupError}. \end{methoddesc} In addition to the above, deques support iteration, membership testing using the \keyword{in} operator, \samp{len(d)}, \samp{copy.copy(d)}, \samp{copy.deepcopy(d)}, and pickling. Example: \begin{verbatim} >>> from collections import deque >>> d = deque('ghi') # make a new deque with three items >>> for elem in d: # iterate over the deque's elements print elem.upper() G H I >>> d.append('j') # add a new entry to the right side >>> d.appendleft('f') # add a new entry to the left side >>> d # show the representation of the deque deque(['f', 'g', 'h', 'i', 'j']) >>> d.pop() # return and remove the rightmost item 'j' >>> d.popleft() # return and remove the leftmost item 'f' >>> list(d) # list the contents of the deque ['g', 'h', 'i'] >>> 'h' in d # search the deque True >>> d.__init__('jkl') # use __init__ to append many elements at once >>> d deque(['g', 'h', 'i', 'j', 'k', 'l']) >>> d.clear() # empty the deque >>> d.pop() # try to pop from an empty deque Traceback (most recent call last): File "", line 1, in -toplevel- d.pop() LookupError: pop from an empty deque \end{verbatim} From rhettinger at projects.sourceforge.net Thu Jan 29 02:29:35 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 02:30:48 2004 Subject: [Python-checkins] python/dist/src/Modules collectionsmodule.c, 1.1, 1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9494 Modified Files: collectionsmodule.c Log Message: Fix spelling. Index: collectionsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/collectionsmodule.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** collectionsmodule.c 29 Jan 2004 06:37:51 -0000 1.1 --- collectionsmodule.c 29 Jan 2004 07:29:32 -0000 1.2 *************** *** 110,114 **** if (deque->len == 0) { ! PyErr_SetString(PyExc_LookupError, "pop from an emtpy deque"); return NULL; } --- 110,114 ---- if (deque->len == 0) { ! PyErr_SetString(PyExc_LookupError, "pop from an empty deque"); return NULL; } *************** *** 145,149 **** if (deque->len == 0) { ! PyErr_SetString(PyExc_LookupError, "pop from an emtpy deque"); return NULL; } --- 145,149 ---- if (deque->len == 0) { ! PyErr_SetString(PyExc_LookupError, "pop from an empty deque"); return NULL; } From rhettinger at projects.sourceforge.net Thu Jan 29 02:35:48 2004 From: rhettinger at projects.sourceforge.net (rhettinger@projects.sourceforge.net) Date: Thu Jan 29 02:37:02 2004 Subject: [Python-checkins] python/dist/src/Doc/lib lib.tex,1.224,1.225 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10447 Modified Files: lib.tex Log Message: Add documentation for collections.deque(). Index: lib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/lib.tex,v retrieving revision 1.224 retrieving revision 1.225 diff -C2 -d -r1.224 -r1.225 *** lib.tex 14 Oct 2003 21:45:59 -0000 1.224 --- lib.tex 29 Jan 2004 07:35:45 -0000 1.225 *************** *** 126,129 **** --- 126,130 ---- \input{libwhrandom} \input{libbisect} + \input{libcollections} \input{libheapq} \input{libarray} From fdrake at projects.sourceforge.net Thu Jan 29 10:13:11 2004 From: fdrake at projects.sourceforge.net (fdrake@projects.sourceforge.net) Date: Thu Jan 29 10:14:28 2004 Subject: [Python-checkins] python/dist/src/Doc Makefile.deps,1.115,1.116 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30594 Modified Files: Makefile.deps Log Message: update dependency information Index: Makefile.deps =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile.deps,v retrieving revision 1.115 retrieving revision 1.116 diff -C2 -d -r1.115 -r1.116 *** Makefile.deps 21 Oct 2003 17:25:05 -0000 1.115 --- Makefile.deps 29 Jan 2004 15:13:08 -0000 1.116 *************** *** 285,288 **** --- 285,289 ---- lib/libpopen2.tex \ lib/libbisect.tex \ + lib/libcollections.tex \ lib/libheapq.tex \ lib/libmimetypes.tex \ From goodger at projects.sourceforge.net Thu Jan 29 14:59:59 2004 From: goodger at projects.sourceforge.net (goodger@projects.sourceforge.net) Date: Thu Jan 29 15:02:32 2004 Subject: [Python-checkins] python/nondist/peps pep-0327.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16029 Added Files: pep-0327.txt Log Message: Added PEP 327, Decimal Data Type, by Facundo Batista. Could use more editing. --- NEW FILE: pep-0327.txt --- PEP: 327 Title: Decimal Data Type Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/01/29 19:59:56 $ Author: Facundo Batista Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 17-Oct-2003 Python-Version: 2.4 Post-History: 30-Nov-2003, 02-Jan-2004 Abstract ======== The idea is to have a Decimal data type, for every use where decimals are needed but binary floating point is too inexact. The Decimal data type will support the Python standard functions and operations, and must comply the decimal arithmetic ANSI standard X3.274-1996 [1]_. Decimal will be floating point (as opposed to fixed point) and will have bounded precision (the precision is the upper limit on the quantity of significant digits in a result). This work is based on code and test functions written by Eric Price, Aahz and Tim Peters. Actually I'll work on the Decimal.py code in the sandbox (at python/nondist/sandbox/decimal in the SourceForge CVS repository). Much of the explanation in this PEP is taken from Cowlishaw's work [2]_ and comp.lang.python. Motivation ========== Here I'll expose the reasons of why I think a Decimal data type is needed and why others numeric data types are not enough. I wanted a Money data type, and after proposing a pre-PEP in comp.lang.python, the community agreed to have a numeric data type with the needed arithmetic behaviour, and then build Money over it: all the considerations about quantity of digits after the decimal point, rounding, etc., will be handled through Money. It is not the purpose of this PEP to have a data type that can be used as Money without further effort. One of the biggest advantages of implementing a standard is that someone already thought all the creepy cases for you. And to a standard GvR redirected me: Mike Cowlishaw's General Decimal Arithmetic specification [2]_. This document defines a general purpose decimal arithmetic. A correct implementation of this specification will conform to the decimal arithmetic defined in ANSI/IEEE standard 854-1987, except for some minor restrictions, and will also provide unrounded decimal arithmetic and integer arithmetic as proper subsets. The problem with binary float ----------------------------- In decimal math, there are many numbers that can't be represented with a fixed number of decimal digits, e.g. 1/3 = 0.3333333333....... In base 2 (the way that standard floating point is calculated), 1/2 = 0.1, 1/4 = 0.01, 1/8 = 0.001, etc. Decimal 0.2 equals 2/10 equals 1/5, resulting in the binary fractional number 0.001100110011001... As you can see, the problem is that some decimal numbers can't be represented exactly in binary, resulting in small roundoff errors. So we need a decimal data type that represents exactly decimal numbers. Instead of a binary data type, we need a decimal one. Why floating point? ------------------- So we go to decimal, but why *floating point*? Floating point numbers use a fixed quantity of digits (precision) to represent a number, working with an exponent when the number gets too big or too small. For example, with a precision of 5:: 1234 ==> 1234e0 12345 ==> 12345e0 123456 ==> 12345e1 In contrast, we have the example of a ``long`` integer with infinite precision, meaning that you can have the number as big as you want, and you'll never lose any information. In a fixed point number, the position of the decimal point is fixed. For a fixed point data type, check Tim Peter's FixedPoint at SourceForge [4]_. I'll go for floating point because it's easier to implement the arithmetic behaviour of the standard, and then you can implement a fixed point data type over Decimal. But why can't we have a floating point number with infinite precision? It's not so easy, because of inexact divisions. E.g.: 1/3 = 0.3333333333333... ad infinitum. In this case you should store a infinite amount of 3s, which takes too much memory, ;). John Roth proposed to eliminate the division operator and force the user to use an explicit method, just to avoid this kind of trouble. This generated adverse reactions in comp.lang.python, as everybody wants to have support for the ``/`` operator in a numeric data type. With this exposed maybe you're thinking "Hey! Can we just store the 1 and the 3 as numerator and denominator?", which take us to the next point. Why not rational ---------------- Rational numbers are stored using two integer numbers, the numerator and the denominator. This implies that the arithmetic operations can't be executed directly (e.g. to add two rational numbers you first need to calculate the common denominator). Quoting Alex Martelli: The performance implications of the fact that summing two rationals (which take O(M) and O(N) space respectively) gives a rational which takes O(M+N) memory space is just too troublesome. There are excellent Rational implementations in both pure Python and as extensions (e.g., gmpy), but they'll always be a "niche market" IMHO. Probably worth PEPping, not worth doing without Decimal -- which is the right way to represent sums of money, a truly major use case in the real world. Anyway, if you're interested in this data type, you maybe will want to take a look at PEP 239: Adding a Rational Type to Python. So, what do we have? -------------------- The result is a Decimal data type, with bounded precision and floating point. Will it be useful? I can't say it better than Alex Martelli: Python (out of the box) doesn't let you have binary floating point numbers *with whatever precision you specify*: you're limited to what your hardware supplies. Decimal, be it used as a fixed or floating point number, should suffer from no such limitation: whatever bounded precision you may specify on number creation (your memory permitting) should work just as well. Most of the expense of programming simplicity can be hidden from application programs and placed in a suitable decimal arithmetic type. As per http://www2.hursley.ibm.com/decimal/, *a single data type can be used for integer, fixed-point, and floating-point decimal arithmetic* -- and for money arithmetic which doesn't drive the application programmer crazy. There are several uses for such a data type. As I said before, I will use it as base for Money. In this case the bounded precision is not an issue; quoting Tim Peters: A precision of 20 would be way more than enough to account for total world economic output, down to the penny, since the beginning of time. General Decimal Arithmetic Specification ======================================== Here I'll include information and descriptions that are part of the specification [2]_ (the structure of the number, the context, etc.). All the requirements included in this section are not for discussion (barring typos or other mistakes), as they are in the standard, and the PEP is just for implementing the standard. Because of copyright restrictions, I can not copy here explanations taken from the specification, so I'll try to explain it in my own words. I firmly encourage you to read the original specification document [2]_ for details or if you have any doubt. The Arithmetic Model -------------------- The specification is based on a decimal arithmetic model, as defined by the relevant standards: IEEE 854 [3]_, ANSI X3-274 [1]_, and the proposed revision [5]_ of IEEE 754 [6]_. The model has three components: - Numbers: just the values that the operation uses as input or output. - Operations: addition, multiplication, etc. - Context: a set of parameters and rules that the user can select and which govern the results of operations (for example, the precision to be used). Numbers ------- Numbers may be finite or special values. The former can be represented exactly. The latter are infinites and undefined (such as 0/0). Finite numbers are defined by three parameters: - Sign: 0 (positive) or 1 (negative). - Coefficient: a non-negative integer. - Exponent: a signed integer, the power of ten of the coefficient multiplier. The numerical value of a finite number is given by:: (-1)**sign * coefficient * 10**exponent Special values are named as following: - Infinity: a value which is infinitely large. Could be positive or negative. - Quiet NaN ("qNaN"): represent undefined results (*Not a Number*). Does not cause an Invalid operation condition. The sign in a NaN has no meaning. - Signaling NaN ("sNaN"): also *Not a Number*, but will cause an Invalid operation condition if used in any operation. Context ------- The context is a set of parameters and rules that the user can select and which govern the results of operations (for example, the precision to be used). The context gets that name because surrounds the Decimal numbers. It's up to the implementation to work with one or several contexts, but definitely the idea is not to get a context per Decimal number. These definitions don't affect the internal storage of the Decimal numbers, just the way that the arithmetic operations are performed. The context is defined by the following parameters: - Precision: The maximum number of significant digits that can result from an arithmetic operation (integer > 0). - Rounding: The name of the algorithm to be used when rounding is necessary, one of "round-down", "round-half-up", "round-half-even", "round-ceiling", "round-floor", "round-half-down", and "round-up". See `Rounding Algorithms`_ below. - Flags and trap-enablers: `Exceptional conditions`_ are grouped into signals, controllable individually, each consisting of a flag (boolean, set when the signal occurs) and a trap-enabler (a boolean that controls behavior). The signals are: "clamped", "division-by-zero", "inexact", "invalid-operation", "overflow", "rounded", "subnormal" and "underflow". Default Contexts ---------------- The specification defines two default contexts, which should be easily selectable by the user. Basic Default Context: - flags: all set to 0 - trap-enablers: inexact, rounded, and subnormal are set to 0; all others are set to 1 - precision: is set to 9 - rounding: is set to round-half-up Extended Default Context: - flags: all set to 0 - trap-enablers: all set to 0 - precision: is set to the designated single precision - rounding: is set to round-half-even Exceptional Conditions ---------------------- The table below lists the exceptional conditions that may arise during the arithmetic operations, the corresponding signal, and the defined result. For details, see the specification [2]_. ==================== ================= =================================== Condition Signal Result ==================== ================= =================================== Clamped clamped see spec [2]_ Conversion syntax invalid-operation [0,qNaN] Division by zero division-by-zero [sign,inf] Division impossible invalid-operation [0,qNaN] Division undefined invalid-operation [0,qNaN] Inexact inexact unchanged Insufficient storage [0,qNaN] Invalid context invalid-operation [0,qNaN] Invalid operation invalid-operation [0,qNaN] (or [s,qNaN] or [s,qNaN,d] when the cause is a signaling NaN) Overflow overflow depends on the rounding mode Rounded rounded unchanged Subnormal subnormal unchanged Underflow underflow see spec [2]_ ==================== ================= =================================== Rounding Algorithms ------------------- ``round-down``: The discarded digits are ignored; the result is unchanged (round toward 0, truncate):: 1.123 --> 1.12 1.128 --> 1.12 1.125 --> 1.12 1.135 --> 1.13 ``round-half-up``: If the discarded digits represent greater than or equal to half (0.5) then the result should be incremented by 1; otherwise the discarded digits are ignored:: 1.123 --> 1.12 1.128 --> 1.13 1.125 --> 1.13 1.135 --> 1.14 ``round-half-even``: If the discarded digits represent greater than half (0.5) then the result coefficient is incremented by 1; if they represent less than half, then the result is not adjusted; otherwise the result is unaltered if its rightmost digit is even, or incremented by 1 if its rightmost digit is odd (to make an even digit):: 1.123 --> 1.12 1.128 --> 1.13 1.125 --> 1.12 1.135 --> 1.14 ``round-ceiling``: If all of the discarded digits are zero or if the sign is negative the result is unchanged; otherwise, the result is incremented by 1:: 1.123 --> 1.13 1.128 --> 1.13 -1.123 --> -1.12 -1.128 --> -1.12 ``round-floor``: If all of the discarded digits are zero or if the sign is positive the result is unchanged; otherwise, the absolute value of the result is incremented by 1:: 1.123 --> 1.12 1.128 --> 1.12 -1.123 --> -1.13 -1.128 --> -1.13 ``round-half-down``: If the discarded digits represent greater than half (0.5) then the result is incremented by 1; otherwise the discarded digits are ignored:: 1.123 --> 1.12 1.128 --> 1.13 1.125 --> 1.12 1.135 --> 1.13 ``round-up``: If all of the discarded digits are zero the result is unchanged, otherwise the result is incremented by 1 (round away from 0):: 1.123 --> 1.13 1.128 --> 1.13 1.125 --> 1.13 1.135 --> 1.14 Rationale ========= I must separate the requirements in two sections. The first is to comply with the ANSI standard. All the requirements for this are specified in the Mike Cowlishaw's work [2]_. He also provided a **comprehensive** suite of test cases. The second section of requirements (standard Python functions support, usability, etc.) is detailed from here, where I'll include all the decisions made and why, and all the subjects still being discussed. Explicit construction --------------------- The explicit construction does not get affected by the context (there is no rounding, no limits by the precision, etc.), because the context affects just operations' results. **From int or long**: There's no loss and no need to specify any other information:: Decimal(35) Decimal(-124) **From string**: Strings with floats in normal and engineering notation will be supported. In this transformation there is no loss of information, as the string is directly converted to Decimal (there is not an intermediate conversion through float):: Decimal("-12") Decimal("23.2e-7") **From float**: The initial discussion on this item was what should happen when passing floating point to the constructor: 1. ``Decimal(1.1) == Decimal('1.1')`` 2. ``Decimal(1.1) == Decimal('110000000000000008881784197001252...e-51')`` 3. an exception is raised Several people alleged that (1) is the better option here, because it's what you expect when writing ``Decimal(1.1)``. And quoting John Roth, it's easy to implement: It's not at all difficult to find where the actual number ends and where the fuzz begins. You can do it visually, and the algorithms to do it are quite well known. But If I *really* want my number to be ``Decimal('110000000000000008881784197001252...e-51')``, why can not write ``Decimal(1.1)``? Why should I expect Decimal to be "rounding" it? Remember that ``1.1`` *is* binary floating point, so I can predict the result. It's not intuitive to a beginner, but that's the way it is. Anyway, Paul Moore shown that (1) can't be, because:: (1) says D(1.1) == D('1.1') but 1.1 == 1.1000000000000001 so D(1.1) == D(1.1000000000000001) together: D(1.1000000000000001) == D('1.1') which is wrong, because if I write ``Decimal('1.1')`` it is exact, not ``D(1.1000000000000001)``. He also proposed to have an explicit conversion to float. bokr says you need to put the precision in the constructor and mwilson has the idea to:: d = Decimal (1.1, 1) # take float value to 1 decimal place d = Decimal (1.1) # gets `places` from pre-set context But Alex Martelli says that: Constructing with some specified precision would be fine. Thus, I think "construction from float with some default precision" runs a substantial risk of tricking naive users. So, I think that the best solution is to have a parameter that says in which position after the decimal point you apply a round-half-up rounding. If you do not specify this parameter, you get an exact conversion. In this way:: Decimal(1.1, 2) == Decimal('1.1') Decimal(1.1, 16) == Decimal('1.1000000000000001') Decimal(1.1) == Decimal('110000000000000008881784197001252...e-51') **From tuples**: Aahz suggested to construct from tuples: it's easier to implement ``eval()``'s round trip and "someone who has numeric values representing a Decimal does not need to convert them to a string." The structure will be a tuple of three elements: sign, number and exponent. The sign is 1 or 0, the number is a tuple of decimal digits and the exponent is a signed int or long:: Decimal((1, (3, 2, 2, 5), -2)) # for -32.25 **From Decimal**: No mystery here, just a copy. **Syntax to all the cases**:: Decimal(value, [decimal_digits]) where ``value`` can be any of the data types just mentioned and ``decimal_digits`` is allowed only when value is float. Implicit construction --------------------- As the implicit construction is the consequence of an operation, it will be affected by the context as is detailed in each point. John Roth suggested that "The other type should be handled in the same way the decimal() constructor would handle it". But Alex Martelli thinks that this total breach with Python tradition would be a terrible mistake. 23+"43" is NOT handled in the same way as 23+int("45"), and a VERY good thing that is too. It's a completely different thing for a user to EXPLICITLY indicate they want construction (conversion) and to just happen to sum two objects one of which by mistake could be a string. So, here I define the behaviour again for each data type. **From int or long**: Aahz suggested the need of an explicit conversion from int, but also thinks it's OK if the precision in the current Context is not exceeded; in that case you raise ValueError. Votes in comp.lang.python agreed with this. **From string**: Everybody agrees to raise an exception here. **From float**: Aahz is strongly opposed to interact with float, suggesting an explicit conversion: The problem is that Decimal is capable of greater precision, accuracy, and range than float. But in Python it's OK to do ``35 + 1.1``, so why can't I do ``Decimal(35) + 1.1``? We agree that when a naive user writes ``1.1`` doesn't know that he's being inexact, but that happens in the both examples I just mentioned. So, what should we do? I propose to allow the interaction with float, making an exact conversion and raising ValueError if exceeds the precision in the current context (this is maybe too tricky, because for example with a precision of 9, ``Decimal(35) + 1.2`` is OK but ``Decimal(35) + 1.1`` raises an error). **From Decimal**: There isn't any issue here. Use of Context -------------- In the last pre-PEP I said that "The Context must be omnipresent, meaning that changes to it affects all the current and future Decimal instances". I was wrong. In response, John Roth said: The context should be selectable for the particular usage. That is, it should be possible to have several different contexts in play at one time in an application. In comp.lang.python, Aahz explained that the idea is to have a "context per thread". So, all the instances of a thread belongs to a context, and you can change a context in thread A (and the behaviour of the instances of that thread) without changing nothing in thread B. Also, and again correcting me, he said: (the) Context applies only to operations, not to Decimal instances; changing the Context does not affect existing instances if there are no operations on them. Arguing about special cases when there's need to perform operations with other rules that those of the current context, Tim Peters said that the context will have the operations as methods. This way, the user "can create whatever private context object(s) it needs, and spell arithmetic as explicit method calls on its private context object(s), so that the default thread context object is neither consulted nor modified". Python Usability ---------------- - Decimal should support the basic arithmetic (``+, -, *, /, //, **, %, divmod``) and comparison (``==, !=, <, >, <=, >=, cmp``) operators in the following cases (check `Implicit Construction`_ to see what types could OtherType be, and what happens in each case): - Decimal op Decimal - Decimal op otherType - otherType op Decimal - Decimal op= Decimal - Decimal op= otherType - Decimal should support unary operators (``-, +, abs``). - Decimal should support the built-in methods: - min, max - float, int, long - str, repr - hash - copy, deepcopy - bool (0 is false, otherwise true) - Calling repr() should do round trip, meaning that:: m = Decimal(...) m == eval(repr(m)) - Decimal should be immutable. Reference Implementation ======================== To be included later: - code - test code - documentation References ========== .. [1] ANSI standard X3.274-1996 (Programming Language REXX): http://www.rexxla.org/Standards/ansi.html .. [2] General Decimal Arithmetic specification (Cowlishaw): http://www2.hursley.ibm.com/decimal/decarith.html (related documents and links at http://www2.hursley.ibm.com/decimal/) .. [3] ANSI/IEEE standard 854-1987 (Radix-Independent Floating-Point Arithmetic): http://www.cs.berkeley.edu/~ejr/projects/754/private/drafts/854-1987/dir.html (unofficial text; official copies can be ordered from http://standards.ieee.org/catalog/ordering.html) .. [4] Tim Peter's FixedPoint at SourceForge: http://fixedpoint.sourceforge.net/ .. [5] IEEE 754 revision: http://grouper.ieee.org/groups/754/revision.html .. [6] IEEE 754 references: http://babbage.cs.qc.edu/courses/cs341/IEEE-754references.html Copyright ========= This document has been placed in the public domain. .. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End: From goodger at projects.sourceforge.net Thu Jan 29 15:00:35 2004 From: goodger at projects.sourceforge.net (goodger@projects.sourceforge.net) Date: Thu Jan 29 15:02:44 2004 Subject: [Python-checkins] python/nondist/peps pep-0000.txt,1.262,1.263 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16396 Modified Files: pep-0000.txt Log Message: added PEP 327 Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.262 retrieving revision 1.263 diff -C2 -d -r1.262 -r1.263 *** pep-0000.txt 6 Jan 2004 15:34:49 -0000 1.262 --- pep-0000.txt 29 Jan 2004 20:00:32 -0000 1.263 *************** *** 122,126 **** S 324 popen5 - New POSIX process module Astrand S 325 Resource-Release Support for Generators Pedroni ! S 326 A Case for Top and Bottom Values Carlson S 754 IEEE 754 Floating Point Special Values Warnes --- 122,126 ---- S 324 popen5 - New POSIX process module Astrand S 325 Resource-Release Support for Generators Pedroni ! S 326 A Case for Top and Bottom Values Carlson, Reedy S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 345,349 **** S 324 popen5 - New POSIX process module Astrand S 325 Resource-Release Support for Generators Pedroni ! S 326 A Case for Top and Bottom Values Carlson SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes --- 345,350 ---- S 324 popen5 - New POSIX process module Astrand S 325 Resource-Release Support for Generators Pedroni ! S 326 A Case for Top and Bottom Values Carlson, Reedy ! S 327 Decimal Data Type Batista SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 371,374 **** --- 372,376 ---- Astrand, Peter astrand@lysator.liu.se Barrett, Paul barrett@stsci.edu + Batista, Facundo facundo@taniquetil.com.ar Baxter, Anthony anthony@interlink.com.au Bellman, Thomas bellman+pep-divmod@lysator.liu.se *************** *** 419,422 **** --- 421,425 ---- Petrone, Jason jp@demonseed.net Prescod, Paul paul@prescod.net + Reedy, Terry tjreedy@udel.edu Reifschneider, Sean jafo-pep@tummy.com Riehl, Jonathan jriehl@spaceship.com From goodger at projects.sourceforge.net Thu Jan 29 15:17:09 2004 From: goodger at projects.sourceforge.net (goodger@projects.sourceforge.net) Date: Thu Jan 29 15:18:30 2004 Subject: [Python-checkins] python/nondist/peps pep-0000.txt,1.263,1.264 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26930 Modified Files: pep-0000.txt Log Message: updated Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.263 retrieving revision 1.264 diff -C2 -d -r1.263 -r1.264 *** pep-0000.txt 29 Jan 2004 20:00:32 -0000 1.263 --- pep-0000.txt 29 Jan 2004 20:17:06 -0000 1.264 *************** *** 123,126 **** --- 123,127 ---- S 325 Resource-Release Support for Generators Pedroni S 326 A Case for Top and Bottom Values Carlson, Reedy + S 327 Decimal Data Type Batista S 754 IEEE 754 Floating Point Special Values Warnes From goodger at projects.sourceforge.net Sat Jan 31 00:14:18 2004 From: goodger at projects.sourceforge.net (goodger@projects.sourceforge.net) Date: Sat Jan 31 00:15:54 2004 Subject: [Python-checkins] python/nondist/peps pep-0328.txt, NONE, 1.1 pep-0000.txt, 1.264, 1.265 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17705 Modified Files: pep-0000.txt Added Files: pep-0328.txt Log Message: Added PEP 328, Imports: Multi-Line and Absolute/Relative, by Aahz --- NEW FILE: pep-0328.txt --- PEP: 328 Title: Imports: multi-line and absolute/relative Version: $Revision: 1.1 $ Last-Modified: $Date: 2004/01/31 05:14:16 $ Author: Aahz `__ - `Re: Python-Dev Digest, Vol 5, Issue 57 `__ - `Relative import `__ - `Another Strategy for Relative Import `__ Copyright ========= This document has been placed in the public domain. .. Local Variables: mode: indented-text indent-tabs-mode: nil sentence-end-double-space: t fill-column: 70 End: Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.264 retrieving revision 1.265 diff -C2 -d -r1.264 -r1.265 *** pep-0000.txt 29 Jan 2004 20:17:06 -0000 1.264 --- pep-0000.txt 31 Jan 2004 05:14:15 -0000 1.265 *************** *** 124,127 **** --- 124,128 ---- S 326 A Case for Top and Bottom Values Carlson, Reedy S 327 Decimal Data Type Batista + S 328 Imports: Multi-Line and Absolute/Relative Aahz S 754 IEEE 754 Floating Point Special Values Warnes *************** *** 348,351 **** --- 349,353 ---- S 326 A Case for Top and Bottom Values Carlson, Reedy S 327 Decimal Data Type Batista + S 328 Imports: Multi-Line and Absolute/Relative Aahz SR 666 Reject Foolish Indentation Creighton S 754 IEEE 754 Floating Point Special Values Warnes From goodger at projects.sourceforge.net Sat Jan 31 00:19:28 2004 From: goodger at projects.sourceforge.net (goodger@projects.sourceforge.net) Date: Sat Jan 31 00:21:01 2004 Subject: [Python-checkins] python/nondist/peps pep-0328.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22399 Modified Files: pep-0328.txt Log Message: title capitalization Index: pep-0328.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0328.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0328.txt 31 Jan 2004 05:14:16 -0000 1.1 --- pep-0328.txt 31 Jan 2004 05:19:25 -0000 1.2 *************** *** 1,4 **** PEP: 328 ! Title: Imports: multi-line and absolute/relative Version: $Revision$ Last-Modified: $Date$ --- 1,4 ---- PEP: 328 ! Title: Imports: Multi-Line and Absolute/Relative Version: $Revision$ Last-Modified: $Date$ From loewis at projects.sourceforge.net Sat Jan 31 07:34:19 2004 From: loewis at projects.sourceforge.net (loewis@projects.sourceforge.net) Date: Sat Jan 31 07:35:55 2004 Subject: [Python-checkins] python/dist/src/Misc ACKS, 1.257, 1.258 NEWS, 1.924, 1.925 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4650/Misc Modified Files: ACKS NEWS Log Message: Patch #874083: Bluetooth support for socket module. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.257 retrieving revision 1.258 diff -C2 -d -r1.257 -r1.258 *** ACKS 5 Jan 2004 10:13:34 -0000 1.257 --- ACKS 31 Jan 2004 12:34:16 -0000 1.258 *************** *** 178,181 **** --- 178,182 ---- Russell Finn Nils Fischbeck + Frederik Fix Hernán Martínez Foffani Doug Fort Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.924 retrieving revision 1.925 diff -C2 -d -r1.924 -r1.925 *** NEWS 29 Jan 2004 06:37:50 -0000 1.924 --- NEWS 31 Jan 2004 12:34:16 -0000 1.925 *************** *** 122,125 **** --- 122,128 ---- ----------------- + - The socket module now supports Bluetooth sockets, if the + system has + - Added a collections module containing a new datatype, deque(), offering high-performance, thread-safe, memory friendly appends From loewis at projects.sourceforge.net Sat Jan 31 07:34:19 2004 From: loewis at projects.sourceforge.net (loewis@projects.sourceforge.net) Date: Sat Jan 31 07:35:59 2004 Subject: [Python-checkins] python/dist/src configure, 1.436, 1.437 configure.in, 1.447, 1.448 pyconfig.h.in, 1.90, 1.91 Message-ID: Update of /cvsroot/python/python/dist/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4650 Modified Files: configure configure.in pyconfig.h.in Log Message: Patch #874083: Bluetooth support for socket module. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.436 retrieving revision 1.437 diff -C2 -d -r1.436 -r1.437 *** configure 17 Jan 2004 04:04:09 -0000 1.436 --- configure 31 Jan 2004 12:34:15 -0000 1.437 *************** *** 1,4 **** #! /bin/sh ! # From configure.in Revision: 1.445 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. --- 1,4 ---- #! /bin/sh ! # From configure.in Revision: 1.447 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.57 for python 2.4. *************** *** 3009,3013 **** # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! SunOS/4*|Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. --- 3009,3013 ---- # Check for unsupported systems case $ac_sys_system/$ac_sys_release in ! Linux*/1*) echo This system \($ac_sys_system/$ac_sys_release\) is no longer supported. echo See README for details. *************** *** 4350,4353 **** --- 4350,4354 ---- + for ac_header in dlfcn.h fcntl.h grp.h limits.h langinfo.h \ libintl.h locale.h ncurses.h poll.h pthread.h \ *************** *** 4357,4361 **** sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ ! sys/resource.h netpacket/packet.h sysexits.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` --- 4358,4362 ---- sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ ! sys/resource.h netpacket/packet.h sysexits.h bluetooth/bluetooth.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` *************** *** 9363,9367 **** echo "${ECHO_T}$SO" >&6 # LDSHARED is the ld *command* used to create shared library ! # -- "ld" on SunOS 4.x.x, "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) --- 9364,9368 ---- echo "${ECHO_T}$SO" >&6 # LDSHARED is the ld *command* used to create shared library ! # -- "cc -G" on SunOS 5.x, "ld -shared" on IRIX 5 # (Shared libraries in this instance are shared modules to be loaded into # Python, as opposed to building Python itself as a shared library.) *************** *** 9381,9385 **** IRIX/5*) LDSHARED="ld -shared";; IRIX*/6*) LDSHARED="ld ${SGI_ABI} -shared -all";; - SunOS/4*) LDSHARED="ld";; SunOS/5*) if test "$GCC" = "yes" --- 9382,9385 ---- *************** *** 15519,15572 **** echo "${ECHO_T}$works" >&6 - if test "$have_prototypes" = yes; then - bad_prototypes=no - echo "$as_me:$LINENO: checking for bad exec* prototypes" >&5 - echo $ECHO_N "checking for bad exec* prototypes... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - /* confdefs.h. */ - _ACEOF - cat confdefs.h >>conftest.$ac_ext - cat >>conftest.$ac_ext <<_ACEOF - /* end confdefs.h. */ - #include - int - main () - { - char **t;execve("@",t,t); - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : - else - echo "$as_me: failed program was:" >&5 - sed 's/^/| /' conftest.$ac_ext >&5 - - - cat >>confdefs.h <<\_ACEOF - #define BAD_EXEC_PROTOTYPES 1 - _ACEOF - - bad_prototypes=yes - - fi - rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:$LINENO: result: $bad_prototypes" >&5 - echo "${ECHO_T}$bad_prototypes" >&6 - fi - # check if sockaddr has sa_len member echo "$as_me:$LINENO: checking if sockaddr has sa_len member" >&5 --- 15519,15522 ---- Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.447 retrieving revision 1.448 diff -C2 -d -r1.447 -r1.448 *** configure.in 17 Jan 2004 14:19:43 -0000 1.447 --- configure.in 31 Jan 2004 12:34:16 -0000 1.448 *************** *** 919,923 **** sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ ! sys/resource.h netpacket/packet.h sysexits.h) AC_HEADER_DIRENT AC_HEADER_MAJOR --- 919,923 ---- sys/param.h sys/poll.h sys/select.h sys/socket.h sys/time.h sys/times.h \ sys/un.h sys/utsname.h sys/wait.h pty.h term.h libutil.h \ ! sys/resource.h netpacket/packet.h sysexits.h bluetooth/bluetooth.h) AC_HEADER_DIRENT AC_HEADER_MAJOR Index: pyconfig.h.in =================================================================== RCS file: /cvsroot/python/python/dist/src/pyconfig.h.in,v retrieving revision 1.90 retrieving revision 1.91 diff -C2 -d -r1.90 -r1.91 *** pyconfig.h.in 17 Jan 2004 14:19:43 -0000 1.90 --- pyconfig.h.in 31 Jan 2004 12:34:16 -0000 1.91 *************** *** 38,41 **** --- 38,44 ---- #undef HAVE_ALTZONE + /* Define to 1 if you have the header file. */ + #undef HAVE_BLUETOOTH_BLUETOOTH_H + /* Define if nice() returns success/failure instead of the new priority. */ #undef HAVE_BROKEN_NICE *************** *** 819,832 **** #undef _OSF_SOURCE - /* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ - #undef _POSIX_1_SOURCE - /* Define to activate features from IEEE Stds 1003.1-2001 */ #undef _POSIX_C_SOURCE - /* Define to 1 if you need to in order for `stat' and other things to work. */ - #undef _POSIX_SOURCE - /* Define if you have POSIX threads, and your system does not define that. */ #undef _POSIX_THREADS --- 822,828 ---- From loewis at projects.sourceforge.net Sat Jan 31 07:34:19 2004 From: loewis at projects.sourceforge.net (loewis@projects.sourceforge.net) Date: Sat Jan 31 07:36:01 2004 Subject: [Python-checkins] python/dist/src/Modules socketmodule.c, 1.281, 1.282 socketmodule.h, 1.9, 1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4650/Modules Modified Files: socketmodule.c socketmodule.h Log Message: Patch #874083: Bluetooth support for socket module. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.281 retrieving revision 1.282 diff -C2 -d -r1.281 -r1.282 *** socketmodule.c 30 Dec 2003 11:14:01 -0000 1.281 --- socketmodule.c 31 Jan 2004 12:34:16 -0000 1.282 *************** *** 1013,1016 **** --- 1013,1078 ---- #endif + #ifdef HAVE_BLUETOOTH_BLUETOOTH_H + case AF_BLUETOOTH: + { + switch( s->sock_proto ) + { + case BTPROTO_L2CAP: + { + struct sockaddr_l2* addr = (struct sockaddr_l2*) &(s->sock_addr).bt_l2; + bdaddr_t* bdaddr = &(addr->l2_bdaddr); + + addr->l2_family = AF_BLUETOOTH; + if( !PyArg_ParseTuple(args, "(iiiiii)i", &bdaddr->b[0], &bdaddr->b[1], &bdaddr->b[2], &bdaddr->b[3], &bdaddr->b[4], &bdaddr->b[5], &addr->l2_psm) ) + { + PyErr_SetString(socket_error, "getsockaddrarg: wrong format"); + return 0; + } + + *addr_ret = (struct sockaddr *) addr; + *len_ret = sizeof *addr; + return 1; + } + case BTPROTO_RFCOMM: + { + struct sockaddr_rc* addr = (struct sockaddr_rc*) &(s->sock_addr).bt_rc; + bdaddr_t* bdaddr = &(addr->rc_bdaddr); + + addr->rc_family = AF_BLUETOOTH; + if( !PyArg_ParseTuple(args, "(iiiiii)i", &bdaddr->b[0], &bdaddr->b[1], &bdaddr->b[2], &bdaddr->b[3], &bdaddr->b[4], &bdaddr->b[5], &addr->rc_channel) ) + { + PyErr_SetString(socket_error, "getsockaddrarg: wrong format"); + return 0; + } + + *addr_ret = (struct sockaddr *) addr; + *len_ret = sizeof *addr; + return 1; + } + case BTPROTO_SCO: + { + struct sockaddr_sco* addr = (struct sockaddr_sco*) &(s->sock_addr).bt_sco; + bdaddr_t* bdaddr = &(addr->sco_bdaddr); + + addr->sco_family = AF_BLUETOOTH; + if( !PyArg_ParseTuple(args, "iiiiii", &bdaddr->b[0], &bdaddr->b[1], &bdaddr->b[2], &bdaddr->b[3], &bdaddr->b[4], &bdaddr->b[5]) ) + { + PyErr_SetString(socket_error, "getsockaddrarg: wrong format"); + return 0; + } + + *addr_ret = (struct sockaddr *) addr; + *len_ret = sizeof *addr; + return 1; + } + default: + { + PyErr_SetString(socket_error, "getsockaddrarg: unknown Bluetooth protocol"); + return 0; + } + } + } + #endif + #ifdef HAVE_NETPACKET_PACKET_H case AF_PACKET: *************** *** 1086,1089 **** --- 1148,1180 ---- #endif + #ifdef HAVE_BLUETOOTH_BLUETOOTH_H + case AF_BLUETOOTH: + { + switch(s->sock_proto) + { + case BTPROTO_L2CAP: + { + *len_ret = sizeof (struct sockaddr_l2); + return 1; + } + case BTPROTO_RFCOMM: + { + *len_ret = sizeof (struct sockaddr_rc); + return 1; + } + case BTPROTO_SCO: + { + *len_ret = sizeof (struct sockaddr_sco); + return 1; + } + default: + { + PyErr_SetString(socket_error, "getsockaddrlen: unknown BT protocol"); + return 0; + } + } + } + #endif + #ifdef HAVE_NETPACKET_PACKET_H case AF_PACKET: *************** *** 3574,3577 **** --- 3665,3678 ---- PyModule_AddIntConstant(m, "AF_ROSE", AF_ROSE); #endif + + #ifdef HAVE_BLUETOOTH_BLUETOOTH_H + PyModule_AddIntConstant(m, "AF_BLUETOOTH", AF_BLUETOOTH); + PyModule_AddIntConstant(m, "BTPROTO_L2CAP", BTPROTO_L2CAP); + PyModule_AddIntConstant(m, "BTPROTO_SCO", BTPROTO_SCO); + PyModule_AddIntConstant(m, "BTPROTO_RFCOMM", BTPROTO_RFCOMM); + PyModule_AddObject(m, "BDADDR_ANY", Py_BuildValue( "iiiiii", 0,0,0,0,0,0 ) ); + PyModule_AddObject(m, "BDADDR_LOCAL", Py_BuildValue( "iiiiii", 0,0,0,0xff,0xff,0xff ) ); + #endif + #ifdef HAVE_NETPACKET_PACKET_H PyModule_AddIntConstant(m, "AF_PACKET", AF_PACKET); Index: socketmodule.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** socketmodule.h 3 May 2003 09:14:53 -0000 1.9 --- socketmodule.h 31 Jan 2004 12:34:17 -0000 1.10 *************** *** 33,36 **** --- 33,43 ---- #endif + #ifdef HAVE_BLUETOOTH_BLUETOOTH_H + #include + #include + #include + #include + #endif + #ifdef HAVE_NETPACKET_PACKET_H # include *************** *** 81,84 **** --- 88,96 ---- struct sockaddr_storage storage; #endif + #ifdef HAVE_BLUETOOTH_BLUETOOTH_H + struct sockaddr_l2 bt_l2; + struct sockaddr_rc bt_rc; + struct sockaddr_sco bt_sco; + #endif #ifdef HAVE_NETPACKET_PACKET_H struct sockaddr_ll ll;