From python-dev@python.org Fri Sep 1 01:02:01 2000 From: python-dev@python.org (Tim Peters) Date: Thu, 31 Aug 2000 17:02:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include ceval.h,2.37,2.38 Message-ID: <200009010002.RAA23419@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Include In directory slayer.i.sourceforge.net:/tmp/cvs-serv20859/python/dist/src/Include Modified Files: ceval.h Log Message: Supply missing prototypes for new Py_{Get,Set}RecursionLimit; fixes compiler wngs; un-analize Get's definition ("void" is needed only in declarations, not defns, & is generally considered bad style in the latter). Index: ceval.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/ceval.h,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -r2.37 -r2.38 *** ceval.h 2000/08/27 20:00:35 2.37 --- ceval.h 2000/09/01 00:01:58 2.38 *************** *** 44,47 **** --- 44,49 ---- DL_IMPORT(int) Py_MakePendingCalls(void); + DL_IMPORT(void) Py_SetRecursionLimit(int); + DL_IMPORT(int) Py_GetRecursionLimit(void); /* Interface for threads. From python-dev@python.org Fri Sep 1 01:02:01 2000 From: python-dev@python.org (Tim Peters) Date: Thu, 31 Aug 2000 17:02:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.200,2.201 Message-ID: <200009010002.RAA23432@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv20859/python/dist/src/Python Modified Files: ceval.c Log Message: Supply missing prototypes for new Py_{Get,Set}RecursionLimit; fixes compiler wngs; un-analize Get's definition ("void" is needed only in declarations, not defns, & is generally considered bad style in the latter). Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.200 retrieving revision 2.201 diff -C2 -r2.200 -r2.201 *** ceval.c 2000/08/31 19:23:01 2.200 --- ceval.c 2000/09/01 00:01:58 2.201 *************** *** 303,307 **** static int recursion_limit = 2500; ! int Py_GetRecursionLimit(void) { return recursion_limit; --- 303,307 ---- static int recursion_limit = 2500; ! int Py_GetRecursionLimit() { return recursion_limit; From python-dev@python.org Fri Sep 1 00:28:55 2000 From: python-dev@python.org (Barry Warsaw) Date: Thu, 31 Aug 2000 16:28:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib gettext.py,1.5,1.6 Message-ID: <200008312328.QAA25213@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv25078 Modified Files: gettext.py Log Message: GNUTranslations._parse(): Fix portability problems on 64-bit machines by masking all unsigned integers with 0xffffffff. Index: gettext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gettext.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** gettext.py 2000/08/31 10:45:54 1.5 --- gettext.py 2000/08/31 23:28:52 1.6 *************** *** 130,133 **** --- 130,136 ---- def _parse(self, fp): """Override this method to support alternative .mo formats.""" + # We need to & all 32 bit unsigned integers with 0xffffff for + # portability to 64 bit machines. + MASK = 0xffffffff unpack = struct.unpack filename = getattr(fp, 'name', '') *************** *** 136,141 **** self._catalog = catalog = {} buf = fp.read() # Are we big endian or little endian? ! magic = unpack(' References: <200009010002.RAA23432@slayer.i.sourceforge.net> Message-ID: <14766.65024.122762.332972@bitdiddle.concentric.net> Any opinion on whether the Py_SetRecursionLimit should do sanity checking on its arguments? Jeremy From python-dev@python.org Fri Sep 1 01:52:48 2000 From: python-dev@python.org (Greg Ward) Date: Thu, 31 Aug 2000 17:52:48 -0700 Subject: [Python-checkins] CVS: distutils/distutils core.py,1.44,1.45 Message-ID: <200009010052.RAA15205@slayer.i.sourceforge.net> Update of /cvsroot/python/distutils/distutils In directory slayer.i.sourceforge.net:/tmp/cvs-serv12843 Modified Files: core.py Log Message: Added 'run_setup()' to allow outsiders to run a setup script under fairly tight control, and the '_setup_stop_after' and '_setup_distribution' globals to provide the tight control. This isn't entirely reliable yet: it dies horribly with a NameError on the example PIL setup script in examples/pil_setup.py (at least with Python 1.5.2; untested with current Python). There's some strangeness going on with execfile(), but I don't understand it and don't have time to track it down right now. Index: core.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/core.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -r1.44 -r1.45 *** core.py 2000/08/29 01:15:18 1.44 --- core.py 2000/09/01 00:52:45 1.45 *************** *** 43,46 **** --- 43,51 ---- + # Some mild magic to control the behaviour of 'setup()' from 'run_setup()'. + _setup_stop_after = None + _setup_distribution = None + + def setup (**attrs): """The gateway to the Distutils: do everything your setup script needs *************** *** 76,79 **** --- 81,86 ---- """ + global _setup_stop_after, _setup_distribution + # Determine the distribution class -- either caller-supplied or # our Distribution (see below). *************** *** 92,99 **** # (ie. everything except distclass) to initialize it try: ! dist = klass (attrs) except DistutilsSetupError, msg: raise SystemExit, "error in setup script: %s" % msg # Find and parse the config file(s): they will override options from # the setup script, but be overridden by the command line. --- 99,109 ---- # (ie. everything except distclass) to initialize it try: ! _setup_distribution = dist = klass (attrs) except DistutilsSetupError, msg: raise SystemExit, "error in setup script: %s" % msg + if _setup_stop_after == "init": + return dist + # Find and parse the config file(s): they will override options from # the setup script, but be overridden by the command line. *************** *** 104,107 **** --- 114,120 ---- dist.dump_option_dicts() + if _setup_stop_after == "config": + return dist + # Parse the command line; any command-line errors are the end user's # fault, so turn them into SystemExit to suppress tracebacks. *************** *** 117,120 **** --- 130,136 ---- dist.dump_option_dicts() + if _setup_stop_after == "commandline": + return dist + # And finally, run all the commands found on the command line. if ok: *************** *** 141,143 **** --- 157,231 ---- raise SystemExit, "error: " + str(msg) + return dist + # setup () + + + def run_setup (script_name, script_args=None, stop_after="run"): + """Run a setup script in a somewhat controlled environment, and + return the Distribution instance that drives things. This is useful + if you need to find out the distribution meta-data (passed as + keyword args from 'script' to 'setup()', or the contents of the + config files or command-line. + + 'script_name' is a file that will be run with 'execfile()'; + 'sys.argv[0]' will be replaced with 'script' for the duration of the + call. 'script_args' is a list of strings; if supplied, + 'sys.argv[1:]' will be replaced by 'script_args' for the duration of + the call. + + 'stop_after' tells 'setup()' when to stop processing; possible + values: + init + stop after the Distribution instance has been created and + populated with the keyword arguments to 'setup()' + config + stop after config files have been parsed (and their data + stored in the Distribution instance) + commandline + stop after the command-line ('sys.argv[1:]' or 'script_args') + have been parsed (and the data stored in the Distribution) + run [default] + stop after all commands have been run (the same as if 'setup()' + had been called in the usual way + + Returns the Distribution instance, which provides all information + used to drive the Distutils. + """ + if stop_after not in ('init', 'config', 'commandline', 'run'): + raise ValueError, "invalid value for 'stop_after': %s" % `stop_after` + + global _setup_stop_after, _setup_distribution + _setup_stop_after = stop_after + + save_argv = sys.argv + g = {} + l = {} + try: + try: + sys.argv[0] = script_name + if script_args is not None: + sys.argv[1:] = script_args + execfile(script_name, g, l) + finally: + sys.argv = save_argv + _setup_stop_after = None + except SystemExit: + # Hmm, should we do something if exiting with a non-zero code + # (ie. error)? + pass + except: + raise + + if _setup_distribution is None: + raise RuntimeError, \ + ("'distutils.core.setup()' was never called -- " + "perhaps '%s' is not a Distutils setup script?") % \ + script_name + + # I wonder if the setup script's namespace -- g and l -- would be of + # any interest to callers? + #print "_setup_distribution:", _setup_distribution + return _setup_distribution + + # run_setup () From python-dev@python.org Fri Sep 1 01:59:50 2000 From: python-dev@python.org (Greg Ward) Date: Thu, 31 Aug 2000 17:59:50 -0700 Subject: [Python-checkins] CVS: distutils README.txt,1.18,1.19 CHANGES.txt,1.12,1.13 Message-ID: <200009010059.RAA21501@slayer.i.sourceforge.net> Update of /cvsroot/python/distutils In directory slayer.i.sourceforge.net:/tmp/cvs-serv21377 Modified Files: README.txt CHANGES.txt Log Message: Update for release 0.9.2. Index: README.txt =================================================================== RCS file: /cvsroot/python/distutils/README.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** README.txt 2000/08/15 13:14:04 1.18 --- README.txt 2000/09/01 00:59:48 1.19 *************** *** 1,5 **** Python Distribution Utilities ! release 0.9.1 ! August 15, 2000 --- 1,5 ---- Python Distribution Utilities ! release 0.9.2 ! August 31, 2000 *************** *** 74,81 **** or 6.0. It also helps to have access to the Windows registry from Python; if you have the Win32 extensions (win32api, win32con) installed, ! you're fine. (Python 2.0 includes the winreg module for this purpose, ! which the Distutils will use if available.) If not, the Distutils might ! not be able to find the Visual C++ executables, in which case it will ! die horribly when you attempt to build any Python extensions. There is also experimental support for building extensions under Windows --- 74,82 ---- or 6.0. It also helps to have access to the Windows registry from Python; if you have the Win32 extensions (win32api, win32con) installed, ! you're fine. (Python 1.6 and 2.0 include the winreg module for this ! purpose, which the Distutils will use if available.) If not, the ! Distutils might not be able to find the Visual C++ executables, in which ! case it will die horribly when you attempt to build any Python ! extensions. There is also experimental support for building extensions under Windows *************** *** 112,121 **** The Distutils have been included with Python since 1.6a1, and Distutils ! 0.9.1 is approximately the code that will be included with Python 2.0b1 ! (modulo bug fixes). Thus, there's generally no need to install the ! Distutils under Python 1.6/2.0. However, Distutils releases may ! occasionally get ahead of Python releases, so if you really like life on ! the bleeding edge, you might want to install this Distutils release into ! your Python 1.6/2.0 library. To do this, you'll need to hide the original Distutils package directory --- 113,122 ---- The Distutils have been included with Python since 1.6a1, and Distutils ! 0.9.2 is the same as the code included with Python 2.0b1 (modulo bug ! fixes). Thus, there's generally no need to install the Distutils under ! Python 1.6/2.0. However, Distutils releases may occasionally get ahead ! of Python releases, so if you really like life on the bleeding edge, you ! might want to install this Distutils release into your Python 1.6/2.0 ! library. To do this, you'll need to hide the original Distutils package directory Index: CHANGES.txt =================================================================== RCS file: /cvsroot/python/distutils/CHANGES.txt,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** CHANGES.txt 2000/08/15 13:13:44 1.12 --- CHANGES.txt 2000/09/01 00:59:48 1.13 *************** *** 1,2 **** --- 1,15 ---- + Release 0.9.2 (31 August, 2000): + ------------------------------- + * fixed bug that broke extension-building under Windows for older + setup scripts (not using the new Extension class) + + * new version of bdist_wininst command and associated tools: fixes + some bugs, produces a smaller exeuctable, and has a nicer GUI + (thanks to Thomas Heller) + + * added some hooks to 'setup()' to allow some slightly sneaky ways + into the Distutils, in addition to the standard "run 'setup()' + from a setup script" + Release 0.9.1 (15 August, 2000): ------------------------------ From python-dev@python.org Fri Sep 1 02:00:43 2000 From: python-dev@python.org (Greg Ward) Date: Thu, 31 Aug 2000 18:00:43 -0700 Subject: [Python-checkins] CVS: distutils/distutils __init__.py,1.11,1.12 Message-ID: <200009010100.SAA22535@slayer.i.sourceforge.net> Update of /cvsroot/python/distutils/distutils In directory slayer.i.sourceforge.net:/tmp/cvs-serv22443/distutils Modified Files: __init__.py Log Message: Bump version to 0.9.2. Index: __init__.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/__init__.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** __init__.py 2000/08/26 02:37:07 1.11 --- __init__.py 2000/09/01 01:00:40 1.12 *************** *** 11,13 **** __revision__ = "$Id$" ! __version__ = "0.9.2pre" --- 11,13 ---- __revision__ = "$Id$" ! __version__ = "0.9.2" From python-dev@python.org Fri Sep 1 02:00:43 2000 From: python-dev@python.org (Greg Ward) Date: Thu, 31 Aug 2000 18:00:43 -0700 Subject: [Python-checkins] CVS: distutils setup.py,1.20,1.21 Message-ID: <200009010100.SAA22532@slayer.i.sourceforge.net> Update of /cvsroot/python/distutils In directory slayer.i.sourceforge.net:/tmp/cvs-serv22443 Modified Files: setup.py Log Message: Bump version to 0.9.2. Index: setup.py =================================================================== RCS file: /cvsroot/python/distutils/setup.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** setup.py 2000/08/26 02:37:06 1.20 --- setup.py 2000/09/01 01:00:40 1.21 *************** *** 12,16 **** setup (name = "Distutils", ! version = "0.9.2pre", description = "Python Distribution Utilities", author = "Greg Ward", --- 12,16 ---- setup (name = "Distutils", ! version = "0.9.2", description = "Python Distribution Utilities", author = "Greg Ward", From python-dev@python.org Fri Sep 1 02:03:30 2000 From: python-dev@python.org (Greg Ward) Date: Thu, 31 Aug 2000 18:03:30 -0700 Subject: [Python-checkins] CVS: distutils/misc get_metadata.py,NONE,1.1 Message-ID: <200009010103.SAA27159@slayer.i.sourceforge.net> Update of /cvsroot/python/distutils/misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv26972 Added Files: get_metadata.py Log Message: Initial revision. ***** Error reading new file: (2, 'No such file or directory') From python-dev@python.org Fri Sep 1 02:07:55 2000 From: python-dev@python.org (Greg Ward) Date: Thu, 31 Aug 2000 18:07:55 -0700 Subject: [Python-checkins] CVS: distutils MANIFEST.in,1.9,1.10 Message-ID: <200009010107.SAA31093@slayer.i.sourceforge.net> Update of /cvsroot/python/distutils In directory slayer.i.sourceforge.net:/tmp/cvs-serv31034 Modified Files: MANIFEST.in Log Message: Exclude Emacs turds. Index: MANIFEST.in =================================================================== RCS file: /cvsroot/python/distutils/MANIFEST.in,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** MANIFEST.in 2000/06/30 03:43:53 1.9 --- MANIFEST.in 2000/09/01 01:07:33 1.10 *************** *** 16,17 **** --- 16,18 ---- graft misc exclude misc/*.zip + global-exclude *~ From python-dev@python.org Fri Sep 1 02:23:29 2000 From: python-dev@python.org (Greg Ward) Date: Thu, 31 Aug 2000 18:23:29 -0700 Subject: [Python-checkins] CVS: distutils/distutils sysconfig.py,1.24,1.25 Message-ID: <200009010123.SAA13412@slayer.i.sourceforge.net> Update of /cvsroot/python/distutils/distutils In directory slayer.i.sourceforge.net:/tmp/cvs-serv12613 Modified Files: sysconfig.py Log Message: Rene Liebscher: hack '_init_posix()' to handle the BeOS linker script. (With a worry-wart comment added by me about where we *should* add the Python library to the link.) Index: sysconfig.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/sysconfig.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** sysconfig.py 2000/08/02 01:49:40 1.24 --- sysconfig.py 2000/09/01 01:23:26 1.25 *************** *** 256,259 **** --- 256,276 ---- g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) + if sys.platform == 'beos': + + # Linker script is in the config directory. In the Makefile it is + # relative to the srcdir, which after installation no longer makes + # sense. + python_lib = get_python_lib(standard_lib=1) + linkerscript_name = os.path.basename(string.split(g['LDSHARED'])[0]) + linkerscript = os.path.join(python_lib, 'config', linkerscript_name) + + # XXX this isn't the right place to do this: adding the Python + # library to the link, if needed, should be in the "build_ext" + # command. (It's also needed for non-MS compilers on Windows, and + # it's taken care of for them by the 'build_ext.get_libraries()' + # method.) + g['LDSHARED'] = ("%s -L%s/lib -lpython%s" % + (linkerscript, sys.prefix, sys.version[0:3])) + def _init_nt(): From python-dev@python.org Fri Sep 1 02:24:34 2000 From: python-dev@python.org (Greg Ward) Date: Thu, 31 Aug 2000 18:24:34 -0700 Subject: [Python-checkins] CVS: distutils/distutils cygwinccompiler.py,1.6,1.7 Message-ID: <200009010124.SAA14424@slayer.i.sourceforge.net> Update of /cvsroot/python/distutils/distutils In directory slayer.i.sourceforge.net:/tmp/cvs-serv14352/distutils Modified Files: cygwinccompiler.py Log Message: Rene Liebscher: comment fixes. Index: cygwinccompiler.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/cygwinccompiler.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** cygwinccompiler.py 2000/08/13 01:18:55 1.6 --- cygwinccompiler.py 2000/09/01 01:24:31 1.7 *************** *** 19,23 **** # see also http://starship.python.net/crew/kernr/mingw32/Notes.html # ! # * We use put export_symbols in a def-file, and don't use # --export-all-symbols because it doesn't worked reliable in some # tested configurations. And because other windows compilers also --- 19,23 ---- # see also http://starship.python.net/crew/kernr/mingw32/Notes.html # ! # * We put export_symbols in a def-file, and don't use # --export-all-symbols because it doesn't worked reliable in some # tested configurations. And because other windows compilers also *************** *** 33,37 **** # * cygwin gcc 2.95.2/ld 2.10.90/dllwrap 2.10.90 works now # - its dllwrap doesn't work, there is a bug in binutils 2.10.90 ! # see also ..... # - using gcc -mdll instead dllwrap doesn't work without -static because # it tries to link against dlls instead their import libraries. (If --- 33,37 ---- # * cygwin gcc 2.95.2/ld 2.10.90/dllwrap 2.10.90 works now # - its dllwrap doesn't work, there is a bug in binutils 2.10.90 ! # see also http://sources.redhat.com/ml/cygwin/2000-06/msg01274.html # - using gcc -mdll instead dllwrap doesn't work without -static because # it tries to link against dlls instead their import libraries. (If From python-dev@python.org Fri Sep 1 02:28:35 2000 From: python-dev@python.org (Greg Ward) Date: Thu, 31 Aug 2000 18:28:35 -0700 Subject: [Python-checkins] CVS: distutils/distutils bcppcompiler.py,1.5,1.6 Message-ID: <200009010128.SAA17640@slayer.i.sourceforge.net> Update of /cvsroot/python/distutils/distutils In directory slayer.i.sourceforge.net:/tmp/cvs-serv16972/distutils Modified Files: bcppcompiler.py Log Message: Rene Liebscher: * reverse library names from bcpp_library to library_bcpp * move some code to the right places, to put the def-files in the right directories again Index: bcppcompiler.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/bcppcompiler.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** bcppcompiler.py 2000/08/13 00:54:39 1.5 --- bcppcompiler.py 2000/09/01 01:28:33 1.6 *************** *** 225,239 **** ld_args = self.ldflags_shared[:] - # Borland C++ has problems with '/' in paths - objects = map(os.path.normpath, objects) - startup_obj = 'c0d32' - objects.insert(0, startup_obj) - - # either exchange python15.lib in the python libs directory against - # a Borland-like one, or create one with name bcpp_python15.lib - # there and remove the pragmas from config.h - libraries.append ('import32') - libraries.append ('cw32mt') - # Create a temporary exports file for use by the linker head, tail = os.path.split (output_filename) --- 225,228 ---- *************** *** 247,250 **** --- 236,250 ---- "writing %s" % def_file) + # Borland C++ has problems with '/' in paths + objects = map(os.path.normpath, objects) + startup_obj = 'c0d32' + objects.insert(0, startup_obj) + + # either exchange python15.lib in the python libs directory against + # a Borland-like one, or create one with name bcpp_python15.lib + # there and remove the pragmas from config.h + libraries.append ('import32') + libraries.append ('cw32mt') + # Start building command line flags and options. *************** *** 378,384 **** if debug: dlib = (lib + "_d") ! try_names = ("bcpp_" + dlib, "bcpp_" + lib, dlib, lib) else: ! try_names = ("bcpp_" + lib, lib) for dir in dirs: --- 378,384 ---- if debug: dlib = (lib + "_d") ! try_names = (dlib + "_bcpp", lib + "_bcpp", dlib, lib) else: ! try_names = (lib + "_bcpp", lib) for dir in dirs: From python-dev@python.org Fri Sep 1 02:37:20 2000 From: python-dev@python.org (Tim Peters) Date: Thu, 31 Aug 2000 21:37:20 -0400 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.200,2.201 In-Reply-To: <14766.65024.122762.332972@bitdiddle.concentric.net> Message-ID: [Jeremy Hylton] > Any opinion on whether the Py_SetRecursionLimit should do sanity > checking on its arguments? If and only if any preconditions on its use are documented <0.7 wink>. I'm busy with other stuff, but certainly trust your judgment on the matter! From python-dev@python.org Fri Sep 1 02:44:48 2000 From: python-dev@python.org (Greg Ward) Date: Thu, 31 Aug 2000 18:44:48 -0700 Subject: [Python-checkins] CVS: distutils/distutils/command bdist_wininst.py,1.7,1.8 Message-ID: <200009010144.SAA32375@slayer.i.sourceforge.net> Update of /cvsroot/python/distutils/distutils/command In directory slayer.i.sourceforge.net:/tmp/cvs-serv31463/distutils/command Modified Files: bdist_wininst.py Log Message: Rene Liebscher/Thomas Heller: * ensure the "dist" directory exists * raise exception if using for modules containing compiled extensions on a non-win32 platform. * don't create an .ini file anymore (it was just for debugging) Index: bdist_wininst.py =================================================================== RCS file: /cvsroot/python/distutils/distutils/command/bdist_wininst.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** bdist_wininst.py 2000/08/27 20:44:13 1.7 --- bdist_wininst.py 2000/09/01 01:44:45 1.8 *************** *** 64,67 **** --- 64,73 ---- def run (self): + if (sys.platform != "win32" and + (self.distribution.has_ext_modules() or + self.distribution.has_c_libraries())): + raise DistutilsPlatformError, \ + ("distribution contains extensions and/or C libraries; " + "must be compiled on a Windows 32 platform") self.run_command ('build') *************** *** 104,122 **** # run() ! def create_inifile (self): ! # Create an inifile containing data describing the installation. ! # This could be done without creating a real file, but ! # a file is (at least) useful for debugging bdist_wininst. metadata = self.distribution.metadata - ini_name = "%s.ini" % metadata.get_fullname() - self.announce ("creating %s" % ini_name) - inifile = open (ini_name, "w") - # Write the [metadata] section. Values are written with # repr()[1:-1], so they do not contain unprintable characters, and # are not surrounded by quote chars. ! inifile.write ("[metadata]\n") # 'info' will be displayed in the installer's dialog box, --- 110,123 ---- # run() ! def get_inidata (self): ! # Return data describing the installation. + lines = [] metadata = self.distribution.metadata # Write the [metadata] section. Values are written with # repr()[1:-1], so they do not contain unprintable characters, and # are not surrounded by quote chars. ! lines.append ("[metadata]") # 'info' will be displayed in the installer's dialog box, *************** *** 130,154 **** info = info + ("\n %s: %s" % \ (string.capitalize (name), data)) ! inifile.write ("%s=%s\n" % (name, repr (data)[1:-1])) # The [setup] section contains entries controlling # the installer runtime. ! inifile.write ("\n[Setup]\n") ! inifile.write ("info=%s\n" % repr (info)[1:-1]) ! inifile.write ("pthname=%s.%s\n" % (metadata.name, metadata.version)) if self.target_version: ! inifile.write ("target_version=%s\n" % self.target_version) title = self.distribution.get_fullname() ! inifile.write ("title=%s\n" % repr (title)[1:-1]) ! inifile.close() ! return ini_name ! # create_inifile() def create_exe (self, arcname, fullname): ! import struct#, zlib ! cfgdata = open (self.create_inifile()).read() installer_name = os.path.join(self.dist_dir, --- 131,156 ---- info = info + ("\n %s: %s" % \ (string.capitalize (name), data)) ! lines.append ("%s=%s" % (name, repr (data)[1:-1])) # The [setup] section contains entries controlling # the installer runtime. ! lines.append ("\n[Setup]") ! lines.append ("info=%s" % repr (info)[1:-1]) ! lines.append ("pthname=%s.%s" % (metadata.name, metadata.version)) if self.target_version: ! lines.append ("target_version=%s" % self.target_version) title = self.distribution.get_fullname() ! lines.append ("title=%s" % repr (title)[1:-1]) ! return string.join (lines, "\n") ! # get_inidata() def create_exe (self, arcname, fullname): ! import struct ! ! self.mkpath(self.dist_dir) ! cfgdata = self.get_inidata() installer_name = os.path.join(self.dist_dir, From python-dev@python.org Fri Sep 1 02:52:11 2000 From: python-dev@python.org (Guido van Rossum) Date: Thu, 31 Aug 2000 18:52:11 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.201,2.202 Message-ID: <200009010152.SAA07203@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv7136 Modified Files: ceval.c Log Message: Set the recursion limit to 1000 -- 2500 was not enough, let's be conservative. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.201 retrieving revision 2.202 diff -C2 -r2.201 -r2.202 *** ceval.c 2000/09/01 00:01:58 2.201 --- ceval.c 2000/09/01 01:52:08 2.202 *************** *** 301,305 **** /* The interpreter's recursion limit */ ! static int recursion_limit = 2500; int Py_GetRecursionLimit() --- 301,305 ---- /* The interpreter's recursion limit */ ! static int recursion_limit = 1000; int Py_GetRecursionLimit() From python-dev@python.org Fri Sep 1 03:20:23 2000 From: python-dev@python.org (Tim Peters) Date: Thu, 31 Aug 2000 19:20:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib gettext.py,1.6,1.7 Message-ID: <200009010220.TAA09104@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv8680/python/dist/src/lib Modified Files: gettext.py Log Message: Repaired comment. Index: gettext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/gettext.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** gettext.py 2000/08/31 23:28:52 1.6 --- gettext.py 2000/09/01 02:20:20 1.7 *************** *** 130,134 **** def _parse(self, fp): """Override this method to support alternative .mo formats.""" ! # We need to & all 32 bit unsigned integers with 0xffffff for # portability to 64 bit machines. MASK = 0xffffffff --- 130,134 ---- def _parse(self, fp): """Override this method to support alternative .mo formats.""" ! # We need to & all 32 bit unsigned integers with 0xffffffff for # portability to 64 bit machines. MASK = 0xffffffff From python-dev@python.org Fri Sep 1 03:20:48 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 19:20:48 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0200.txt,1.33,1.34 Message-ID: <200009010220.TAA09503@slayer.i.sourceforge.net> Update of /cvsroot/python/python/nondist/peps In directory slayer.i.sourceforge.net:/tmp/cvs-serv9262 Modified Files: pep-0200.txt Log Message: lookdict bug is closed Index: pep-0200.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0200.txt,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** pep-0200.txt 2000/08/31 21:24:20 1.33 --- pep-0200.txt 2000/09/01 02:20:46 1.34 *************** *** 101,107 **** Get all patches out of Accepted. - Fix bug 112558 - https://sourceforge.net/bugs/?func=detailbug&bug_id=112558&group_id=5470 - Fix all other bugs with priority 7 or higher --- 101,104 ---- From python-dev@python.org Fri Sep 1 03:39:03 2000 From: python-dev@python.org (Guido van Rossum) Date: Thu, 31 Aug 2000 19:39:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects abstract.c,2.50,2.51 Message-ID: <200009010239.TAA27288@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Objects In directory slayer.i.sourceforge.net:/tmp/cvs-serv27223 Modified Files: abstract.c Log Message: Add parens suggested by gcc -Wall. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.50 retrieving revision 2.51 diff -C2 -r2.50 -r2.51 *** abstract.c 2000/08/31 07:02:19 2.50 --- abstract.c 2000/09/01 02:39:00 2.51 *************** *** 814,820 **** return x; } ! else if (HASINPLACE(v) && ((v->ob_type->tp_as_sequence != NULL && ! (f = v->ob_type->tp_as_sequence->sq_inplace_concat) != NULL)) || (v->ob_type->tp_as_number != NULL && (f = v->ob_type->tp_as_number->nb_inplace_add) != NULL)) --- 814,821 ---- return x; } ! else if ((HASINPLACE(v) && ((v->ob_type->tp_as_sequence != NULL && ! (f = v->ob_type->tp_as_sequence->sq_inplace_concat) ! != NULL))) || (v->ob_type->tp_as_number != NULL && (f = v->ob_type->tp_as_number->nb_inplace_add) != NULL)) From python-dev@python.org Fri Sep 1 03:40:13 2000 From: python-dev@python.org (Guido van Rossum) Date: Thu, 31 Aug 2000 19:40:13 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules Makefile.pre.in,1.65,1.66 Message-ID: <200009010240.TAA28107@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv28079 Modified Files: Makefile.pre.in Log Message: Moodules -> Modules. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/Makefile.pre.in,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -r1.65 -r1.66 *** Makefile.pre.in 2000/08/31 21:53:03 1.65 --- Makefile.pre.in 2000/09/01 02:40:11 1.66 *************** *** 165,169 **** echo; \ echo "----------------------------------------------"; \ ! echo "Modules/Setup.in is newer than Moodules/Setup;"; \ echo "check to make sure you have all the updates"; \ echo "you need in your Setup file."; \ --- 165,169 ---- echo; \ echo "----------------------------------------------"; \ ! echo "Modules/Setup.in is newer than Modules/Setup;"; \ echo "check to make sure you have all the updates"; \ echo "you need in your Setup file."; \ From python-dev@python.org Fri Sep 1 03:43:40 2000 From: python-dev@python.org (Guido van Rossum) Date: Thu, 31 Aug 2000 19:43:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules readline.c,2.29,2.30 Message-ID: <200009010243.TAA31341@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv31296 Modified Files: readline.c Log Message: Add three prototypes for functions in history.h to shut up gcc -Wall. Index: readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -r2.29 -r2.30 *** readline.c 2000/08/31 05:18:53 2.29 --- readline.c 2000/09/01 02:43:38 2.30 *************** *** 35,38 **** --- 35,41 ---- extern int rl_initialize(void); extern int add_history(char *); + extern int read_history(char *); + extern int write_history(char *); + extern int history_truncate_file(char *, int); extern Function *rl_event_hook; #endif From python-dev@python.org Fri Sep 1 03:47:26 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 19:47:26 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include pyerrors.h,2.39,2.40 Message-ID: <200009010247.TAA03113@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Include In directory slayer.i.sourceforge.net:/tmp/cvs-serv2009/Include Modified Files: pyerrors.h Log Message: refactor __del__ exception handler into PyErr_WriteUnraisable add sanity check to gc: if an exception occurs during GC, call PyErr_WriteUnraisable and then call Py_FatalEror. Index: pyerrors.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyerrors.h,v retrieving revision 2.39 retrieving revision 2.40 diff -C2 -r2.39 -r2.40 *** pyerrors.h 2000/08/24 22:38:39 2.39 --- pyerrors.h 2000/09/01 02:47:24 2.40 *************** *** 93,96 **** --- 93,97 ---- DL_IMPORT(PyObject *) PyErr_NewException(char *name, PyObject *base, PyObject *dict); + extern DL_IMPORT(void) PyErr_WriteUnraisable(PyObject *); /* In sigcheck.c or signalmodule.c */ From python-dev@python.org Fri Sep 1 03:47:27 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 19:47:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python errors.c,2.53,2.54 Message-ID: <200009010247.TAA03123@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv2009/Python Modified Files: errors.c Log Message: refactor __del__ exception handler into PyErr_WriteUnraisable add sanity check to gc: if an exception occurs during GC, call PyErr_WriteUnraisable and then call Py_FatalEror. Index: errors.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v retrieving revision 2.53 retrieving revision 2.54 diff -C2 -r2.53 -r2.54 *** errors.c 2000/08/24 22:38:39 2.53 --- errors.c 2000/09/01 02:47:24 2.54 *************** *** 451,452 **** --- 451,479 ---- return result; } + + /* Call when an exception has occurred but there is no way for Python + to handle it. Examples: exception in __del__ or during GC. */ + void + PyErr_WriteUnraisable(PyObject *obj) + { + PyObject *f, *t, *v, *tb; + PyErr_Fetch(&t, &v, &tb); + f = PySys_GetObject("stderr"); + if (f != NULL) { + PyFile_WriteString("Exception ", f); + if (t) { + PyFile_WriteObject(t, f, Py_PRINT_RAW); + if (v && v != Py_None) { + PyFile_WriteString(": ", f); + PyFile_WriteObject(v, f, 0); + } + } + PyFile_WriteString(" in ", f); + PyFile_WriteObject(obj, f, 0); + PyFile_WriteString(" ignored\n", f); + PyErr_Clear(); /* Just in case */ + } + Py_XDECREF(t); + Py_XDECREF(v); + Py_XDECREF(tb); + } From python-dev@python.org Fri Sep 1 03:47:27 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 19:47:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.78,1.79 Message-ID: <200009010247.TAA03141@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/api In directory slayer.i.sourceforge.net:/tmp/cvs-serv2009/Doc/api Modified Files: api.tex Log Message: refactor __del__ exception handler into PyErr_WriteUnraisable add sanity check to gc: if an exception occurs during GC, call PyErr_WriteUnraisable and then call Py_FatalEror. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -r1.78 -r1.79 *** api.tex 2000/08/31 05:50:40 1.78 --- api.tex 2000/09/01 02:47:25 1.79 *************** *** 973,976 **** --- 973,987 ---- \end{cfuncdesc} + \begin{cfuncdesc}{void}{PyErr_WriteUnraisable}{PyObject *obj} + This utility function prints a warning message to \var{sys.stderr} + when an exception has been set but it is impossible for the + interpreter to actually raise the exception. It is used, for example, + when an exception occurs in an \member{__del__} method. + + The function is called with a single argument \var{obj} that + identifies where the context in which the unraisable exception + occurred. The repr of \var{obj} will be printed in the warning + message. + \end{cfuncdesc} \section{Standard Exceptions \label{standardExceptions}} From python-dev@python.org Fri Sep 1 03:47:27 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 19:47:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects classobject.c,2.106,2.107 Message-ID: <200009010247.TAA03138@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Objects In directory slayer.i.sourceforge.net:/tmp/cvs-serv2009/Objects Modified Files: classobject.c Log Message: refactor __del__ exception handler into PyErr_WriteUnraisable add sanity check to gc: if an exception occurs during GC, call PyErr_WriteUnraisable and then call Py_FatalEror. Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.106 retrieving revision 2.107 diff -C2 -r2.106 -r2.107 *** classobject.c 2000/08/25 10:47:46 2.106 --- classobject.c 2000/09/01 02:47:25 2.107 *************** *** 520,543 **** PyObject *res = PyEval_CallObject(del, (PyObject *)NULL); if (res == NULL) { ! PyObject *f, *t, *v, *tb; ! PyErr_Fetch(&t, &v, &tb); ! f = PySys_GetObject("stderr"); ! if (f != NULL) { ! PyFile_WriteString("Exception ", f); ! if (t) { ! PyFile_WriteObject(t, f, Py_PRINT_RAW); ! if (v && v != Py_None) { ! PyFile_WriteString(": ", f); ! PyFile_WriteObject(v, f, 0); ! } ! } ! PyFile_WriteString(" in ", f); ! PyFile_WriteObject(del, f, 0); ! PyFile_WriteString(" ignored\n", f); ! PyErr_Clear(); /* Just in case */ ! } ! Py_XDECREF(t); ! Py_XDECREF(v); ! Py_XDECREF(tb); } else --- 520,524 ---- PyObject *res = PyEval_CallObject(del, (PyObject *)NULL); if (res == NULL) { ! PyErr_WriteUnraisable(del); } else From python-dev@python.org Fri Sep 1 03:47:27 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 19:47:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.8,2.9 Message-ID: <200009010247.TAA03124@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv2009/Modules Modified Files: gcmodule.c Log Message: refactor __del__ exception handler into PyErr_WriteUnraisable add sanity check to gc: if an exception occurs during GC, call PyErr_WriteUnraisable and then call Py_FatalEror. Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -r2.8 -r2.9 *** gcmodule.c 2000/08/31 15:10:24 2.8 --- gcmodule.c 2000/09/01 02:47:24 2.9 *************** *** 58,66 **** DEBUG_INSTANCES | \ DEBUG_OBJECTS ! static int debug = 0; /* list of uncollectable objects */ static PyObject *garbage; /*** list functions ***/ --- 58,68 ---- DEBUG_INSTANCES | \ DEBUG_OBJECTS ! static int debug; /* list of uncollectable objects */ static PyObject *garbage; + /* Python string to use if unhandled exception occurs */ + static PyObject *gc_str; /*** list functions ***/ *************** *** 436,439 **** --- 438,445 ---- handle_finalizers(&finalizers, old); + if (PyErr_Occurred()) { + PyErr_WriteUnraisable(gc_str); + Py_FatalError("unexpected exception during garbage collection"); + } allocated = 0; return n+m; *************** *** 699,702 **** --- 705,711 ---- if (garbage == NULL) { garbage = PyList_New(0); + } + if (gc_str == NULL) { + gc_str = PyString_FromString("garbage collection"); } PyDict_SetItemString(d, "garbage", garbage); From python-dev@python.org Fri Sep 1 03:50:27 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 19:50:27 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0200.txt,1.34,1.35 Message-ID: <200009010250.TAA06290@slayer.i.sourceforge.net> Update of /cvsroot/python/python/nondist/peps In directory slayer.i.sourceforge.net:/tmp/cvs-serv5898 Modified Files: pep-0200.txt Log Message: add notes about popen2 problem on Windows and SocketServer changes Index: pep-0200.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0200.txt,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** pep-0200.txt 2000/09/01 02:20:46 1.34 --- pep-0200.txt 2000/09/01 02:50:24 1.35 *************** *** 96,99 **** --- 96,102 ---- Add popen2 support for Linux -- Fred Drake + There are some threads problems on windows... + + Deal with buffering problem with SocketServer -- GvR Get all patches out of Open. From python-dev@python.org Fri Sep 1 04:06:43 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 20:06:43 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0200.txt,1.35,1.36 Message-ID: <200009010306.UAA12122@slayer.i.sourceforge.net> Update of /cvsroot/python/python/nondist/peps In directory slayer.i.sourceforge.net:/tmp/cvs-serv11623 Modified Files: pep-0200.txt Log Message: add the anti-tab action item Index: pep-0200.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0200.txt,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** pep-0200.txt 2000/09/01 02:50:24 1.35 --- pep-0200.txt 2000/09/01 03:06:39 1.36 *************** *** 100,103 **** --- 100,105 ---- Deal with buffering problem with SocketServer -- GvR + Make sure there are no tabs in the std library. + Get all patches out of Open. From python-dev@python.org Fri Sep 1 04:25:17 2000 From: python-dev@python.org (Guido van Rossum) Date: Thu, 31 Aug 2000 20:25:17 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib SocketServer.py,1.18,1.19 Message-ID: <200009010325.UAA18253@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv18218 Modified Files: SocketServer.py Log Message: In class StreamRequestHandler, make the default buffering for rfile and wfile class variables (that the instance can also override). Change the default for rfile to buffered, because that seems to make a big difference in performance on some platforms. An anti-patch is needed to revert the effect in CGIHTTPServer.py which I'll check in momentarily. Index: SocketServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/SocketServer.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** SocketServer.py 2000/05/09 14:53:29 1.18 --- SocketServer.py 2000/09/01 03:25:14 1.19 *************** *** 413,420 **** """Define self.rfile and self.wfile for stream sockets.""" def setup(self): self.connection = self.request ! self.rfile = self.connection.makefile('rb', 0) ! self.wfile = self.connection.makefile('wb', 0) def finish(self): --- 413,430 ---- """Define self.rfile and self.wfile for stream sockets.""" + # Default buffer sizes for rfile, wfile. + # We default rfile to buffered because otherwise it could be + # really slow for large data (a getc() call per byte); we make + # wfile unbuffered because (a) often after a write() we want to + # read and we need to flush the line; (b) big writes to unbuffered + # files are typically optimized by stdio even when big reads + # aren't. + rbufsize = -1 + wbufsize = 0 + def setup(self): self.connection = self.request ! self.rfile = self.connection.makefile('rb', self.rbufsize) ! self.wfile = self.connection.makefile('wb', self.wbufsize) def finish(self): From python-dev@python.org Fri Sep 1 04:27:36 2000 From: python-dev@python.org (Guido van Rossum) Date: Thu, 31 Aug 2000 20:27:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib CGIHTTPServer.py,1.12,1.13 Message-ID: <200009010327.UAA18357@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv18350 Modified Files: CGIHTTPServer.py Log Message: Now that StreamRequestHandler defaults rfile to buffered, make it unbuffered (by setting the class variable rbufsize to 0), because we (may) need to pass the file descriptor to the subprocess running the CGI script positioned after the headers. Index: CGIHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/CGIHTTPServer.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** CGIHTTPServer.py 1999/10/18 13:43:44 1.12 --- CGIHTTPServer.py 2000/09/01 03:27:34 1.13 *************** *** 36,39 **** --- 36,43 ---- """ + # Make rfile unbuffered -- we need to read one line and then pass + # the rest to a subprocess, so we can't use buffered input. + rbufsize = 0 + def do_POST(self): """Serve a POST request. From python-dev@python.org Fri Sep 1 04:34:30 2000 From: python-dev@python.org (Tim Peters) Date: Thu, 31 Aug 2000 20:34:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.202,2.203 Message-ID: <200009010334.UAA18676@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv18614/python/dist/src/python Modified Files: ceval.c Log Message: Revert removal of void from function definition. Guido sez I can take it out again after we complete switching to C++ . Thanks to Greg Stein for hitting me. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.202 retrieving revision 2.203 diff -C2 -r2.202 -r2.203 *** ceval.c 2000/09/01 01:52:08 2.202 --- ceval.c 2000/09/01 03:34:26 2.203 *************** *** 303,307 **** static int recursion_limit = 1000; ! int Py_GetRecursionLimit() { return recursion_limit; --- 303,307 ---- static int recursion_limit = 1000; ! int Py_GetRecursionLimit(void) { return recursion_limit; From python-dev@python.org Fri Sep 1 04:46:19 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 20:46:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _cursesmodule.c,2.38,2.39 _localemodule.c,2.16,2.17 Message-ID: <200009010346.UAA19443@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv19410/Modules Modified Files: _cursesmodule.c _localemodule.c Log Message: Don't call Py_FatalError in module initialization (leaving the rest of the modules for Barry) Index: _cursesmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v retrieving revision 2.38 retrieving revision 2.39 diff -C2 -r2.38 -r2.39 *** _cursesmodule.c 2000/08/20 23:37:02 2.38 --- _cursesmodule.c 2000/09/01 03:46:16 2.39 *************** *** 2353,2359 **** SetDictInt("KEY_MAX", KEY_MAX); } - - /* Check for errors */ - if (PyErr_Occurred()) - Py_FatalError("can't initialize module _curses"); } --- 2353,2355 ---- Index: _localemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_localemodule.c,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -r2.16 -r2.17 *** _localemodule.c 2000/08/18 05:07:12 2.16 --- _localemodule.c 2000/09/01 03:46:16 2.17 *************** *** 453,458 **** PyDict_SetItemString(d, "__doc__", x); Py_XDECREF(x); - - if (PyErr_Occurred()) - Py_FatalError("Can't initialize module _locale"); } --- 453,455 ---- From python-dev@python.org Fri Sep 1 04:49:50 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 20:49:50 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python errors.c,2.54,2.55 Message-ID: <200009010349.UAA19599@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv19548/Python Modified Files: errors.c Log Message: code part of patch #100895 by Fredrik Lundh PyErr_Format computes size of buffer needed rather than relying on static buffer. Index: errors.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -r2.54 -r2.55 *** errors.c 2000/09/01 02:47:24 2.54 --- errors.c 2000/09/01 03:49:47 2.55 *************** *** 30,33 **** --- 30,35 ---- #endif + #include + void PyErr_Restore(PyObject *type, PyObject *value, PyObject *traceback) *************** *** 365,369 **** { return PyErr_SetFromWindowsErrWithFilename(ierr, NULL); - } #endif /* MS_WINDOWS */ --- 367,370 ---- *************** *** 394,403 **** { va_list vargs; ! char buffer[500]; /* Caller is responsible for limiting the format */ va_start(vargs, format); ! vsprintf(buffer, format, vargs); ! PyErr_SetString(exception, buffer); return NULL; } --- 395,523 ---- { va_list vargs; ! int n, i; ! const char* f; ! char* s; ! PyObject* string; ! ! /* step 1: figure out how large a buffer we need */ + #ifdef HAVE_STDARG_PROTOTYPES va_start(vargs, format); + #else + va_start(vargs); + #endif ! n = 0; ! for (f = format; *f; f++) { ! if (*f == '%') { ! const char* p = f; ! while (*++f && *f != '%' && !isalpha(*f)) ! ; ! switch (*f) { ! case 'c': ! va_arg(vargs, int); ! /* fall through... */ ! case '%': ! n++; ! break; ! case 'd': case 'i': case 'x': ! va_arg(vargs, int); ! /* 20 bytes should be enough to hold a 64-bit ! integer */ ! n = n + 20; ! break; ! case 's': ! s = va_arg(vargs, char*); ! n = n + strlen(s); ! break; ! default: ! /* if we stumble upon an unknown ! formatting code, copy the rest of ! the format string to the output ! string. (we cannot just skip the ! code, since there's no way to know ! what's in the argument list) */ ! n = n + strlen(p); ! goto expand; ! } ! } else ! n = n + 1; ! } ! ! expand: ! ! string = PyString_FromStringAndSize(NULL, n); ! if (!string) ! return NULL; ! ! #ifdef HAVE_STDARG_PROTOTYPES ! va_start(vargs, format); ! #else ! va_start(vargs); ! #endif ! ! /* step 2: fill the buffer */ ! ! s = PyString_AsString(string); ! ! for (f = format; *f; f++) { ! if (*f == '%') { ! const char* p = f++; ! /* parse the width.precision part (we're only ! interested in the precision value, if any) */ ! n = 0; ! while (isdigit(*f)) ! n = (n*10) + *f++ - '0'; ! if (*f == '.') { ! f++; ! n = 0; ! while (isdigit(*f)) ! n = (n*10) + *f++ - '0'; ! } ! while (*f && *f != '%' && !isalpha(*f)) ! f++; ! switch (*f) { ! case 'c': ! *s++ = va_arg(vargs, int); ! break; ! case 'd': ! sprintf(s, "%d", va_arg(vargs, int)); ! s = s + strlen(s); ! break; ! case 'i': ! sprintf(s, "%i", va_arg(vargs, int)); ! s = s + strlen(s); ! break; ! case 'x': ! sprintf(s, "%x", va_arg(vargs, int)); ! s = s + strlen(s); ! break; ! case 's': ! p = va_arg(vargs, char*); ! i = strlen(p); ! if (n > 0 && i > n) ! i = n; ! memcpy(s, p, i); ! s = s + i; ! break; ! case '%': ! *s++ = '%'; ! break; ! default: ! strcpy(s, p); ! s = s + strlen(s); ! goto end; ! } ! } else ! *s++ = *f; ! } ! ! end: ! ! _PyString_Resize(&string, s - PyString_AsString(string)); ! ! PyErr_SetObject(exception, string); ! Py_XDECREF(string); ! return NULL; } From python-dev@python.org Fri Sep 1 05:01:59 2000 From: python-dev@python.org (Jeremy Hylton) Date: Thu, 31 Aug 2000 21:01:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.9,2.10 Message-ID: <200009010401.VAA20868@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv20751/Modules Modified Files: gcmodule.c Log Message: set the default threshold much higher we don't need to run gc frequently Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -r2.9 -r2.10 *** gcmodule.c 2000/09/01 02:47:24 2.9 --- gcmodule.c 2000/09/01 04:01:55 2.10 *************** *** 41,45 **** /* collection frequencies, XXX tune these */ static int enabled = 1; /* automatic collection enabled? */ ! static int threshold0 = 100; /* net new containers before collection */ static int threshold1 = 10; /* generation0 collections before collecting 1 */ static int threshold2 = 10; /* generation1 collections before collecting 2 */ --- 41,45 ---- /* collection frequencies, XXX tune these */ static int enabled = 1; /* automatic collection enabled? */ ! static int threshold0 = 5000; /* net new containers before collection */ static int threshold1 = 10; /* generation0 collections before collecting 1 */ static int threshold2 = 10; /* generation1 collections before collecting 2 */ From python-dev@python.org Fri Sep 1 06:30:03 2000 From: python-dev@python.org (Fred L. Drake) Date: Thu, 31 Aug 2000 22:30:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.79,1.80 Message-ID: <200009010530.WAA10485@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/api In directory slayer.i.sourceforge.net:/tmp/cvs-serv10464/api Modified Files: api.tex Log Message: Document PyImport_AppendInittab(), PyImport_ExtendInittab(), and struct _inittab. This closes SourceForge bug #111499. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -r1.79 -r1.80 *** api.tex 2000/09/01 02:47:25 1.79 --- api.tex 2000/09/01 05:30:00 1.80 *************** *** 1239,1243 **** as generated by the \program{freeze}\index{freeze utility} utility (see \file{Tools/freeze/} in the Python source distribution). Its ! definition is: \begin{verbatim} --- 1239,1243 ---- as generated by the \program{freeze}\index{freeze utility} utility (see \file{Tools/freeze/} in the Python source distribution). Its ! definition, found in \file{Include/import.h}, is: \begin{verbatim} *************** *** 1257,1260 **** --- 1257,1298 ---- dynamically created collection of frozen modules. \end{cvardesc} + + \begin{cfuncdesc}{int}{PyImport_AppendInittab}{char *name, + void (*initfunc)(void)} + Add a single module to the existing table of built-in modules. This + is a convenience wrapper around \cfunction{PyImport_ExtendInittab()}, + returning \code{-1} if the table could not be extended. The new + module can be imported by the name \var{name}, and uses the function + \var{initfunc} as the initialization function called on the first + attempted import. This should be called before + \cfunction{Py_Initialize()}. + \end{cfuncdesc} + + \begin{ctypedesc}[_inittab]{struct _inittab} + Structure describing a single entry in the list of built-in modules. + Each of these structures gives the name and initialization function + for a module built into the interpreter. Programs which embed Python + may use an array of these structures in conjunction with + \cfunction{PyImport_ExtendInittab()} to provide additional built-in + modules. The structure is defined in \file{Include/import.h} as: + + \begin{verbatim} + struct _inittab { + char *name; + void (*initfunc)(void); + }; + \end{verbatim} + \end{ctypedesc} + + \begin{cfuncdesc}{int}{PyImport_ExtendInittab}{struct _inittab *newtab} + Add a collection of modules to the table of built-in modules. The + \var{newtab} array must end with a sentinel entry which contains + \NULL{} for the \member{name} field; failure to provide the sentinel + value can result in a memory fault. Returns \code{0} on success or + \code{-1} if insufficient memory could be allocated to extend the + internal table. In the event of failure, no modules are added to the + internal table. This should be called before + \cfunction{Py_Initialize()}. + \end{cfuncdesc} From python-dev@python.org Fri Sep 1 07:09:27 2000 From: python-dev@python.org (Barry Warsaw) Date: Thu, 31 Aug 2000 23:09:27 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib ftplib.py,1.44,1.45 Message-ID: <200009010609.XAA15998@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv15966 Modified Files: ftplib.py Log Message: Added support for RFC 959's REST command (restart), closing SF patch #101187, which some modifications. Specifically, ntransfercmd(), transfercmd(), and retrbinary() all grow an optional `rest' argument, which if not None, is used as the argument to an FTP REST comman dbefore the socket is returned. Differences from the SF patch: - always compare against None with `is' or `is not' instead of == or != - no parens around conditional - RFC 959 defines the argument to REST is a string containing any ASCII characters in the range [33..126]. Therefore, we use the %s format character instead of %f or %d as suggested in the patch's comments. Note that we do /not/ sanity checkthe contents of the rest argument (but we'll document this in the library reference manual). Index: ftplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ftplib.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -r1.44 -r1.45 *** ftplib.py 2000/08/17 05:06:49 1.44 --- ftplib.py 2000/09/01 06:09:23 1.45 *************** *** 1,6 **** """An FTP client class and some helper functions. ! Based on RFC 959: File Transfer Protocol ! (FTP), by J. Postel and J. Reynolds Example: --- 1,5 ---- """An FTP client class and some helper functions. ! Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds Example: *************** *** 236,240 **** def sendport(self, host, port): ! '''Send a PORT command with the current host and the given port number.''' hbytes = string.splitfields(host, '.') pbytes = [`port/256`, `port%256`] --- 235,241 ---- def sendport(self, host, port): ! '''Send a PORT command with the current host and the given ! port number. ! ''' hbytes = string.splitfields(host, '.') pbytes = [`port/256`, `port%256`] *************** *** 254,271 **** return sock ! def ntransfercmd(self, cmd): ! '''Initiate a transfer over the data connection. ! If the transfer is active, send a port command and ! the transfer command, and accept the connection. ! If the server is passive, send a pasv command, connect ! to it, and start the transfer command. ! Either way, return the socket for the connection and ! the expected size of the transfer. The expected size ! may be None if it could not be determined.''' size = None if self.passiveserver: host, port = parse227(self.sendcmd('PASV')) ! conn = socket.socket(socket.AF_INET, socket.SOCK_STREAM) conn.connect((host, port)) resp = self.sendcmd(cmd) if resp[0] <> '1': --- 255,280 ---- return sock ! def ntransfercmd(self, cmd, rest=None): ! """Initiate a transfer over the data connection. ! ! If the transfer is active, send a port command and the ! transfer command, and accept the connection. If the server is ! passive, send a pasv command, connect to it, and start the ! transfer command. Either way, return the socket for the ! connection and the expected size of the transfer. The ! expected size may be None if it could not be determined. ! ! Optional `rest' argument can be a string that is sent as the ! argument to a RESTART command. This is essentially a server ! marker used to tell the server to skip over any data up to the ! given marker. ! """ size = None if self.passiveserver: host, port = parse227(self.sendcmd('PASV')) ! conn=socket.socket(socket.AF_INET, socket.SOCK_STREAM) conn.connect((host, port)) + if rest is not None: + self.sendcmd("REST %s" % rest) resp = self.sendcmd(cmd) if resp[0] <> '1': *************** *** 273,276 **** --- 282,287 ---- else: sock = self.makeport() + if rest is not None: + self.sendcmd("REST %s" % rest) resp = self.sendcmd(cmd) if resp[0] <> '1': *************** *** 282,289 **** return conn, size ! def transfercmd(self, cmd): ! '''Initiate a transfer over the data connection. Returns ! the socket for the connection. See also ntransfercmd().''' ! return self.ntransfercmd(cmd)[0] def login(self, user = '', passwd = '', acct = ''): --- 293,299 ---- return conn, size ! def transfercmd(self, cmd, rest=None): ! """Like nstransfercmd() but returns only the socket.""" ! return self.ntransfercmd(cmd, rest)[0] def login(self, user = '', passwd = '', acct = ''): *************** *** 312,323 **** raise error_reply, resp return resp ! def retrbinary(self, cmd, callback, blocksize=8192): ! '''Retrieve data in binary mode. ! The argument is a RETR command. ! The callback function is called for each block. ! This creates a new port for you''' self.voidcmd('TYPE I') ! conn = self.transfercmd(cmd) while 1: data = conn.recv(blocksize) --- 322,338 ---- raise error_reply, resp return resp + + def retrbinary(self, cmd, callback, blocksize=8192, rest=None): + """Retrieve data in binary mode. + + `cmd' is a RETR command. `callback' is a callback function is + called for each block. No more than `blocksize' number of + bytes will be read from the socket. Optional `rest' is passed + to transfercmd(). ! A new port is created for you. Return the response code. ! """ self.voidcmd('TYPE I') ! conn = self.transfercmd(cmd, rest) while 1: data = conn.recv(blocksize) From python-dev@python.org Fri Sep 1 07:32:35 2000 From: python-dev@python.org (Barry Warsaw) Date: Thu, 31 Aug 2000 23:32:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libftplib.tex,1.28,1.29 Message-ID: <200009010632.XAA22281@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv22273 Modified Files: libftplib.tex Log Message: Document the new optional argument "rest" on the transfercmd(), ntransfercmd(), and retrbinary() commands. This closes SF patch #101187. Index: libftplib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libftplib.tex,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** libftplib.tex 2000/07/16 19:01:09 1.28 --- libftplib.tex 2000/09/01 06:32:32 1.29 *************** *** 146,150 **** \end{methoddesc} ! \begin{methoddesc}{retrbinary}{command, callback\optional{, maxblocksize}} Retrieve a file in binary transfer mode. \var{command} should be an appropriate \samp{RETR} command, i.e.\ \code{'RETR \var{filename}'}. --- 146,151 ---- \end{methoddesc} ! \begin{methoddesc}{retrbinary}{command, ! callback\optional{, maxblocksize\optional{, rest}}} Retrieve a file in binary transfer mode. \var{command} should be an appropriate \samp{RETR} command, i.e.\ \code{'RETR \var{filename}'}. *************** *** 154,158 **** read on the low-level socket object created to do the actual transfer (which will also be the largest size of the data blocks passed to ! \var{callback}). A reasonable default is chosen. \end{methoddesc} --- 155,160 ---- read on the low-level socket object created to do the actual transfer (which will also be the largest size of the data blocks passed to ! \var{callback}). A reasonable default is chosen. \var{rest} means the ! same thing as in the \method{transfercmd()} method. \end{methoddesc} *************** *** 186,190 **** \end{methoddesc} ! \begin{methoddesc}{transfercmd}{cmd} Initiate a transfer over the data connection. If the transfer is active, send a \samp{PORT} command and the transfer command specified --- 188,192 ---- \end{methoddesc} ! \begin{methoddesc}{transfercmd}{cmd\optional{, rest}} Initiate a transfer over the data connection. If the transfer is active, send a \samp{PORT} command and the transfer command specified *************** *** 192,202 **** send a \samp{PASV} command, connect to it, and start the transfer command. Either way, return the socket for the connection. \end{methoddesc} ! \begin{methoddesc}{ntransfercmd}{cmd} Like \method{transfercmd()}, but returns a tuple of the data connection and the expected size of the data. If the expected size could not be computed, \code{None} will be returned as the expected ! size. \end{methoddesc} --- 194,219 ---- send a \samp{PASV} command, connect to it, and start the transfer command. Either way, return the socket for the connection. + + If optional \var{rest} is given, a \samp{REST} command is + sent to the server, passing \var{rest} as an argument. \var{rest} is + usually a byte offset into the requested file, telling the server to + restart sending the file's bytes at the requested offset, skipping + over the initial bytes. Note however that RFC + 959 requires only that \var{rest} be a string containing characters + in the printable range from ASCII code 33 to ASCII code 126. The + \method{transfercmd()} method, therefore, converts + \var{rest} to a string, but no check is + performed on the string's contents. If the server does + not recognize the \samp{REST} command, an + \exception{error_reply} exception will be raised. If this happens, + simply call \method{transfercmd()} without a \var{rest} argument. \end{methoddesc} ! \begin{methoddesc}{ntransfercmd}{cmd\optional{, rest}} Like \method{transfercmd()}, but returns a tuple of the data connection and the expected size of the data. If the expected size could not be computed, \code{None} will be returned as the expected ! size. \var{cmd} and \var{rest} means the same thing as in ! \method{transfercmd()}. \end{methoddesc} From python-dev@python.org Fri Sep 1 07:40:09 2000 From: python-dev@python.org (Barry Warsaw) Date: Thu, 31 Aug 2000 23:40:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib smtplib.py,1.28,1.29 Message-ID: <200009010640.XAA22682@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv22668 Modified Files: smtplib.py Log Message: Applied patch #101350, closing it. Index: smtplib.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtplib.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** smtplib.py 2000/08/16 14:26:22 1.28 --- smtplib.py 2000/09/01 06:40:07 1.29 *************** *** 225,229 **** if self.sock: try: ! self.sock.send(str) except socket.error: raise SMTPServerDisconnected('Server not connected') --- 225,231 ---- if self.sock: try: ! sendptr = 0 ! while sendptr < len(str): ! sendptr = sendptr + self.sock.send(str[sendptr:]) except socket.error: raise SMTPServerDisconnected('Server not connected') From python-dev@python.org Fri Sep 1 07:51:28 2000 From: python-dev@python.org (Tim Peters) Date: Thu, 31 Aug 2000 23:51:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.166,2.167 Message-ID: <200009010651.XAA23345@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv23159/python/dist/src/modules Modified Files: posixmodule.c Log Message: Fix test_popen2 on Windows, recently broken by changes to the dict(!) implementation. You don't want to know. I've asked Guido to give this a critical review (we agreed on the approach, but the implementation proved more ... interesting ... than anticipated). This will almost certainly be the highlight of Mark Hammond's day . Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.166 retrieving revision 2.167 diff -C2 -r2.166 -r2.167 *** posixmodule.c 2000/08/15 18:52:33 2.166 --- posixmodule.c 2000/09/01 06:51:24 2.167 *************** *** 2686,2689 **** --- 2686,2704 ---- * final handle that will return the exit code. */ + + /* RED_FLAG 31-Aug-2000 Tim + * This is always called (today!) between a pair of + * Py_BEGIN_ALLOW_THREADS/ Py_END_ALLOW_THREADS + * macros. So the thread running this has no valid thread state, as + * far as Python is concerned. However, this calls some Python API + * functions that cannot be called safely without a valid thread + * state, in particular PyDict_GetItem. + * As a temporary hack (although it may last for years ...), we + * *rely* on not having a valid thread state in this function, in + * order to create our own "from scratch". + * This will deadlock if _PyPclose is ever called by a thread + * holding the global lock. + */ + static int _PyPclose(FILE *file) { *************** *** 2693,2697 **** PyObject *procObj, *hProcessObj, *intObj, *fileObj; long file_count; ! /* Close the file handle first, to ensure it can't block the * child from exiting if it's the last handle. --- 2708,2716 ---- PyObject *procObj, *hProcessObj, *intObj, *fileObj; long file_count; ! #ifdef WITH_THREAD ! PyInterpreterState* pInterpreterState; ! PyThreadState* pThreadState; ! #endif ! /* Close the file handle first, to ensure it can't block the * child from exiting if it's the last handle. *************** *** 2699,2702 **** --- 2718,2746 ---- result = fclose(file); + #ifdef WITH_THREAD + /* Bootstrap a valid thread state into existence. */ + pInterpreterState = PyInterpreterState_New(); + if (!pInterpreterState) { + /* Well, we're hosed now! We don't have a thread + * state, so can't call a nice error routine, or raise + * an exception. Just die. + */ + Py_FatalError("unable to allocate interpreter state " + " when closing popen object."); + return -1; /* unreachable */ + } + pThreadState = PyThreadState_New(pInterpreterState); + if (!pThreadState) { + Py_FatalError("unable to allocate thread state " + " when closing popen object."); + return -1; /* unreachable */ + } + /* Grab the global lock. Note that this will deadlock if the + * current thread already has the lock! (see RED_FLAG comments + * before this function) + */ + PyEval_RestoreThread(pThreadState); + #endif + if (_PyPopenProcs) { if ((fileObj = PyLong_FromVoidPtr(file)) != NULL && *************** *** 2755,2758 **** --- 2799,2814 ---- Py_XDECREF(fileObj); } /* if _PyPopenProcs */ + + #ifdef WITH_THREAD + /* Tear down the thread & interpreter states. + * Note that interpreter state clear & delete functions automatically + * call the thread & clear functions, and * indeed insist on doing + * that themselves. The lock must be held during the clear, but need + * not be held during the delete. + */ + PyInterpreterState_Clear(pInterpreterState); + PyEval_ReleaseThread(pThreadState); + PyInterpreterState_Delete(pInterpreterState); + #endif return result; From python-dev@python.org Fri Sep 1 07:53:54 2000 From: python-dev@python.org (Barry Warsaw) Date: Thu, 31 Aug 2000 23:53:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_pkg,1.4,1.5 Message-ID: <200009010653.XAA23494@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/test/output In directory slayer.i.sourceforge.net:/tmp/cvs-serv23476/output Modified Files: test_pkg Log Message: Applying patch #100994 to allow JPython to use more of the standard Python test suite. Specifically, - import time instead of strop in test_b1 - test for ClassType of exceptions using isinstance instead of equality in test_exceptions - remove __builtins__ from dir() output in test_pkg test_pkg output needs to be regenerated. Index: test_pkg =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_pkg,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** test_pkg 2000/08/17 22:55:00 1.4 --- test_pkg 2000/09/01 06:53:52 1.5 *************** *** 27,39 **** 1 ['foo', 'string', 't5'] ! ['__builtins__', '__doc__', '__file__', '__name__', '__path__', 'foo', 'string', 't5'] ! ['__builtins__', '__doc__', '__file__', '__name__', 'string'] ! ['__builtins__', '__doc__', '__file__', '__name__', 'spam'] running test t6 ! ['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__path__'] t6.spam loading t6.ham loading t6.eggs loading ! ['__all__', '__builtins__', '__doc__', '__file__', '__name__', '__path__', 'eggs', 'ham', 'spam'] ['eggs', 'ham', 'spam', 't6'] running test t7 --- 27,39 ---- 1 ['foo', 'string', 't5'] ! ['__doc__', '__file__', '__name__', '__path__', 'foo', 'string', 't5'] ! ['__doc__', '__file__', '__name__', 'string'] ! ['__doc__', '__file__', '__name__', 'spam'] running test t6 ! ['__all__', '__doc__', '__file__', '__name__', '__path__'] t6.spam loading t6.ham loading t6.eggs loading ! ['__all__', '__doc__', '__file__', '__name__', '__path__', 'eggs', 'ham', 'spam'] ['eggs', 'ham', 'spam', 't6'] running test t7 From python-dev@python.org Fri Sep 1 07:53:54 2000 From: python-dev@python.org (Barry Warsaw) Date: Thu, 31 Aug 2000 23:53:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_b1.py,1.25,1.26 test_exceptions.py,1.8,1.9 test_pkg.py,1.8,1.9 Message-ID: <200009010653.XAA23490@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/test In directory slayer.i.sourceforge.net:/tmp/cvs-serv23476 Modified Files: test_b1.py test_exceptions.py test_pkg.py Log Message: Applying patch #100994 to allow JPython to use more of the standard Python test suite. Specifically, - import time instead of strop in test_b1 - test for ClassType of exceptions using isinstance instead of equality in test_exceptions - remove __builtins__ from dir() output in test_pkg test_pkg output needs to be regenerated. Index: test_b1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_b1.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** test_b1.py 2000/08/23 21:11:05 1.25 --- test_b1.py 2000/09/01 06:53:51 1.26 *************** *** 5,9 **** print '__import__' __import__('sys') ! __import__('strop') __import__('string') try: __import__('spamspam') --- 5,9 ---- print '__import__' __import__('sys') ! __import__('time') __import__('string') try: __import__('spamspam') Index: test_exceptions.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_exceptions.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** test_exceptions.py 2000/07/11 17:52:59 1.8 --- test_exceptions.py 2000/09/01 06:53:51 1.9 *************** *** 20,24 **** def r(thing): test_raise_catch(thing) ! if type(thing) == ClassType: print thing.__name__ else: --- 20,24 ---- def r(thing): test_raise_catch(thing) ! if isinstance(thing, ClassType): print thing.__name__ else: Index: test_pkg.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pkg.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** test_pkg.py 2000/08/17 22:54:59 1.8 --- test_pkg.py 2000/09/01 06:53:51 1.9 *************** *** 43,46 **** --- 43,53 ---- os.rmdir(x) + def fixdir(lst): + try: + lst.remove('__builtins__') + except ValueError: + pass + return lst + # Helper to run a test *************** *** 147,153 **** print dir() import t5 ! print dir(t5) ! print dir(t5.foo) ! print dir(t5.string) """), --- 154,160 ---- print dir() import t5 ! print fixdir(dir(t5)) ! print fixdir(dir(t5.foo)) ! print fixdir(dir(t5.string)) """), *************** *** 161,167 **** """ import t6 ! print dir(t6) from t6 import * ! print dir(t6) print dir() """), --- 168,174 ---- """ import t6 ! print fixdir(dir(t6)) from t6 import * ! print fixdir(dir(t6)) print dir() """), From python-dev@python.org Fri Sep 1 08:05:02 2000 From: python-dev@python.org (Tim Peters) Date: Fri, 1 Sep 2000 00:05:02 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0200.txt,1.36,1.37 Message-ID: <200009010705.AAA25917@slayer.i.sourceforge.net> Update of /cvsroot/python/python/nondist/peps In directory slayer.i.sourceforge.net:/tmp/cvs-serv24827 Modified Files: pep-0200.txt Log Message: Record that test_popen2 on Windows failed again, and why. Removed the line about "Windows threads problems" because I believe the test_popen2 failure is what that was talking about. Index: pep-0200.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0200.txt,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** pep-0200.txt 2000/09/01 03:06:39 1.36 --- pep-0200.txt 2000/09/01 07:04:59 1.37 *************** *** 96,100 **** Add popen2 support for Linux -- Fred Drake - There are some threads problems on windows... Deal with buffering problem with SocketServer -- GvR --- 96,99 ---- *************** *** 176,179 **** --- 175,187 ---- test_popen2 Win32 26-Jul-2000 + [31-Aug-2000 tim + This died again, but for an entirely different reason: it uses a + dict to map file pointers to process handles, and calls a dict + access function during popen.close(). But .close releases threads, + which left the internal popen code accessing the dict without a + valid thread state. The dict implementation changed so that's no + longer accepted. Fixed by creating a temporary thread state in the + guts of popen's close routine, and grabbing the global lock with + it for the duration] [20-Aug-2000 tim changed the popen2.py _test function to use the "more" cmd From python-dev@python.org Fri Sep 1 08:53:28 2000 From: python-dev@python.org (Thomas Wouters) Date: Fri, 1 Sep 2000 00:53:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects abstract.c,2.51,2.52 Message-ID: <200009010753.AAA03458@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Objects In directory slayer.i.sourceforge.net:/tmp/cvs-serv3441 Modified Files: abstract.c Log Message: Fix grouping, again. This time properly :-) Sorry, guys. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.51 retrieving revision 2.52 diff -C2 -r2.51 -r2.52 *** abstract.c 2000/09/01 02:39:00 2.51 --- abstract.c 2000/09/01 07:53:25 2.52 *************** *** 814,823 **** return x; } ! else if ((HASINPLACE(v) && ((v->ob_type->tp_as_sequence != NULL && (f = v->ob_type->tp_as_sequence->sq_inplace_concat) ! != NULL))) || (v->ob_type->tp_as_number != NULL && ! (f = v->ob_type->tp_as_number->nb_inplace_add) != NULL)) return (*f)(v, w); --- 814,823 ---- return x; } ! else if (HASINPLACE(v) && ((v->ob_type->tp_as_sequence != NULL && (f = v->ob_type->tp_as_sequence->sq_inplace_concat) ! != NULL) || (v->ob_type->tp_as_number != NULL && ! (f = v->ob_type->tp_as_number->nb_inplace_add) != NULL))) return (*f)(v, w); From python-dev@python.org Fri Sep 1 08:54:06 2000 From: python-dev@python.org (Tim Peters) Date: Fri, 1 Sep 2000 00:54:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.9,1.10 Message-ID: <200009010754.AAA03505@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/PCbuild In directory slayer.i.sourceforge.net:/tmp/cvs-serv3427/python/dist/src/pcbuild Modified Files: python20.wse Log Message: Added installation of w9xpopen.exe. Removed installation of Lib/plat-win/*.py, because it no longer exists! Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** python20.wse 2000/08/25 06:52:44 1.9 --- python20.wse 2000/09/01 07:54:04 1.10 *************** *** 662,665 **** --- 662,670 ---- end item: Install File + Source=%_SRC_%\PCbuild\w9xpopen.exe + Destination=%MAINDIR%\w9xpopen.exe + Flags=0000000000000010 + end + item: Install File Source=%_SRC_%\pcbuild\*.pyd Destination=%MAINDIR%\DLLs *************** *** 696,700 **** Flags=0000000000000010 end ! item: Install File Source=%_SRC_%\Lib\plat-win\*.py Destination=%MAINDIR%\Lib\Plat-Win --- 701,705 ---- Flags=0000000000000010 end ! remarked item: Install File Source=%_SRC_%\Lib\plat-win\*.py Destination=%MAINDIR%\Lib\Plat-Win From python-dev@python.org Fri Sep 1 08:54:47 2000 From: python-dev@python.org (Tim Peters) Date: Fri, 1 Sep 2000 00:54:47 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0200.txt,1.37,1.38 Message-ID: <200009010754.AAA03534@slayer.i.sourceforge.net> Update of /cvsroot/python/python/nondist/peps In directory slayer.i.sourceforge.net:/tmp/cvs-serv3517 Modified Files: pep-0200.txt Log Message: Closed the w9xpopen issue. Index: pep-0200.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0200.txt,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** pep-0200.txt 2000/09/01 07:04:59 1.37 --- pep-0200.txt 2000/09/01 07:54:44 1.38 *************** *** 114,119 **** Python can be installed on NT & 2000 without admin privileges). - Windows installer: Install w9xpopen.exe only under Win95/98. - Windows ME: Don't know anything about it. Will the installer even run? Does it need the w9xpopen hack? --- 114,117 ---- *************** *** 244,247 **** --- 242,250 ---- Open items -- completed/fixed + + [01-Sep-200 tim - as Guido said, runtime code in posixmodule.c doesn't + call this on NT/2000, so no need to avoid installing it everywhere. + Added code to the installer *to* install it, though.] + Windows installer: Install w9xpopen.exe only under Win95/98. [23-Aug-2000 jeremy - tim reports "completed recently"] From python-dev@python.org Fri Sep 1 09:10:21 2000 From: python-dev@python.org (Barry Warsaw) Date: Fri, 1 Sep 2000 01:10:21 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/i18n msgfmt.py,NONE,1.1 Message-ID: <200009010810.BAA09737@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Tools/i18n In directory slayer.i.sourceforge.net:/tmp/cvs-serv9709 Added Files: msgfmt.py Log Message: Tool to generate binary GNU .mo file from .po template files. Written by Martin v. Loewis, proofed by Barry Warsaw for coding standards, typos, and to make command line options compatible with GNU msgfmt where they overlap. Closes patch #101295. --- NEW FILE --- #! /usr/bin/env python # Written by Martin v. Löwis """Generate binary message catalog from textual translation description. This program converts a textual Uniforum-style message catalog (.po file) into a binary GNU catalog (.mo file). This is essentially the same function as the GNU msgfmt program, however, it is a simpler implementation. Usage: msgfmt.py [OPTIONS] filename.po Options: -h --help Print this message and exit. -V --version Display version information and exit. """ import sys import getopt import struct import array __version__ = "1.0" MESSAGES = {} def usage(code, msg=''): print >> sys.stderr, __doc__ if msg: print >> sys.stderr, msg sys.exit(code) def add(id, str, fuzzy): "Add a non-fuzzy translation to the dictionary." global MESSAGES if not fuzzy and str: MESSAGES[id] = str def generate(): "Return the generated output." global MESSAGES keys = MESSAGES.keys() # the keys are sorted in the .mo file keys.sort() offsets = [] ids = strs = '' for id in keys: # For each string, we need size and file offset. Each string is NUL # terminated; the NUL does not count into the size. offsets.append((len(ids), len(id), len(strs), len(MESSAGES[id]))) ids += id + '\0' strs += MESSAGES[id] + '\0' output = '' # The header is 7 32-bit unsigned integers. We don't use hash tables, so # the keys start right after the index tables. # translated string. keystart = 7*4+16*len(keys) # and the values start after the keys valuestart = keystart + len(ids) koffsets = [] voffsets = [] # The string table first has the list of keys, then the list of values. # Each entry has first the size of the string, then the file offset. for o1, l1, o2, l2 in offsets: koffsets += [l1, o1+keystart] voffsets += [l2, o2+valuestart] offsets = koffsets + voffsets output = struct.pack("iiiiiii", 0x950412de, # Magic 0, # Version len(keys), # # of entries 7*4, # start of key index 7*4+len(keys)*8, # start of value index 0, 0) # size and offset of hash table output += array.array("i", offsets).tostring() output += ids output += strs return output def make(filename): ID = 1 STR = 2 # Compute .mo name from .po name if filename.endswith('.po'): infile = filename outfile = filename[:-2] + 'mo' else: infile = filename + '.po' outfile = filename + '.mo' try: lines = open(infile).readlines() except IOError, msg: print >> sys.stderr, msg sys.exit(1) section = None fuzzy = 0 # Parse the catalog lno = 0 for l in lines: lno += 1 # If we get a comment line after a msgstr, this is a new entry if l[0] == '#' and section == STR: add(msgid, msgstr, fuzzy) section = None fuzzy = 0 # Record a fuzzy mark if l[:2] == '#,' and l.find('fuzzy'): fuzzy = 1 # Skip comments if l[0] == '#': continue # Now we are in a msgid section, output previous section if l.startswith('msgid'): if section == STR: add(msgid, msgstr, fuzzy) section = ID l = l[5:] msgid = msgstr = '' # Now we are in a msgstr section elif l.startswith('msgstr'): section = STR l = l[6:] # Skip empty lines l = l.strip() if not l: continue # XXX: Does this always follow Python escape semantics? l = eval(l) if section == ID: msgid += l elif section == STR: msgstr += l else: print >> sys.stderr, 'Syntax error on %s:%d' % (infile, lno), \ 'before:' print >> sys.stderr, l sys.exit(1) # Add last entry if section == STR: add(msgid, msgstr, fuzzy) # Compute output output = generate() # Save output try: open(outfile,"wb").write(output) except IOError,msg: print >> sys.stderr, msg def main(): try: opts, args = getopt.getopt(sys.argv[1:], 'hV', ['help','version']) except getopt.error, msg: usage(1, msg) # parse options for opt, arg in opts: if opt in ('-h', '--help'): usage(0) elif opt in ('-V', '--version'): print >> sys.stderr, "msgfmt.py", __version__ sys.exit(0) # do it if not args: print >> sys.stderr, 'No input file given' print >> sys.stderr, "Try `msgfmt --help' for more information." return for filename in args: make(filename) if __name__ == '__main__': main() From python-dev@python.org Fri Sep 1 10:01:36 2000 From: python-dev@python.org (Barry Warsaw) Date: Fri, 1 Sep 2000 02:01:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules almodule.c,1.30,1.31 cdmodule.c,1.23,1.24 errnomodule.c,2.13,2.14 fcntlmodule.c,2.24,2.25 linuxaudiodev.c,2.7,2.8 mathmodule.c,2.53,2.54 mpzmodule.c,2.31,2.32 parsermodule.c,2.54,2.55 pcremodule.c,2.23,2.24 puremodule.c,2.3,2.4 shamodule.c,2.10,2.11 stropmodule.c,2.72,2.73 syslogmodule.c,2.16,2.17 timemodule.c,2.101,2.102 timingmodule.c,2.7,2.8 Message-ID: <200009010901.CAA18075@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv17453 Modified Files: almodule.c cdmodule.c errnomodule.c fcntlmodule.c linuxaudiodev.c mathmodule.c mpzmodule.c parsermodule.c pcremodule.c puremodule.c shamodule.c stropmodule.c syslogmodule.c timemodule.c timingmodule.c Log Message: Do the absolute minimal amount of modifications to eradicate Py_FatalError() from module initialization functions. The importing mechanism already checks for PyErr_Occurred() after module importation and it Does The Right Thing. Unfortunately, the following either were not compiled or tested by the regression suite, due to issues with my development platform: almodule.c cdmodule.c mpzmodule.c puremodule.c timingmodule.c Index: almodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/almodule.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** almodule.c 2000/07/21 06:00:07 1.30 --- almodule.c 2000/09/01 09:01:32 1.31 *************** *** 3243,3250 **** #endif /* OLD_INTERFACE */ ! /* Check for errors */ ! if (PyErr_Occurred()) { ! error: ! Py_FatalError("can't initialize module al"); ! } } --- 3243,3247 ---- #endif /* OLD_INTERFACE */ ! error: ! return; } Index: cdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cdmodule.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** cdmodule.c 2000/07/21 06:00:07 1.23 --- cdmodule.c 2000/09/01 09:01:32 1.24 *************** *** 803,808 **** PyDict_SetItemString(d, "CDROM", PyInt_FromLong((long) CD_CDROM)); #endif - - if (PyErr_Occurred()) - Py_FatalError("can't initialize module cd"); } --- 803,805 ---- Index: errnomodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/errnomodule.c,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -r2.13 -r2.14 *** errnomodule.c 2000/07/21 06:00:07 2.13 --- errnomodule.c 2000/09/01 09:01:32 2.14 *************** *** 36,50 **** _inscode(PyObject *d, PyObject *de, char *name, int code) { ! PyObject *u; ! PyObject *v; ! u = PyString_FromString(name); ! v = PyInt_FromLong((long) code); ! ! if (!u || !v) { ! /* Don't bother reporting this error */ ! PyErr_Clear(); ! } ! else { /* insert in modules dict */ PyDict_SetItem(d, u, v); --- 36,47 ---- _inscode(PyObject *d, PyObject *de, char *name, int code) { ! PyObject *u = PyString_FromString(name); ! PyObject *v = PyInt_FromLong((long) code); ! /* Don't bother checking for errors; they'll be caught at the end ! * of the module initialization function by the caller of ! * initerrno(). ! */ ! if (u && v) { /* insert in modules dict */ PyDict_SetItem(d, u, v); *************** *** 77,82 **** d = PyModule_GetDict(m); de = PyDict_New(); ! if (de == NULL || PyDict_SetItemString(d, "errorcode", de)) ! Py_FatalError("can't initialize errno module"); /* Macro so I don't have to edit each and every line below... */ --- 74,79 ---- d = PyModule_GetDict(m); de = PyDict_New(); ! if (!d || !de || PyDict_SetItemString(d, "errorcode", de) < 0) ! return; /* Macro so I don't have to edit each and every line below... */ Index: fcntlmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/fcntlmodule.c,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -r2.24 -r2.25 *** fcntlmodule.c 2000/08/02 20:46:51 2.24 --- fcntlmodule.c 2000/09/01 09:01:32 2.25 *************** *** 329,335 **** d = PyModule_GetDict(m); all_ins(d); - - /* Check for errors */ - if (PyErr_Occurred()) - Py_FatalError("can't initialize module fcntl"); } --- 329,331 ---- Index: linuxaudiodev.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/linuxaudiodev.c,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -r2.7 -r2.8 *** linuxaudiodev.c 2000/08/31 18:11:07 2.7 --- linuxaudiodev.c 2000/09/01 09:01:32 2.8 *************** *** 443,450 **** Py_DECREF(x); ! /* Check for errors */ ! if (PyErr_Occurred()) { ! error: ! Py_FatalError("can't initialize module linuxaudiodev"); ! } } --- 443,447 ---- Py_DECREF(x); ! error: ! return; } Index: mathmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mathmodule.c,v retrieving revision 2.53 retrieving revision 2.54 diff -C2 -r2.53 -r2.54 *** mathmodule.c 2000/08/10 04:23:30 2.53 --- mathmodule.c 2000/09/01 09:01:32 2.54 *************** *** 269,275 **** goto finally; Py_DECREF(v); - return; finally: ! Py_FatalError("can't initialize math module"); } --- 269,274 ---- goto finally; Py_DECREF(v); finally: ! return; } Index: mpzmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mpzmodule.c,v retrieving revision 2.31 retrieving revision 2.32 diff -C2 -r2.31 -r2.32 *** mpzmodule.c 2000/07/21 06:00:07 2.31 --- mpzmodule.c 2000/09/01 09:01:32 2.32 *************** *** 1730,1742 **** /* create some frequently used constants */ if ((mpz_value_zero = newmpzobject()) == NULL) ! Py_FatalError("initmpz: can't initialize mpz constants"); mpz_set_ui(&mpz_value_zero->mpz, (unsigned long int)0); if ((mpz_value_one = newmpzobject()) == NULL) ! Py_FatalError("initmpz: can't initialize mpz constants"); mpz_set_ui(&mpz_value_one->mpz, (unsigned long int)1); if ((mpz_value_mone = newmpzobject()) == NULL) ! Py_FatalError("initmpz: can't initialize mpz constants"); mpz_set_si(&mpz_value_mone->mpz, (long)-1); --- 1730,1742 ---- /* create some frequently used constants */ if ((mpz_value_zero = newmpzobject()) == NULL) ! goto finally; mpz_set_ui(&mpz_value_zero->mpz, (unsigned long int)0); if ((mpz_value_one = newmpzobject()) == NULL) ! goto finally; mpz_set_ui(&mpz_value_one->mpz, (unsigned long int)1); if ((mpz_value_mone = newmpzobject()) == NULL) ! goto finally; mpz_set_si(&mpz_value_mone->mpz, (long)-1); *************** *** 1745,1750 **** PyDict_SetItemString(dict, "MPZType", (PyObject*)&MPZtype); } ! } /* initmpz() */ #ifdef MAKEDUMMYINT int _mpz_dummy_int; /* XXX otherwise, we're .bss-less (DYNLOAD->Jack?) */ --- 1745,1752 ---- PyDict_SetItemString(dict, "MPZType", (PyObject*)&MPZtype); } ! finally: ! return; } /* initmpz() */ + #ifdef MAKEDUMMYINT int _mpz_dummy_int; /* XXX otherwise, we're .bss-less (DYNLOAD->Jack?) */ Index: parsermodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/parsermodule.c,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -r2.54 -r2.55 *** parsermodule.c 2000/08/26 07:38:06 2.54 --- parsermodule.c 2000/09/01 09:01:32 2.55 *************** *** 2863,2871 **** if ((parser_error == 0) ! || (PyDict_SetItemString(dict, "ParserError", parser_error) != 0)) { ! /* ! * This is serious. ! */ ! Py_FatalError("can't define parser.ParserError"); } /* --- 2863,2870 ---- if ((parser_error == 0) ! || (PyDict_SetItemString(dict, "ParserError", parser_error) != 0)) ! { ! /* caller will check PyErr_Occurred() */ ! return; } /* Index: pcremodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pcremodule.c,v retrieving revision 2.23 retrieving revision 2.24 diff -C2 -r2.23 -r2.24 *** pcremodule.c 2000/07/21 06:00:07 2.23 --- pcremodule.c 2000/09/01 09:01:32 2.24 *************** *** 651,658 **** insint(d, "VERBOSE", PCRE_EXTENDED); insint(d, "LOCALE", PCRE_LOCALE); - - /* Check for errors */ - if (PyErr_Occurred()) - Py_FatalError("can't initialize module pcre"); } --- 651,654 ---- Index: puremodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/puremodule.c,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -r2.3 -r2.4 *** puremodule.c 2000/08/18 05:13:47 2.3 --- puremodule.c 2000/09/01 09:01:32 2.4 *************** *** 984,988 **** PyDict_SetItemString(d, "QUANTIFY_VERSION", Py_None); #endif - if (PyErr_Occurred()) - Py_FatalError("couldn't initialize the pure module"); } --- 984,986 ---- Index: shamodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/shamodule.c,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -r2.10 -r2.11 *** shamodule.c 2000/08/15 06:03:35 2.10 --- shamodule.c 2000/09/01 09:01:32 2.11 *************** *** 560,566 **** blocks */ insint("digestsize", 20); - - /* Check for errors */ - if (PyErr_Occurred()) - Py_FatalError("can't initialize module SHA"); } --- 560,562 ---- Index: stropmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/stropmodule.c,v retrieving revision 2.72 retrieving revision 2.73 diff -C2 -r2.72 -r2.73 *** stropmodule.c 2000/08/03 02:34:44 2.72 --- stropmodule.c 2000/09/01 09:01:32 2.73 *************** *** 1245,1250 **** Py_DECREF(s); } - - if (PyErr_Occurred()) - Py_FatalError("can't initialize module strop"); } --- 1245,1247 ---- Index: syslogmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/syslogmodule.c,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -r2.16 -r2.17 *** syslogmodule.c 2000/07/21 06:00:07 2.16 --- syslogmodule.c 2000/09/01 09:01:32 2.17 *************** *** 233,239 **** ins(d, "LOG_UUCP", LOG_UUCP); ins(d, "LOG_NEWS", LOG_NEWS); - - /* Check for errors */ - if (PyErr_Occurred()) - Py_FatalError("can't initialize module syslog"); } --- 233,235 ---- Index: timemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/timemodule.c,v retrieving revision 2.101 retrieving revision 2.102 diff -C2 -r2.101 -r2.102 *** timemodule.c 2000/08/15 18:52:33 2.101 --- timemodule.c 2000/09/01 09:01:32 2.102 *************** *** 513,524 **** ins(PyObject *d, char *name, PyObject *v) { ! if (v == NULL) ! Py_FatalError("Can't initialize time module -- NULL value"); ! if (PyDict_SetItemString(d, name, v) != 0) ! Py_FatalError( ! "Can't initialize time module -- PyDict_SetItemString failed"); ! Py_DECREF(v); } static char module_doc[] = "This module provides various functions to manipulate time values.\n\ --- 513,525 ---- ins(PyObject *d, char *name, PyObject *v) { ! /* Don't worry too much about errors, they'll be caught by the ! * caller of inittime(). ! */ ! if (v) ! PyDict_SetItemString(d, name, v); ! Py_XDECREF(v); } + static char module_doc[] = "This module provides various functions to manipulate time values.\n\ *************** *** 648,653 **** #endif /* HAVE_TM_ZONE */ #endif /* !HAVE_TZNAME || __GLIBC__ */ - if (PyErr_Occurred()) - Py_FatalError("Can't initialize time module"); } --- 649,652 ---- Index: timingmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/timingmodule.c,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -r2.7 -r2.8 *** timingmodule.c 2000/07/21 06:00:07 2.7 --- timingmodule.c 2000/09/01 09:01:32 2.8 *************** *** 73,77 **** { (void)Py_InitModule("timing", timing_methods); - if (PyErr_Occurred()) - Py_FatalError("can't initialize module timing"); } --- 73,75 ---- From python-dev@python.org Fri Sep 1 10:47:23 2000 From: python-dev@python.org (Moshe Zadka) Date: Fri, 1 Sep 2000 02:47:23 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.80,1.81 Message-ID: <200009010947.CAA29501@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/api In directory slayer.i.sourceforge.net:/tmp/cvs-serv25847 Modified Files: api.tex Log Message: Update documentation for PyErr_Format, because the function has changed. Connected to patch 100895 Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -r1.80 -r1.81 *** api.tex 2000/09/01 05:30:00 1.80 --- api.tex 2000/09/01 09:47:20 1.81 *************** *** 883,895 **** \begin{cfuncdesc}{PyObject*}{PyErr_Format}{PyObject *exception, ! const char *format, ...} ! This function sets the error indicator using a printf-style format ! string. The first argument specifies the exception type and the ! second argument specifies the format string for the exception. Any ! subsequent arguments are converted to output by the C library's ! \cfunction{vsprintf()} function. The buffer used internally by ! \cfunction{PyErr_Format()} is 500 bytes long. The caller is ! responsible for guaranteeing that the formatted output does not ! overflow the buffer. \end{cfuncdesc} --- 883,905 ---- \begin{cfuncdesc}{PyObject*}{PyErr_Format}{PyObject *exception, ! const char *format, \moreargs} ! This function sets the error indicator. ! \var{exception} should be a Python object. ! \var{fmt} should be a string, containing format codes, similar to ! \cfunction{printf}. The \code{width.precision} before a format code ! is parsed, but the width part is ignored. ! ! \begin{tableii}{c|l}{character}{Character}{Meaning} ! \lineii{c}{Character, as an \ctype{int} parameter} ! \lineii{d}{Number in decimal, as an \ctype{int} parameter} ! \lineii{x}{Number in hexadecimal, as an \ctype{int} parameter} ! \lineii{x}{A string, as a \ctype{char *} parameter} ! \end{tableii} ! ! An unrecognized format character causes all the rest of ! the format string to be copied as-is to the result string, ! and any extra arguments discarded. ! ! A new reference is returned, which is owned by the caller. \end{cfuncdesc} From python-dev@python.org Fri Sep 1 12:07:25 2000 From: python-dev@python.org (Vladimir Marangozov) Date: Fri, 1 Sep 2000 04:07:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.203,2.204 Message-ID: <200009011107.EAA00320@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv31008/Python Modified Files: ceval.c Log Message: Cosmetics on Py_Get/SetRecursionLimit (for the style guide) Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.203 retrieving revision 2.204 diff -C2 -r2.203 -r2.204 *** ceval.c 2000/09/01 03:34:26 2.203 --- ceval.c 2000/09/01 11:07:19 2.204 *************** *** 303,312 **** static int recursion_limit = 1000; ! int Py_GetRecursionLimit(void) { return recursion_limit; } ! void Py_SetRecursionLimit(int new_limit) { recursion_limit = new_limit; --- 303,314 ---- static int recursion_limit = 1000; ! int ! Py_GetRecursionLimit(void) { return recursion_limit; } ! void ! Py_SetRecursionLimit(int new_limit) { recursion_limit = new_limit; From python-dev@python.org Fri Sep 1 12:45:05 2000 From: python-dev@python.org (Tim Peters) Date: Fri, 1 Sep 2000 04:45:05 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.10,1.11 Message-ID: <200009011145.EAA12368@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/PCbuild In directory slayer.i.sourceforge.net:/tmp/cvs-serv10513/python/dist/src/pcbuild Modified Files: python20.wse Log Message: Back off to HKCU (instead of HKLM) if user doesn't have "NT adminstrator privileges". Untested except on Win98SE (where Wise writes to HKLM). Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** python20.wse 2000/09/01 07:54:04 1.10 --- python20.wse 2000/09/01 11:45:02 1.11 *************** *** 51,55 **** item: End Block end ! item: Check Configuration Message=Sorry, but we can not install Python on your system unless you have Administrator Privileges. Message= --- 51,55 ---- item: End Block end ! remarked item: Check Configuration Message=Sorry, but we can not install Python on your system unless you have Administrator Privileges. Message= *************** *** 982,985 **** --- 982,991 ---- New Value=%MAINDIR%\pyc.ico end + item: Remark + Text=Write to HKLM for admin, else HKCU. Keep these blocks otherwise identical! + end + item: Check Configuration + Flags=10111111 + end item: Edit Registry Key=Software\Python\PythonCore\CurrentVersion *************** *** 1010,1015 **** --- 1016,1060 ---- Root=2 end + item: Else Statement + end + item: Display Message + Title=Doing non-admin install + Text=The current login does not have Administrator Privileges on this machine. Python will install its registry information into the per-user area only for the current login, instead of into the per-machine area for every account on this machine. Some advanced uses of Python may not work as a result (for example, running a Python script as a service). + Text= + Text=If this is not what you want, please log on as an Administrator, and start the installation again. + Flags=00001000 + end + item: Edit Registry + Key=Software\Python\PythonCore\CurrentVersion + Root=129 + end + item: Edit Registry + Key=Software\Python\PythonCore\%PY_VERSION%\InstallPath + New Value=%MAINDIR% + Root=1 + end + item: Edit Registry + Key=Software\Python\PythonCore\%PY_VERSION%\InstallPath\InstallGroup + New Value=%GROUP% + Root=1 + end + item: Edit Registry + Key=Software\Python\PythonCore\%PY_VERSION%\PythonPath + New Value=%MAINDIR%\Lib\plat-win;%MAINDIR%\Lib;%MAINDIR%\DLLs;%MAINDIR%\Lib\lib-tk + Root=1 + end + item: Edit Registry + Key=Software\Python\PythonCore\%PY_VERSION%\Modules + Root=1 + end + item: Edit Registry + Key=Software\Microsoft\Windows\CurrentVersion\App Paths\Python.exe + New Value=%MAINDIR%\Python.exe + Root=1 + end item: End Block end + item: End Block + end item: If/While Statement Variable=COMPONENTS *************** *** 1017,1024 **** --- 1062,1084 ---- Flags=00001010 end + item: Remark + Text=Write to HKLM for admin, else HKCU. Keep these blocks otherwise identical! + end + item: Check Configuration + Flags=10111111 + end item: Edit Registry Key=Software\Python\PythonCore\%PY_VERSION%\Help\Main Python Documentation New Value=%MAINDIR%\Doc\index.html Root=2 + end + item: Else Statement + end + item: Edit Registry + Key=Software\Python\PythonCore\%PY_VERSION%\Help\Main Python Documentation + New Value=%MAINDIR%\Doc\index.html + Root=1 + end + item: End Block end item: End Block From python-dev@python.org Fri Sep 1 12:46:13 2000 From: python-dev@python.org (Tim Peters) Date: Fri, 1 Sep 2000 04:46:13 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0200.txt,1.38,1.39 Message-ID: <200009011146.EAA13514@slayer.i.sourceforge.net> Update of /cvsroot/python/python/nondist/peps In directory slayer.i.sourceforge.net:/tmp/cvs-serv13031 Modified Files: pep-0200.txt Log Message: Updated status of Windows installer issues. Index: pep-0200.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0200.txt,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** pep-0200.txt 2000/09/01 07:54:44 1.38 --- pep-0200.txt 2000/09/01 11:46:11 1.39 *************** *** 111,117 **** --- 111,119 ---- Decide on a license. + [01-Sep-2000 tim: ompleted but untested except on Win98SE] Windows installer: If HKLM isn't writable, back off to HKCU (so Python can be installed on NT & 2000 without admin privileges). + [01-Sep-2000 tim: make a prerelease availabe] Windows ME: Don't know anything about it. Will the installer even run? Does it need the w9xpopen hack? From python-dev@python.org Fri Sep 1 14:41:41 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 06:41:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts eptags.py,1.6,1.7 ptags.py,1.5,1.6 Message-ID: <200009011341.GAA02575@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Tools/scripts In directory slayer.i.sourceforge.net:/tmp/cvs-serv1775 Modified Files: eptags.py ptags.py Log Message: Rob Hooft, Moshe Zadka: converted to 4 space indents and re instead of regex. Index: eptags.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/eptags.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** eptags.py 1998/10/08 15:24:46 1.6 --- eptags.py 2000/09/01 13:41:37 1.7 *************** *** 1,50 **** #! /usr/bin/env python ! # eptags ! # ! # Create a TAGS file for Python programs, usable with GNU Emacs (version 18). ! # Tagged are: ! # - functions (even inside other defs or classes) ! # - classes ! # Warns about files it cannot open. ! # No warnings about duplicate tags. ! import sys ! import regex ! def main(): ! outfp = open('TAGS', 'w') ! args = sys.argv[1:] ! for file in args: ! treat_file(file, outfp) ! ! expr = '^[ \t]*\(def\|class\)[ \t]+\([a-zA-Z0-9_]+\)[ \t]*[:(]' ! matcher = regex.compile(expr) def treat_file(file, outfp): ! try: ! fp = open(file, 'r') ! except: ! print 'Cannot open', file ! return ! charno = 0 ! lineno = 0 ! tags = [] ! size = 0 ! while 1: ! line = fp.readline() ! if not line: break ! lineno = lineno + 1 ! if matcher.search(line) >= 0: ! (a, b), (a1, b1), (a2, b2) = matcher.regs[:3] ! name = line[a2:b2] ! pat = line[a:b] ! tag = pat + '\177' + `lineno` + ',' + `charno` + '\n' ! tags.append((name, tag)) ! size = size + len(tag) ! charno = charno + len(line) ! outfp.write('\f\n' + file + ',' + `size` + '\n') ! for name, tag in tags: ! outfp.write(tag) ! main() --- 1,55 ---- #! /usr/bin/env python + """Create a TAGS file for Python programs, usable with GNU Emacs. ! usage: eptags pyfiles... ! The output TAGS file is usable with Emacs version 18, 19, 20. ! Tagged are: ! - functions (even inside other defs or classes) ! - classes ! ! eptags warns about files it cannot open. ! eptags will not give warnings about duplicate tags. ! ! BUGS: ! Because of tag duplication (methods with the same name in different ! classes), TAGS files are not very useful for most object-oriented ! python projects. ! """ ! import sys,re ! expr = r'^[ \t]*(def|class)[ \t]+([a-zA-Z_][a-zA-Z0-9_]*)[ \t]*[:\(]' ! matcher = re.compile(expr) def treat_file(file, outfp): ! """Append tags found in file named 'file' to the open file 'outfp'""" ! try: ! fp = open(file, 'r') ! except: ! sys.stderr.write('Cannot open %s\n'%file) ! return ! charno = 0 ! lineno = 0 ! tags = [] ! size = 0 ! while 1: ! line = fp.readline() ! if not line: break ! lineno = lineno + 1 ! m = matcher.search(line) ! if m: ! tag = m.group(0) + '\177%d,%d\n'%(lineno,charno) ! tags.append(tag) ! size = size + len(tag) ! charno = charno + len(line) ! outfp.write('\f\n%s,%d\n'%(file,size)) ! for tag in tags: ! outfp.write(tag) ! ! def main(): ! outfp = open('TAGS', 'w') ! for file in sys.argv[1:]: ! treat_file(file, outfp) ! if __name__=="__main__": ! main() Index: ptags.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/ptags.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** ptags.py 1996/11/27 19:44:33 1.5 --- ptags.py 2000/09/01 13:41:37 1.6 *************** *** 11,50 **** # No warnings about duplicate tags. ! import sys ! import regex ! import os ! tags = [] # Modified global variable! def main(): ! args = sys.argv[1:] ! for file in args: treat_file(file) ! if tags: ! fp = open('tags', 'w') ! tags.sort() ! for s in tags: fp.write(s) ! expr = '^[ \t]*\(def\|class\)[ \t]+\([a-zA-Z0-9_]+\)[ \t]*[:(]' ! matcher = regex.compile(expr) def treat_file(file): ! try: ! fp = open(file, 'r') ! except: ! print 'Cannot open', file ! return ! base = os.path.basename(file) ! if base[-3:] == '.py': base = base[:-3] ! s = base + '\t' + file + '\t' + '1\n' ! tags.append(s) ! while 1: ! line = fp.readline() ! if not line: break ! if matcher.search(line) >= 0: ! (a, b), (a1, b1), (a2, b2) = matcher.regs[:3] ! name = line[a2:b2] ! s = name + '\t' + file + '\t/^' + line[a:b] + '/\n' ! tags.append(s) main() --- 11,51 ---- # No warnings about duplicate tags. ! import sys, re, os ! tags = [] # Modified global variable! def main(): ! args = sys.argv[1:] ! for file in args: treat_file(file) ! if tags: ! fp = open('tags', 'w') ! tags.sort() ! for s in tags: fp.write(s) ! expr = '^[ \t]*(def|class)[ \t]+([a-zA-Z0-9_]+)[ \t]*[:\(]' ! matcher = re.compile(expr) def treat_file(file): ! try: ! fp = open(file, 'r') ! except: ! sys.stderr.write('Cannot open %s\n' % file) ! return ! base = os.path.basename(file) ! if base[-3:] == '.py': ! base = base[:-3] ! s = base + '\t' + file + '\t' + '1\n' ! tags.append(s) ! while 1: ! line = fp.readline() ! if not line: ! break ! m = matcher.match(line) ! if m: ! content = m.group(0) ! name = m.group(2) ! s = name + '\t' + file + '\t/^' + content + '/\n' ! tags.append(s) main() From python-dev@python.org Fri Sep 1 16:35:19 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 08:35:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules linuxaudiodev.c,2.8,2.9 Message-ID: <200009011535.IAA28250@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv28224 Modified Files: linuxaudiodev.c Log Message: Move the Py_DECREF(x) after the error: label so that we don't leak x when PyDict_SetItemString() fails. Index: linuxaudiodev.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/linuxaudiodev.c,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -r2.8 -r2.9 *** linuxaudiodev.c 2000/09/01 09:01:32 2.8 --- linuxaudiodev.c 2000/09/01 15:35:12 2.9 *************** *** 441,447 **** if (x == NULL || PyDict_SetItemString(d, "AFMT_S16_LE", x) < 0) goto error; - Py_DECREF(x); error: return; } --- 441,447 ---- if (x == NULL || PyDict_SetItemString(d, "AFMT_S16_LE", x) < 0) goto error; error: + Py_DECREF(x); return; } From python-dev@python.org Fri Sep 1 20:22:58 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 12:22:58 -0700 Subject: [Python-checkins] CVS: python/dist/src configure,1.143,1.144 Message-ID: <200009011922.MAA23919@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv23886 Modified Files: configure Log Message: Correct configure.in version. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -r1.143 -r1.144 *** configure 2000/08/31 17:45:35 1.143 --- configure 2000/09/01 19:22:55 1.144 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.153 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.154 # Guess values for system-dependent variables and create Makefiles. From python-dev@python.org Fri Sep 1 20:26:38 2000 From: python-dev@python.org (Tim Peters) Date: Fri, 1 Sep 2000 12:26:38 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.167,2.168 Message-ID: <200009011926.MAA24249@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv23995/python/dist/src/modules Modified Files: posixmodule.c Log Message: Repaired damaged comments, and extra spaces in fatal error msgs we'd better not ever see! Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.167 retrieving revision 2.168 diff -C2 -r2.167 -r2.168 *** posixmodule.c 2000/09/01 06:51:24 2.167 --- posixmodule.c 2000/09/01 19:26:36 2.168 *************** *** 2727,2731 **** */ Py_FatalError("unable to allocate interpreter state " ! " when closing popen object."); return -1; /* unreachable */ } --- 2727,2731 ---- */ Py_FatalError("unable to allocate interpreter state " ! "when closing popen object."); return -1; /* unreachable */ } *************** *** 2733,2737 **** if (!pThreadState) { Py_FatalError("unable to allocate thread state " ! " when closing popen object."); return -1; /* unreachable */ } --- 2733,2737 ---- if (!pThreadState) { Py_FatalError("unable to allocate thread state " ! "when closing popen object."); return -1; /* unreachable */ } *************** *** 2803,2809 **** /* Tear down the thread & interpreter states. * Note that interpreter state clear & delete functions automatically ! * call the thread & clear functions, and * indeed insist on doing ! * that themselves. The lock must be held during the clear, but need ! * not be held during the delete. */ PyInterpreterState_Clear(pInterpreterState); --- 2803,2809 ---- /* Tear down the thread & interpreter states. * Note that interpreter state clear & delete functions automatically ! * call the thread clear & delete functions, and indeed insist on ! * doing that themselves. The lock must be held during the clear, but ! * need not be held during the delete. */ PyInterpreterState_Clear(pInterpreterState); *************** *** 2814,2818 **** return result; } ! #else static PyObject * posix_popen(PyObject *self, PyObject *args) --- 2814,2819 ---- return result; } ! ! #else /* which OS? */ static PyObject * posix_popen(PyObject *self, PyObject *args) From python-dev@python.org Fri Sep 1 20:25:55 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 12:25:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/dos-8x3 basehttp.py,1.6,1.7 cgihttps.py,1.7,1.8 configpa.py,1.7,1.8 multifil.py,1.5,1.6 posixfil.py,1.8,1.9 posixpat.py,1.11,1.12 simpleht.py,1.6,1.7 socketse.py,1.10,1.11 sre_comp.py,1.5,1.6 sre_cons.py,1.3,1.4 sre_pars.py,1.4,1.5 test_arr.py,1.7,1.8 test_bin.py,1.4,1.5 test_exc.py,1.4,1.5 test_ext.py,1.1,1.2 test_fcn.py,1.6,1.7 test_for.py,1.1,1.2 test_gra.py,1.3,1.4 test_gzi.py,1.1,1.2 test_lin.py,1.1,1.2 test_mat.py,1.3,1.4 test_mma.py,1.2,1.3 test_ntp.py,1.2,1.3 test_ope.py,1.4,1.5 test_pop.py,1.1,1.2 test_rgb.py,1.6,1.7 test_sel.py,1.6,1.7 test_sig.py,1.4,1.5 test_str.py,1.9,1.10 test_sup.py,1.3,1.4 test_tim.py,1.6,1.7 test_typ.py,1.7,1.8 test_uni.py,1.2,1.3 test_unp.py,1.2,1.3 test_use.py,1.2,1.3 threadin.py,1.3,1.4 tracebac.py,1.8,1.9 userdict.py,1.6,1.7 userlist.py,1.7,1.8 userstri.py,1.1,1.2 Message-ID: <200009011925.MAA24203@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/dos-8x3 In directory slayer.i.sourceforge.net:/tmp/cvs-serv24152 Modified Files: basehttp.py cgihttps.py configpa.py multifil.py posixfil.py posixpat.py simpleht.py socketse.py sre_comp.py sre_cons.py sre_pars.py test_arr.py test_bin.py test_exc.py test_ext.py test_fcn.py test_for.py test_gra.py test_gzi.py test_lin.py test_mat.py test_mma.py test_ntp.py test_ope.py test_pop.py test_rgb.py test_sel.py test_sig.py test_str.py test_sup.py test_tim.py test_typ.py test_uni.py test_unp.py test_use.py threadin.py tracebac.py userdict.py userlist.py userstri.py Log Message: The usual Index: basehttp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/basehttp.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** basehttp.py 2000/06/29 19:35:29 1.6 --- basehttp.py 2000/09/01 19:25:51 1.7 *************** *** 94,110 **** SocketServer.TCPServer.server_bind(self) host, port = self.socket.getsockname() ! if not host or host == '0.0.0.0': ! host = socket.gethostname() ! try: ! hostname, hostnames, hostaddrs = socket.gethostbyaddr(host) ! except socket.error: ! hostname = host ! else: ! if '.' not in hostname: ! for host in hostnames: ! if '.' in host: ! hostname = host ! break ! self.server_name = hostname self.server_port = port --- 94,98 ---- SocketServer.TCPServer.server_bind(self) host, port = self.socket.getsockname() ! self.server_name = socket.getfqdn(host) self.server_port = port *************** *** 418,432 **** """ - - (host, port) = self.client_address - try: - name, names, addresses = socket.gethostbyaddr(host) - except socket.error, msg: - return host - names.insert(0, name) - for name in names: - if '.' in name: return name - return names[0] # Essentially static class variables --- 406,412 ---- """ + host, port = self.client_address + return socket.getfqdn(host) # Essentially static class variables Index: cgihttps.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/cgihttps.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** cgihttps.py 2000/05/08 17:30:59 1.7 --- cgihttps.py 2000/09/01 19:25:51 1.8 *************** *** 36,39 **** --- 36,43 ---- """ + # Make rfile unbuffered -- we need to read one line and then pass + # the rest to a subprocess, so we can't use buffered input. + rbufsize = 0 + def do_POST(self): """Serve a POST request. Index: configpa.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/configpa.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** configpa.py 2000/06/29 19:35:29 1.7 --- configpa.py 2000/09/01 19:25:51 1.8 *************** *** 37,40 **** --- 37,43 ---- return whether the given section exists + has_option(section, option) + return whether the given option exists in the given section + options(section) return list of configuration options for the named section *************** *** 69,72 **** --- 72,87 ---- like get(), but convert value to a boolean (currently defined as 0 or 1, only) + + remove_section(section) + remove the given file section and all its options + + remove_option(section, option) + remove the given option from the given section + + set(section, option, value) + set the given option + + write(fp) + write the configuration state in .ini format """ *************** *** 287,290 **** --- 302,363 ---- return string.lower(optionstr) + def has_option(self, section, option): + """Check for the existence of a given option in a given section.""" + if not section or section == "DEFAULT": + return self.__defaults.has_key(option) + elif not self.has_section(section): + return 0 + else: + return self.__sections[section].has_key(option) + + def set(self, section, option, value): + """Set an option.""" + if not section or section == "DEFAULT": + sectdict = self.__defaults + else: + try: + sectdict = self.__sections[section] + except KeyError: + raise NoSectionError(section) + sectdict[option] = value + + def write(self, fp): + """Write an .ini-format representation of the configuration state.""" + if self.__defaults: + fp.write("[DEFAULT]\n") + for (key, value) in self.__defaults.items(): + fp.write("%s = %s\n" % (key, value)) + fp.write("\n") + for section in self.sections(): + fp.write("[" + section + "]\n") + sectdict = self.__sections[section] + for (key, value) in sectdict.items(): + if key == "__name__": + continue + fp.write("%s = %s\n" % (key, value)) + fp.write("\n") + + def remove_option(self, section, option): + """Remove an option.""" + if not section or section == "DEFAULT": + sectdict = self.__defaults + else: + try: + sectdict = self.__sections[section] + except KeyError: + raise NoSectionError(section) + existed = sectdict.has_key(key) + if existed: + del sectdict[key] + return existed + + def remove_section(self, section): + """Remove a file section.""" + if self.__sections.has_key(section): + del self.__sections[section] + return 1 + else: + return 0 + # # Regular expressions for parsing section headers and options. Note a *************** *** 358,362 **** if mo: optname, vi, optval = mo.group('option', 'vi', 'value') - optname = string.lower(optname) if vi in ('=', ':') and ';' in optval: # ';' is a comment delimiter only if it follows --- 431,434 ---- Index: multifil.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/multifil.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** multifil.py 2000/07/16 12:04:30 1.5 --- multifil.py 2000/09/01 19:25:51 1.6 *************** *** 31,35 **** import string ! Error = 'multifile.Error' class MultiFile: --- 31,36 ---- import string ! class Error(Exception): ! pass class MultiFile: Index: posixfil.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/posixfil.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** posixfil.py 2000/05/08 17:31:00 1.8 --- posixfil.py 2000/09/01 19:25:51 1.9 *************** *** 177,181 **** if sys.platform in ('netbsd1', 'openbsd2', ! 'freebsd2', 'freebsd3', 'bsdos2', 'bsdos3', 'bsdos4'): flock = struct.pack('lxxxxlxxxxlhh', \ --- 177,181 ---- if sys.platform in ('netbsd1', 'openbsd2', ! 'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5', 'bsdos2', 'bsdos3', 'bsdos4'): flock = struct.pack('lxxxxlxxxxlhh', \ *************** *** 193,197 **** if sys.platform in ('netbsd1', 'openbsd2', ! 'freebsd2', 'freebsd3', 'bsdos2', 'bsdos3', 'bsdos4'): l_start, l_len, l_pid, l_type, l_whence = \ --- 193,197 ---- if sys.platform in ('netbsd1', 'openbsd2', ! 'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5', 'bsdos2', 'bsdos3', 'bsdos4'): l_start, l_len, l_pid, l_type, l_whence = \ Index: posixpat.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/posixpat.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** posixpat.py 2000/06/28 14:48:01 1.11 --- posixpat.py 2000/09/01 19:25:51 1.12 *************** *** 343,370 **** def normpath(path): """Normalize path, eliminating double slashes, etc.""" import string ! # Treat initial slashes specially ! slashes = '' ! while path[:1] == '/': ! slashes = slashes + '/' ! path = path[1:] ! comps = string.splitfields(path, '/') ! i = 0 ! while i < len(comps): ! if comps[i] == '.': ! del comps[i] ! while i < len(comps) and comps[i] == '': ! del comps[i] ! elif comps[i] == '..' and i > 0 and comps[i-1] not in ('', '..'): ! del comps[i-1:i+1] ! i = i-1 ! elif comps[i] == '' and i > 0 and comps[i-1] <> '': ! del comps[i] ! else: ! i = i+1 ! # If the path is now empty, substitute '.' ! if not comps and not slashes: ! comps.append('.') ! return slashes + string.joinfields(comps, '/') --- 343,365 ---- def normpath(path): """Normalize path, eliminating double slashes, etc.""" + if path == '': + return '.' import string ! initial_slash = (path[0] == '/') ! comps = string.split(path, '/') ! new_comps = [] ! for comp in comps: ! if comp in ('', '.'): ! continue ! if (comp != '..' or (not initial_slash and not new_comps) or ! (new_comps and new_comps[-1] == '..')): ! new_comps.append(comp) ! elif new_comps: ! new_comps.pop() ! comps = new_comps ! path = string.join(comps, '/') ! if initial_slash: ! path = '/' + path ! return path or '.' Index: simpleht.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/simpleht.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** simpleht.py 2000/06/29 19:35:29 1.6 --- simpleht.py 2000/09/01 19:25:51 1.7 *************** *** 16,19 **** --- 16,20 ---- import urllib import cgi + import shutil from StringIO import StringIO *************** *** 152,161 **** """ ! ! BLOCKSIZE = 8192 ! while 1: ! data = source.read(BLOCKSIZE) ! if not data: break ! outputfile.write(data) def guess_type(self, path): --- 153,157 ---- """ ! shutil.copyfileobj(source, outputfile) def guess_type(self, path): Index: socketse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/socketse.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** socketse.py 2000/06/29 19:35:29 1.10 --- socketse.py 2000/09/01 19:25:51 1.11 *************** *** 413,420 **** """Define self.rfile and self.wfile for stream sockets.""" def setup(self): self.connection = self.request ! self.rfile = self.connection.makefile('rb', 0) ! self.wfile = self.connection.makefile('wb', 0) def finish(self): --- 413,430 ---- """Define self.rfile and self.wfile for stream sockets.""" + # Default buffer sizes for rfile, wfile. + # We default rfile to buffered because otherwise it could be + # really slow for large data (a getc() call per byte); we make + # wfile unbuffered because (a) often after a write() we want to + # read and we need to flush the line; (b) big writes to unbuffered + # files are typically optimized by stdio even when big reads + # aren't. + rbufsize = -1 + wbufsize = 0 + def setup(self): self.connection = self.request ! self.rfile = self.connection.makefile('rb', self.rbufsize) ! self.wfile = self.connection.makefile('wb', self.wbufsize) def finish(self): Index: sre_comp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/sre_comp.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** sre_comp.py 2000/07/16 12:04:30 1.5 --- sre_comp.py 2000/09/01 19:25:51 1.6 *************** *** 6,25 **** # Copyright (c) 1997-2000 by Secret Labs AB. All rights reserved. # ! # Portions of this engine have been developed in cooperation with ! # CNRI. Hewlett-Packard provided funding for 1.6 integration and ! # other compatibility work. # - import array import _sre from sre_constants import * ! # find an array type code that matches the engine's code size ! for WORDSIZE in "BHil": ! if len(array.array(WORDSIZE, [0]).tostring()) == _sre.getcodesize(): ! break ! else: ! raise RuntimeError, "cannot find a usable array type" def _compile(code, pattern, flags): --- 6,17 ---- # Copyright (c) 1997-2000 by Secret Labs AB. All rights reserved. # ! # See the sre.py file for information on usage and redistribution. # import _sre from sre_constants import * ! MAXCODE = 65535 def _compile(code, pattern, flags): *************** *** 42,73 **** fixup = lambda x: x skip = len(code); emit(0) ! for op, av in av: ! emit(OPCODES[op]) ! if op is NEGATE: ! pass ! elif op is LITERAL: ! emit(fixup(av)) ! elif op is RANGE: ! emit(fixup(av[0])) ! emit(fixup(av[1])) ! elif op is CATEGORY: ! if flags & SRE_FLAG_LOCALE: ! emit(CHCODES[CH_LOCALE[av]]) ! elif flags & SRE_FLAG_UNICODE: ! emit(CHCODES[CH_UNICODE[av]]) ! else: ! emit(CHCODES[av]) ! else: ! raise error, "internal: unsupported set operator" ! emit(OPCODES[FAILURE]) code[skip] = len(code) - skip elif op is ANY: if flags & SRE_FLAG_DOTALL: ! emit(OPCODES[op]) else: ! emit(OPCODES[CATEGORY]) ! emit(CHCODES[CATEGORY_NOT_LINEBREAK]) elif op in (REPEAT, MIN_REPEAT, MAX_REPEAT): if flags & SRE_FLAG_TEMPLATE: emit(OPCODES[REPEAT]) skip = len(code); emit(0) --- 34,47 ---- fixup = lambda x: x skip = len(code); emit(0) ! _compile_charset(av, flags, code, fixup) code[skip] = len(code) - skip elif op is ANY: if flags & SRE_FLAG_DOTALL: ! emit(OPCODES[ANY_ALL]) else: ! emit(OPCODES[ANY]) elif op in (REPEAT, MIN_REPEAT, MAX_REPEAT): if flags & SRE_FLAG_TEMPLATE: + raise error, "internal: unsupported template operator" emit(OPCODES[REPEAT]) skip = len(code); emit(0) *************** *** 77,116 **** emit(OPCODES[SUCCESS]) code[skip] = len(code) - skip else: ! lo, hi = av[2].getwidth() ! if lo == 0: ! raise error, "nothing to repeat" ! if 0 and lo == hi == 1 and op is MAX_REPEAT: ! # FIXME: need a better way to figure out when ! # it's safe to use this one (in the parser, probably) ! emit(OPCODES[MAX_REPEAT_ONE]) ! skip = len(code); emit(0) ! emit(av[0]) ! emit(av[1]) ! _compile(code, av[2], flags) ! emit(OPCODES[SUCCESS]) ! code[skip] = len(code) - skip else: ! emit(OPCODES[op]) ! skip = len(code); emit(0) ! emit(av[0]) ! emit(av[1]) ! _compile(code, av[2], flags) ! emit(OPCODES[SUCCESS]) ! code[skip] = len(code) - skip elif op is SUBPATTERN: ! group = av[0] ! if group: emit(OPCODES[MARK]) ! emit((group-1)*2) _compile(code, av[1], flags) ! if group: emit(OPCODES[MARK]) ! emit((group-1)*2+1) elif op in (SUCCESS, FAILURE): emit(OPCODES[op]) ! elif op in (ASSERT, ASSERT_NOT, CALL): emit(OPCODES[op]) skip = len(code); emit(0) _compile(code, av, flags) emit(OPCODES[SUCCESS]) --- 51,100 ---- emit(OPCODES[SUCCESS]) code[skip] = len(code) - skip + elif _simple(av) and op == MAX_REPEAT: + emit(OPCODES[REPEAT_ONE]) + skip = len(code); emit(0) + emit(av[0]) + emit(av[1]) + _compile(code, av[2], flags) + emit(OPCODES[SUCCESS]) + code[skip] = len(code) - skip else: ! emit(OPCODES[REPEAT]) ! skip = len(code); emit(0) ! emit(av[0]) ! emit(av[1]) ! _compile(code, av[2], flags) ! code[skip] = len(code) - skip ! if op == MAX_REPEAT: ! emit(OPCODES[MAX_UNTIL]) else: ! emit(OPCODES[MIN_UNTIL]) elif op is SUBPATTERN: ! if av[0]: emit(OPCODES[MARK]) ! emit((av[0]-1)*2) ! # _compile_info(code, av[1], flags) _compile(code, av[1], flags) ! if av[0]: emit(OPCODES[MARK]) ! emit((av[0]-1)*2+1) elif op in (SUCCESS, FAILURE): emit(OPCODES[op]) ! elif op in (ASSERT, ASSERT_NOT): emit(OPCODES[op]) skip = len(code); emit(0) + if av[0] >= 0: + emit(0) # look ahead + else: + lo, hi = av[1].getwidth() + if lo != hi: + raise error, "look-behind requires fixed-width pattern" + emit(lo) # look behind + _compile(code, av[1], flags) + emit(OPCODES[SUCCESS]) + code[skip] = len(code) - skip + elif op is CALL: + emit(OPCODES[op]) + skip = len(code); emit(0) _compile(code, av, flags) emit(OPCODES[SUCCESS]) *************** *** 127,130 **** --- 111,115 ---- for av in av[1]: skip = len(code); emit(0) + # _compile_info(code, av, flags) _compile(code, av, flags) emit(OPCODES[JUMP]) *************** *** 142,146 **** else: emit(CHCODES[av]) ! elif op is GROUP: if flags & SRE_FLAG_IGNORECASE: emit(OPCODES[OP_IGNORE[op]]) --- 127,131 ---- else: emit(CHCODES[av]) ! elif op is GROUPREF: if flags & SRE_FLAG_IGNORECASE: emit(OPCODES[OP_IGNORE[op]]) *************** *** 148,161 **** emit(OPCODES[op]) emit(av-1) - elif op is MARK: - emit(OPCODES[op]) - emit(av) else: raise ValueError, ("unsupported operand type", op) def _compile_info(code, pattern, flags): # internal: compile an info block. in the current version, ! # this contains min/max pattern width and a literal prefix, ! # if any lo, hi = pattern.getwidth() if lo == 0: --- 133,234 ---- emit(OPCODES[op]) emit(av-1) else: raise ValueError, ("unsupported operand type", op) + def _compile_charset(charset, flags, code, fixup=None): + # compile charset subprogram + emit = code.append + if not fixup: + fixup = lambda x: x + for op, av in _optimize_charset(charset, fixup): + emit(OPCODES[op]) + if op is NEGATE: + pass + elif op is LITERAL: + emit(fixup(av)) + elif op is RANGE: + emit(fixup(av[0])) + emit(fixup(av[1])) + elif op is CHARSET: + code.extend(av) + elif op is CATEGORY: + if flags & SRE_FLAG_LOCALE: + emit(CHCODES[CH_LOCALE[av]]) + elif flags & SRE_FLAG_UNICODE: + emit(CHCODES[CH_UNICODE[av]]) + else: + emit(CHCODES[av]) + else: + raise error, "internal: unsupported set operator" + emit(OPCODES[FAILURE]) + + def _optimize_charset(charset, fixup): + # internal: optimize character set + out = [] + charmap = [0]*256 + try: + for op, av in charset: + if op is NEGATE: + out.append((op, av)) + elif op is LITERAL: + charmap[fixup(av)] = 1 + elif op is RANGE: + for i in range(fixup(av[0]), fixup(av[1])+1): + charmap[i] = 1 + elif op is CATEGORY: + # FIXME: could append to charmap tail + return charset # cannot compress + except IndexError: + # character set contains unicode characters + return charset + # compress character map + i = p = n = 0 + runs = [] + for c in charmap: + if c: + if n == 0: + p = i + n = n + 1 + elif n: + runs.append((p, n)) + n = 0 + i = i + 1 + if n: + runs.append((p, n)) + if len(runs) <= 2: + # use literal/range + for p, n in runs: + if n == 1: + out.append((LITERAL, p)) + else: + out.append((RANGE, (p, p+n-1))) + if len(out) < len(charset): + return out + else: + # use bitmap + data = [] + m = 1; v = 0 + for c in charmap: + if c: + v = v + m + m = m << 1 + if m > MAXCODE: + data.append(v) + m = 1; v = 0 + out.append((CHARSET, data)) + return out + return charset + + def _simple(av): + # check if av is a "simple" operator + lo, hi = av[2].getwidth() + if lo == 0: + raise error, "nothing to repeat" + return lo == hi == 1 and av[2][0][0] != SUBPATTERN + def _compile_info(code, pattern, flags): # internal: compile an info block. in the current version, ! # this contains min/max pattern width, and an optional literal ! # prefix or a character map lo, hi = pattern.getwidth() if lo == 0: *************** *** 163,172 **** --- 236,293 ---- # look for a literal prefix prefix = [] + prefix_skip = 0 + charset = [] # not used if not (flags & SRE_FLAG_IGNORECASE): + # look for literal prefix for op, av in pattern.data: if op is LITERAL: + if len(prefix) == prefix_skip: + prefix_skip = prefix_skip + 1 prefix.append(av) + elif op is SUBPATTERN and len(av[1]) == 1: + op, av = av[1][0] + if op is LITERAL: + prefix.append(av) + else: + break else: break + # if no prefix, look for charset prefix + if not prefix and pattern.data: + op, av = pattern.data[0] + if op is SUBPATTERN and av[1]: + op, av = av[1][0] + if op is LITERAL: + charset.append((op, av)) + elif op is BRANCH: + c = [] + for p in av[1]: + if not p: + break + op, av = p[0] + if op is LITERAL: + c.append((op, av)) + else: + break + else: + charset = c + elif op is BRANCH: + c = [] + for p in av[1]: + if not p: + break + op, av = p[0] + if op is LITERAL: + c.append((op, av)) + else: + break + else: + charset = c + elif op is IN: + charset = av + ## if prefix: + ## print "*** PREFIX", prefix, prefix_skip + ## if charset: + ## print "*** CHARSET", charset # add an info block emit = code.append *************** *** 175,190 **** # literal flag mask = 0 ! if len(prefix) == len(pattern.data): ! mask = 1 emit(mask) # pattern length ! emit(lo) ! if hi < 32768: emit(hi) else: emit(0) # add literal prefix - emit(len(prefix)) if prefix: code.extend(prefix) # generate overlap table --- 296,320 ---- # literal flag mask = 0 ! if prefix: ! mask = SRE_INFO_PREFIX ! if len(prefix) == prefix_skip == len(pattern.data): ! mask = mask + SRE_INFO_LITERAL ! elif charset: ! mask = mask + SRE_INFO_CHARSET emit(mask) # pattern length ! if lo < MAXCODE: ! emit(lo) ! else: ! emit(MAXCODE) ! prefix = prefix[:MAXCODE] ! if hi < MAXCODE: emit(hi) else: emit(0) # add literal prefix if prefix: + emit(len(prefix)) # length + emit(prefix_skip) # skip code.extend(prefix) # generate overlap table *************** *** 195,211 **** table[i+1] = table[table[i+1]-1]+1 code.extend(table[1:]) # don't store first entry code[skip] = len(code) - skip ! def compile(p, flags=0): ! # internal: convert pattern list to internal format ! # compile, as necessary ! if type(p) in (type(""), type(u"")): ! import sre_parse ! pattern = p ! p = sre_parse.parse(p, flags) ! else: ! pattern = None flags = p.pattern.flags | flags code = [] --- 325,341 ---- table[i+1] = table[table[i+1]-1]+1 code.extend(table[1:]) # don't store first entry + elif charset: + _compile_charset(charset, 0, code) code[skip] = len(code) - skip ! STRING_TYPES = [type("")] ! try: ! STRING_TYPES.append(type(unicode(""))) ! except NameError: ! pass + def _code(p, flags): + flags = p.pattern.flags | flags code = [] *************** *** 219,229 **** code.append(OPCODES[SUCCESS]) # FIXME: get rid of this limitation! assert p.pattern.groups <= 100,\ "sorry, but this version only supports 100 named groups" return _sre.compile( ! pattern, flags, ! array.array(WORDSIZE, code).tostring(), ! p.pattern.groups-1, p.pattern.groupdict ) --- 349,381 ---- code.append(OPCODES[SUCCESS]) + return code + + def compile(p, flags=0): + # internal: convert pattern list to internal format + + if type(p) in STRING_TYPES: + import sre_parse + pattern = p + p = sre_parse.parse(p, flags) + else: + pattern = None + + code = _code(p, flags) + + # print code + # FIXME: get rid of this limitation! assert p.pattern.groups <= 100,\ "sorry, but this version only supports 100 named groups" + # map in either direction + groupindex = p.pattern.groupdict + indexgroup = [None] * p.pattern.groups + for k, i in groupindex.items(): + indexgroup[i] = k + return _sre.compile( ! pattern, flags, code, ! p.pattern.groups-1, ! groupindex, indexgroup ) Index: sre_cons.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/sre_cons.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** sre_cons.py 2000/06/30 16:13:37 1.3 --- sre_cons.py 2000/09/01 19:25:51 1.4 *************** *** 7,13 **** # Copyright (c) 1998-2000 by Secret Labs AB. All rights reserved. # ! # Portions of this engine have been developed in cooperation with ! # CNRI. Hewlett-Packard provided funding for 1.6 integration and ! # other compatibility work. # --- 7,11 ---- # Copyright (c) 1998-2000 by Secret Labs AB. All rights reserved. # ! # See the sre.py file for information on usage and redistribution. # *************** *** 23,26 **** --- 21,25 ---- ANY = "any" + ANY_ALL = "any_all" ASSERT = "assert" ASSERT_NOT = "assert_not" *************** *** 29,34 **** CALL = "call" CATEGORY = "category" ! GROUP = "group" ! GROUP_IGNORE = "group_ignore" IN = "in" IN_IGNORE = "in_ignore" --- 28,34 ---- CALL = "call" CATEGORY = "category" ! CHARSET = "charset" ! GROUPREF = "groupref" ! GROUPREF_IGNORE = "groupref_ignore" IN = "in" IN_IGNORE = "in_ignore" *************** *** 39,44 **** MARK = "mark" MAX_REPEAT = "max_repeat" ! MAX_REPEAT_ONE = "max_repeat_one" MIN_REPEAT = "min_repeat" NEGATE = "negate" NOT_LITERAL = "not_literal" --- 39,45 ---- MARK = "mark" MAX_REPEAT = "max_repeat" ! MAX_UNTIL = "max_until" MIN_REPEAT = "min_repeat" + MIN_UNTIL = "min_until" NEGATE = "negate" NOT_LITERAL = "not_literal" *************** *** 82,86 **** FAILURE, SUCCESS, ! ANY, ASSERT, ASSERT_NOT, AT, --- 83,87 ---- FAILURE, SUCCESS, ! ANY, ANY_ALL, ASSERT, ASSERT_NOT, AT, *************** *** 88,92 **** CALL, CATEGORY, ! GROUP, GROUP_IGNORE, IN, IN_IGNORE, INFO, --- 89,94 ---- CALL, CATEGORY, ! CHARSET, ! GROUPREF, GROUPREF_IGNORE, IN, IN_IGNORE, INFO, *************** *** 94,104 **** LITERAL, LITERAL_IGNORE, MARK, ! MAX_REPEAT, ! MAX_REPEAT_ONE, ! MIN_REPEAT, NOT_LITERAL, NOT_LITERAL_IGNORE, NEGATE, RANGE, ! REPEAT ] --- 96,107 ---- LITERAL, LITERAL_IGNORE, MARK, ! MAX_UNTIL, ! MIN_UNTIL, NOT_LITERAL, NOT_LITERAL_IGNORE, NEGATE, RANGE, ! REPEAT, ! REPEAT_ONE, ! SUBPATTERN ] *************** *** 133,137 **** # replacement operations for "ignore case" mode OP_IGNORE = { ! GROUP: GROUP_IGNORE, IN: IN_IGNORE, LITERAL: LITERAL_IGNORE, --- 136,140 ---- # replacement operations for "ignore case" mode OP_IGNORE = { ! GROUPREF: GROUPREF_IGNORE, IN: IN_IGNORE, LITERAL: LITERAL_IGNORE, *************** *** 167,177 **** # flags ! SRE_FLAG_TEMPLATE = 1 ! SRE_FLAG_IGNORECASE = 2 ! SRE_FLAG_LOCALE = 4 ! SRE_FLAG_MULTILINE = 8 ! SRE_FLAG_DOTALL = 16 ! SRE_FLAG_UNICODE = 32 ! SRE_FLAG_VERBOSE = 64 if __name__ == "__main__": --- 170,185 ---- # flags ! SRE_FLAG_TEMPLATE = 1 # template mode (disable backtracking) ! SRE_FLAG_IGNORECASE = 2 # case insensitive ! SRE_FLAG_LOCALE = 4 # honour system locale ! SRE_FLAG_MULTILINE = 8 # treat target as multiline string ! SRE_FLAG_DOTALL = 16 # treat target as a single string ! SRE_FLAG_UNICODE = 32 # use unicode locale ! SRE_FLAG_VERBOSE = 64 # ignore whitespace and comments ! ! # flags for INFO primitive ! SRE_INFO_PREFIX = 1 # has prefix ! SRE_INFO_LITERAL = 2 # entire pattern is literal (given by prefix) ! SRE_INFO_CHARSET = 4 # pattern starts with character from given set if __name__ == "__main__": *************** *** 202,205 **** --- 210,214 ---- dump(f, ATCODES, "SRE") dump(f, CHCODES, "SRE") + f.write("#define SRE_FLAG_TEMPLATE %d\n" % SRE_FLAG_TEMPLATE) f.write("#define SRE_FLAG_IGNORECASE %d\n" % SRE_FLAG_IGNORECASE) *************** *** 209,212 **** --- 218,226 ---- f.write("#define SRE_FLAG_UNICODE %d\n" % SRE_FLAG_UNICODE) f.write("#define SRE_FLAG_VERBOSE %d\n" % SRE_FLAG_VERBOSE) + + f.write("#define SRE_INFO_PREFIX %d\n" % SRE_INFO_PREFIX) + f.write("#define SRE_INFO_LITERAL %d\n" % SRE_INFO_LITERAL) + f.write("#define SRE_INFO_CHARSET %d\n" % SRE_INFO_CHARSET) + f.close() print "done" Index: sre_pars.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/sre_pars.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** sre_pars.py 2000/07/01 04:23:47 1.4 --- sre_pars.py 2000/09/01 19:25:51 1.5 *************** *** 6,36 **** # Copyright (c) 1998-2000 by Secret Labs AB. All rights reserved. # ! # Portions of this engine have been developed in cooperation with ! # CNRI. Hewlett-Packard provided funding for 1.6 integration and ! # other compatibility work. # import string, sys - import _sre - from sre_constants import * - - # FIXME: should be 65535, but the arraymodule is still broken - MAXREPEAT = 32767 ! # FIXME: might change in 2.0 final. but for now, this seems ! # to be the best way to be compatible with 1.5.2 ! CHARMASK = 0xff SPECIAL_CHARS = ".\\[{()*+?^$|" REPEAT_CHARS = "*+?{" ! DIGITS = tuple(string.digits) OCTDIGITS = tuple("01234567") HEXDIGITS = tuple("0123456789abcdefABCDEF") ! WHITESPACE = tuple(string.whitespace) ESCAPES = { --- 6,27 ---- # Copyright (c) 1998-2000 by Secret Labs AB. All rights reserved. # ! # See the sre.py file for information on usage and redistribution. # import string, sys from sre_constants import * ! MAXREPEAT = 65535 SPECIAL_CHARS = ".\\[{()*+?^$|" REPEAT_CHARS = "*+?{" ! DIGITS = tuple("012345689") OCTDIGITS = tuple("01234567") HEXDIGITS = tuple("0123456789abcdefABCDEF") ! WHITESPACE = tuple(" \t\n\r\v\f") ESCAPES = { *************** *** 70,74 **** } ! class State: def __init__(self): self.flags = 0 --- 61,66 ---- } ! class Pattern: ! # master pattern object. keeps track of global attributes def __init__(self): self.flags = 0 *************** *** 90,93 **** --- 82,112 ---- self.data = data self.width = None + def dump(self, level=0): + nl = 1 + for op, av in self.data: + print level*" " + op,; nl = 0 + if op == "in": + # member sublanguage + print; nl = 1 + for op, a in av: + print (level+1)*" " + op, a + elif op == "branch": + print; nl = 1 + i = 0 + for a in av[1]: + if i > 0: + print level*" " + "or" + a.dump(level+1); nl = 1 + i = i + 1 + elif type(av) in (type(()), type([])): + for a in av: + if isinstance(a, SubPattern): + if not nl: print + a.dump(level+1); nl = 1 + else: + print a, ; nl = 0 + else: + print av, ; nl = 0 + if not nl: print def __repr__(self): return repr(self.data) *************** *** 113,122 **** for op, av in self.data: if op is BRANCH: ! l = sys.maxint ! h = 0 for av in av[1]: ! i, j = av.getwidth() ! l = min(l, i) ! h = min(h, j) lo = lo + i hi = hi + j --- 132,141 ---- for op, av in self.data: if op is BRANCH: ! i = sys.maxint ! j = 0 for av in av[1]: ! l, h = av.getwidth() ! i = min(i, l) ! j = max(j, h) lo = lo + i hi = hi + j *************** *** 143,152 **** class Tokenizer: def __init__(self, string): - self.index = 0 self.string = string ! self.next = self.__next() def __next(self): if self.index >= len(self.string): ! return None char = self.string[self.index] if char[0] == "\\": --- 162,172 ---- class Tokenizer: def __init__(self, string): self.string = string ! self.index = 0 ! self.__next() def __next(self): if self.index >= len(self.string): ! self.next = None ! return char = self.string[self.index] if char[0] == "\\": *************** *** 157,175 **** char = char + c self.index = self.index + len(char) ! return char ! def match(self, char): if char == self.next: ! self.next = self.__next() ! return 1 ! return 0 ! def match_set(self, set): ! if self.next and self.next in set: ! self.next = self.__next() return 1 return 0 def get(self): this = self.next ! self.next = self.__next() return this def isident(char): --- 177,195 ---- char = char + c self.index = self.index + len(char) ! self.next = char ! def match(self, char, skip=1): if char == self.next: ! if skip: ! self.__next() return 1 return 0 def get(self): this = self.next ! self.__next() return this + def tell(self): + return self.index, self.next + def seek(self, index): + self.index, self.next = index def isident(char): *************** *** 208,220 **** try: if escape[1:2] == "x": ! while source.next in HEXDIGITS: escape = escape + source.get() escape = escape[2:] ! return LITERAL, int(escape[-4:], 16) & CHARMASK elif str(escape[1:2]) in OCTDIGITS: ! while source.next in OCTDIGITS: escape = escape + source.get() escape = escape[1:] ! return LITERAL, int(escape[-6:], 8) & CHARMASK if len(escape) == 2: return LITERAL, ord(escape[1]) --- 228,244 ---- try: if escape[1:2] == "x": ! # hexadecimal escape (exactly two digits) ! while source.next in HEXDIGITS and len(escape) < 4: escape = escape + source.get() escape = escape[2:] ! if len(escape) != 2: ! raise error, "bogus escape: %s" % repr("\\" + escape) ! return LITERAL, int(escape, 16) & 0xff elif str(escape[1:2]) in OCTDIGITS: ! # octal escape (up to three digits) ! while source.next in OCTDIGITS and len(escape) < 5: escape = escape + source.get() escape = escape[1:] ! return LITERAL, int(escape, 8) & 0xff if len(escape) == 2: return LITERAL, ord(escape[1]) *************** *** 233,254 **** try: if escape[1:2] == "x": ! while source.next in HEXDIGITS: escape = escape + source.get() escape = escape[2:] ! return LITERAL, int(escape[-4:], 16) & CHARMASK elif escape[1:2] in DIGITS: ! while 1: ! group = _group(escape, state.groups) ! if group: ! if (not source.next or ! not _group(escape + source.next, state.groups)): ! return GROUP, group ! escape = escape + source.get() ! elif source.next in OCTDIGITS: escape = escape + source.get() ! else: ! break ! escape = escape[1:] ! return LITERAL, int(escape[-6:], 8) & CHARMASK if len(escape) == 2: return LITERAL, ord(escape[1]) --- 257,286 ---- try: if escape[1:2] == "x": ! # hexadecimal escape ! while source.next in HEXDIGITS and len(escape) < 4: escape = escape + source.get() escape = escape[2:] ! if len(escape) != 2: ! raise error, "bogus escape: %s" % repr("\\" + escape) ! return LITERAL, int(escape, 16) & 0xff ! elif escape[1:2] == "0": ! # octal escape ! while source.next in OCTDIGITS and len(escape) < 5: ! escape = escape + source.get() ! return LITERAL, int(escape[1:], 8) & 0xff elif escape[1:2] in DIGITS: ! # octal escape *or* decimal group reference (sigh) ! here = source.tell() ! if source.next in DIGITS: ! escape = escape + source.get() ! if escape[2] in OCTDIGITS and source.next in OCTDIGITS: ! # got three octal digits; this is an octal escape escape = escape + source.get() ! return LITERAL, int(escape[1:], 8) & 0xff ! # got at least one decimal digit; this is a group reference ! group = _group(escape, state.groups) ! if group: ! return GROUPREF, group ! raise error, "bogus escape: %s" % repr(escape) if len(escape) == 2: return LITERAL, ord(escape[1]) *************** *** 257,265 **** raise error, "bogus escape: %s" % repr(escape) ! def _branch(pattern, items): ! # form a branch operator from a set of items ! subpattern = SubPattern(pattern) # check if all items share a common prefix while 1: --- 289,312 ---- raise error, "bogus escape: %s" % repr(escape) ! def _parse_sub(source, state, nested=1): ! # parse an alternation: a|b|c ! ! items = [] ! while 1: ! items.append(_parse(source, state)) ! if source.match("|"): ! continue ! if not nested: ! break ! if not source.next or source.match(")", 0): ! break ! else: ! raise error, "pattern not properly closed" ! if len(items) == 1: ! return items[0] + subpattern = SubPattern(state) + # check if all items share a common prefix while 1: *************** *** 287,291 **** else: # we can store this as a character set instead of a ! # branch (FIXME: use a range if possible) set = [] for item in items: --- 334,338 ---- else: # we can store this as a character set instead of a ! # branch (the compiler may optimize this even more) set = [] for item in items: *************** *** 298,303 **** def _parse(source, state): ! ! # parse regular expression pattern into an operator list. subpattern = SubPattern(state) --- 345,349 ---- def _parse(source, state): ! # parse a simple pattern subpattern = SubPattern(state) *************** *** 358,362 **** if code1[0] != LITERAL or code2[0] != LITERAL: raise error, "illegal range" ! set.append((RANGE, (code1[1], code2[1]))) else: if code1[0] is IN: --- 404,412 ---- if code1[0] != LITERAL or code2[0] != LITERAL: raise error, "illegal range" ! lo = code1[1] ! hi = code2[1] ! if hi < lo: ! raise error, "illegal range" ! set.append((RANGE, (lo, hi))) else: if code1[0] is IN: *************** *** 382,385 **** --- 432,436 ---- min, max = 1, MAXREPEAT elif this == "{": + here = source.tell() min, max = 0, MAXREPEAT lo = hi = "" *************** *** 392,396 **** hi = lo if not source.match("}"): ! raise error, "bogus range" if lo: min = int(lo) --- 443,449 ---- hi = lo if not source.match("}"): ! subpattern.append((LITERAL, ord(this))) ! source.seek(here) ! continue if lo: min = int(lo) *************** *** 449,453 **** if gid is None: raise error, "unknown group name" ! subpattern.append((GROUP, gid)) else: char = source.get() --- 502,507 ---- if gid is None: raise error, "unknown group name" ! subpattern.append((GROUPREF, gid)) ! continue else: char = source.get() *************** *** 464,486 **** break source.get() ! elif source.next in ("=", "!"): # lookahead assertions char = source.get() ! b = [] ! while 1: ! p = _parse(source, state) ! if source.next == ")": ! if b: ! b.append(p) ! p = _branch(state, b) ! if char == "=": ! subpattern.append((ASSERT, p)) ! else: ! subpattern.append((ASSERT_NOT, p)) ! break ! elif source.match("|"): ! b.append(p) ! else: ! raise error, "pattern not properly closed" else: # flags --- 518,541 ---- break source.get() ! if not source.match(")"): ! raise error, "unbalanced parenthesis" ! continue ! elif source.next in ("=", "!", "<"): # lookahead assertions char = source.get() ! dir = 1 ! if char == "<": ! if source.next not in ("=", "!"): ! raise error, "syntax error" ! dir = -1 # lookbehind ! char = source.get() ! p = _parse_sub(source, state) ! if not source.match(")"): ! raise error, "unbalanced parenthesis" ! if char == "=": ! subpattern.append((ASSERT, (dir, p))) ! else: ! subpattern.append((ASSERT_NOT, (dir, p))) ! continue else: # flags *************** *** 489,493 **** if group: # parse group contents - b = [] if group == 2: # anonymous group --- 544,547 ---- *************** *** 495,510 **** else: group = state.getgroup(name) ! while 1: ! p = _parse(source, state) ! if source.match(")"): ! if b: ! b.append(p) ! p = _branch(state, b) ! subpattern.append((SUBPATTERN, (group, p))) ! break ! elif source.match("|"): ! b.append(p) ! else: ! raise error, "group not properly closed" else: while 1: --- 549,556 ---- else: group = state.getgroup(name) ! p = _parse_sub(source, state) ! if not source.match(")"): ! raise error, "unbalanced parenthesis" ! subpattern.append((SUBPATTERN, (group, p))) else: while 1: *************** *** 529,552 **** return subpattern ! def parse(pattern, flags=0): # parse 're' pattern into list of (opcode, argument) tuples ! source = Tokenizer(pattern) ! state = State() ! state.flags = flags ! b = [] ! while 1: ! p = _parse(source, state) ! tail = source.get() ! if tail == "|": ! b.append(p) ! elif tail == ")": ! raise error, "unbalanced parenthesis" ! elif tail is None: ! if b: ! b.append(p) ! p = _branch(state, b) ! break ! else: ! raise error, "bogus characters at end of regular expression" return p --- 575,597 ---- return subpattern ! def parse(str, flags=0, pattern=None): # parse 're' pattern into list of (opcode, argument) tuples ! ! source = Tokenizer(str) ! ! if pattern is None: ! pattern = Pattern() ! pattern.flags = flags ! ! p = _parse_sub(source, pattern, 0) ! ! tail = source.get() ! if tail == ")": ! raise error, "unbalanced parenthesis" ! elif tail: ! raise error, "bogus characters at end of regular expression" ! ! # p.dump() ! return p *************** *** 600,604 **** if not code: this = this[1:] ! code = LITERAL, int(this[-6:], 8) & CHARMASK a(code) else: --- 645,649 ---- if not code: this = this[1:] ! code = LITERAL, int(this[-6:], 8) & 0xff a(code) else: *************** *** 630,632 **** raise error, "empty group" a(s) ! return sep.join(p) --- 675,677 ---- raise error, "empty group" a(s) ! return string.join(p, sep) Index: test_arr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_arr.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** test_arr.py 2000/06/29 19:35:29 1.7 --- test_arr.py 2000/09/01 19:25:51 1.8 *************** *** 106,109 **** --- 106,129 ---- if a != array.array(type, "aabcdee"): raise TestFailed, "array(%s) self-slice-assign (cntr)" % `type` + if a.index("e") != 5: + raise TestFailed, "array(%s) index-test" % `type` + if a.count("a") != 2: + raise TestFailed, "array(%s) count-test" % `type` + a.remove("e") + if a != array.array(type, "aabcde"): + raise TestFailed, "array(%s) remove-test" % `type` + if a.pop(0) != "a": + raise TestFailed, "array(%s) pop-test" % `type` + if a.pop(1) != "b": + raise TestFailed, "array(%s) pop-test" % `type` + a.extend(array.array(type, "xyz")) + if a != array.array(type, "acdexyz"): + raise TestFailed, "array(%s) extend-test" % `type` + a.pop() + a.pop() + a.pop() + a.pop() + if a != array.array(type, "acd"): + raise TestFailed, "array(%s) pop-test" % `type` else: a = array.array(type, [1, 2, 3, 4, 5]) *************** *** 119,122 **** --- 139,162 ---- if a != array.array(type, [1, 1, 2, 3, 4, 5, 5]): raise TestFailed, "array(%s) self-slice-assign (cntr)" % `type` + if a.index(5) != 5: + raise TestFailed, "array(%s) index-test" % `type` + if a.count(1) != 2: + raise TestFailed, "array(%s) count-test" % `type` + a.remove(5) + if a != array.array(type, [1, 1, 2, 3, 4, 5]): + raise TestFailed, "array(%s) remove-test" % `type` + if a.pop(0) != 1: + raise TestFailed, "array(%s) pop-test" % `type` + if a.pop(1) != 2: + raise TestFailed, "array(%s) pop-test" % `type` + a.extend(array.array(type, [7, 8, 9])) + if a != array.array(type, [1, 3, 4, 5, 7, 8, 9]): + raise TestFailed, "array(%s) extend-test" % `type` + a.pop() + a.pop() + a.pop() + a.pop() + if a != array.array(type, [1, 3, 4]): + raise TestFailed, "array(%s) pop-test" % `type` # test that overflow exceptions are raised as expected for assignment Index: test_bin.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_bin.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** test_bin.py 2000/06/29 19:35:29 1.4 --- test_bin.py 2000/09/01 19:25:51 1.5 *************** *** 1,46 **** ! #! /usr/bin/env python ! """Test script for the binhex C module - Uses the mechanism of the python binhex module - Roger E. Masse - """ - import binhex - import tempfile from test_support import verbose ! def test(): ! try: ! fname1 = tempfile.mktemp() ! fname2 = tempfile.mktemp() ! f = open(fname1, 'w') ! except: ! raise ImportError, "Cannot test binhex without a temp file" ! ! start = 'Jack is my hero' ! f.write(start) ! f.close() ! ! binhex.binhex(fname1, fname2) ! if verbose: ! print 'binhex' ! ! binhex.hexbin(fname2, fname1) ! if verbose: ! print 'hexbin' ! ! f = open(fname1, 'r') ! finish = f.readline() ! ! if start <> finish: ! print 'Error: binhex <> hexbin' ! elif verbose: ! print 'binhex == hexbin' ! ! try: ! import os ! os.unlink(fname1) ! os.unlink(fname2) ! except: ! pass ! test() --- 1,112 ---- ! """Test the binascii C module.""" from test_support import verbose + import binascii ! # Show module doc string ! print binascii.__doc__ ! # Show module exceptions ! print binascii.Error ! print binascii.Incomplete ! ! # Check presence and display doc strings of all functions ! funcs = [] ! for suffix in "base64", "hqx", "uu": ! prefixes = ["a2b_", "b2a_"] ! if suffix == "hqx": ! prefixes.extend(["crc_", "rlecode_", "rledecode_"]) ! for prefix in prefixes: ! name = prefix + suffix ! funcs.append(getattr(binascii, name)) ! for func in funcs: ! print "%-15s: %s" % (func.__name__, func.__doc__) ! ! # Create binary test data ! testdata = "The quick brown fox jumps over the lazy dog.\r\n" ! for i in range(256): ! # Be slow so we don't depend on other modules ! testdata = testdata + chr(i) ! testdata = testdata + "\r\nHello world.\n" ! ! # Test base64 with valid data ! print "base64 test" ! MAX_BASE64 = 57 ! lines = [] ! for i in range(0, len(testdata), MAX_BASE64): ! b = testdata[i:i+MAX_BASE64] ! a = binascii.b2a_base64(b) ! lines.append(a) ! print a, ! res = "" ! for line in lines: ! b = binascii.a2b_base64(line) ! res = res + b ! assert res == testdata ! ! # Test base64 with random invalid characters sprinkled throughout ! # (This requires a new version of binascii.) ! fillers = "" ! valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/" ! for i in range(256): ! c = chr(i) ! if c not in valid: ! fillers = fillers + c ! def addnoise(line): ! noise = fillers ! ratio = len(line) / len(noise) ! res = "" ! while line and noise: ! if len(line) / len(noise) > ratio: ! c, line = line[0], line[1:] ! else: ! c, noise = noise[0], noise[1:] ! res = res + c ! return res + noise + line ! res = "" ! for line in map(addnoise, lines): ! b = binascii.a2b_base64(line) ! res = res + b ! assert res == testdata ! ! # Test uu ! print "uu test" ! MAX_UU = 45 ! lines = [] ! for i in range(0, len(testdata), MAX_UU): ! b = testdata[i:i+MAX_UU] ! a = binascii.b2a_uu(b) ! lines.append(a) ! print a, ! res = "" ! for line in lines: ! b = binascii.a2b_uu(line) ! res = res + b ! assert res == testdata ! ! # Test crc32() ! crc = binascii.crc32("Test the CRC-32 of") ! crc = binascii.crc32(" this string.", crc) ! if crc != 1571220330: ! print "binascii.crc32() failed." ! ! # The hqx test is in test_binhex.py ! ! # test hexlification ! s = '{s\005\000\000\000worldi\002\000\000\000s\005\000\000\000helloi\001\000\000\0000' ! t = binascii.b2a_hex(s) ! u = binascii.a2b_hex(t) ! if s <> u: ! print 'binascii hexlification failed' ! try: ! binascii.a2b_hex(t[:-1]) ! except TypeError: ! pass ! else: ! print 'expected TypeError not raised' ! try: ! binascii.a2b_hex(t[:-1] + 'q') ! except TypeError: ! pass ! else: ! print 'expected TypeError not raised' Index: test_exc.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_exc.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** test_exc.py 2000/06/29 19:35:29 1.4 --- test_exc.py 2000/09/01 19:25:51 1.5 *************** *** 20,24 **** def r(thing): test_raise_catch(thing) ! if type(thing) == ClassType: print thing.__name__ else: --- 20,24 ---- def r(thing): test_raise_catch(thing) ! if isinstance(thing, ClassType): print thing.__name__ else: *************** *** 86,89 **** --- 86,97 ---- try: exec '/\n' except SyntaxError: pass + + r(IndentationError) + + r(TabError) + # can only be tested under -tt, and is the only test for -tt + #try: compile("try:\n\t1/0\n \t1/0\nfinally:\n pass\n", '', 'exec') + #except TabError: pass + #else: raise TestFailed r(SystemError) Index: test_ext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_ext.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** test_ext.py 2000/05/08 17:31:02 1.1 --- test_ext.py 2000/09/01 19:25:51 1.2 *************** *** 86,93 **** # what about willful misconduct? def saboteur(**kw): ! kw['x'] = locals() d = {} ! saboteur(a=1, **d) assert d == {} try: --- 86,96 ---- # what about willful misconduct? def saboteur(**kw): ! kw['x'] = locals() # yields a cyclic kw ! return kw d = {} ! kw = saboteur(a=1, **d) assert d == {} + # break the cycle + del kw['x'] try: Index: test_fcn.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_fcn.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** test_fcn.py 2000/05/08 17:31:02 1.6 --- test_fcn.py 2000/09/01 19:25:51 1.7 *************** *** 18,22 **** if sys.platform in ('netbsd1', ! 'freebsd2', 'freebsd3', 'bsdos2', 'bsdos3', 'bsdos4', 'openbsd', 'openbsd2'): --- 18,22 ---- if sys.platform in ('netbsd1', ! 'freebsd2', 'freebsd3', 'freebsd4', 'freebsd5', 'bsdos2', 'bsdos3', 'bsdos4', 'openbsd', 'openbsd2'): Index: test_for.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_for.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** test_for.py 2000/05/08 17:31:02 1.1 --- test_for.py 2000/09/01 19:25:51 1.2 *************** *** 7,18 **** active threads survive in the child after a fork(); this is an error. """ import os, sys, time, thread try: os.fork except AttributeError: ! raise ImportError, "os.fork not defined -- skipping test_fork1" LONGSLEEP = 2 --- 7,28 ---- active threads survive in the child after a fork(); this is an error. + On BeOS, you CANNOT mix threads and fork(), the behaviour is undefined. + That's OK, fork() is a grotesque hack anyway. ;-) [cjh] + """ import os, sys, time, thread + from test_support import TestSkipped + + try: + if os.uname()[0] == "BeOS": + raise TestSkipped, "can't mix os.fork with threads on BeOS" + except AttributeError: + pass try: os.fork except AttributeError: ! raise TestSkipped, "os.fork not defined -- skipping test_fork1" LONGSLEEP = 2 Index: test_gra.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_gra.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** test_gra.py 2000/05/08 17:31:02 1.3 --- test_gra.py 2000/09/01 19:25:51 1.4 *************** *** 261,264 **** --- 261,308 ---- print 0 or 1 + print 'extended print_stmt' # 'print' '>>' test ',' + import sys + print >> sys.stdout, 1, 2, 3 + print >> sys.stdout, 1, 2, 3, + print >> sys.stdout + print >> sys.stdout, 0 or 1, 0 or 1, + print >> sys.stdout, 0 or 1 + + # test print >> None + class Gulp: + def write(self, msg): pass + + def driver(): + oldstdout = sys.stdout + sys.stdout = Gulp() + try: + tellme(Gulp()) + tellme() + finally: + sys.stdout = oldstdout + + # we should see this once + def tellme(file=sys.stdout): + print >> file, 'hello world' + + driver() + + # we should not see this at all + def tellme(file=None): + print >> file, 'goodbye universe' + + driver() + + # syntax errors + def check_syntax(statement): + try: + compile(statement, '', 'exec') + except SyntaxError: + pass + else: + print 'Missing SyntaxError: "%s"' % statement + check_syntax('print ,') + check_syntax('print >> x,') + print 'del_stmt' # 'del' exprlist del abc *************** *** 543,544 **** --- 587,634 ---- def meth2(self, arg): pass def meth3(self, a1, a2): pass + + # list comprehension tests + nums = [1, 2, 3, 4, 5] + strs = ["Apple", "Banana", "Coconut"] + spcs = [" Apple", " Banana ", "Coco nut "] + + print [s.strip() for s in spcs] + print [3 * x for x in nums] + print [x for x in nums if x > 2] + print [(i, s) for i in nums for s in strs] + print [(i, s) for i in nums for s in [f for f in strs if "n" in f]] + try: + eval("[i, s for i in nums for s in strs]") + print "FAIL: should have raised a SyntaxError!" + except SyntaxError: + print "good: got a SyntaxError as expected" + + try: + eval("[x if y]") + print "FAIL: should have raised a SyntaxError!" + except SyntaxError: + print "good: got a SyntaxError as expected" + + suppliers = [ + (1, "Boeing"), + (2, "Ford"), + (3, "Macdonalds") + ] + + parts = [ + (10, "Airliner"), + (20, "Engine"), + (30, "Cheeseburger") + ] + + suppart = [ + (1, 10), (1, 20), (2, 20), (3, 30) + ] + + print [ + (sname, pname) + for (sno, sname) in suppliers + for (pno, pname) in parts + for (sp_sno, sp_pno) in suppart + if sno == sp_sno and pno == sp_pno + ] Index: test_gzi.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_gzi.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** test_gzi.py 1999/04/08 20:27:47 1.1 --- test_gzi.py 2000/09/01 19:25:51 1.2 *************** *** 17,30 **** """ ! f = gzip.GzipFile(filename, 'wb') ; f.write(data1) ; f.close() f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close() ! assert d == data1 # Append to the previous file ! f = gzip.GzipFile(filename, 'ab') ; f.write(data2) ; f.close() f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close() ! assert d == data1+data2 os.unlink( filename ) --- 17,54 ---- """ ! f = gzip.GzipFile(filename, 'wb') ; f.write(data1 * 50) ; f.close() f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close() ! assert d == data1*50 # Append to the previous file ! f = gzip.GzipFile(filename, 'ab') ; f.write(data2 * 15) ; f.close() f = gzip.GzipFile(filename, 'rb') ; d = f.read() ; f.close() ! assert d == (data1*50) + (data2*15) ! ! # Try .readline() with varying line lengths ! ! f = gzip.GzipFile(filename, 'rb') ! line_length = 0 ! while 1: ! L = f.readline( line_length ) ! if L == "" and line_length != 0: break ! assert len(L) <= line_length ! line_length = (line_length + 1) % 50 ! f.close() ! ! # Try .readlines() ! ! f = gzip.GzipFile(filename, 'rb') ! L = f.readlines() ! f.close() ! ! f = gzip.GzipFile(filename, 'rb') ! while 1: ! L = f.readlines(150) ! if L == []: break ! f.close() ! os.unlink( filename ) Index: test_lin.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_lin.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** test_lin.py 2000/06/29 19:35:29 1.1 --- test_lin.py 2000/09/01 19:25:51 1.2 *************** *** 1,4 **** ! from test_support import verbose, findfile, TestFailed import linuxaudiodev import os --- 1,5 ---- ! from test_support import verbose, findfile, TestFailed, TestSkipped import linuxaudiodev + import errno import os *************** *** 10,13 **** --- 11,16 ---- a = linuxaudiodev.open('w') except linuxaudiodev.error, msg: + if msg[0] in (errno.EACCES, errno.ENODEV): + raise TestSkipped, msg raise TestFailed, msg else: Index: test_mat.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_mat.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** test_mat.py 2000/06/29 19:35:29 1.3 --- test_mat.py 2000/09/01 19:25:51 1.4 *************** *** 130,145 **** testit('pow(2,-1)', math.pow(2,-1), 0.5) - print 'rint' - try: - math.rint - except AttributeError: - # this platform does not have rint, that is fine, skip the test - pass - else: - testit('rint(0.7)', math.rint(0.7), 1) - testit('rint(-0.3)', math.rint(-0.3), 0) - testit('rint(2.5)', math.rint(2.5), 2) - testit('rint(3.5)', math.rint(3.5), 4) - print 'sin' testit('sin(0)', math.sin(0), 0) --- 130,133 ---- Index: test_mma.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_mma.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** test_mma.py 2000/06/29 19:35:29 1.2 --- test_mma.py 2000/09/01 19:25:51 1.3 *************** *** 70,74 **** print ' Seek to last byte' assert m.tell() == len(m) ! print ' Try to seek to negative position...' try: --- 70,74 ---- print ' Seek to last byte' assert m.tell() == len(m) ! print ' Try to seek to negative position...' try: *************** *** 95,98 **** --- 95,118 ---- assert 0, 'expected a ValueError but did not get it' + # Try resizing map + print ' Attempting resize()' + try: + m.resize( 512 ) + except SystemError: + # resize() not supported + # No messages are printed, since the output of this test suite + # would then be different across platforms. + pass + else: + # resize() is supported + assert len(m) == 512, "len(m) is %d, but expecting 512" % (len(m),) + # Check that we can no longer seek beyond the new size. + try: + m.seek(513,0) + except ValueError: + pass + else: + assert 0, 'Could seek beyond the new size' + m.close() os.unlink("foo") Index: test_ntp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_ntp.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** test_ntp.py 1999/04/08 20:27:48 1.2 --- test_ntp.py 2000/09/01 19:25:51 1.3 *************** *** 1,4 **** --- 1,5 ---- import ntpath import string + import os errors = 0 *************** *** 34,37 **** --- 35,47 ---- tester('ntpath.isabs("\\foo")', 1) tester('ntpath.isabs("\\foo\\bar")', 1) + + tester('ntpath.abspath("C:\\")', "C:\\") + + tester('ntpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"])', + "/home/swen") + tester('ntpath.commonprefix(["\\home\\swen\\spam", "\\home\\swen\\eggs"])', + "\\home\\swen\\") + tester('ntpath.commonprefix(["/home/swen/spam", "/home/swen/spam"])', + "/home/swen/spam") if errors: Index: test_ope.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_ope.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** test_ope.py 2000/06/29 19:35:29 1.4 --- test_ope.py 2000/09/01 19:25:51 1.5 *************** *** 1,77 **** ! import operator ! import sys ! def test(name, input, output, *args): ! print 'testing:', name ! f = getattr(operator, name) ! params = (input,) + args ! try: ! val = apply(f, params) ! except: ! val = sys.exc_type ! if val <> output: ! print '%s%s = %s: %s expected' % (f.__name__, params, `val`, `output`) ! test('abs', -1, 1) ! test('add', 3, 7, 4) ! test('and_', 0xf, 0xa, 0xa) ! test('concat', 'py', 'python', 'thon') ! test('countOf', [1, 2, 1, 3, 1, 4], 1, 3) - a = [4, 3, 2, 1] - test('delitem', a, None, 1) - if a <> [4, 2, 1]: - print 'delitem() failed' - - a = range(10) - test('delslice', a, None, 2, 8) - if a <> [0, 1, 8, 9]: - print 'delslice() failed' - - a = range(10) - test('div', 5, 2, 2) - test('getitem', a, 2, 2) - test('getslice', a, [4, 5], 4, 6) - test('indexOf', [4, 3, 2, 1], 1, 3) - test('inv', 4, -5) - test('isCallable', 4, 0) - test('isCallable', operator.isCallable, 1) - test('isMappingType', operator.isMappingType, 0) - test('isMappingType', operator.__dict__, 1) - test('isNumberType', 8.3, 1) - test('isNumberType', dir(), 0) - test('isSequenceType', dir(), 1) - test('isSequenceType', 'yeahbuddy', 1) - test('isSequenceType', 3, 0) - test('lshift', 5, 10, 1) - test('mod', 5, 1, 2) - test('mul', 5, 10, 2) - test('neg', 5, -5) - test('or_', 0xa, 0xf, 0x5) - test('pos', -5, -5) - - a = range(3) - test('repeat', a, a+a, 2) - test('rshift', 5, 2, 1) - - test('sequenceIncludes', range(4), 1, 2) - test('sequenceIncludes', range(4), 0, 5) - - test('setitem', a, None, 0, 2) - if a <> [2, 1, 2]: - print 'setitem() failed' - - a = range(4) - test('setslice', a, None, 1, 3, [2, 1]) - if a <> [0, 2, 1, 3]: - print 'setslice() failed:', a - - test('sub', 5, 2, 3) - test('truth', 5, 1) - test('truth', [], 0) - test('xor', 0xb, 0x7, 0xc) - - - # some negative tests - test('indexOf', [4, 3, 2, 1], ValueError, 9) --- 1,22 ---- ! # Test to see if openpty works. (But don't worry if it isn't available.) ! import os ! from test_support import verbose, TestFailed, TestSkipped ! try: ! if verbose: ! print "Calling os.openpty()" ! master, slave = os.openpty() ! if verbose: ! print "(master, slave) = (%d, %d)"%(master, slave) ! except AttributeError: ! raise TestSkipped, "No openpty() available." ! ! if not os.isatty(master): ! raise TestFailed, "Master-end of pty is not a terminal." ! if not os.isatty(slave): ! raise TestFailed, "Slave-end of pty is not a terminal." ! os.write(slave, 'Ping!') ! print os.read(master, 1024) Index: test_pop.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_pop.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** test_pop.py 1999/04/08 20:27:50 1.1 --- test_pop.py 2000/09/01 19:25:51 1.2 *************** *** 4,17 **** """ # popen2 contains its own testing routine # which is especially useful to see if open files ! # like stdin can be read successfully by a forked # subprocess. def main(): ! from os import fork # skips test through ImportError import popen2 popen2._test() - main() --- 4,56 ---- """ + import os + # popen2 contains its own testing routine # which is especially useful to see if open files ! # like stdin can be read successfully by a forked # subprocess. def main(): ! print "Test popen2 module:" ! try: ! from os import popen ! except ImportError: ! # if we don't have os.popen, check that ! # we have os.fork. if not, skip the test ! # (by raising an ImportError) ! from os import fork import popen2 popen2._test() + def _test(): + # same test as popen2._test(), but using the os.popen*() API + print "Testing os module:" + import popen2 + cmd = "cat" + teststr = "abc\n" + resultstr = teststr + if os.name == "nt": + cmd = "more" + resultstr = "\n" + resultstr + print "testing popen2..." + w, r = os.popen2(cmd) + w.write(teststr) + w.close() + assert r.read() == resultstr + print "testing popen3..." + try: + w, r, e = os.popen3([cmd]) + except: + w, r, e = os.popen3(cmd) + w.write(teststr) + w.close() + assert r.read() == resultstr + assert e.read() == "" + for inst in popen2._active[:]: + inst.wait() + assert not popen2._active + print "All OK" + + main() + _test() Index: test_rgb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_rgb.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** test_rgb.py 1998/08/12 02:38:03 1.6 --- test_rgb.py 2000/09/01 19:25:51 1.7 *************** *** 5,9 **** from test_support import verbose, unlink, findfile ! error = 'test_rgbimg.error' print 'RGBimg test suite:' --- 5,10 ---- from test_support import verbose, unlink, findfile ! class error(Exception): ! pass print 'RGBimg test suite:' Index: test_sel.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_sel.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** test_sel.py 1998/03/26 22:14:01 1.6 --- test_sel.py 2000/09/01 19:25:51 1.7 *************** *** 46,50 **** print 'timeout =', tout rfd, wfd, xfd = select.select([p], [], [], tout) - ## print rfd, wfd, xfd if (rfd, wfd, xfd) == ([], [], []): continue --- 46,49 ---- *************** *** 58,62 **** break continue ! print 'Heh?' p.close() --- 57,61 ---- break continue ! print 'Unexpected return values from select():', rfd, wfd, xfd p.close() Index: test_sig.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_sig.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** test_sig.py 1997/11/26 15:44:25 1.4 --- test_sig.py 2000/09/01 19:25:51 1.5 *************** *** 1,4 **** # Test the signal module ! from test_support import verbose import signal import os --- 1,4 ---- # Test the signal module ! from test_support import verbose, TestSkipped import signal import os *************** *** 6,10 **** if sys.platform[:3] in ('win', 'os2'): ! raise ImportError, "Can't test signal on %s" % sys.platform[:3] if verbose: --- 6,10 ---- if sys.platform[:3] in ('win', 'os2'): ! raise TestSkipped, "Can't test signal on %s" % sys.platform[:3] if verbose: Index: test_str.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_str.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** test_str.py 2000/06/29 19:35:29 1.9 --- test_str.py 2000/09/01 19:25:51 1.10 *************** *** 1,185 **** from test_support import verbose - import string, sys ! # XXX: kludge... short circuit if strings don't have methods ! try: ! ''.join ! except AttributeError: ! raise ImportError ! def test(name, input, output, *args): if verbose: ! print 'string.%s%s =? %s... ' % (name, (input,) + args, output), try: ! # Prefer string methods over string module functions try: ! f = getattr(input, name) ! value = apply(f, args) ! except AttributeError: ! f = getattr(string, name) ! value = apply(f, (input,) + args) ! except: ! value = sys.exc_type ! if value != output: ! if verbose: ! print 'no' ! print f, `input`, `output`, `value` ! else: ! if verbose: ! print 'yes' ! ! test('atoi', " 1 ", 1) ! test('atoi', " 1x", ValueError) ! test('atoi', " x1 ", ValueError) ! test('atol', " 1 ", 1L) ! test('atol', " 1x ", ValueError) ! test('atol', " x1 ", ValueError) ! test('atof', " 1 ", 1.0) ! test('atof', " 1x ", ValueError) ! test('atof', " x1 ", ValueError) ! ! test('capitalize', ' hello ', ' hello ') ! test('capitalize', 'hello ', 'Hello ') ! test('find', 'abcdefghiabc', 0, 'abc') ! test('find', 'abcdefghiabc', 9, 'abc', 1) ! test('find', 'abcdefghiabc', -1, 'def', 4) ! test('rfind', 'abcdefghiabc', 9, 'abc') ! test('lower', 'HeLLo', 'hello') ! test('lower', 'hello', 'hello') ! test('upper', 'HeLLo', 'HELLO') ! test('upper', 'HELLO', 'HELLO') ! ! test('title', ' hello ', ' Hello ') ! test('title', 'hello ', 'Hello ') ! test('title', "fOrMaT thIs aS titLe String", 'Format This As Title String') ! test('title', "fOrMaT,thIs-aS*titLe;String", 'Format,This-As*Title;String') ! test('title', "getInt", 'Getint') ! ! test('expandtabs', 'abc\rab\tdef\ng\thi', 'abc\rab def\ng hi') ! test('expandtabs', 'abc\rab\tdef\ng\thi', 'abc\rab def\ng hi', 8) ! test('expandtabs', 'abc\rab\tdef\ng\thi', 'abc\rab def\ng hi', 4) ! test('expandtabs', 'abc\r\nab\tdef\ng\thi', 'abc\r\nab def\ng hi', 4) ! ! test('islower', 'a', 1) ! test('islower', 'A', 0) ! test('islower', '\n', 0) ! test('islower', 'abc', 1) ! test('islower', 'aBc', 0) ! test('islower', 'abc\n', 1) ! ! test('isupper', 'a', 0) ! test('isupper', 'A', 1) ! test('isupper', '\n', 0) ! test('isupper', 'ABC', 1) ! test('isupper', 'AbC', 0) ! test('isupper', 'ABC\n', 1) ! ! test('istitle', 'a', 0) ! test('istitle', 'A', 1) ! test('istitle', '\n', 0) ! test('istitle', 'A Titlecased Line', 1) ! test('istitle', 'A\nTitlecased Line', 1) ! test('istitle', 'A Titlecased, Line', 1) ! test('istitle', 'Not a capitalized String', 0) ! test('istitle', 'Not\ta Titlecase String', 0) ! test('istitle', 'Not--a Titlecase String', 0) ! ! test('splitlines', "abc\ndef\n\rghi", ['abc', 'def', '', 'ghi']) ! test('splitlines', "abc\ndef\n\r\nghi", ['abc', 'def', '', 'ghi']) ! test('splitlines', "abc\ndef\r\nghi", ['abc', 'def', 'ghi']) ! test('splitlines', "abc\ndef\r\nghi\n", ['abc', 'def', 'ghi']) ! test('splitlines', "abc\ndef\r\nghi\n\r", ['abc', 'def', 'ghi', '']) ! test('splitlines', "\nabc\ndef\r\nghi\n\r", ['', 'abc', 'def', 'ghi', '']) ! test('splitlines', "\nabc\ndef\r\nghi\n\r", ['\n', 'abc\n', 'def\r\n', 'ghi\n', '\r'], 1) ! ! transtable = '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377' ! ! test('maketrans', 'abc', transtable, 'xyz') ! test('maketrans', 'abc', ValueError, 'xyzq') ! ! test('split', 'this is the split function', ! ['this', 'is', 'the', 'split', 'function']) ! test('split', 'a|b|c|d', ['a', 'b', 'c', 'd'], '|') ! test('split', 'a|b|c|d', ['a', 'b', 'c|d'], '|', 2) ! test('split', 'a b c d', ['a', 'b c d'], None, 1) ! test('split', 'a b c d', ['a', 'b', 'c d'], None, 2) ! test('split', 'a b c d', ['a', 'b', 'c', 'd'], None, 3) ! test('split', 'a b c d', ['a', 'b', 'c', 'd'], None, 4) ! test('split', 'a b c d', ['a b c d'], None, 0) ! test('split', 'a b c d', ['a', 'b', 'c d'], None, 2) ! test('split', 'a b c d ', ['a', 'b', 'c', 'd']) ! ! # join now works with any sequence type ! class Sequence: ! def __init__(self): self.seq = 'wxyz' ! def __len__(self): return len(self.seq) ! def __getitem__(self, i): return self.seq[i] ! ! test('join', ['a', 'b', 'c', 'd'], 'a b c d') ! test('join', ('a', 'b', 'c', 'd'), 'abcd', '') ! test('join', Sequence(), 'w x y z') ! test('join', 7, TypeError) ! ! class BadSeq(Sequence): ! def __init__(self): self.seq = [7, 'hello', 123L] ! ! test('join', BadSeq(), TypeError) ! ! # try a few long ones ! print string.join(['x' * 100] * 100, ':') ! print string.join(('x' * 100,) * 100, ':') ! ! test('strip', ' hello ', 'hello') ! test('lstrip', ' hello ', 'hello ') ! test('rstrip', ' hello ', ' hello') ! test('strip', 'hello', 'hello') ! ! test('swapcase', 'HeLLo cOmpUteRs', 'hEllO CoMPuTErS') ! test('translate', 'xyzabcdef', 'xyzxyz', transtable, 'def') ! ! table = string.maketrans('a', 'A') ! test('translate', 'abc', 'Abc', table) ! test('translate', 'xyz', 'xyz', table) ! ! test('replace', 'one!two!three!', 'one@two!three!', '!', '@', 1) ! test('replace', 'one!two!three!', 'onetwothree', '!', '') ! test('replace', 'one!two!three!', 'one@two@three!', '!', '@', 2) ! test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 3) ! test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 4) ! test('replace', 'one!two!three!', 'one!two!three!', '!', '@', 0) ! test('replace', 'one!two!three!', 'one@two@three@', '!', '@') ! test('replace', 'one!two!three!', 'one!two!three!', 'x', '@') ! test('replace', 'one!two!three!', 'one!two!three!', 'x', '@', 2) ! ! test('startswith', 'hello', 1, 'he') ! test('startswith', 'hello', 1, 'hello') ! test('startswith', 'hello', 0, 'hello world') ! test('startswith', 'hello', 1, '') ! test('startswith', 'hello', 0, 'ello') ! test('startswith', 'hello', 1, 'ello', 1) ! test('startswith', 'hello', 1, 'o', 4) ! test('startswith', 'hello', 0, 'o', 5) ! test('startswith', 'hello', 1, '', 5) ! test('startswith', 'hello', 0, 'lo', 6) ! test('startswith', 'helloworld', 1, 'lowo', 3) ! test('startswith', 'helloworld', 1, 'lowo', 3, 7) ! test('startswith', 'helloworld', 0, 'lowo', 3, 6) ! ! test('endswith', 'hello', 1, 'lo') ! test('endswith', 'hello', 0, 'he') ! test('endswith', 'hello', 1, '') ! test('endswith', 'hello', 0, 'hello world') ! test('endswith', 'helloworld', 0, 'worl') ! test('endswith', 'helloworld', 1, 'worl', 3, 9) ! test('endswith', 'helloworld', 1, 'world', 3, 12) ! test('endswith', 'helloworld', 1, 'lowo', 1, 7) ! test('endswith', 'helloworld', 1, 'lowo', 2, 7) ! test('endswith', 'helloworld', 1, 'lowo', 3, 7) ! test('endswith', 'helloworld', 0, 'lowo', 4, 7) ! test('endswith', 'helloworld', 0, 'lowo', 3, 8) ! test('endswith', 'ab', 0, 'ab', 0, 1) ! test('endswith', 'ab', 0, 'ab', 0, 0) ! ! string.whitespace ! string.lowercase ! string.uppercase --- 1,134 ---- + #! /usr/bin/env python + + # Sanity checker for time.strftime + + import time, calendar, sys, string, os, re from test_support import verbose ! def main(): ! global verbose ! now = time.time() ! strftest(now) ! verbose = 0 ! # Try a bunch of dates and times, chosen to vary through time of ! # day and daylight saving time ! for j in range(-5, 5): ! for i in range(25): ! strftest(now + (i + j*100)*23*3603) ! def strftest(now): if verbose: ! print "strftime test for", time.ctime(now) ! nowsecs = str(long(now))[:-1] ! gmt = time.gmtime(now) ! now = time.localtime(now) ! ! if now[3] < 12: ampm='AM' ! else: ampm='PM' ! ! jan1 = time.localtime(time.mktime((now[0], 1, 1) + (0,)*6)) ! try: ! if now[8]: tz = time.tzname[1] ! else: tz = time.tzname[0] ! except AttributeError: ! tz = '' ! ! if now[3] > 12: clock12 = now[3] - 12 ! elif now[3] > 0: clock12 = now[3] ! else: clock12 = 12 ! ! expectations = ( ! ('%a', calendar.day_abbr[now[6]], 'abbreviated weekday name'), ! ('%A', calendar.day_name[now[6]], 'full weekday name'), ! ('%b', calendar.month_abbr[now[1]], 'abbreviated month name'), ! ('%B', calendar.month_name[now[1]], 'full month name'), ! # %c see below ! ('%d', '%02d' % now[2], 'day of month as number (00-31)'), ! ('%H', '%02d' % now[3], 'hour (00-23)'), ! ('%I', '%02d' % clock12, 'hour (01-12)'), ! ('%j', '%03d' % now[7], 'julian day (001-366)'), ! ('%m', '%02d' % now[1], 'month as number (01-12)'), ! ('%M', '%02d' % now[4], 'minute, (00-59)'), ! ('%p', ampm, 'AM or PM as appropriate'), ! ('%S', '%02d' % now[5], 'seconds of current time (00-60)'), ! ('%U', '%02d' % ((now[7] + jan1[6])/7), ! 'week number of the year (Sun 1st)'), ! ('%w', '0?%d' % ((1+now[6]) % 7), 'weekday as a number (Sun 1st)'), ! ('%W', '%02d' % ((now[7] + (jan1[6] - 1)%7)/7), ! 'week number of the year (Mon 1st)'), ! # %x see below ! ('%X', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ! ('%y', '%02d' % (now[0]%100), 'year without century'), ! ('%Y', '%d' % now[0], 'year with century'), ! # %Z see below ! ('%%', '%', 'single percent sign'), ! ) ! ! nonstandard_expectations = ( ! # These are standard but don't have predictable output ! ('%c', fixasctime(time.asctime(now)), 'near-asctime() format'), ! ('%x', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), ! '%m/%d/%y %H:%M:%S'), ! ('%Z', '%s' % tz, 'time zone name'), ! ! # These are some platform specific extensions ! ('%D', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), 'mm/dd/yy'), ! ('%e', '%2d' % now[2], 'day of month as number, blank padded ( 0-31)'), ! ('%h', calendar.month_abbr[now[1]], 'abbreviated month name'), ! ('%k', '%2d' % now[3], 'hour, blank padded ( 0-23)'), ! ('%n', '\n', 'newline character'), ! ('%r', '%02d:%02d:%02d %s' % (clock12, now[4], now[5], ampm), ! '%I:%M:%S %p'), ! ('%R', '%02d:%02d' % (now[3], now[4]), '%H:%M'), ! ('%s', nowsecs, 'seconds since the Epoch in UCT'), ! ('%t', '\t', 'tab character'), ! ('%T', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ! ('%3y', '%03d' % (now[0]%100), ! 'year without century rendered using fieldwidth'), ! ) ! ! if verbose: ! print "Strftime test, platform: %s, Python version: %s" % \ ! (sys.platform, string.split(sys.version)[0]) ! ! for e in expectations: try: ! result = time.strftime(e[0], now) ! except ValueError, error: ! print "Standard '%s' format gave error:" % e[0], error ! continue ! if re.match(e[1], result): continue ! if not result or result[0] == '%': ! print "Does not support standard '%s' format (%s)" % (e[0], e[2]) ! else: ! print "Conflict for %s (%s):" % (e[0], e[2]) ! print " Expected %s, but got %s" % (e[1], result) ! ! for e in nonstandard_expectations: ! try: ! result = time.strftime(e[0], now) ! except ValueError, result: ! if verbose: ! print "Error for nonstandard '%s' format (%s): %s" % \ ! (e[0], e[2], str(result)) ! continue ! if re.match(e[1], result): ! if verbose: ! print "Supports nonstandard '%s' format (%s)" % (e[0], e[2]) ! elif not result or result[0] == '%': ! if verbose: ! print "Does not appear to support '%s' format (%s)" % (e[0], ! e[2]) ! else: ! if verbose: ! print "Conflict for nonstandard '%s' format (%s):" % (e[0], ! e[2]) ! print " Expected %s, but got %s" % (e[1], result) ! ! def fixasctime(s): ! if s[8] == ' ': ! s = s[:8] + '0' + s[9:] ! return s ! ! main() Index: test_sup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_sup.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** test_sup.py 1998/08/12 02:38:05 1.3 --- test_sup.py 2000/09/01 19:25:51 1.4 *************** *** 1,7 **** ! # Python test set -- supporting definitions. - TestFailed = 'test_support -- test failed' # Exception verbose = 1 # Flag set to 0 by regrtest.py def unload(name): --- 1,25 ---- ! """Supporting definitions for the Python regression test.""" + class Error(Exception): + """Base class for regression test exceptions.""" + + class TestFailed(Error): + """Test failed.""" + + class TestSkipped(Error): + """Test skipped. + + This can be raised to indicate that a test was deliberatly + skipped, but not because a feature wasn't available. For + example, if some resource can't be used, such as the network + appears to be unavailable, this should be raised instead of + TestFailed. + + """ + + verbose = 1 # Flag set to 0 by regrtest.py + use_large_resources = 1 # Flag set to 0 by regrtest.py def unload(name): Index: test_tim.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_tim.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** test_tim.py 2000/06/29 19:35:29 1.6 --- test_tim.py 2000/09/01 19:25:51 1.7 *************** *** 1,21 **** ! from test_support import verbose ! import timing ! r = range(100000) ! if verbose: ! print 'starting...' ! timing.start() ! for i in r: pass - timing.finish() - if verbose: - print 'finished' - - secs = timing.seconds() - milli = timing.milli() - micro = timing.micro() - - if verbose: - print 'seconds:', secs - print 'milli :', milli - print 'micro :', micro --- 1,39 ---- ! import time ! time.altzone ! time.clock() ! t = time.time() ! time.asctime(time.gmtime(t)) ! if time.ctime(t) <> time.asctime(time.localtime(t)): ! print 'time.ctime(t) <> time.asctime(time.localtime(t))' ! ! time.daylight ! if long(time.mktime(time.localtime(t))) <> long(t): ! print 'time.mktime(time.localtime(t)) <> t' ! ! time.sleep(1.2) ! tt = time.gmtime(t) ! for directive in ('a', 'A', 'b', 'B', 'c', 'd', 'H', 'I', ! 'j', 'm', 'M', 'p', 'S', ! 'U', 'w', 'W', 'x', 'X', 'y', 'Y', 'Z', '%'): ! format = ' %' + directive ! try: ! time.strftime(format, tt) ! except ValueError: ! print 'conversion specifier:', format, ' failed.' ! ! time.timezone ! time.tzname ! ! # expected errors ! try: ! time.asctime(0) ! except TypeError: ! pass ! ! try: ! time.mktime((999999, 999999, 999999, 999999, ! 999999, 999999, 999999, 999999, ! 999999)) ! except OverflowError: pass Index: test_typ.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_typ.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** test_typ.py 2000/05/08 17:31:03 1.7 --- test_typ.py 2000/09/01 19:25:51 1.8 *************** *** 254,255 **** --- 254,267 ---- if d.get('a') != 1: raise TestFailed, 'present dict get, no 2nd arg' if d.get('a', 3) != 1: raise TestFailed, 'present dict get, w/ 2nd arg' + # dict.setdefault() + d = {} + if d.setdefault('key0') <> None: + raise TestFailed, 'missing {} setdefault, no 2nd arg' + if d.setdefault('key0') <> None: + raise TestFailed, 'present {} setdefault, no 2nd arg' + d.setdefault('key', []).append(3) + if d['key'][0] <> 3: + raise TestFailed, 'missing {} setdefault, w/ 2nd arg' + d.setdefault('key', []).append(4) + if len(d['key']) <> 2: + raise TestFailed, 'present {} setdefault, w/ 2nd arg' Index: test_uni.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_uni.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** test_uni.py 2000/06/29 19:35:29 1.2 --- test_uni.py 2000/09/01 19:25:51 1.3 *************** *** 1,3 **** ! """ Test script for the unicodedata module. Written by Marc-Andre Lemburg (mal@lemburg.com). --- 1,3 ---- ! """ Test script for the Unicode implementation. Written by Marc-Andre Lemburg (mal@lemburg.com). *************** *** 5,50 **** (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. ! """#" from test_support import verbose import sys ! # Test Unicode database APIs ! import unicodedata ! print 'Testing unicodedata module...', ! assert unicodedata.digit(u'A',None) is None ! assert unicodedata.digit(u'9') == 9 ! assert unicodedata.digit(u'\u215b',None) is None ! assert unicodedata.digit(u'\u2468') == 9 ! ! assert unicodedata.numeric(u'A',None) is None ! assert unicodedata.numeric(u'9') == 9 ! assert unicodedata.numeric(u'\u215b') == 0.125 ! assert unicodedata.numeric(u'\u2468') == 9.0 ! ! assert unicodedata.decimal(u'A',None) is None ! assert unicodedata.decimal(u'9') == 9 ! assert unicodedata.decimal(u'\u215b',None) is None ! assert unicodedata.decimal(u'\u2468',None) is None ! ! assert unicodedata.category(u'\uFFFE') == 'Cn' ! assert unicodedata.category(u'a') == 'Ll' ! assert unicodedata.category(u'A') == 'Lu' ! ! assert unicodedata.bidirectional(u'\uFFFE') == '' ! assert unicodedata.bidirectional(u' ') == 'WS' ! assert unicodedata.bidirectional(u'A') == 'L' ! ! assert unicodedata.decomposition(u'\uFFFE') == '' ! assert unicodedata.decomposition(u'\u00bc') == ' 0031 2044 0034' ! ! assert unicodedata.mirrored(u'\uFFFE') == 0 ! assert unicodedata.mirrored(u'a') == 0 ! assert unicodedata.mirrored(u'\u2201') == 1 ! ! assert unicodedata.combining(u'\uFFFE') == 0 ! assert unicodedata.combining(u'a') == 0 ! assert unicodedata.combining(u'\u20e1') == 230 print 'done.' --- 5,517 ---- (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. ! """ from test_support import verbose import sys ! def test(method, input, output, *args): ! if verbose: ! print '%s.%s%s =? %s... ' % (repr(input), method, args, output), ! try: ! f = getattr(input, method) ! value = apply(f, args) ! except: ! value = sys.exc_type ! exc = sys.exc_info()[:2] ! else: ! exc = None ! if value != output: ! if verbose: ! print 'no' ! print '*',f, `input`, `output`, `value` ! if exc: ! print ' value == %s: %s' % (exc) ! else: ! if verbose: ! print 'yes' ! ! test('capitalize', u' hello ', u' hello ') ! test('capitalize', u'hello ', u'Hello ') ! ! test('title', u' hello ', u' Hello ') ! test('title', u'hello ', u'Hello ') ! test('title', u"fOrMaT thIs aS titLe String", u'Format This As Title String') ! test('title', u"fOrMaT,thIs-aS*titLe;String", u'Format,This-As*Title;String') ! test('title', u"getInt", u'Getint') ! ! test('find', u'abcdefghiabc', 0, u'abc') ! test('find', u'abcdefghiabc', 9, u'abc', 1) ! test('find', u'abcdefghiabc', -1, u'def', 4) ! ! test('rfind', u'abcdefghiabc', 9, u'abc') ! ! test('lower', u'HeLLo', u'hello') ! test('lower', u'hello', u'hello') ! ! test('upper', u'HeLLo', u'HELLO') ! test('upper', u'HELLO', u'HELLO') ! ! if 0: ! transtable = '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377' ! ! test('maketrans', u'abc', transtable, u'xyz') ! test('maketrans', u'abc', ValueError, u'xyzq') ! ! test('split', u'this is the split function', ! [u'this', u'is', u'the', u'split', u'function']) ! test('split', u'a|b|c|d', [u'a', u'b', u'c', u'd'], u'|') ! test('split', u'a|b|c|d', [u'a', u'b', u'c|d'], u'|', 2) ! test('split', u'a b c d', [u'a', u'b c d'], None, 1) ! test('split', u'a b c d', [u'a', u'b', u'c d'], None, 2) ! test('split', u'a b c d', [u'a', u'b', u'c', u'd'], None, 3) ! test('split', u'a b c d', [u'a', u'b', u'c', u'd'], None, 4) ! test('split', u'a b c d', [u'a b c d'], None, 0) ! test('split', u'a b c d', [u'a', u'b', u'c d'], None, 2) ! test('split', u'a b c d ', [u'a', u'b', u'c', u'd']) ! ! # join now works with any sequence type ! class Sequence: ! def __init__(self): self.seq = 'wxyz' ! def __len__(self): return len(self.seq) ! def __getitem__(self, i): return self.seq[i] ! ! test('join', u' ', u'a b c d', [u'a', u'b', u'c', u'd']) ! test('join', u'', u'abcd', (u'a', u'b', u'c', u'd')) ! test('join', u' ', u'w x y z', Sequence()) ! test('join', u' ', TypeError, 7) ! ! class BadSeq(Sequence): ! def __init__(self): self.seq = [7, u'hello', 123L] ! ! test('join', u' ', TypeError, BadSeq()) ! ! result = u'' ! for i in range(10): ! if i > 0: ! result = result + u':' ! result = result + u'x'*10 ! test('join', u':', result, [u'x' * 10] * 10) ! test('join', u':', result, (u'x' * 10,) * 10) ! ! test('strip', u' hello ', u'hello') ! test('lstrip', u' hello ', u'hello ') ! test('rstrip', u' hello ', u' hello') ! test('strip', u'hello', u'hello') ! ! test('swapcase', u'HeLLo cOmpUteRs', u'hEllO CoMPuTErS') ! ! if 0: ! test('translate', u'xyzabcdef', u'xyzxyz', transtable, u'def') ! ! table = string.maketrans('a', u'A') ! test('translate', u'abc', u'Abc', table) ! test('translate', u'xyz', u'xyz', table) ! ! test('replace', u'one!two!three!', u'one@two!three!', u'!', u'@', 1) ! test('replace', u'one!two!three!', u'onetwothree', '!', '') ! test('replace', u'one!two!three!', u'one@two@three!', u'!', u'@', 2) ! test('replace', u'one!two!three!', u'one@two@three@', u'!', u'@', 3) ! test('replace', u'one!two!three!', u'one@two@three@', u'!', u'@', 4) ! test('replace', u'one!two!three!', u'one!two!three!', u'!', u'@', 0) ! test('replace', u'one!two!three!', u'one@two@three@', u'!', u'@') ! test('replace', u'one!two!three!', u'one!two!three!', u'x', u'@') ! test('replace', u'one!two!three!', u'one!two!three!', u'x', u'@', 2) ! ! test('startswith', u'hello', 1, u'he') ! test('startswith', u'hello', 1, u'hello') ! test('startswith', u'hello', 0, u'hello world') ! test('startswith', u'hello', 1, u'') ! test('startswith', u'hello', 0, u'ello') ! test('startswith', u'hello', 1, u'ello', 1) ! test('startswith', u'hello', 1, u'o', 4) ! test('startswith', u'hello', 0, u'o', 5) ! test('startswith', u'hello', 1, u'', 5) ! test('startswith', u'hello', 0, u'lo', 6) ! test('startswith', u'helloworld', 1, u'lowo', 3) ! test('startswith', u'helloworld', 1, u'lowo', 3, 7) ! test('startswith', u'helloworld', 0, u'lowo', 3, 6) ! ! test('endswith', u'hello', 1, u'lo') ! test('endswith', u'hello', 0, u'he') ! test('endswith', u'hello', 1, u'') ! test('endswith', u'hello', 0, u'hello world') ! test('endswith', u'helloworld', 0, u'worl') ! test('endswith', u'helloworld', 1, u'worl', 3, 9) ! test('endswith', u'helloworld', 1, u'world', 3, 12) ! test('endswith', u'helloworld', 1, u'lowo', 1, 7) ! test('endswith', u'helloworld', 1, u'lowo', 2, 7) ! test('endswith', u'helloworld', 1, u'lowo', 3, 7) ! test('endswith', u'helloworld', 0, u'lowo', 4, 7) ! test('endswith', u'helloworld', 0, u'lowo', 3, 8) ! test('endswith', u'ab', 0, u'ab', 0, 1) ! test('endswith', u'ab', 0, u'ab', 0, 0) ! ! test('expandtabs', u'abc\rab\tdef\ng\thi', u'abc\rab def\ng hi') ! test('expandtabs', u'abc\rab\tdef\ng\thi', u'abc\rab def\ng hi', 8) ! test('expandtabs', u'abc\rab\tdef\ng\thi', u'abc\rab def\ng hi', 4) ! test('expandtabs', u'abc\r\nab\tdef\ng\thi', u'abc\r\nab def\ng hi', 4) ! ! if 0: ! test('capwords', u'abc def ghi', u'Abc Def Ghi') ! test('capwords', u'abc\tdef\nghi', u'Abc Def Ghi') ! test('capwords', u'abc\t def \nghi', u'Abc Def Ghi') ! ! # Comparisons: ! print 'Testing Unicode comparisons...', ! assert u'abc' == 'abc' ! assert 'abc' == u'abc' ! assert u'abc' == u'abc' ! assert u'abcd' > 'abc' ! assert 'abcd' > u'abc' ! assert u'abcd' > u'abc' ! assert u'abc' < 'abcd' ! assert 'abc' < u'abcd' ! assert u'abc' < u'abcd' ! print 'done.' ! if 0: ! # Move these tests to a Unicode collation module test... ! print 'Testing UTF-16 code point order comparisons...', ! #No surrogates, no fixup required. ! assert u'\u0061' < u'\u20ac' ! # Non surrogate below surrogate value, no fixup required ! assert u'\u0061' < u'\ud800\udc02' ! ! # Non surrogate above surrogate value, fixup required ! def test_lecmp(s, s2): ! assert s < s2 , "comparison failed on %s < %s" % (s, s2) ! ! def test_fixup(s): ! s2 = u'\ud800\udc01' ! test_lecmp(s, s2) ! s2 = u'\ud900\udc01' ! test_lecmp(s, s2) ! s2 = u'\uda00\udc01' ! test_lecmp(s, s2) ! s2 = u'\udb00\udc01' ! test_lecmp(s, s2) ! s2 = u'\ud800\udd01' ! test_lecmp(s, s2) ! s2 = u'\ud900\udd01' ! test_lecmp(s, s2) ! s2 = u'\uda00\udd01' ! test_lecmp(s, s2) ! s2 = u'\udb00\udd01' ! test_lecmp(s, s2) ! s2 = u'\ud800\ude01' ! test_lecmp(s, s2) ! s2 = u'\ud900\ude01' ! test_lecmp(s, s2) ! s2 = u'\uda00\ude01' ! test_lecmp(s, s2) ! s2 = u'\udb00\ude01' ! test_lecmp(s, s2) ! s2 = u'\ud800\udfff' ! test_lecmp(s, s2) ! s2 = u'\ud900\udfff' ! test_lecmp(s, s2) ! s2 = u'\uda00\udfff' ! test_lecmp(s, s2) ! s2 = u'\udb00\udfff' ! test_lecmp(s, s2) ! ! test_fixup(u'\ue000') ! test_fixup(u'\uff61') ! ! # Surrogates on both sides, no fixup required ! assert u'\ud800\udc02' < u'\ud84d\udc56' ! print 'done.' ! ! test('ljust', u'abc', u'abc ', 10) ! test('rjust', u'abc', u' abc', 10) ! test('center', u'abc', u' abc ', 10) ! test('ljust', u'abc', u'abc ', 6) ! test('rjust', u'abc', u' abc', 6) ! test('center', u'abc', u' abc ', 6) ! test('ljust', u'abc', u'abc', 2) ! test('rjust', u'abc', u'abc', 2) ! test('center', u'abc', u'abc', 2) ! ! test('islower', u'a', 1) ! test('islower', u'A', 0) ! test('islower', u'\n', 0) ! test('islower', u'\u1FFc', 0) ! test('islower', u'abc', 1) ! test('islower', u'aBc', 0) ! test('islower', u'abc\n', 1) ! ! test('isupper', u'a', 0) ! test('isupper', u'A', 1) ! test('isupper', u'\n', 0) ! test('isupper', u'\u1FFc', 0) ! test('isupper', u'ABC', 1) ! test('isupper', u'AbC', 0) ! test('isupper', u'ABC\n', 1) ! ! test('istitle', u'a', 0) ! test('istitle', u'A', 1) ! test('istitle', u'\n', 0) ! test('istitle', u'\u1FFc', 1) ! test('istitle', u'A Titlecased Line', 1) ! test('istitle', u'A\nTitlecased Line', 1) ! test('istitle', u'A Titlecased, Line', 1) ! test('istitle', u'Greek \u1FFcitlecases ...', 1) ! test('istitle', u'Not a capitalized String', 0) ! test('istitle', u'Not\ta Titlecase String', 0) ! test('istitle', u'Not--a Titlecase String', 0) ! ! test('isalpha', u'a', 1) ! test('isalpha', u'A', 1) ! test('isalpha', u'\n', 0) ! test('isalpha', u'\u1FFc', 1) ! test('isalpha', u'abc', 1) ! test('isalpha', u'aBc123', 0) ! test('isalpha', u'abc\n', 0) ! ! test('isalnum', u'a', 1) ! test('isalnum', u'A', 1) ! test('isalnum', u'\n', 0) ! test('isalnum', u'123abc456', 1) ! test('isalnum', u'a1b3c', 1) ! test('isalnum', u'aBc000 ', 0) ! test('isalnum', u'abc\n', 0) ! ! test('splitlines', u"abc\ndef\n\rghi", [u'abc', u'def', u'', u'ghi']) ! test('splitlines', u"abc\ndef\n\r\nghi", [u'abc', u'def', u'', u'ghi']) ! test('splitlines', u"abc\ndef\r\nghi", [u'abc', u'def', u'ghi']) ! test('splitlines', u"abc\ndef\r\nghi\n", [u'abc', u'def', u'ghi']) ! test('splitlines', u"abc\ndef\r\nghi\n\r", [u'abc', u'def', u'ghi', u'']) ! test('splitlines', u"\nabc\ndef\r\nghi\n\r", [u'', u'abc', u'def', u'ghi', u'']) ! test('splitlines', u"\nabc\ndef\r\nghi\n\r", [u'\n', u'abc\n', u'def\r\n', u'ghi\n', u'\r'], 1) ! ! test('translate', u"abababc", u'bbbc', {ord('a'):None}) ! test('translate', u"abababc", u'iiic', {ord('a'):None, ord('b'):ord('i')}) ! test('translate', u"abababc", u'iiix', {ord('a'):None, ord('b'):ord('i'), ord('c'):u'x'}) ! ! # Contains: ! print 'Testing Unicode contains method...', ! assert ('a' in u'abdb') == 1 ! assert ('a' in u'bdab') == 1 ! assert ('a' in u'bdaba') == 1 ! assert ('a' in u'bdba') == 1 ! assert ('a' in u'bdba') == 1 ! assert (u'a' in u'bdba') == 1 ! assert (u'a' in u'bdb') == 0 ! assert (u'a' in 'bdb') == 0 ! assert (u'a' in 'bdba') == 1 ! assert (u'a' in ('a',1,None)) == 1 ! assert (u'a' in (1,None,'a')) == 1 ! assert (u'a' in (1,None,u'a')) == 1 ! assert ('a' in ('a',1,None)) == 1 ! assert ('a' in (1,None,'a')) == 1 ! assert ('a' in (1,None,u'a')) == 1 ! assert ('a' in ('x',1,u'y')) == 0 ! assert ('a' in ('x',1,None)) == 0 ! print 'done.' + # Formatting: + print 'Testing Unicode formatting strings...', + assert u"%s, %s" % (u"abc", "abc") == u'abc, abc' + assert u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", 1, 2, 3) == u'abc, abc, 1, 2.000000, 3.00' + assert u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", 1, -2, 3) == u'abc, abc, 1, -2.000000, 3.00' + assert u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", -1, -2, 3.5) == u'abc, abc, -1, -2.000000, 3.50' + assert u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", -1, -2, 3.57) == u'abc, abc, -1, -2.000000, 3.57' + assert u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", -1, -2, 1003.57) == u'abc, abc, -1, -2.000000, 1003.57' + assert u"%c" % (u"a",) == u'a' + assert u"%c" % ("a",) == u'a' + assert u"%c" % (34,) == u'"' + assert u"%c" % (36,) == u'$' + value = u"%r, %r" % (u"abc", "abc") + if value != u"u'abc', 'abc'": + print '*** formatting failed for "%s"' % 'u"%r, %r" % (u"abc", "abc")' + + assert u"%(x)s, %(y)s" % {'x':u"abc", 'y':"def"} == u'abc, def' + try: + value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä'.encode('utf-8'):"def"} + except KeyError: + print '*** formatting failed for "%s"' % "u'abc, def'" + else: + assert value == u'abc, def' + + # formatting jobs delegated from the string implementation: + assert '...%(foo)s...' % {'foo':u"abc"} == u'...abc...' + assert '...%(foo)s...' % {'foo':"abc"} == '...abc...' + assert '...%(foo)s...' % {u'foo':"abc"} == '...abc...' + assert '...%(foo)s...' % {u'foo':u"abc"} == u'...abc...' + assert '...%(foo)s...' % {u'foo':u"abc",'def':123} == u'...abc...' + assert '...%(foo)s...' % {u'foo':u"abc",u'def':123} == u'...abc...' + assert '...%s...%s...%s...%s...' % (1,2,3,u"abc") == u'...1...2...3...abc...' + assert '...%s...' % u"abc" == u'...abc...' print 'done.' + + # Test builtin codecs + print 'Testing builtin codecs...', + + # UTF-8 specific encoding tests: + assert u'\u20ac'.encode('utf-8') == \ + ''.join((chr(0xe2), chr(0x82), chr(0xac))) + assert u'\ud800\udc02'.encode('utf-8') == \ + ''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))) + assert u'\ud84d\udc56'.encode('utf-8') == \ + ''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))) + # UTF-8 specific decoding tests + assert unicode(''.join((chr(0xf0), chr(0xa3), chr(0x91), chr(0x96))), + 'utf-8') == u'\ud84d\udc56' + assert unicode(''.join((chr(0xf0), chr(0x90), chr(0x80), chr(0x82))), + 'utf-8') == u'\ud800\udc02' + assert unicode(''.join((chr(0xe2), chr(0x82), chr(0xac))), + 'utf-8') == u'\u20ac' + + # Other possible utf-8 test cases: + # * strict decoding testing for all of the + # UTF8_ERROR cases in PyUnicode_DecodeUTF8 + + + + assert unicode('hello','ascii') == u'hello' + assert unicode('hello','utf-8') == u'hello' + assert unicode('hello','utf8') == u'hello' + assert unicode('hello','latin-1') == u'hello' + + class String: + x = '' + def __str__(self): + return self.x + + o = String() + + o.x = 'abc' + assert unicode(o) == u'abc' + assert str(o) == 'abc' + + o.x = u'abc' + assert unicode(o) == u'abc' + assert str(o) == 'abc' + + try: + u'Andr\202 x'.encode('ascii') + u'Andr\202 x'.encode('ascii','strict') + except ValueError: + pass + else: + raise AssertionError, "u'Andr\202'.encode('ascii') failed to raise an exception" + assert u'Andr\202 x'.encode('ascii','ignore') == "Andr x" + assert u'Andr\202 x'.encode('ascii','replace') == "Andr? x" + + try: + unicode('Andr\202 x','ascii') + unicode('Andr\202 x','ascii','strict') + except ValueError: + pass + else: + raise AssertionError, "unicode('Andr\202') failed to raise an exception" + assert unicode('Andr\202 x','ascii','ignore') == u"Andr x" + assert unicode('Andr\202 x','ascii','replace') == u'Andr\uFFFD x' + + assert u'hello'.encode('ascii') == 'hello' + assert u'hello'.encode('utf-8') == 'hello' + assert u'hello'.encode('utf8') == 'hello' + assert u'hello'.encode('utf-16-le') == 'h\000e\000l\000l\000o\000' + assert u'hello'.encode('utf-16-be') == '\000h\000e\000l\000l\000o' + assert u'hello'.encode('latin-1') == 'hello' + + u = u''.join(map(unichr, range(1024))) + for encoding in ('utf-8', 'utf-16', 'utf-16-le', 'utf-16-be', + 'raw_unicode_escape', 'unicode_escape', 'unicode_internal'): + assert unicode(u.encode(encoding),encoding) == u + + u = u''.join(map(unichr, range(256))) + for encoding in ( + 'latin-1', + ): + try: + assert unicode(u.encode(encoding),encoding) == u + except AssertionError: + print '*** codec "%s" failed round-trip' % encoding + except ValueError,why: + print '*** codec for "%s" failed: %s' % (encoding, why) + + u = u''.join(map(unichr, range(128))) + for encoding in ( + 'ascii', + ): + try: + assert unicode(u.encode(encoding),encoding) == u + except AssertionError: + print '*** codec "%s" failed round-trip' % encoding + except ValueError,why: + print '*** codec for "%s" failed: %s' % (encoding, why) + + print 'done.' + + print 'Testing standard mapping codecs...', + + print '0-127...', + s = ''.join(map(chr, range(128))) + for encoding in ( + 'cp037', 'cp1026', + 'cp437', 'cp500', 'cp737', 'cp775', 'cp850', + 'cp852', 'cp855', 'cp860', 'cp861', 'cp862', + 'cp863', 'cp865', 'cp866', + 'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15', + 'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6', + 'iso8859_7', 'iso8859_9', 'koi8_r', 'latin_1', + 'mac_cyrillic', 'mac_latin2', + + 'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', + 'cp1256', 'cp1257', 'cp1258', + 'cp856', 'cp857', 'cp864', 'cp869', 'cp874', + + 'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish', + 'cp1006', 'cp875', 'iso8859_8', + + ### These have undefined mappings: + #'cp424', + + ): + try: + assert unicode(s,encoding).encode(encoding) == s + except AssertionError: + print '*** codec "%s" failed round-trip' % encoding + except ValueError,why: + print '*** codec for "%s" failed: %s' % (encoding, why) + + print '128-255...', + s = ''.join(map(chr, range(128,256))) + for encoding in ( + 'cp037', 'cp1026', + 'cp437', 'cp500', 'cp737', 'cp775', 'cp850', + 'cp852', 'cp855', 'cp860', 'cp861', 'cp862', + 'cp863', 'cp865', 'cp866', + 'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15', + 'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6', + 'iso8859_7', 'iso8859_9', 'koi8_r', 'latin_1', + 'mac_cyrillic', 'mac_latin2', + + ### These have undefined mappings: + #'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', + #'cp1256', 'cp1257', 'cp1258', + #'cp424', 'cp856', 'cp857', 'cp864', 'cp869', 'cp874', + #'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish', + + ### These fail the round-trip: + #'cp1006', 'cp875', 'iso8859_8', + + ): + try: + assert unicode(s,encoding).encode(encoding) == s + except AssertionError: + print '*** codec "%s" failed round-trip' % encoding + except ValueError,why: + print '*** codec for "%s" failed: %s' % (encoding, why) + + print 'done.' + + print 'Testing Unicode string concatenation...', + assert (u"abc" u"def") == u"abcdef" + assert ("abc" u"def") == u"abcdef" + assert (u"abc" "def") == u"abcdef" + assert (u"abc" u"def" "ghi") == u"abcdefghi" + assert ("abc" "def" u"ghi") == u"abcdefghi" + print 'done.' + Index: test_unp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_unp.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** test_unp.py 1998/03/26 22:14:13 1.2 --- test_unp.py 2000/09/01 19:25:51 1.3 *************** *** 101,105 **** # unpacking a sequence where the test for too long raises a different # kind of error ! BozoError = 'BozoError' class BadSeq: --- 101,106 ---- # unpacking a sequence where the test for too long raises a different # kind of error ! class BozoError(Exception): ! pass class BadSeq: Index: test_use.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_use.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** test_use.py 2000/06/29 19:35:29 1.2 --- test_use.py 2000/09/01 19:25:51 1.3 *************** *** 1,227 **** ! #!/usr/bin/env python ! import sys, string ! from test_support import verbose ! # UserString is a wrapper around the native builtin string type. ! # UserString instances should behave similar to builtin string objects. ! # The test cases were in part derived from 'test_string.py'. ! from UserString import UserString ! ! if __name__ == "__main__": ! verbose = 0 ! ! tested_methods = {} ! ! def test(methodname, input, *args): ! global tested_methods ! tested_methods[methodname] = 1 ! if verbose: ! print '%s.%s(%s) ' % (input, methodname, args), ! u = UserString(input) ! objects = [input, u, UserString(u)] ! res = [""] * 3 ! for i in range(3): ! object = objects[i] ! try: ! f = getattr(object, methodname) ! res[i] = apply(f, args) ! except: ! res[i] = sys.exc_type ! if res[0] != res[1]: ! if verbose: ! print 'no' ! print `input`, f, `res[0]`, "<>", `res[1]` ! else: ! if verbose: ! print 'yes' ! if res[1] != res[2]: ! if verbose: ! print 'no' ! print `input`, f, `res[1]`, "<>", `res[2]` ! else: ! if verbose: ! print 'yes' ! ! test('capitalize', ' hello ') ! test('capitalize', 'hello ') ! ! test('center', 'foo', 0) ! test('center', 'foo', 3) ! test('center', 'foo', 16) ! ! test('ljust', 'foo', 0) ! test('ljust', 'foo', 3) ! test('ljust', 'foo', 16) ! ! test('rjust', 'foo', 0) ! test('rjust', 'foo', 3) ! test('rjust', 'foo', 16) ! ! test('count', 'abcabcabc', 'abc') ! test('count', 'abcabcabc', 'abc', 1) ! test('count', 'abcabcabc', 'abc', -1) ! test('count', 'abcabcabc', 'abc', 7) ! test('count', 'abcabcabc', 'abc', 0, 3) ! test('count', 'abcabcabc', 'abc', 0, 333) ! ! test('find', 'abcdefghiabc', 'abc') ! test('find', 'abcdefghiabc', 'abc', 1) ! test('find', 'abcdefghiabc', 'def', 4) ! test('rfind', 'abcdefghiabc', 'abc') ! ! test('index', 'abcabcabc', 'abc') ! test('index', 'abcabcabc', 'abc', 1) ! test('index', 'abcabcabc', 'abc', -1) ! test('index', 'abcabcabc', 'abc', 7) ! test('index', 'abcabcabc', 'abc', 0, 3) ! test('index', 'abcabcabc', 'abc', 0, 333) ! ! test('rindex', 'abcabcabc', 'abc') ! test('rindex', 'abcabcabc', 'abc', 1) ! test('rindex', 'abcabcabc', 'abc', -1) ! test('rindex', 'abcabcabc', 'abc', 7) ! test('rindex', 'abcabcabc', 'abc', 0, 3) ! test('rindex', 'abcabcabc', 'abc', 0, 333) ! ! ! test('lower', 'HeLLo') ! test('lower', 'hello') ! test('upper', 'HeLLo') ! test('upper', 'HELLO') ! ! test('title', ' hello ') ! test('title', 'hello ') ! test('title', "fOrMaT thIs aS titLe String") ! test('title', "fOrMaT,thIs-aS*titLe;String") ! test('title', "getInt") ! ! test('expandtabs', 'abc\rab\tdef\ng\thi') ! test('expandtabs', 'abc\rab\tdef\ng\thi', 8) ! test('expandtabs', 'abc\rab\tdef\ng\thi', 4) ! test('expandtabs', 'abc\r\nab\tdef\ng\thi', 4) ! ! test('islower', 'a') ! test('islower', 'A') ! test('islower', '\n') ! test('islower', 'abc') ! test('islower', 'aBc') ! test('islower', 'abc\n') ! ! test('isupper', 'a') ! test('isupper', 'A') ! test('isupper', '\n') ! test('isupper', 'ABC') ! test('isupper', 'AbC') ! test('isupper', 'ABC\n') ! ! test('isdigit', ' 0123456789') ! test('isdigit', '56789') ! test('isdigit', '567.89') ! test('isdigit', '0123456789abc') ! ! test('isspace', '') ! test('isspace', ' ') ! test('isspace', ' \t') ! test('isspace', ' \t\f\n') ! ! test('istitle', 'a') ! test('istitle', 'A') ! test('istitle', '\n') ! test('istitle', 'A Titlecased Line') ! test('istitle', 'A\nTitlecased Line') ! test('istitle', 'A Titlecased, Line') ! test('istitle', 'Not a capitalized String') ! test('istitle', 'Not\ta Titlecase String') ! test('istitle', 'Not--a Titlecase String') ! ! test('splitlines', "abc\ndef\n\rghi") ! test('splitlines', "abc\ndef\n\r\nghi") ! test('splitlines', "abc\ndef\r\nghi") ! test('splitlines', "abc\ndef\r\nghi\n") ! test('splitlines', "abc\ndef\r\nghi\n\r") ! test('splitlines', "\nabc\ndef\r\nghi\n\r") ! test('splitlines', "\nabc\ndef\r\nghi\n\r") ! test('splitlines', "\nabc\ndef\r\nghi\n\r") ! ! test('split', 'this is the split function') ! test('split', 'a|b|c|d', '|') ! test('split', 'a|b|c|d', '|', 2) ! test('split', 'a b c d', None, 1) ! test('split', 'a b c d', None, 2) ! test('split', 'a b c d', None, 3) ! test('split', 'a b c d', None, 4) ! test('split', 'a b c d', None, 0) ! test('split', 'a b c d', None, 2) ! test('split', 'a b c d ') ! ! # join now works with any sequence type ! class Sequence: ! def __init__(self): self.seq = 'wxyz' ! def __len__(self): return len(self.seq) ! def __getitem__(self, i): return self.seq[i] ! ! test('join', '', ('a', 'b', 'c', 'd')) ! test('join', '', Sequence()) ! test('join', '', 7) ! ! class BadSeq(Sequence): ! def __init__(self): self.seq = [7, 'hello', 123L] ! ! test('join', '', BadSeq()) ! ! test('strip', ' hello ') ! test('lstrip', ' hello ') ! test('rstrip', ' hello ') ! test('strip', 'hello') ! ! test('swapcase', 'HeLLo cOmpUteRs') ! transtable = string.maketrans("abc", "xyz") ! test('translate', 'xyzabcdef', transtable, 'def') ! ! transtable = string.maketrans('a', 'A') ! test('translate', 'abc', transtable) ! test('translate', 'xyz', transtable) ! ! test('replace', 'one!two!three!', '!', '@', 1) ! test('replace', 'one!two!three!', '!', '') ! test('replace', 'one!two!three!', '!', '@', 2) ! test('replace', 'one!two!three!', '!', '@', 3) ! test('replace', 'one!two!three!', '!', '@', 4) ! test('replace', 'one!two!three!', '!', '@', 0) ! test('replace', 'one!two!three!', '!', '@') ! test('replace', 'one!two!three!', 'x', '@') ! test('replace', 'one!two!three!', 'x', '@', 2) ! ! test('startswith', 'hello', 'he') ! test('startswith', 'hello', 'hello') ! test('startswith', 'hello', 'hello world') ! test('startswith', 'hello', '') ! test('startswith', 'hello', 'ello') ! test('startswith', 'hello', 'ello', 1) ! test('startswith', 'hello', 'o', 4) ! test('startswith', 'hello', 'o', 5) ! test('startswith', 'hello', '', 5) ! test('startswith', 'hello', 'lo', 6) ! test('startswith', 'helloworld', 'lowo', 3) ! test('startswith', 'helloworld', 'lowo', 3, 7) ! test('startswith', 'helloworld', 'lowo', 3, 6) ! ! test('endswith', 'hello', 'lo') ! test('endswith', 'hello', 'he') ! test('endswith', 'hello', '') ! test('endswith', 'hello', 'hello world') ! test('endswith', 'helloworld', 'worl') ! test('endswith', 'helloworld', 'worl', 3, 9) ! test('endswith', 'helloworld', 'world', 3, 12) ! test('endswith', 'helloworld', 'lowo', 1, 7) ! test('endswith', 'helloworld', 'lowo', 2, 7) ! test('endswith', 'helloworld', 'lowo', 3, 7) ! test('endswith', 'helloworld', 'lowo', 4, 7) ! test('endswith', 'helloworld', 'lowo', 3, 8) ! test('endswith', 'ab', 'ab', 0, 1) ! test('endswith', 'ab', 'ab', 0, 0) ! ! # TODO: test cases for: int, long, float, complex, +, * and cmp ! s = "" ! for builtin_method in dir(s): ! if not tested_methods.has_key(builtin_method): ! print "no regression test case for method '"+builtin_method+"'" --- 1,101 ---- ! # Check every path through every method of UserDict ! ! from UserDict import UserDict ! ! d0 = {} ! d1 = {"one": 1} ! d2 = {"one": 1, "two": 2} ! ! # Test constructors ! ! u = UserDict() ! u0 = UserDict(d0) ! u1 = UserDict(d1) ! u2 = UserDict(d2) ! ! uu = UserDict(u) ! uu0 = UserDict(u0) ! uu1 = UserDict(u1) ! uu2 = UserDict(u2) ! ! # Test __repr__ ! ! assert str(u0) == str(d0) ! assert repr(u1) == repr(d1) ! assert `u2` == `d2` ! ! # Test __cmp__ and __len__ ! ! all = [d0, d1, d2, u, u0, u1, u2, uu, uu0, uu1, uu2] ! for a in all: ! for b in all: ! assert cmp(a, b) == cmp(len(a), len(b)) ! ! # Test __getitem__ ! ! assert u2["one"] == 1 ! try: ! u1["two"] ! except KeyError: ! pass ! else: ! assert 0, "u1['two'] shouldn't exist" ! ! # Test __setitem__ ! ! u3 = UserDict(u2) ! u3["two"] = 2 ! u3["three"] = 3 ! ! # Test __delitem__ ! ! del u3["three"] ! try: ! del u3["three"] ! except KeyError: ! pass ! else: ! assert 0, "u3['three'] shouldn't exist" ! ! # Test clear ! ! u3.clear() ! assert u3 == {} ! ! # Test copy() ! ! u2a = u2.copy() ! assert u2a == u2 ! ! class MyUserDict(UserDict): ! def display(self): print self ! ! m2 = MyUserDict(u2) ! m2a = m2.copy() ! assert m2a == m2 ! ! # Test keys, items, values ! ! assert u2.keys() == d2.keys() ! assert u2.items() == d2.items() ! assert u2.values() == d2.values() ! ! # Test has_key ! ! for i in u2.keys(): ! assert u2.has_key(i) == 1 ! assert u1.has_key(i) == d1.has_key(i) ! assert u0.has_key(i) == d0.has_key(i) ! ! # Test update ! ! t = UserDict() ! t.update(u2) ! assert t == u2 ! ! # Test get ! ! for i in u2.keys(): ! assert u2.get(i) == u2[i] ! assert u1.get(i) == d1.get(i) ! assert u0.get(i) == d0.get(i) Index: threadin.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/threadin.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** threadin.py 2000/06/29 19:35:29 1.3 --- threadin.py 2000/09/01 19:25:51 1.4 *************** *** 463,471 **** _active[_get_ident()] = self _active_limbo_lock.release() ! try: ! self.__oldexitfunc = _sys.exitfunc ! except AttributeError: ! self.__oldexitfunc = None ! _sys.exitfunc = self.__exitfunc def _set_daemon(self): --- 463,468 ---- _active[_get_ident()] = self _active_limbo_lock.release() ! import atexit ! atexit.register(self.__exitfunc) def _set_daemon(self): *************** *** 481,488 **** t.join() t = _pickSomeNonDaemonThread() - if self.__oldexitfunc: - if __debug__: - self._note("%s: calling exit handler", self) - self.__oldexitfunc() if __debug__: self._note("%s: exiting", self) --- 478,481 ---- Index: tracebac.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/tracebac.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** tracebac.py 2000/07/16 12:04:30 1.8 --- tracebac.py 2000/09/01 19:25:51 1.9 *************** *** 167,172 **** list.append('%s^\n' % s) value = msg ! list.append('%s: %s\n' % (str(stype), str(value))) return list --- 167,178 ---- list.append('%s^\n' % s) value = msg ! list.append('%s: %s\n' % (str(stype), _some_str(value))) return list + + def _some_str(value): + try: + return str(value) + except: + return '' % type(value).__name__ Index: userdict.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/userdict.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** userdict.py 2000/05/08 17:31:04 1.6 --- userdict.py 2000/09/01 19:25:51 1.7 *************** *** 35,36 **** --- 35,40 ---- def get(self, key, failobj=None): return self.data.get(key, failobj) + def setdefault(self, key, failobj=None): + if not self.data.has_key(key): + self.data[key] = failobj + return self.data[key] Index: userlist.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/userlist.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** userlist.py 2000/07/16 12:04:30 1.7 --- userlist.py 2000/09/01 19:25:51 1.8 *************** *** 52,58 **** --- 52,69 ---- else: return self.__class__(list(other) + self.data) + def __iadd__(self, other): + if isinstance(other, UserList): + self.data += other.data + elif isinstance(other, type(self.data)): + self.data += other + else: + self.data += list(other) + return self def __mul__(self, n): return self.__class__(self.data*n) __rmul__ = __mul__ + def __imul__(self, n): + self.data *= n + return self def append(self, item): self.data.append(item) def insert(self, i, item): self.data.insert(i, item) Index: userstri.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/userstri.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** userstri.py 2000/05/08 17:31:04 1.1 --- userstri.py 2000/09/01 19:25:51 1.2 *************** *** 51,57 **** --- 51,68 ---- else: return self.__class__(str(other) + self.data) + def __iadd__(self, other): + if isinstance(other, UserString): + self.data += other.data + elif isinstance(other, StringType) or isinstance(other, UnicodeType): + self.data += other + else: + self.data += str(other) + return self def __mul__(self, n): return self.__class__(self.data*n) __rmul__ = __mul__ + def __imull__(self, n): + self.data += n + return self # the following methods are defined in alphabetical order: *************** *** 76,79 **** --- 87,92 ---- def index(self, sub, start=0, end=sys.maxint): return self.data.index(sub, start, end) + def isalpha(self): return self.data.isalpha() + def isalnum(self): return self.data.isalnum() def isdecimal(self): return self.data.isdecimal() def isdigit(self): return self.data.isdigit() *************** *** 103,108 **** def swapcase(self): return self.__class__(self.data.swapcase()) def title(self): return self.__class__(self.data.title()) ! def translate(self, table, deletechars=""): ! return self.__class__(self.data.translate(table, deletechars)) def upper(self): return self.__class__(self.data.upper()) --- 116,121 ---- def swapcase(self): return self.__class__(self.data.swapcase()) def title(self): return self.__class__(self.data.title()) ! def translate(self, *args): ! return self.__class__(self.data.translate(*args)) def upper(self): return self.__class__(self.data.upper()) From python-dev@python.org Fri Sep 1 20:27:36 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 12:27:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/dos-8x3 cookie.py,NONE,1.1 string_t.py,NONE,1.1 test_aug.py,NONE,1.1 test_cla.py,NONE,1.1 test_com.py,NONE,1.1 test_coo.py,NONE,1.1 test_dos.py,NONE,1.1 test_fil.py,NONE,1.1 test_get.py,NONE,1.1 test_lar.py,NONE,1.1 test_min.py,NONE,1.1 test_par.py,NONE,1.1 test_pol.py,NONE,1.1 test_pos.py,NONE,1.1 test_url.py,NONE,1.1 webbrows.py,NONE,1.1 exceptio.py,1.8,NONE threadst.py,1.2,NONE Message-ID: <200009011927.MAA24307@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/dos-8x3 In directory slayer.i.sourceforge.net:/tmp/cvs-serv24300 Added Files: cookie.py string_t.py test_aug.py test_cla.py test_com.py test_coo.py test_dos.py test_fil.py test_get.py test_lar.py test_min.py test_par.py test_pol.py test_pos.py test_url.py webbrows.py Removed Files: exceptio.py threadst.py Log Message: Adding new files, removing some. --- NEW FILE --- #!/usr/bin/env python # #### # Copyright 2000 by Timothy O'Malley # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software # and its documentation for any purpose and without fee is hereby # granted, provided that the above copyright notice appear in all # copies and that both that copyright notice and this permission # notice appear in supporting documentation, and that the name of # Timothy O'Malley not be used in advertising or publicity # pertaining to distribution of the software without specific, written # prior permission. # # Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS # SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR # ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. # #### # # Id: Cookie.py,v 2.29 2000/08/23 05:28:49 timo Exp # by Timothy O'Malley # # Cookie.py is a Python module for the handling of HTTP # cookies as a Python dictionary. See RFC 2109 for more # information on cookies. # # The original idea to treat Cookies as a dictionary came from # Dave Mitchell (davem@magnet.com) in 1995, when he released the # first version of nscookie.py. # #### """ Here's a sample session to show how to use this module. At the moment, this is the only documentation. The Basics ---------- Importing is easy.. >>> import Cookie Most of the time you start by creating a cookie. Cookies come in three flavors, each with slighly different encoding semanitcs, but more on that later. >>> C = Cookie.SimpleCookie() >>> C = Cookie.SerialCookie() >>> C = Cookie.SmartCookie() [Note: Long-time users of Cookie.py will remember using Cookie.Cookie() to create an Cookie object. Although deprecated, it is still supported by the code. See the Backward Compatibility notes for more information.] Once you've created your Cookie, you can add values just as if it were a dictionary. >>> C = Cookie.SmartCookie() >>> C["fig"] = "newton" >>> C["sugar"] = "wafer" >>> print C Set-Cookie: sugar=wafer; Set-Cookie: fig=newton; Notice that the printable representation of a Cookie is the appropriate format for a Set-Cookie: header. This is the default behavior. You can change the header and printed attributes by using the the .output() function >>> C = Cookie.SmartCookie() >>> C["rocky"] = "road" >>> C["rocky"]["path"] = "/cookie" >>> print C.output(header="Cookie:") Cookie: rocky=road; Path=/cookie; >>> print C.output(attrs=[], header="Cookie:") Cookie: rocky=road; The load() method of a Cookie extracts cookies from a string. In a CGI script, you would use this method to extract the cookies from the HTTP_COOKIE environment variable. >>> C = Cookie.SmartCookie() >>> C.load("chips=ahoy; vienna=finger") >>> print C Set-Cookie: vienna=finger; Set-Cookie: chips=ahoy; The load() method is darn-tootin smart about identifying cookies within a string. Escaped quotation marks, nested semicolons, and other such trickeries do not confuse it. >>> C = Cookie.SmartCookie() >>> C.load('keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;";') >>> print C Set-Cookie: keebler="E=everybody; L=\"Loves\"; fudge=\012;"; Each element of the Cookie also supports all of the RFC 2109 Cookie attributes. Here's an example which sets the Path attribute. >>> C = Cookie.SmartCookie() >>> C["oreo"] = "doublestuff" >>> C["oreo"]["path"] = "/" >>> print C Set-Cookie: oreo="doublestuff"; Path=/; Each dictionary element has a 'value' attribute, which gives you back the value associated with the key. >>> C = Cookie.SmartCookie() >>> C["twix"] = "none for you" >>> C["twix"].value 'none for you' A Bit More Advanced ------------------- As mentioned before, there are three different flavors of Cookie objects, each with different encoding/decoding semantics. This section briefly discusses the differences. SimpleCookie The SimpleCookie expects that all values should be standard strings. Just to be sure, SimpleCookie invokes the str() builtin to convert the value to a string, when the values are set dictionary-style. >>> C = Cookie.SimpleCookie() >>> C["number"] = 7 >>> C["string"] = "seven" >>> C["number"].value '7' >>> C["string"].value 'seven' >>> print C Set-Cookie: number=7; Set-Cookie: string=seven; SerialCookie The SerialCookie expects that all values should be serialized using cPickle (or pickle, if cPickle isn't available). As a result of serializing, SerialCookie can save almost any Python object to a value, and recover the exact same object when the cookie has been returned. (SerialCookie can yield some strange-looking cookie values, however.) >>> C = Cookie.SerialCookie() >>> C["number"] = 7 >>> C["string"] = "seven" >>> C["number"].value 7 >>> C["string"].value 'seven' >>> print C Set-Cookie: number="I7\012."; Set-Cookie: string="S'seven'\012p1\012."; Be warned, however, if SerialCookie cannot de-serialize a value (because it isn't a valid pickle'd object), IT WILL RAISE AN EXCEPTION. SmartCookie The SmartCookie combines aspects of each of the other two flavors. When setting a value in a dictionary-fashion, the SmartCookie will serialize (ala cPickle) the value *if and only if* it isn't a Python string. String objects are *not* serialized. Similarly, when the load() method parses out values, it attempts to de-serialize the value. If it fails, then it fallsback to treating the value as a string. >>> C = Cookie.SmartCookie() >>> C["number"] = 7 >>> C["string"] = "seven" >>> C["number"].value 7 >>> C["string"].value 'seven' >>> print C Set-Cookie: number="I7\012."; Set-Cookie: string=seven; Backwards Compatibility ----------------------- In order to keep compatibilty with earlier versions of Cookie.py, it is still possible to use Cookie.Cookie() to create a Cookie. In fact, this simply returns a SmartCookie. >>> C = Cookie.Cookie() >>> C.__class__ Finis. """ #" # ^ # |----helps out font-lock # # Import our required modules # import string, sys from UserDict import UserDict try: from cPickle import dumps, loads except ImportError: from pickle import dumps, loads try: import re except ImportError: raise ImportError, "Cookie.py requires 're' from Python 1.5 or later" # # Define an exception visible to External modules # class CookieError(Exception): pass # These quoting routines conform to the RFC2109 specification, which in # turn references the character definitions from RFC2068. They provide # a two-way quoting algorithm. Any non-text character is translated # into a 4 character sequence: a forward-slash followed by the # three-digit octal equivalent of the character. Any '\' or '"' is # quoted with a preceeding '\' slash. # # These are taken from RFC2068 and RFC2109. # _LegalChars is the list of chars which don't require "'s # _Translator hash-table for fast quoting # _LegalChars = string.letters + string.digits + "!#$%&'*+-.^_`|~" _Translator = { '\000' : '\\000', '\001' : '\\001', '\002' : '\\002', '\003' : '\\003', '\004' : '\\004', '\005' : '\\005', '\006' : '\\006', '\007' : '\\007', '\010' : '\\010', '\011' : '\\011', '\012' : '\\012', '\013' : '\\013', '\014' : '\\014', '\015' : '\\015', '\016' : '\\016', '\017' : '\\017', '\020' : '\\020', '\021' : '\\021', '\022' : '\\022', '\023' : '\\023', '\024' : '\\024', '\025' : '\\025', '\026' : '\\026', '\027' : '\\027', '\030' : '\\030', '\031' : '\\031', '\032' : '\\032', '\033' : '\\033', '\034' : '\\034', '\035' : '\\035', '\036' : '\\036', '\037' : '\\037', '"' : '\\"', '\\' : '\\\\', '\177' : '\\177', '\200' : '\\200', '\201' : '\\201', '\202' : '\\202', '\203' : '\\203', '\204' : '\\204', '\205' : '\\205', '\206' : '\\206', '\207' : '\\207', '\210' : '\\210', '\211' : '\\211', '\212' : '\\212', '\213' : '\\213', '\214' : '\\214', '\215' : '\\215', '\216' : '\\216', '\217' : '\\217', '\220' : '\\220', '\221' : '\\221', '\222' : '\\222', '\223' : '\\223', '\224' : '\\224', '\225' : '\\225', '\226' : '\\226', '\227' : '\\227', '\230' : '\\230', '\231' : '\\231', '\232' : '\\232', '\233' : '\\233', '\234' : '\\234', '\235' : '\\235', '\236' : '\\236', '\237' : '\\237', '\240' : '\\240', '\241' : '\\241', '\242' : '\\242', '\243' : '\\243', '\244' : '\\244', '\245' : '\\245', '\246' : '\\246', '\247' : '\\247', '\250' : '\\250', '\251' : '\\251', '\252' : '\\252', '\253' : '\\253', '\254' : '\\254', '\255' : '\\255', '\256' : '\\256', '\257' : '\\257', '\260' : '\\260', '\261' : '\\261', '\262' : '\\262', '\263' : '\\263', '\264' : '\\264', '\265' : '\\265', '\266' : '\\266', '\267' : '\\267', '\270' : '\\270', '\271' : '\\271', '\272' : '\\272', '\273' : '\\273', '\274' : '\\274', '\275' : '\\275', '\276' : '\\276', '\277' : '\\277', '\300' : '\\300', '\301' : '\\301', '\302' : '\\302', '\303' : '\\303', '\304' : '\\304', '\305' : '\\305', '\306' : '\\306', '\307' : '\\307', '\310' : '\\310', '\311' : '\\311', '\312' : '\\312', '\313' : '\\313', '\314' : '\\314', '\315' : '\\315', '\316' : '\\316', '\317' : '\\317', '\320' : '\\320', '\321' : '\\321', '\322' : '\\322', '\323' : '\\323', '\324' : '\\324', '\325' : '\\325', '\326' : '\\326', '\327' : '\\327', '\330' : '\\330', '\331' : '\\331', '\332' : '\\332', '\333' : '\\333', '\334' : '\\334', '\335' : '\\335', '\336' : '\\336', '\337' : '\\337', '\340' : '\\340', '\341' : '\\341', '\342' : '\\342', '\343' : '\\343', '\344' : '\\344', '\345' : '\\345', '\346' : '\\346', '\347' : '\\347', '\350' : '\\350', '\351' : '\\351', '\352' : '\\352', '\353' : '\\353', '\354' : '\\354', '\355' : '\\355', '\356' : '\\356', '\357' : '\\357', '\360' : '\\360', '\361' : '\\361', '\362' : '\\362', '\363' : '\\363', '\364' : '\\364', '\365' : '\\365', '\366' : '\\366', '\367' : '\\367', '\370' : '\\370', '\371' : '\\371', '\372' : '\\372', '\373' : '\\373', '\374' : '\\374', '\375' : '\\375', '\376' : '\\376', '\377' : '\\377' } def _quote(str, LegalChars=_LegalChars, join=string.join, idmap=string._idmap, translate=string.translate): # # If the string does not need to be double-quoted, # then just return the string. Otherwise, surround # the string in doublequotes and precede quote (with a \) # special characters. # if "" == translate(str, idmap, LegalChars): return str else: return '"' + join( map(_Translator.get, str, str), "" ) + '"' # end _quote _OctalPatt = re.compile(r"\\[0-3][0-7][0-7]") _QuotePatt = re.compile(r"[\\].") def _unquote(str, join=string.join, atoi=string.atoi): # If there aren't any doublequotes, # then there can't be any special characters. See RFC 2109. if len(str) < 2: return str if str[0] != '"' or str[-1] != '"': return str # We have to assume that we must decode this string. # Down to work. # Remove the "s str = str[1:-1] # Check for special sequences. Examples: # \012 --> \n # \" --> " # i = 0 n = len(str) res = [] while 0 <= i < n: Omatch = _OctalPatt.search(str, i) Qmatch = _QuotePatt.search(str, i) if not Omatch and not Qmatch: # Neither matched res.append(str[i:]) break # else: j = k = -1 if Omatch: j = Omatch.start(0) if Qmatch: k = Qmatch.start(0) if Qmatch and ( not Omatch or k < j ): # QuotePatt matched res.append(str[i:k]) res.append(str[k+1]) i = k+2 else: # OctalPatt matched res.append(str[i:j]) res.append( chr( atoi(str[j+1:j+4], 8) ) ) i = j+4 return join(res, "") # end _unquote # The _getdate() routine is used to set the expiration time in # the cookie's HTTP header. By default, _getdate() returns the # current time in the appropriate "expires" format for a # Set-Cookie header. The one optional argument is an offset from # now, in seconds. For example, an offset of -3600 means "one hour ago". # The offset may be a floating point number. # _weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] _monthname = [None, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] def _getdate(future=0, weekdayname=_weekdayname, monthname=_monthname): from time import gmtime, time now = time() year, month, day, hh, mm, ss, wd, y, z = gmtime(now + future) return "%s, %02d-%3s-%4d %02d:%02d:%02d GMT" % \ (weekdayname[wd], day, monthname[month], year, hh, mm, ss) # # A class to hold ONE key,value pair. # In a cookie, each such pair may have several attributes. # so this class is used to keep the attributes associated # with the appropriate key,value pair. # This class also includes a coded_value attribute, which # is used to hold the network representation of the # value. This is most useful when Python objects are # pickled for network transit. # class Morsel(UserDict): # RFC 2109 lists these attributes as reserved: # path comment domain # max-age secure version # # For historical reasons, these attributes are also reserved: # expires # # This dictionary provides a mapping from the lowercase # variant on the left to the appropriate traditional # formatting on the right. _reserved = { "expires" : "expires", "path" : "Path", "comment" : "Comment", "domain" : "Domain", "max-age" : "Max-Age", "secure" : "secure", "version" : "Version", } _reserved_keys = _reserved.keys() def __init__(self): # Set defaults self.key = self.value = self.coded_value = None UserDict.__init__(self) # Set default attributes for K in self._reserved_keys: UserDict.__setitem__(self, K, "") # end __init__ def __setitem__(self, K, V): K = string.lower(K) if not K in self._reserved_keys: raise CookieError("Invalid Attribute %s" % K) UserDict.__setitem__(self, K, V) # end __setitem__ def isReservedKey(self, K): return string.lower(K) in self._reserved_keys # end isReservedKey def set(self, key, val, coded_val, LegalChars=_LegalChars, idmap=string._idmap, translate=string.translate ): # First we verify that the key isn't a reserved word # Second we make sure it only contains legal characters if string.lower(key) in self._reserved_keys: raise CookieError("Attempt to set a reserved key: %s" % key) if "" != translate(key, idmap, LegalChars): raise CookieError("Illegal key value: %s" % key) # It's a good key, so save it. self.key = key self.value = val self.coded_value = coded_val # end set def output(self, attrs=None, header = "Set-Cookie:"): return "%s %s" % ( header, self.OutputString(attrs) ) __str__ = output def __repr__(self): return '<%s: %s=%s>' % (self.__class__.__name__, self.key, repr(self.value) ) def js_output(self, attrs=None): # Print javascript return """ """ % ( self.OutputString(attrs), ) # end js_output() def OutputString(self, attrs=None): # Build up our result # result = [] RA = result.append # First, the key=value pair RA("%s=%s;" % (self.key, self.coded_value)) # Now add any defined attributes if attrs == None: attrs = self._reserved_keys for K,V in self.items(): if V == "": continue if K not in attrs: continue if K == "expires" and type(V) == type(1): RA("%s=%s;" % (self._reserved[K], _getdate(V))) elif K == "max-age" and type(V) == type(1): RA("%s=%d;" % (self._reserved[K], V)) elif K == "secure": RA("%s;" % self._reserved[K]) else: RA("%s=%s;" % (self._reserved[K], V)) # Return the result return string.join(result, " ") # end OutputString # end Morsel class # # Pattern for finding cookie # # This used to be strict parsing based on the RFC2109 and RFC2068 # specifications. I have since discovered that MSIE 3.0x doesn't # follow the character rules outlined in those specs. As a # result, the parsing rules here are less strict. # _LegalCharsPatt = r"[\w\d!#%&'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{]" _CookiePattern = re.compile( r"(?x)" # This is a Verbose pattern r"(?P" # Start of group 'key' ""+ _LegalCharsPatt +"+" # Any word of at least one letter r")" # End of group 'key' r"\s*=\s*" # Equal Sign r"(?P" # Start of group 'val' r'"(?:[^\\"]|\\.)*"' # Any doublequoted string r"|" # or ""+ _LegalCharsPatt +"*" # Any word or empty string r")" # End of group 'val' r"\s*;?" # Probably ending in a semi-colon ) # At long last, here is the cookie class. # Using this class is almost just like using a dictionary. # See this module's docstring for example usage. # class BaseCookie(UserDict): # A container class for a set of Morsels # def value_decode(self, val): """real_value, coded_value = value_decode(STRING) Called prior to setting a cookie's value from the network representation. The VALUE is the value read from HTTP header. Override this function to modify the behavior of cookies. """ return val, val # end value_encode def value_encode(self, val): """real_value, coded_value = value_encode(VALUE) Called prior to setting a cookie's value from the dictionary representation. The VALUE is the value being assigned. Override this function to modify the behavior of cookies. """ strval = str(val) return strval, strval # end value_encode def __init__(self, input=None): UserDict.__init__(self) if input: self.load(input) # end __init__ def __set(self, key, real_value, coded_value): """Private method for setting a cookie's value""" M = self.get(key, Morsel()) M.set(key, real_value, coded_value) UserDict.__setitem__(self, key, M) # end __set def __setitem__(self, key, value): """Dictionary style assignment.""" rval, cval = self.value_encode(value) self.__set(key, rval, cval) # end __setitem__ def output(self, attrs=None, header="Set-Cookie:", sep="\n"): """Return a string suitable for HTTP.""" result = [] for K,V in self.items(): result.append( V.output(attrs, header) ) return string.join(result, sep) # end output __str__ = output def __repr__(self): L = [] for K,V in self.items(): L.append( '%s=%s' % (K,repr(V.value) ) ) return '<%s: %s>' % (self.__class__.__name__, string.join(L)) def js_output(self, attrs=None): """Return a string suitable for JavaScript.""" result = [] for K,V in self.items(): result.append( V.js_output(attrs) ) return string.join(result, "") # end js_output def load(self, rawdata): """Load cookies from a string (presumably HTTP_COOKIE) or from a dictionary. Loading cookies from a dictionary 'd' is equivalent to calling: map(Cookie.__setitem__, d.keys(), d.values()) """ if type(rawdata) == type(""): self.__ParseString(rawdata) else: self.update(rawdata) return # end load() def __ParseString(self, str, patt=_CookiePattern): i = 0 # Our starting point n = len(str) # Length of string M = None # current morsel while 0 <= i < n: # Start looking for a cookie match = patt.search(str, i) if not match: break # No more cookies K,V = match.group("key"), match.group("val") i = match.end(0) # Parse the key, value in case it's metainfo if K[0] == "$": # We ignore attributes which pertain to the cookie # mechanism as a whole. See RFC 2109. # (Does anyone care?) if M: M[ K[1:] ] = V elif string.lower(K) in Morsel._reserved_keys: if M: M[ K ] = _unquote(V) else: rval, cval = self.value_decode(V) self.__set(K, rval, cval) M = self[K] # end __ParseString # end BaseCookie class class SimpleCookie(BaseCookie): """SimpleCookie SimpleCookie supports strings as cookie values. When setting the value using the dictionary assignment notation, SimpleCookie calls the builtin str() to convert the value to a string. Values received from HTTP are kept as strings. """ def value_decode(self, val): return _unquote( val ), val def value_encode(self, val): strval = str(val) return strval, _quote( strval ) # end SimpleCookie class SerialCookie(BaseCookie): """SerialCookie SerialCookie supports arbitrary objects as cookie values. All values are serialized (using cPickle) before being sent to the client. All incoming values are assumed to be valid Pickle representations. IF AN INCOMING VALUE IS NOT IN A VALID PICKLE FORMAT, THEN AN EXCEPTION WILL BE RAISED. Note: Large cookie values add overhead because they must be retransmitted on every HTTP transaction. Note: HTTP has a 2k limit on the size of a cookie. This class does not check for this limit, so be careful!!! """ def value_decode(self, val): # This could raise an exception! return loads( _unquote(val) ), val def value_encode(self, val): return val, _quote( dumps(val) ) # end SerialCookie class SmartCookie(BaseCookie): """SmartCookie SmartCookie supports arbitrary objects as cookie values. If the object is a string, then it is quoted. If the object is not a string, however, then SmartCookie will use cPickle to serialize the object into a string representation. Note: Large cookie values add overhead because they must be retransmitted on every HTTP transaction. Note: HTTP has a 2k limit on the size of a cookie. This class does not check for this limit, so be careful!!! """ def value_decode(self, val): strval = _unquote(val) try: return loads(strval), val except: return strval, val def value_encode(self, val): if type(val) == type(""): return val, _quote(val) else: return val, _quote( dumps(val) ) # end SmartCookie ########################################################### # Backwards Compatibility: Don't break any existing code! # We provide Cookie() as an alias for SmartCookie() Cookie = SmartCookie # ########################################################### #Local Variables: #tab-width: 4 #end: --- NEW FILE --- """Common tests shared by test_string and test_userstring""" import string transtable = '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377' from UserList import UserList class Sequence: def __init__(self): self.seq = 'wxyz' def __len__(self): return len(self.seq) def __getitem__(self, i): return self.seq[i] class BadSeq1(Sequence): def __init__(self): self.seq = [7, 'hello', 123L] class BadSeq2(Sequence): def __init__(self): self.seq = ['a', 'b', 'c'] def __len__(self): return 8 def run_module_tests(test): """Run all tests that exercise a function in the string module""" test('atoi', " 1 ", 1) test('atoi', " 1x", ValueError) test('atoi', " x1 ", ValueError) test('atol', " 1 ", 1L) test('atol', " 1x ", ValueError) test('atol', " x1 ", ValueError) test('atof', " 1 ", 1.0) test('atof', " 1x ", ValueError) test('atof', " x1 ", ValueError) test('maketrans', 'abc', transtable, 'xyz') test('maketrans', 'abc', ValueError, 'xyzq') # join now works with any sequence type test('join', ['a', 'b', 'c', 'd'], 'a b c d') test('join', ('a', 'b', 'c', 'd'), 'abcd', '') test('join', Sequence(), 'w x y z') test('join', 7, TypeError) test('join', BadSeq1(), TypeError) test('join', BadSeq2(), 'a b c') # try a few long ones print string.join(['x' * 100] * 100, ':') print string.join(('x' * 100,) * 100, ':') def run_method_tests(test): """Run all tests that exercise a method of a string object""" test('capitalize', ' hello ', ' hello ') test('capitalize', 'hello ', 'Hello ') test('find', 'abcdefghiabc', 0, 'abc') test('find', 'abcdefghiabc', 9, 'abc', 1) test('find', 'abcdefghiabc', -1, 'def', 4) test('rfind', 'abcdefghiabc', 9, 'abc') test('lower', 'HeLLo', 'hello') test('lower', 'hello', 'hello') test('upper', 'HeLLo', 'HELLO') test('upper', 'HELLO', 'HELLO') test('title', ' hello ', ' Hello ') test('title', 'hello ', 'Hello ') test('title', "fOrMaT thIs aS titLe String", 'Format This As Title String') test('title', "fOrMaT,thIs-aS*titLe;String", 'Format,This-As*Title;String') test('title', "getInt", 'Getint') test('expandtabs', 'abc\rab\tdef\ng\thi', 'abc\rab def\ng hi') test('expandtabs', 'abc\rab\tdef\ng\thi', 'abc\rab def\ng hi', 8) test('expandtabs', 'abc\rab\tdef\ng\thi', 'abc\rab def\ng hi', 4) test('expandtabs', 'abc\r\nab\tdef\ng\thi', 'abc\r\nab def\ng hi', 4) test('islower', 'a', 1) test('islower', 'A', 0) test('islower', '\n', 0) test('islower', 'abc', 1) test('islower', 'aBc', 0) test('islower', 'abc\n', 1) test('isupper', 'a', 0) test('isupper', 'A', 1) test('isupper', '\n', 0) test('isupper', 'ABC', 1) test('isupper', 'AbC', 0) test('isupper', 'ABC\n', 1) test('istitle', 'a', 0) test('istitle', 'A', 1) test('istitle', '\n', 0) test('istitle', 'A Titlecased Line', 1) test('istitle', 'A\nTitlecased Line', 1) test('istitle', 'A Titlecased, Line', 1) test('istitle', 'Not a capitalized String', 0) test('istitle', 'Not\ta Titlecase String', 0) test('istitle', 'Not--a Titlecase String', 0) test('isalpha', 'a', 1) test('isalpha', 'A', 1) test('isalpha', '\n', 0) test('isalpha', 'abc', 1) test('isalpha', 'aBc123', 0) test('isalpha', 'abc\n', 0) test('isalnum', 'a', 1) test('isalnum', 'A', 1) test('isalnum', '\n', 0) test('isalnum', '123abc456', 1) test('isalnum', 'a1b3c', 1) test('isalnum', 'aBc000 ', 0) test('isalnum', 'abc\n', 0) # join now works with any sequence type test('join', ' ', 'a b c d', ['a', 'b', 'c', 'd']) test('join', '', 'abcd', ('a', 'b', 'c', 'd')) test('join', ' ', 'w x y z', Sequence()) test('join', 'a', 'abc', ('abc',)) test('join', 'a', 'z', UserList(['z'])) test('join', u'.', u'a.b.c', ['a', 'b', 'c']) test('join', '.', u'a.b.c', [u'a', 'b', 'c']) test('join', '.', u'a.b.c', ['a', u'b', 'c']) test('join', '.', u'a.b.c', ['a', 'b', u'c']) test('join', '.', TypeError, ['a', u'b', 3]) for i in [5, 25, 125]: test('join', '-', ((('a' * i) + '-') * i)[:-1], ['a' * i] * i) test('join', ' ', TypeError, BadSeq1()) test('join', ' ', 'a b c', BadSeq2()) test('splitlines', "abc\ndef\n\rghi", ['abc', 'def', '', 'ghi']) test('splitlines', "abc\ndef\n\r\nghi", ['abc', 'def', '', 'ghi']) test('splitlines', "abc\ndef\r\nghi", ['abc', 'def', 'ghi']) test('splitlines', "abc\ndef\r\nghi\n", ['abc', 'def', 'ghi']) test('splitlines', "abc\ndef\r\nghi\n\r", ['abc', 'def', 'ghi', '']) test('splitlines', "\nabc\ndef\r\nghi\n\r", ['', 'abc', 'def', 'ghi', '']) test('splitlines', "\nabc\ndef\r\nghi\n\r", ['\n', 'abc\n', 'def\r\n', 'ghi\n', '\r'], 1) test('split', 'this is the split function', ['this', 'is', 'the', 'split', 'function']) test('split', 'a|b|c|d', ['a', 'b', 'c', 'd'], '|') test('split', 'a|b|c|d', ['a', 'b', 'c|d'], '|', 2) test('split', 'a b c d', ['a', 'b c d'], None, 1) test('split', 'a b c d', ['a', 'b', 'c d'], None, 2) test('split', 'a b c d', ['a', 'b', 'c', 'd'], None, 3) test('split', 'a b c d', ['a', 'b', 'c', 'd'], None, 4) test('split', 'a b c d', ['a b c d'], None, 0) test('split', 'a b c d', ['a', 'b', 'c d'], None, 2) test('split', 'a b c d ', ['a', 'b', 'c', 'd']) test('strip', ' hello ', 'hello') test('lstrip', ' hello ', 'hello ') test('rstrip', ' hello ', ' hello') test('strip', 'hello', 'hello') test('swapcase', 'HeLLo cOmpUteRs', 'hEllO CoMPuTErS') test('translate', 'xyzabcdef', 'xyzxyz', transtable, 'def') table = string.maketrans('a', 'A') test('translate', 'abc', 'Abc', table) test('translate', 'xyz', 'xyz', table) test('replace', 'one!two!three!', 'one@two!three!', '!', '@', 1) test('replace', 'one!two!three!', 'onetwothree', '!', '') test('replace', 'one!two!three!', 'one@two@three!', '!', '@', 2) test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 3) test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 4) test('replace', 'one!two!three!', 'one!two!three!', '!', '@', 0) test('replace', 'one!two!three!', 'one@two@three@', '!', '@') test('replace', 'one!two!three!', 'one!two!three!', 'x', '@') test('replace', 'one!two!three!', 'one!two!three!', 'x', '@', 2) test('startswith', 'hello', 1, 'he') test('startswith', 'hello', 1, 'hello') test('startswith', 'hello', 0, 'hello world') test('startswith', 'hello', 1, '') test('startswith', 'hello', 0, 'ello') test('startswith', 'hello', 1, 'ello', 1) test('startswith', 'hello', 1, 'o', 4) test('startswith', 'hello', 0, 'o', 5) test('startswith', 'hello', 1, '', 5) test('startswith', 'hello', 0, 'lo', 6) test('startswith', 'helloworld', 1, 'lowo', 3) test('startswith', 'helloworld', 1, 'lowo', 3, 7) test('startswith', 'helloworld', 0, 'lowo', 3, 6) test('endswith', 'hello', 1, 'lo') test('endswith', 'hello', 0, 'he') test('endswith', 'hello', 1, '') test('endswith', 'hello', 0, 'hello world') test('endswith', 'helloworld', 0, 'worl') test('endswith', 'helloworld', 1, 'worl', 3, 9) test('endswith', 'helloworld', 1, 'world', 3, 12) test('endswith', 'helloworld', 1, 'lowo', 1, 7) test('endswith', 'helloworld', 1, 'lowo', 2, 7) test('endswith', 'helloworld', 1, 'lowo', 3, 7) test('endswith', 'helloworld', 0, 'lowo', 4, 7) test('endswith', 'helloworld', 0, 'lowo', 3, 8) test('endswith', 'ab', 0, 'ab', 0, 1) test('endswith', 'ab', 0, 'ab', 0, 0) --- NEW FILE --- # Augmented assignment test. x = 2 x += 1 x *= 2 x **= 2 x -= 8 x /= 2 x %= 12 x &= 2 x |= 5 x ^= 1 print x x = [2] x[0] += 1 x[0] *= 2 x[0] **= 2 x[0] -= 8 x[0] /= 2 x[0] %= 12 x[0] &= 2 x[0] |= 5 x[0] ^= 1 print x x = {0: 2} x[0] += 1 x[0] *= 2 x[0] **= 2 x[0] -= 8 x[0] /= 2 x[0] %= 12 x[0] &= 2 x[0] |= 5 x[0] ^= 1 print x[0] x = [1,2] x += [3,4] x *= 2 print x x = [1, 2, 3] y = x x[1:2] *= 2 y[1:2] += [1] print x print x is y class aug_test: def __init__(self, value): self.val = value def __radd__(self, val): return self.val + val def __add__(self, val): return aug_test(self.val + val) class aug_test2(aug_test): def __iadd__(self, val): self.val = self.val + val return self class aug_test3(aug_test): def __iadd__(self, val): return aug_test3(self.val + val) x = aug_test(1) y = x x += 10 print isinstance(x, aug_test) print y is not x print x.val x = aug_test2(2) y = x x += 10 print y is x print x.val x = aug_test3(3) y = x x += 10 print isinstance(x, aug_test3) print y is not x print x.val class testall: def __add__(self, val): print "__add__ called" def __radd__(self, val): print "__radd__ called" def __iadd__(self, val): print "__iadd__ called" return self def __sub__(self, val): print "__sub__ called" def __rsub__(self, val): print "__rsub__ called" def __isub__(self, val): print "__isub__ called" return self def __mul__(self, val): print "__mul__ called" def __rmul__(self, val): print "__rmul__ called" def __imul__(self, val): print "__imul__ called" return self def __div__(self, val): print "__div__ called" def __rdiv__(self, val): print "__rdiv__ called" def __idiv__(self, val): print "__idiv__ called" return self def __mod__(self, val): print "__mod__ called" def __rmod__(self, val): print "__rmod__ called" def __imod__(self, val): print "__imod__ called" return self def __pow__(self, val): print "__pow__ called" def __rpow__(self, val): print "__rpow__ called" def __ipow__(self, val): print "__ipow__ called" return self def __or__(self, val): print "__or__ called" def __ror__(self, val): print "__ror__ called" def __ior__(self, val): print "__ior__ called" return self def __and__(self, val): print "__and__ called" def __rand__(self, val): print "__rand__ called" def __iand__(self, val): print "__iand__ called" return self def __xor__(self, val): print "__xor__ called" def __rxor__(self, val): print "__rxor__ called" def __ixor__(self, val): print "__ixor__ called" return self def __rshift__(self, val): print "__rshift__ called" def __rrshift__(self, val): print "__rrshift__ called" def __irshift__(self, val): print "__irshift__ called" return self def __lshift__(self, val): print "__lshift__ called" def __rlshift__(self, val): print "__rlshift__ called" def __ilshift__(self, val): print "__ilshift__ called" return self x = testall() x + 1 1 + x x += 1 x - 1 1 - x x -= 1 x * 1 1 * x x *= 1 x / 1 1 / x x /= 1 x % 1 1 % x x %= 1 x ** 1 1 ** x x **= 1 x | 1 1 | x x |= 1 x & 1 1 & x x &= 1 x ^ 1 1 ^ x x ^= 1 x >> 1 1 >> x x >>= 1 x << 1 1 << x x <<= 1 --- NEW FILE --- "Test the functionality of Python classes implementing operators." testmeths = [ # Binary operations "add", "radd", "sub", "rsub", "mul", "rmul", "div", "rdiv", "mod", "rmod", "divmod", "rdivmod", "pow", "rpow", "rshift", "rrshift", "lshift", "rlshift", "and", "rand", "or", "ror", "xor", "rxor", # List/dict operations "contains", "getitem", "getslice", "setitem", "setslice", "delitem", "delslice", # Unary operations "neg", "pos", "abs", "int", "long", "float", "oct", "hex", # generic operations "init", "del", ] # These need to return something other than None # "coerce", # "hash", # "str", # "repr", # These are separate because they can influence the test of other methods. # "getattr", # "setattr", # "delattr", class AllTests: def __coerce__(self, *args): print "__coerce__:", args return (self,) + args def __hash__(self, *args): print "__hash__:", args return id(self) def __str__(self, *args): print "__str__:", args return "AllTests" def __repr__(self, *args): print "__repr__:", args return "AllTests" def __cmp__(self, *args): print "__cmp__:", args return 0 for method in testmeths: exec("""def __%(method)s__(self, *args): print "__%(method)s__:", args """%locals(), AllTests.__dict__); # this also tests __init__ of course. testme = AllTests() # Binary operations testme + 1 1 + testme testme - 1 1 - testme testme * 1 1 * testme testme / 1 1 / testme testme % 1 1 % testme divmod(testme,1) divmod(1, testme) testme ** 1 1 ** testme testme >> 1 1 >> testme testme << 1 1 << testme testme & 1 1 & testme testme | 1 1 | testme testme ^ 1 1 ^ testme # List/dict operations 1 in testme testme[1] testme[1] = 1 del testme[1] testme[:42] testme[:42] = "The Answer" del testme[:42] testme[2:1024:10] testme[2:1024:10] = "A lot" del testme[2:1024:10] testme[:42, ..., :24:, 24, 100] testme[:42, ..., :24:, 24, 100] = "Strange" del testme[:42, ..., :24:, 24, 100] # Now remove the slice hooks to see if converting normal slices to slice # object works. del AllTests.__getslice__ del AllTests.__setslice__ del AllTests.__delslice__ testme[:42] testme[:42] = "The Answer" del testme[:42] # Unary operations -testme +testme abs(testme) int(testme) long(testme) float(testme) oct(testme) hex(testme) # And the rest... hash(testme) repr(testme) str(testme) testme == 1 testme < 1 testme > 1 testme <> 1 testme != 1 1 == testme 1 < testme 1 > testme 1 <> testme 1 != testme # This test has to be last (duh.) del testme # Interfering tests class ExtraTests: def __getattr__(self, *args): print "__getattr__:", args return "SomeVal" def __setattr__(self, *args): print "__setattr__:", args def __delattr__(self, *args): print "__delattr__:", args testme = ExtraTests() testme.spam testme.eggs = "spam, spam, spam and ham" del testme.cardinal --- NEW FILE --- from test_support import verbose, TestFailed if verbose: print 'Running test on duplicate arguments' try: exec('def f(a, a): pass') raise TestFailed, "duplicate arguments" except SyntaxError: pass try: exec('def f(a = 0, a = 1): pass') raise TestFailed, "duplicate keyword arguments" except SyntaxError: pass --- NEW FILE --- # Simple test suite for Cookie.py import Cookie # Currently this only tests SimpleCookie cases = [ ('chips=ahoy; vienna=finger', {'chips':'ahoy', 'vienna':'finger'}), ('keebler="E=mc2; L=\\"Loves\\"; fudge=\\012;";', {'keebler' : 'E=mc2; L="Loves"; fudge=\012;'}), ] for data, dict in cases: C = Cookie.SimpleCookie() ; C.load(data) print repr(C) print str(C) for k, v in dict.items(): print ' ', k, repr( C[k].value ), repr(v) assert C[k].value == v print C[k] C = Cookie.SimpleCookie() C.load('Customer="WILE_E_COYOTE"; Version=1; Path=/acme') assert C['Customer'].value == 'WILE_E_COYOTE' assert C['Customer']['version'] == '1' assert C['Customer']['path'] == '/acme' print C.output(['path']) print C.js_output() print C.js_output(['path']) # Try cookie with quoted meta-data C = Cookie.SimpleCookie() C.load('Customer="WILE_E_COYOTE"; Version="1"; Path="/acme"') assert C['Customer'].value == 'WILE_E_COYOTE' assert C['Customer']['version'] == '1' assert C['Customer']['path'] == '/acme' --- NEW FILE --- import dospath import string import os errors = 0 def tester(fn, wantResult): fn = string.replace(fn, "\\", "\\\\") gotResult = eval(fn) if wantResult != gotResult: print "error!" print "evaluated: " + str(fn) print "should be: " + str(wantResult) print " returned: " + str(gotResult) print "" global errors errors = errors + 1 tester('dospath.splitdrive("c:\\foo\\bar")', ('c:', '\\foo\\bar')) tester('dospath.splitdrive("c:/foo/bar")', ('c:', '/foo/bar')) tester('dospath.split("c:\\foo\\bar")', ('c:\\foo', 'bar')) tester('dospath.split("\\\\conky\\mountpoint\\foo\\bar")', ('\\\\conky\\mountpoint\\foo', 'bar')) tester('dospath.split("c:\\")', ('c:\\', '')) tester('dospath.split("\\\\conky\\mountpoint\\")', ('\\\\conky\\mountpoint', '')) tester('dospath.split("c:/")', ('c:/', '')) tester('dospath.split("//conky/mountpoint/")', ('//conky/mountpoint', '')) tester('dospath.isabs("c:\\")', 1) tester('dospath.isabs("\\\\conky\\mountpoint\\")', 1) tester('dospath.isabs("\\foo")', 1) tester('dospath.isabs("\\foo\\bar")', 1) tester('dospath.abspath("C:\\")', "C:\\") tester('dospath.commonprefix(["/home/swenson/spam", "/home/swen/spam"])', "/home/swen") tester('dospath.commonprefix(["\\home\\swen\\spam", "\\home\\swen\\eggs"])', "\\home\\swen\\") tester('dospath.commonprefix(["/home/swen/spam", "/home/swen/spam"])', "/home/swen/spam") if errors: print str(errors) + " errors." else: print "No errors. Thank your lucky stars." --- NEW FILE --- from test_support import TESTFN from UserList import UserList # verify writelines with instance sequence l = UserList(['1', '2']) f = open(TESTFN, 'wb') f.writelines(l) f.close() f = open(TESTFN, 'rb') buf = f.read() f.close() assert buf == '12' # verify writelines with integers f = open(TESTFN, 'wb') try: f.writelines([1, 2, 3]) except TypeError: pass else: print "writelines accepted sequence of integers" f.close() # verify writelines with integers in UserList f = open(TESTFN, 'wb') l = UserList([1,2,3]) try: f.writelines(l) except TypeError: pass else: print "writelines accepted sequence of integers" f.close() # verify writelines with non-string object class NonString: pass f = open(TESTFN, 'wb') try: f.writelines([NonString(), NonString()]) except TypeError: pass else: print "writelines accepted sequence of non-string objects" f.close() --- NEW FILE --- # test_getopt.py # David Goodger 2000-08-19 import getopt from getopt import GetoptError from test_support import verbose def expectException(teststr, expected, failure=AssertionError): """Executes a statement passed in teststr, and raises an exception (failure) if the expected exception is *not* raised.""" try: exec teststr except expected: pass else: raise failure if verbose: print 'Running tests on getopt.short_has_arg' assert getopt.short_has_arg('a', 'a:') assert not getopt.short_has_arg('a', 'a') expectException("tmp = getopt.short_has_arg('a', 'b')", GetoptError) expectException("tmp = getopt.short_has_arg('a', '')", GetoptError) if verbose: print 'Running tests on getopt.long_has_args' has_arg, option = getopt.long_has_args('abc', ['abc=']) assert has_arg assert option == 'abc' has_arg, option = getopt.long_has_args('abc', ['abc']) assert not has_arg assert option == 'abc' has_arg, option = getopt.long_has_args('abc', ['abcd']) assert not has_arg assert option == 'abcd' expectException("has_arg, option = getopt.long_has_args('abc', ['def'])", GetoptError) expectException("has_arg, option = getopt.long_has_args('abc', [])", GetoptError) expectException("has_arg, option = " + \ "getopt.long_has_args('abc', ['abcd','abcde'])", GetoptError) if verbose: print 'Running tests on getopt.do_shorts' opts, args = getopt.do_shorts([], 'a', 'a', []) assert opts == [('-a', '')] assert args == [] opts, args = getopt.do_shorts([], 'a1', 'a:', []) assert opts == [('-a', '1')] assert args == [] #opts, args = getopt.do_shorts([], 'a=1', 'a:', []) #assert opts == [('-a', '1')] #assert args == [] opts, args = getopt.do_shorts([], 'a', 'a:', ['1']) assert opts == [('-a', '1')] assert args == [] opts, args = getopt.do_shorts([], 'a', 'a:', ['1', '2']) assert opts == [('-a', '1')] assert args == ['2'] expectException("opts, args = getopt.do_shorts([], 'a1', 'a', [])", GetoptError) expectException("opts, args = getopt.do_shorts([], 'a', 'a:', [])", GetoptError) if verbose: print 'Running tests on getopt.do_longs' opts, args = getopt.do_longs([], 'abc', ['abc'], []) assert opts == [('--abc', '')] assert args == [] opts, args = getopt.do_longs([], 'abc=1', ['abc='], []) assert opts == [('--abc', '1')] assert args == [] opts, args = getopt.do_longs([], 'abc=1', ['abcd='], []) assert opts == [('--abcd', '1')] assert args == [] expectException("opts, args = getopt.do_longs([], 'abc=1', ['abc'], [])", GetoptError) expectException("opts, args = getopt.do_longs([], 'abc', ['abc='], [])", GetoptError) # note: the empty string between '-a' and '--beta' is significant: # it simulates an empty string option argument ('-a ""') on the command line. cmdline = ['-a', '1', '-b', '--alpha=2', '--beta', '-a', '3', '-a', '', '--beta', 'arg1', 'arg2'] if verbose: print 'Running tests on getopt.getopt' opts, args = getopt.getopt(cmdline, 'a:b', ['alpha=', 'beta']) assert opts == [('-a', '1'), ('-b', ''), ('--alpha', '2'), ('--beta', ''), ('-a', '3'), ('-a', ''), ('--beta', '')] # Note ambiguity of ('-b', '') and ('-a', '') above. This must be # accounted for in the code that calls getopt(). assert args == ['arg1', 'arg2'] expectException( "opts, args = getopt.getopt(cmdline, 'a:b', ['alpha', 'beta'])", GetoptError) if verbose: print "Module getopt: tests completed successfully." --- NEW FILE --- #!python #---------------------------------------------------------------------- # test largefile support on system where this makes sense # #XXX how to only run this when support is there #XXX how to only optionally run this, it will take along time #---------------------------------------------------------------------- import test_support import os, struct, stat, sys # only run if the current system support large files f = open(test_support.TESTFN, 'w') try: # 2**31 == 2147483648 f.seek(2147483649L) except OverflowError: raise test_support.TestSkipped, "platform does not have largefile support" else: f.close() # create >2GB file (2GB = 2147483648 bytes) size = 2500000000L name = test_support.TESTFN # on Windows this test comsumes large resources: # it takes a long time to build the >2GB file and takes >2GB of disk space # therefore test_support.use_large_resources must be defined to run this test if sys.platform[:3] == 'win' and not test_support.use_large_resources: raise test_support.TestSkipped, \ "test requires %s bytes and a long time to run" % str(size) def expect(got_this, expect_this): if test_support.verbose: print '%s =?= %s ...' % (`got_this`, `expect_this`), if got_this != expect_this: if test_support.verbose: print 'no' raise test_support.TestFailed, 'got %s, but expected %s' %\ (str(got_this), str(expect_this)) else: if test_support.verbose: print 'yes' # test that each file function works as expected for a large (i.e. >2GB, do # we have to check >4GB) files if test_support.verbose: print 'create large file via seek (may be sparse file) ...' f = open(name, 'w') f.seek(size) f.write('a') f.flush() expect(os.fstat(f.fileno())[stat.ST_SIZE], size+1) if test_support.verbose: print 'check file size with os.fstat' f.close() if test_support.verbose: print 'check file size with os.stat' expect(os.stat(name)[stat.ST_SIZE], size+1) if test_support.verbose: print 'play around with seek() and read() with the built largefile' f = open(name, 'r') expect(f.tell(), 0) expect(f.read(1), '\000') expect(f.tell(), 1) f.seek(0) expect(f.tell(), 0) f.seek(0, 0) expect(f.tell(), 0) f.seek(42) expect(f.tell(), 42) f.seek(42, 0) expect(f.tell(), 42) f.seek(42, 1) expect(f.tell(), 84) f.seek(0, 1) expect(f.tell(), 84) f.seek(0, 2) # seek from the end expect(f.tell(), size + 1 + 0) f.seek(-10, 2) expect(f.tell(), size + 1 - 10) f.seek(-size-1, 2) expect(f.tell(), 0) f.seek(size) expect(f.tell(), size) expect(f.read(1), 'a') # the 'a' that was written at the end of the file above f.close() if test_support.verbose: print 'play around with os.lseek() with the built largefile' f = open(name, 'r') expect(os.lseek(f.fileno(), 0, 0), 0) expect(os.lseek(f.fileno(), 42, 0), 42) expect(os.lseek(f.fileno(), 42, 1), 84) expect(os.lseek(f.fileno(), 0, 1), 84) expect(os.lseek(f.fileno(), 0, 2), size+1+0) expect(os.lseek(f.fileno(), -10, 2), size+1-10) expect(os.lseek(f.fileno(), -size-1, 2), 0) expect(os.lseek(f.fileno(), size, 0), size) expect(f.read(1), 'a') # the 'a' that was written at the end of the file above f.close() # XXX add tests for truncate if it exists # XXX has truncate ever worked on Windows? specifically on WinNT I get: # "IOError: [Errno 13] Permission denied" ##try: ## newsize = size - 10 ## f.seek(newsize) ## f.truncate() ## expect(f.tell(), newsize) ## newsize = newsize - 1 ## f.seek(0) ## f.truncate(newsize) ## expect(f.tell(), newsize) ##except AttributeError: ## pass os.unlink(name) --- NEW FILE --- # test for xml.dom.minidom from xml.dom.minidom import parse, Node, Document, parseString import os.path import sys import traceback if __name__ == "__main__": base = sys.argv[0] else: base = __file__ tstfile = os.path.join(os.path.dirname(base), "test.xml") del base Node._debug=1 def testGetElementsByTagName( ): dom=parse( tstfile ) assert dom.getElementsByTagName( "LI" )==\ dom.documentElement.getElementsByTagName( "LI" ) dom.unlink() dom=None assert( len( Node.allnodes ))==0 def testInsertBefore( ): dom=parse( tstfile ) docel=dom.documentElement #docel.insertBefore( dom.createProcessingInstruction("a", "b"), # docel.childNodes[1]) #docel.insertBefore( dom.createProcessingInstruction("a", "b"), # docel.childNodes[0]) #assert docel.childNodes[0].target=="a" #assert docel.childNodes[2].target=="a" dom.unlink() del dom del docel assert( len( Node.allnodes ))==0 def testAppendChild(): dom=parse( tstfile ) dom.documentElement.appendChild( dom.createComment( u"Hello" )) assert dom.documentElement.childNodes[-1].nodeName=="#comment" assert dom.documentElement.childNodes[-1].data=="Hello" dom.unlink() dom=None assert( len( Node.allnodes ))==0 def testNonZero(): dom=parse( tstfile ) assert dom # should not be zero dom.appendChild( dom.createComment( "foo" ) ) assert not dom.childNodes[-1].childNodes dom.unlink() dom=None assert( len( Node.allnodes ))==0 def testUnlink(): dom=parse( tstfile ) dom.unlink() dom=None assert( len( Node.allnodes ))==0 def testElement(): dom=Document() dom.appendChild( dom.createElement( "abc" ) ) assert dom.documentElement dom.unlink() dom=None assert( len( Node.allnodes ))==0 def testAAA(): dom=parseString( "" ) el=dom.documentElement el.setAttribute( "spam", "jam2" ) dom.unlink() dom=None def testAAB(): dom=parseString( "" ) el=dom.documentElement el.setAttribute( "spam", "jam" ) el.setAttribute( "spam", "jam2" ) dom.unlink() dom=None def testAddAttr(): dom=Document() child=dom.appendChild( dom.createElement( "abc" ) ) child.setAttribute( "def", "ghi" ) assert child.getAttribute( "def" )=="ghi" assert child.attributes["def"].value=="ghi" child.setAttribute( "jkl", "mno" ) assert child.getAttribute( "jkl" )=="mno" assert child.attributes["jkl"].value=="mno" assert len( child.attributes )==2 child.setAttribute( "def", "newval" ) assert child.getAttribute( "def" )=="newval" assert child.attributes["def"].value=="newval" assert len( child.attributes )==2 dom.unlink() dom=None child=None def testDeleteAttr(): dom=Document() child=dom.appendChild( dom.createElement( "abc" ) ) assert len( child.attributes)==0 child.setAttribute( "def", "ghi" ) assert len( child.attributes)==1 del child.attributes["def"] assert len( child.attributes)==0 dom.unlink() assert( len( Node.allnodes ))==0 def testRemoveAttr(): dom=Document() child=dom.appendChild( dom.createElement( "abc" ) ) child.setAttribute( "def", "ghi" ) assert len( child.attributes)==1 child.removeAttribute("def" ) assert len( child.attributes)==0 dom.unlink() def testRemoveAttrNS(): dom=Document() child=dom.appendChild( dom.createElementNS( "http://www.python.org", "python:abc" ) ) child.setAttributeNS( "http://www.w3.org", "xmlns:python", "http://www.python.org" ) child.setAttributeNS( "http://www.python.org", "python:abcattr", "foo" ) assert len( child.attributes )==2 child.removeAttributeNS( "http://www.python.org", "abcattr" ) assert len( child.attributes )==1 dom.unlink() dom=None def testRemoveAttributeNode(): dom=Document() child=dom.appendChild( dom.createElement( "foo" ) ) child.setAttribute( "spam", "jam" ) assert len( child.attributes )==1 node=child.getAttributeNode( "spam" ) child.removeAttributeNode( node ) assert len( child.attributes )==0 dom.unlink() dom=None assert len( Node.allnodes )==0 def testChangeAttr(): dom=parseString( "" ) el=dom.documentElement el.setAttribute( "spam", "jam" ) assert len( el.attributes )==1 el.setAttribute( "spam", "bam" ) assert len( el.attributes )==1 el.attributes["spam"]="ham" assert len( el.attributes )==1 el.setAttribute( "spam2", "bam" ) assert len( el.attributes )==2 el.attributes[ "spam2"]= "bam2" assert len( el.attributes )==2 dom.unlink() dom=None assert len( Node.allnodes )==0 def testGetAttrList(): pass def testGetAttrValues(): pass def testGetAttrLength(): pass def testGetAttribute(): pass def testGetAttributeNS(): pass def testGetAttributeNode(): pass def testGetElementsByTagNameNS(): pass def testGetEmptyNodeListFromElementsByTagNameNS(): pass def testElementReprAndStr(): dom=Document() el=dom.appendChild( dom.createElement( "abc" ) ) string1=repr( el ) string2=str( el ) assert string1==string2 dom.unlink() # commented out until Fredrick's fix is checked in def _testElementReprAndStrUnicode(): dom=Document() el=dom.appendChild( dom.createElement( u"abc" ) ) string1=repr( el ) string2=str( el ) assert string1==string2 dom.unlink() # commented out until Fredrick's fix is checked in def _testElementReprAndStrUnicodeNS(): dom=Document() el=dom.appendChild( dom.createElementNS( u"http://www.slashdot.org", u"slash:abc" )) string1=repr( el ) string2=str( el ) assert string1==string2 assert string1.find("slash:abc" )!=-1 dom.unlink() def testAttributeRepr(): dom=Document() el=dom.appendChild( dom.createElement( u"abc" ) ) node=el.setAttribute( "abc", "def" ) assert str( node ) == repr( node ) dom.unlink() def testTextNodeRepr(): pass def testWriteXML(): pass def testProcessingInstruction(): pass def testProcessingInstructionRepr(): pass def testTextRepr(): pass def testWriteText(): pass def testDocumentElement(): pass def testTooManyDocumentElements(): pass def testCreateElementNS(): pass def testCreatAttributeNS(): pass def testParse(): pass def testParseString(): pass def testComment(): pass def testAttrListItem(): pass def testAttrListItems(): pass def testAttrListItemNS(): pass def testAttrListKeys(): pass def testAttrListKeysNS(): pass def testAttrListValues(): pass def testAttrListLength(): pass def testAttrList__getitem__(): pass def testAttrList__setitem__(): pass def testSetAttrValueandNodeValue(): pass def testParseElement(): pass def testParseAttributes(): pass def testParseElementNamespaces(): pass def testParseAttributeNamespaces(): pass def testParseProcessingInstructions(): pass def testChildNodes(): pass def testFirstChild(): pass def testHasChildNodes(): pass def testCloneElementShallow(): pass def testCloneElementShallowCopiesAttributes(): pass def testCloneElementDeep(): pass def testCloneDocumentShallow(): pass def testCloneDocumentDeep(): pass def testCloneAttributeShallow(): pass def testCloneAttributeDeep(): pass def testClonePIShallow(): pass def testClonePIDeep(): pass names=globals().keys() names.sort() for name in names: if name.startswith( "test" ): func=globals()[name] try: func() print "Test Succeeded", name if len( Node.allnodes ): print "Garbage left over:" print Node.allnodes.items()[0:10] Node.allnodes={} except Exception, e : print "Test Failed: ", name apply( traceback.print_exception, sys.exc_info() ) print `e` Node.allnodes={} raise --- NEW FILE --- import os.path import parser import pprint import sys from parser import expr, suite, sequence2ast from test_support import verbose # # First, we test that we can generate trees from valid source fragments, # and that these valid trees are indeed allowed by the tree-loading side # of the parser module. # def roundtrip(f, s): st1 = f(s) t = st1.totuple() st2 = parser.sequence2ast(t) def roundtrip_fromfile(filename): roundtrip(suite, open(filename).read()) def test_expr(s): print "expr:", s roundtrip(expr, s) def test_suite(s): print "suite:", s roundtrip(suite, s) print "Expressions:" test_expr("foo(1)") test_expr("[1, 2, 3]") test_expr("[x**3 for x in range(20)]") test_expr("[x**3 for x in range(20) if x % 3]") test_expr("foo(*args)") test_expr("foo(*args, **kw)") test_expr("foo(**kw)") test_expr("foo(key=value)") test_expr("foo(key=value, *args)") test_expr("foo(key=value, *args, **kw)") test_expr("foo(key=value, **kw)") test_expr("foo(a, b, c, *args)") test_expr("foo(a, b, c, *args, **kw)") test_expr("foo(a, b, c, **kw)") test_expr("foo + bar") print print "Statements:" test_suite("print") test_suite("print 1") test_suite("print 1,") test_suite("print >>fp") test_suite("print >>fp, 1") test_suite("print >>fp, 1,") # expr_stmt test_suite("a") test_suite("a = b") test_suite("a = b = c = d = e") test_suite("a += b") test_suite("a -= b") test_suite("a *= b") test_suite("a /= b") test_suite("a %= b") test_suite("a &= b") test_suite("a |= b") test_suite("a ^= b") test_suite("a <<= b") test_suite("a >>= b") test_suite("a **= b") #d = os.path.dirname(os.__file__) #roundtrip_fromfile(os.path.join(d, "os.py")) #roundtrip_fromfile(os.path.join(d, "test", "test_parser.py")) # # Second, we take *invalid* trees and make sure we get ParserError # rejections for them. # print print "Invalid parse trees:" def check_bad_tree(tree, label): print print label try: sequence2ast(tree) except parser.ParserError: print "caught expected exception for invalid tree" pass else: print "test failed: did not properly detect invalid tree:" pprint.pprint(tree) # not even remotely valid: check_bad_tree((1, 2, 3), "") # print >>fp, tree = \ (257, (264, (265, (266, (268, (1, 'print'), (35, '>>'), (290, (291, (292, (293, (295, (296, (297, (298, (299, (300, (301, (302, (303, (1, 'fp')))))))))))))), (12, ','))), (4, ''))), (0, '')) check_bad_tree(tree, "print >>fp,") # a,,c tree = \ (258, (311, (290, (291, (292, (293, (295, (296, (297, (298, (299, (300, (301, (302, (303, (1, 'a')))))))))))))), (12, ','), (12, ','), (290, (291, (292, (293, (295, (296, (297, (298, (299, (300, (301, (302, (303, (1, 'c'))))))))))))))), (4, ''), (0, '')) check_bad_tree(tree, "a,,c") # a $= b tree = \ (257, (264, (265, (266, (267, (312, (291, (292, (293, (294, (296, (297, (298, (299, (300, (301, (302, (303, (304, (1, 'a'))))))))))))))), (268, (37, '$=')), (312, (291, (292, (293, (294, (296, (297, (298, (299, (300, (301, (302, (303, (304, (1, 'b'))))))))))))))))), (4, ''))), (0, '')) check_bad_tree(tree, "a $= b") --- NEW FILE --- # Test case for the os.poll() function import sys, os, select, random from test_support import verbose, TestSkipped, TESTFN try: select.poll except AttributeError: raise TestSkipped, "select.poll not defined -- skipping test_poll" def find_ready_matching(ready, flag): match = [] for fd, mode in ready: if mode & flag: match.append(fd) return match def test_poll1(): """Basic functional test of poll object Create a bunch of pipe and test that poll works with them. """ print 'Running poll test 1' p = select.poll() NUM_PIPES = 12 MSG = " This is a test." MSG_LEN = len(MSG) readers = [] writers = [] r2w = {} w2r = {} for i in range(NUM_PIPES): rd, wr = os.pipe() p.register(rd, select.POLLIN) p.register(wr, select.POLLOUT) readers.append(rd) writers.append(wr) r2w[rd] = wr w2r[wr] = rd while writers: ready = p.poll() ready_writers = find_ready_matching(ready, select.POLLOUT) if not ready_writers: raise RuntimeError, "no pipes ready for writing" wr = random.choice(ready_writers) os.write(wr, MSG) ready = p.poll() ready_readers = find_ready_matching(ready, select.POLLIN) if not ready_readers: raise RuntimeError, "no pipes ready for reading" rd = random.choice(ready_readers) buf = os.read(rd, MSG_LEN) assert len(buf) == MSG_LEN print buf os.close(r2w[rd]) ; os.close( rd ) p.unregister( r2w[rd] ) p.unregister( rd ) writers.remove(r2w[rd]) poll_unit_tests() print 'Poll test 1 complete' def poll_unit_tests(): # returns NVAL for invalid file descriptor FD = 42 try: os.close(FD) except OSError: pass p = select.poll() p.register(FD) r = p.poll() assert r[0] == (FD, select.POLLNVAL) f = open(TESTFN, 'w') fd = f.fileno() p = select.poll() p.register(f) r = p.poll() assert r[0][0] == fd f.close() r = p.poll() assert r[0] == (fd, select.POLLNVAL) os.unlink(TESTFN) # type error for invalid arguments p = select.poll() try: p.register(p) except TypeError: pass else: print "Bogus register call did not raise TypeError" try: p.unregister(p) except TypeError: pass else: print "Bogus unregister call did not raise TypeError" # can't unregister non-existent object p = select.poll() try: p.unregister(3) except KeyError: pass else: print "Bogus unregister call did not raise KeyError" # Test error cases pollster = select.poll() class Nope: pass class Almost: def fileno(self): return 'fileno' try: pollster.register( Nope(), 0 ) except TypeError: pass else: print 'expected TypeError exception, not raised' try: pollster.register( Almost(), 0 ) except TypeError: pass else: print 'expected TypeError exception, not raised' # Another test case for poll(). This is copied from the test case for # select(), modified to use poll() instead. def test_poll2(): print 'Running poll test 2' cmd = 'for i in 0 1 2 3 4 5 6 7 8 9; do echo testing...; sleep 1; done' p = os.popen(cmd, 'r') pollster = select.poll() pollster.register( p, select.POLLIN ) for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10: if verbose: print 'timeout =', tout fdlist = pollster.poll(tout) if (fdlist == []): continue fd, flags = fdlist[0] if flags & select.POLLHUP: line = p.readline() if line != "": print 'error: pipe seems to be closed, but still returns data' continue elif flags & select.POLLIN: line = p.readline() if verbose: print `line` if not line: if verbose: print 'EOF' break continue else: print 'Unexpected return value from select.poll:', fdlist p.close() print 'Poll test 2 complete' test_poll1() test_poll2() --- NEW FILE --- import posixpath import string errors = 0 def tester(fn, wantResult): gotResult = eval(fn) if wantResult != gotResult: print "error!" print "evaluated: " + str(fn) print "should be: " + str(wantResult) print " returned: " + str(gotResult) print "" global errors errors = errors + 1 tester('posixpath.splitdrive("/foo/bar")', ('', '/foo/bar')) tester('posixpath.split("/foo/bar")', ('/foo', 'bar')) tester('posixpath.split("/")', ('/', '')) tester('posixpath.split("foo")', ('', 'foo')) tester('posixpath.splitext("foo.ext")', ('foo', '.ext')) tester('posixpath.splitext("/foo/foo.ext")', ('/foo/foo', '.ext')) tester('posixpath.isabs("/")', 1) tester('posixpath.isabs("/foo")', 1) tester('posixpath.isabs("/foo/bar")', 1) tester('posixpath.isabs("foo/bar")', 0) tester('posixpath.commonprefix(["/home/swenson/spam", "/home/swen/spam"])', "/home/swen") tester('posixpath.commonprefix(["/home/swen/spam", "/home/swen/eggs"])', "/home/swen/") tester('posixpath.commonprefix(["/home/swen/spam", "/home/swen/spam"])', "/home/swen/spam") if errors: print str(errors) + " errors." else: print "No errors. Thank your lucky stars." --- NEW FILE --- --- NEW FILE --- """Remote-control interfaces to some browsers.""" import os import sys PROCESS_CREATION_DELAY = 4 class Error(Exception): pass _browsers = {} def register(name, klass, instance=None): """Register a browser connector and, optionally, connection.""" _browsers[name.lower()] = [klass, instance] def get(name=None): """Retrieve a connection to a browser by type name, or the default browser.""" name = name or DEFAULT_BROWSER try: L = _browsers[name.lower()] except KeyError: raise ValueError, "unknown browser type: " + `name` if L[1] is None: L[1] = L[0]() return L[1] # Please note: the following definition hides a builtin function. def open(url, new=0): get().open(url, new) def open_new(url): get().open_new(url) def _iscommand(cmd): """Return true if cmd can be found on the executable search path.""" path = os.environ.get("PATH") if not path: return 0 for d in path.split(os.pathsep): exe = os.path.join(d, cmd) if os.path.isfile(exe): return 1 return 0 class CommandLineBrowser: _browsers = [] if os.environ.get("DISPLAY"): _browsers.extend([ ("netscape", "netscape %s >/dev/null &"), ("mosaic", "mosaic %s >/dev/null &"), ]) _browsers.extend([ ("lynx", "lynx %s"), ("w3m", "w3m %s"), ]) def open(self, url, new=0): for exe, cmd in self._browsers: if _iscommand(exe): os.system(cmd % url) return raise Error("could not locate runnable browser") def open_new(self, url): self.open(url) register("command-line", CommandLineBrowser) class Netscape: autoRaise = 1 def _remote(self, action): raise_opt = ("-noraise", "-raise")[self.autoRaise] cmd = "netscape %s -remote '%s' >/dev/null 2>&1" % (raise_opt, action) rc = os.system(cmd) if rc: import time os.system("netscape -no-about-splash &") time.sleep(PROCESS_CREATION_DELAY) rc = os.system(cmd) return not rc def open(self, url, new=0): if new: self.open_new(url) else: self._remote("openURL(%s)" % url) def open_new(self, url): self._remote("openURL(%s, new-window)" % url) register("netscape", Netscape) class Konquerer: """Controller for the KDE File Manager (kfm, or Konquerer). See http://developer.kde.org/documentation/other/kfmclient.html for more information on the Konquerer remote-control interface. """ def _remote(self, action): cmd = "kfmclient %s >/dev/null 2>&1" % action rc = os.system(cmd) if rc: import time os.system("kfm -d &") time.sleep(PROCESS_CREATION_DELAY) rc = os.system(cmd) return not rc def open(self, url, new=1): # XXX currently I know no way to prevent KFM from opening a new win. self.open_new(url) def open_new(self, url): self._remote("openURL %s" % url) register("kfm", Konquerer) class Grail: # There should be a way to maintain a connection to Grail, but the # Grail remote control protocol doesn't really allow that at this # point. It probably never will! def _find_grail_rc(self): import glob import pwd import socket import tempfile tempdir = os.path.join(tempfile.gettempdir(), ".grail-unix") user = pwd.getpwuid(_os.getuid())[0] filename = os.path.join(tempdir, user + "-*") maybes = glob.glob(filename) if not maybes: return None s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) for fn in maybes: # need to PING each one until we find one that's live try: s.connect(fn) except socket.error: # no good; attempt to clean it out, but don't fail: try: os.unlink(fn) except IOError: pass else: return s def _remote(self, action): s = self._find_grail_rc() if not s: return 0 s.send(action) s.close() return 1 def open(self, url, new=0): if new: self.open_new(url) else: self._remote("LOAD " + url) def open_new(self, url): self._remote("LOADNEW " + url) register("grail", Grail) class WindowsDefault: def open(self, url, new=0): import win32api, win32con win32api.ShellExecute(0, "open", url, None, ".", win32con.SW_SHOWNORMAL) def open_new(self, url): self.open(url) DEFAULT_BROWSER = "command-line" if sys.platform[:3] == "win": del _browsers["kfm"] register("windows-default", WindowsDefault) DEFAULT_BROWSER = "windows-default" elif os.environ.get("DISPLAY"): if os.environ.get("KDEDIR"): DEFAULT_BROWSER = "kfm" elif _iscommand("netscape"): DEFAULT_BROWSER = "netscape" # If the $BROWSER environment variable is set and true, let that be # the name of the browser to use: # DEFAULT_BROWSER = os.environ.get("BROWSER") or DEFAULT_BROWSER # Now try to support the MacOS world. This is the only supported # controller on that platform, so don't mess with the default! try: import ic except ImportError: pass else: class InternetConfig: def open(self, url, new=0): ic.launcurl(url) def open_new(self, url): self.open(url) _browsers.clear() register("internet-config", InternetConfig) DEFAULT_BROWSER = "internet-config" --- exceptio.py DELETED --- --- threadst.py DELETED --- From python-dev@python.org Fri Sep 1 20:30:28 2000 From: python-dev@python.org (Tim Peters) Date: Fri, 1 Sep 2000 12:30:28 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.11,1.12 Message-ID: <200009011930.MAA24509@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/PCbuild In directory slayer.i.sourceforge.net:/tmp/cvs-serv24288/python/dist/src/pcbuild Modified Files: python20.wse Log Message: Guido pointed out that the "non-admin install" blurb got displayed very late in the process when running on Windows 2000 without admim privs. Rearranged so that the admin check is done at the start instead. Added words to the end of the blurb to make it very clear how to abort the install (wasn't obvious to me that "Cancel" was the right thing to click). Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** python20.wse 2000/09/01 11:45:02 1.11 --- python20.wse 2000/09/01 19:30:26 1.12 *************** *** 51,61 **** item: End Block end ! remarked item: Check Configuration ! Message=Sorry, but we can not install Python on your system unless you have Administrator Privileges. ! Message= ! Message=Please log on as an Administrator, and start the installation again. ! Title=Must have administrator rights ! Flags=01011111 end item: Set Variable Variable=APPTITLE --- 51,66 ---- item: End Block end ! item: Check Configuration ! Flags=10011111 ! end ! item: Display Message ! Title=Doing non-admin install ! Text=The current login does not have Administrator Privileges on this machine. Python will install its registry information into the per-user area only for the current login, instead of into the per-machine area for every account on this machine. Some advanced uses of Python may not work as a result (for example, running a Python script as a service). ! Text= ! Text=If this is not what you want, please click Cancel to abort this installation, log on as an Administrator, and start the installation again. ! Flags=00001000 end + item: End Block + end item: Set Variable Variable=APPTITLE *************** *** 1017,1027 **** end item: Else Statement - end - item: Display Message - Title=Doing non-admin install - Text=The current login does not have Administrator Privileges on this machine. Python will install its registry information into the per-user area only for the current login, instead of into the per-machine area for every account on this machine. Some advanced uses of Python may not work as a result (for example, running a Python script as a service). - Text= - Text=If this is not what you want, please log on as an Administrator, and start the installation again. - Flags=00001000 end item: Edit Registry --- 1022,1025 ---- From python-dev@python.org Fri Sep 1 20:51:16 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 12:51:16 -0700 Subject: [Python-checkins] CVS: python/dist/src LICENSE,1.1,1.2 Message-ID: <200009011951.MAA25884@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv25875 Modified Files: LICENSE Log Message: Tentative license. Could still change for the 2.0b1 release and will definitely change for the 2.0 final release. Index: LICENSE =================================================================== RCS file: /cvsroot/python/python/dist/src/LICENSE,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** LICENSE 2000/08/02 02:35:08 1.1 --- LICENSE 2000/09/01 19:51:14 1.2 *************** *** 1 **** ! # Placeholder for license information. --- 1,103 ---- ! HISTORY OF THE SOFTWARE ! ======================= ! ! Python was created in the early 1990s by Guido van Rossum at Stichting ! Mathematisch Centrum (CWI) in the Netherlands as a successor of a ! language called ABC. Guido is Python's principal author, although it ! includes many contributions by others. The last version released from ! CWI was Python 1.2. In 1995, Guido continued his work on Python at ! the Corporation for National Research Initiatives (CNRI) in Reston, ! Virginia where he released several versions of the software. Python ! 1.6 was the last of the versions released by CNRI. In 2000, Guido and ! the Python core developement team moved to BeOpen.com to form tbe ! BeOpen PythonLabs group. Python 2.0 is a derivative work of Python ! 1.6, developed by PythonLabs and many outside volunteers, under ! Guido's direction. ! ! ! TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON 2.0 ! ================================================================ ! ! BEOPEN LICENSE AGREEMENT ! ------------------------ ! ! BEOPEN OPEN SOURCE LICENSE AGREEMENT ! ! 1. This LICENSE AGREEMENT is between BeOpen.com, having an office at ! 160 Saratoga Avenue, Santa Clara, CA 95051 ("BeOpen"), and the ! Individual or Organization ("Licensee") accessing and otherwise using ! this software in source or binary form and its associated ! documentation ("the Software"). ! ! 2. Subject to the terms and conditions of this License Agreement, ! BeOpen hereby grants Licensee a non-exclusive, royalty-free, ! world-wide license to reproduce, analyze, test, perform and/or display ! publicly, prepare derivative works, distribute, and otherwise use the ! Software alone or in any derivative version, provided, however, that ! BeOpen's License Agreement is retained in the Software, alone or in ! any derivative version prepared by Licensee. ! ! 3. BeOpen is making the Software available to Licensee on an "AS IS" ! basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR ! IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND ! DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS ! FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT ! INFRINGE ANY THIRD PARTY RIGHTS. ! ! 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE ! SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS ! AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY ! DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. ! ! 5. This License Agreement will automatically terminate upon a material ! breach of its terms and conditions. ! ! 6. This License Agreement shall be governed by and interpreted in all ! respects by the law of the State of California, excluding conflict of ! law provisions. Nothing in this License Agreement shall be deemed to ! create any relationship of agency, partnership, or joint venture ! between BeOpen and Licensee. This License Agreement does not grant ! permission to use BeOpen trademarks or trade name in a trademark sense ! to endorse or promote products or services of Licensee, or any third ! party. The "BeOpen Python" logos may be downloaded and used according ! to the permissions granted on the logo download page. ! ! 7. By copying, installing or otherwise using the software, Licensee ! agrees to be bound by the terms and conditions of this License ! Agreement. ! ! ! CNRI LICENSE AGREEMENT ! ---------------------- ! ! Python 1.6 is made available subject to the terms and conditions in ! CNRI's License Agreement. This Agreement may be located on the ! Internet using the following unique, persistent identifier (known as a ! handle): 1895.22/1011. This Agreement may also be obtained from a ! proxy server on the Internet using the ! URL:http://hdl.handle.net/1895.22/1011" ! ! ! ! CWI PERMISSIONS STATEMENT AND DISCLAIMER ! ---------------------------------------- ! ! Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, ! The Netherlands. All rights reserved. ! ! Permission to use, copy, modify, and distribute this software and its ! documentation for any purpose and without fee is hereby granted, ! provided that the above copyright notice appear in all copies and that ! both that copyright notice and this permission notice appear in ! supporting documentation, and that the name of Stichting Mathematisch ! Centrum or CWI not be used in advertising or publicity pertaining to ! distribution of the software without specific, written prior ! permission. ! ! STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO ! THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND ! FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE ! FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT ! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. From python-dev@python.org Fri Sep 1 20:59:14 2000 From: python-dev@python.org (Tim Peters) Date: Fri, 1 Sep 2000 12:59:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.12,1.13 Message-ID: <200009011959.MAA26562@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/PCbuild In directory slayer.i.sourceforge.net:/tmp/cvs-serv26383/python/dist/src/pcbuild Modified Files: python20.wse Log Message: Install LICENSE.txt and README.txt. In the Welcome dialog: Reworded reference to non-existent "Exit Setup" button. Removed useless "Back" button. Changed "push" to "click". Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** python20.wse 2000/09/01 19:30:26 1.12 --- python20.wse 2000/09/01 19:59:11 1.13 *************** *** 140,154 **** end item: Push Button - Rectangle=105 187 150 202 - Variable=DISABLED - Value=! - Create Flags=01010000000000010000000000000000 - Text=< &Back - Text French=< &Retour - Text German=< &Zurück - Text Spanish=< &Atrás - Text Italian=< &Indietro - end - item: Push Button Rectangle=211 186 256 201 Action=3 --- 140,143 ---- *************** *** 165,169 **** Text=This installation program will install %APPTITLE% on your system. Text= ! Text=Press the Next button to start the installation. You can press the Exit Setup button now if you do not want to install %APPTITLE% at this time. Text French=Ce programme d'installation va installer %APPTITLE%. Text French= --- 154,158 ---- Text=This installation program will install %APPTITLE% on your system. Text= ! Text=Click the Next button to start the installation. Click the Cancel button now if you do not want to install %APPTITLE% at this time. Text French=Ce programme d'installation va installer %APPTITLE%. Text French= *************** *** 655,658 **** --- 644,657 ---- Value=D Flags=00001010 + end + item: Install File + Source=%_SRC_%\LICENSE + Destination=%MAINDIR%\LICENSE.txt + Flags=0000000000000010 + end + item: Install File + Source=%_SRC_%\README + Destination=%MAINDIR%\README.txt + Flags=0000000000000010 end item: Install File From python-dev@python.org Fri Sep 1 21:04:27 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 13:04:27 -0700 Subject: [Python-checkins] CVS: python/dist/src LICENSE,1.1.2.6,1.1.2.7 Message-ID: <200009012004.NAA27893@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv27867 Modified Files: Tag: cnri-16-start LICENSE Log Message: New 1.6 license text as Kahn currently wants it. I'm just checking this in so I can get it off my TO-DO list; I won't release 1.6 final until the license is approved by the FSF as GPL-compatible. Index: LICENSE =================================================================== RCS file: /cvsroot/python/python/dist/src/LICENSE,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -r1.1.2.6 -r1.1.2.7 *** LICENSE 2000/08/14 17:05:10 1.1.2.6 --- LICENSE 2000/09/01 20:04:23 1.1.2.7 *************** *** 16,26 **** ! 1. CNRI LICENSE AGREEMENT - PYTHON 1.6 - CNRI OPEN SOURCE LICENSE AGREEMENT - - IMPORTANT: PLEASE READ THE FOLLOWING AGREEMENT CAREFULLY. --- 16,22 ---- ! 1. CNRI OPEN SOURCE LICENSE AGREEMENT IMPORTANT: PLEASE READ THE FOLLOWING AGREEMENT CAREFULLY. *************** *** 32,60 **** Research Initiatives, having an office at 1895 Preston White Drive, Reston, VA 20191 ("CNRI"), and the Individual or Organization ! ("Licensee") accessing and otherwise using Python 1.6 software ! in source or binary form and its associated documentation, as released ! at the www.python.org Internet site on August 4, 2000 ("Python ! 1.6"). 2. Subject to the terms and conditions of this License Agreement, CNRI ! hereby grants Licensee a non-exclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python 1.6 alone or in any derivative version, provided, however, that CNRI's ! License Agreement is retained in Python 1.6, alone or in any ! derivative version prepared by Licensee. Alternately, in lieu of CNRI's License Agreement, Licensee may ! substitute the following text (omitting the quotes): "Python 1.6, is made available subject to the terms and conditions in CNRI's License ! Agreement. This Agreement may be located on the Internet using the ! following unique, persistent identifier (known as a handle): ! 1895.22/1011. This Agreement may also be obtained from a proxy server ! on the Internet using the URL:http://hdl.handle.net/1895.22/1011". 3. In the event Licensee prepares a derivative work that is based on ! or incorporates Python 1.6 or any part thereof, and wants to make ! the derivative work available to the public as provided herein, then ! Licensee hereby agrees to indicate in any such work the nature of the modifications made to Python 1.6. --- 28,58 ---- Research Initiatives, having an office at 1895 Preston White Drive, Reston, VA 20191 ("CNRI"), and the Individual or Organization ! ("Licensee") accessing and otherwise using Python 1.6 software in ! source or binary form and its associated documentation, as released at ! the www.python.org Internet site on ("Python 1.6"). 2. Subject to the terms and conditions of this License Agreement, CNRI ! hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use Python 1.6 alone or in any derivative version, provided, however, that CNRI's ! License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) ! 1995-2000 Corporation for National Research Initiatives; All Rights ! Reserved" are retained in Python 1.6 alone or in any derivative ! version prepared by Licensee. Alternately, in lieu of CNRI's License Agreement, Licensee may ! substitute the following text (omitting the quotes): "Python 1.6 is made available subject to the terms and conditions in CNRI's License ! Agreement. This Agreement together with Python 1.6 may be located on ! the Internet using the following unique, persistent identifier (known ! as a handle): 1895.22/1012. This Agreement may also be obtained from a ! proxy server on the Internet using the following URL: ! http://hdl.handle.net/1895.22/1012". 3. In the event Licensee prepares a derivative work that is based on ! or incorporates Python 1.6 or any part thereof, and wants to make the ! derivative work available to others as provided herein, then Licensee ! hereby agrees to indicate in any such work the nature of the modifications made to Python 1.6. *************** *** 66,73 **** INFRINGE ANY THIRD PARTY RIGHTS. ! 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE ! SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS ! AS A RESULT OF USING, MODIFYING OR DISTRIBUTING PYTHON 1.6, OR ANY ! DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material --- 64,71 ---- INFRINGE ANY THIRD PARTY RIGHTS. ! 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON ! 1.6 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A ! RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6, OR ! ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material From python-dev@python.org Fri Sep 1 21:33:29 2000 From: python-dev@python.org (Jeremy Hylton) Date: Fri, 1 Sep 2000 13:33:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pycodegen.py,1.22,1.23 transformer.py,1.12,1.13 Message-ID: <200009012033.NAA05811@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory slayer.i.sourceforge.net:/tmp/cvs-serv5706/compiler Modified Files: pycodegen.py transformer.py Log Message: Update magic number. Fix import support to work with import as variant of Python 2.0. The grammar for import changed, requiring changes in transformer and code generator, even to handle compilation of imports with as. Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** pycodegen.py 2000/08/12 20:32:46 1.22 --- pycodegen.py 2000/09/01 20:33:26 1.23 *************** *** 2,5 **** --- 2,6 ---- import marshal import stat + import string import struct import types *************** *** 45,49 **** marshal.dump(self.code, f) ! MAGIC = (50811 | (ord('\r')<<16) | (ord('\n')<<24)) def getPycHeader(self): --- 46,50 ---- marshal.dump(self.code, f) ! MAGIC = (50823 | (ord('\r')<<16) | (ord('\n')<<24)) def getPycHeader(self): *************** *** 421,437 **** def visitImport(self, node): self.set_lineno(node) ! for name in node.names: self.emit('IMPORT_NAME', name) ! self.storeName(name) def visitFrom(self, node): self.set_lineno(node) self.emit('IMPORT_NAME', node.modname) ! for name in node.names: if name == '*': self.namespace = 0 self.emit('IMPORT_FROM', name) self.emit('POP_TOP') def visitGetattr(self, node): self.visit(node.expr) --- 422,451 ---- def visitImport(self, node): self.set_lineno(node) ! for name, alias in node.names: ! self.emit('LOAD_CONST', None) self.emit('IMPORT_NAME', name) ! self._resolveDots(name) ! self.storeName(alias or name) def visitFrom(self, node): self.set_lineno(node) + fromlist = map(lambda (name, alias): name, node.names) + self.emit('LOAD_CONST', tuple(fromlist)) self.emit('IMPORT_NAME', node.modname) ! for name, alias in node.names: if name == '*': self.namespace = 0 self.emit('IMPORT_FROM', name) + self._resolveDots(name) + self.storeName(alias or name) self.emit('POP_TOP') + def _resolveDots(self, name): + elts = string.split(name, ".") + if len(elts) == 1: + return + for elt in elts[1:]: + self.emit('LOAD_ATTR', elt) + def visitGetattr(self, node): self.visit(node.expr) *************** *** 788,797 **** def visitImport(self, node): ! for name in node.names: ! self.names.add(name) def visitFrom(self, node): ! for name in node.names: ! self.names.add(name) def visitClass(self, node): --- 802,811 ---- def visitImport(self, node): ! for name, alias in node.names: ! self.names.add(alias or name) def visitFrom(self, node): ! for name, alias in node.names: ! self.names.add(alias or name) def visitClass(self, node): Index: transformer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/transformer.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** transformer.py 2000/08/04 16:54:54 1.12 --- transformer.py 2000/09/01 20:33:26 1.13 *************** *** 403,413 **** def import_stmt(self, nodelist): ! # import: dotted_name (',' dotted_name)* | ! # from: dotted_name 'import' ('*' | NAME (',' NAME)*) ! names = [ ] ! if nodelist[0][1][0] == 'f': for i in range(3, len(nodelist), 2): ! # note: nodelist[i] could be (token.STAR, '*') or (token.NAME, name) ! names.append(nodelist[i][1]) n = Node('from', self.com_dotted_name(nodelist[1]), names) n.lineno = nodelist[0][2] --- 403,414 ---- def import_stmt(self, nodelist): ! # import_stmt: 'import' dotted_as_name (',' dotted_as_name)* | ! # from: 'from' dotted_name 'import' ! # ('*' | import_as_name (',' import_as_name)*) ! names = [] ! is_as = 0 ! if nodelist[0][1] == 'from': for i in range(3, len(nodelist), 2): ! names.append(self.com_import_as_name(nodelist[i][1])) n = Node('from', self.com_dotted_name(nodelist[1]), names) n.lineno = nodelist[0][2] *************** *** 415,419 **** for i in range(1, len(nodelist), 2): ! names.append(self.com_dotted_name(nodelist[i])) n = Node('import', names) n.lineno = nodelist[0][2] --- 416,420 ---- for i in range(1, len(nodelist), 2): ! names.append(self.com_dotted_as_name(nodelist[i])) n = Node('import', names) n.lineno = nodelist[0][2] *************** *** 739,742 **** --- 740,744 ---- raise error, 'illegal node passed to com_node: %s' % node[0] + # print "dispatch", self._dispatch[node[0]].__name__, node return self._dispatch[node[0]](node[1:]) *************** *** 814,817 **** --- 816,835 ---- name = name + n[1] + '.' return name[:-1] + + def com_dotted_as_name(self, node): + dot = self.com_dotted_name(node[1]) + if len(node) == 2: + return dot, None + assert node[2][1] == 'as' + assert node[3][0] == token.NAME + return dot, node[3][1] + + def com_import_as_name(self, node): + if node[0] == token.NAME: + return node[1], None + assert len(node) == 4 + assert node[2][1] == 'as' + assert node[3][0] == token.NAME + return node[1][1], node[3][1] def com_bases(self, node): From python-dev@python.org Fri Sep 1 21:36:37 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 13:36:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc python.man,1.14,1.15 Message-ID: <200009012036.NAA06111@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv6096 Modified Files: python.man Log Message: Clean up a bit. Drop -X option, update date, remove documentation URLs, add various useful URLs. Update address and email. Drop PSA and copyright. Add license info. Index: python.man =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/python.man,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** python.man 2000/06/30 23:50:38 1.14 --- python.man 2000/09/01 20:36:34 1.15 *************** *** 1,3 **** ! .TH PYTHON "1" "20 August, 1999" .SH NAME python \- an interpreted, interactive, object-oriented programming language --- 1,3 ---- ! .TH PYTHON "1" "5 September, 2000" .SH NAME python \- an interpreted, interactive, object-oriented programming language *************** *** 25,34 **** .B \-v ] - .br - [ - .B \-x - ] [ ! .B \-X ] .br --- 25,30 ---- .B \-v ] [ ! .B \-x ] .br *************** *** 53,58 **** Finally, the Python Reference Manual describes the syntax and semantics of the core language in (perhaps too) much detail. ! (Information on locating these documents is included in ! .B "SEE ALSO" below; they may be installed on your system as well.) .PP --- 49,54 ---- Finally, the Python Reference Manual describes the syntax and semantics of the core language in (perhaps too) much detail. ! (These documents may be located via the ! .B "INTERNET RESOURCES" below; they may be installed on your system as well.) .PP *************** *** 109,117 **** be off by one! .TP - .B \-X - Make the standard exceptions strings instead of classes. - Use for backward compatibility with old code only. This is not - necessary for most uses of string exceptions. - .TP .BI "\-c " command Specify the command to execute (see next section). --- 105,108 ---- *************** *** 145,150 **** to be able to access it). If no script name is given, ! .I sys.argv ! is empty; if .B \-c is used, --- 136,141 ---- to be able to access it). If no script name is given, ! .I sys.argv[0] ! is an empty string; if .B \-c is used, *************** *** 245,299 **** If this is set to a non-empty string it is equivalent to specifying the \fB\-v\fP option. - .SH SEE ALSO - .IP "Python Tutorial" - URL: http://www.python.org/doc/tut/tut.html - .IP "Python Library Reference" - URL: http://www.python.org/doc/lib/lib.html - .IP "Python Reference Manual" - URL: http://www.python.org/doc/ref/ref.html - .IP "Extending and Embedding the Python Interpreter" - URL: http://www.python.org/doc/ext/ext.html - .IP "Python/C API" - URL: http://www.python.org/doc/api/api.html - .PP - Downloadable versions of these documents in many formats are available - at the Python website; see \fB\INTERNET RESOURCES\fP below. .SH AUTHOR .nf Guido van Rossum ! CNRI ! 1895 Preston White Drive ! Reston, VA 20191 USA .PP ! E-mail: guido@cnri.reston.va.us, guido@python.org .fi .PP And a cast of thousands. .SH INTERNET RESOURCES ! Web site: http://www.python.org .br ! FTP site: ftp://ftp.python.org .br Newsgroups: comp.lang.python, comp.lang.python.announce ! .PP ! There are many mirror sites; a current list is available at ! http://www.python.org/mirrors.html. ! .PP ! The \fI\Python Software Activity\fP provides many mailing lists which ! serve various special interests within the Python community; ! information on these special interest groups is available at ! http://www.python.org/sigs/. ! .SH COPYRIGHT ! Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, ! The Netherlands. ! .IP " " ! All Rights Reserved ! .PP ! Copyright (c) 2000, BeOpen.com. ! Copyright (c) 1995-2000, Corporation for National Research Initiatives. ! Copyright (c) 1990-1995, Stichting Mathematisch Centrum. ! All rights reserved. ! ! See the file "Misc/COPYRIGHT" for information on usage and ! redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. --- 236,270 ---- If this is set to a non-empty string it is equivalent to specifying the \fB\-v\fP option. .SH AUTHOR .nf Guido van Rossum ! BeOpen.com ! 160 Saratoga Avenue ! Santa Clara, CA 95051 USA .PP ! E-mail: guido@beopen.com, guido@python.org .fi .PP And a cast of thousands. .SH INTERNET RESOURCES ! Main website: http://www.python.org .br ! BeOpen development team: http://pythonlabs.com .br + Community website: http://starship.python.net + .br + Developer resources: + .br + http://sourceforge.net/project/?group_id=5470 + .br + FTP: ftp://ftp.python.org/pub/python + .br + Module repository: http://www.vex.net/parnassus/ + .br Newsgroups: comp.lang.python, comp.lang.python.announce ! .SH LICENSING ! Python is distributed under an Open Source license. See the file ! "LICENSE" in the Python source distribution for information on terms & ! conditions for accessing and otherwise using Python and for a ! DISCLAIMER OF ALL WARRANTIES. From python-dev@python.org Fri Sep 1 21:38:57 2000 From: python-dev@python.org (Tim Peters) Date: Fri, 1 Sep 2000 13:38:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_popen2.py,1.3,1.4 Message-ID: <200009012038.NAA06233@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/test In directory slayer.i.sourceforge.net:/tmp/cvs-serv5897/python/dist/src/lib/test Modified Files: test_popen2.py Log Message: The "more" cmd varies across Windows flavors, sometimes adding stray newlines at the start or end. Fiddle test_popen2 and popen2._test() to tolerate this. Also change all "assert"s in these tests to raise explicit exceptions, so that python -O doesn't render them useless. Also, in case of error, make the msg display the reprs of what we wrote and what we read, so we can tell exactly why it's failing. Index: test_popen2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_popen2.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** test_popen2.py 2000/08/28 17:20:05 1.3 --- test_popen2.py 2000/09/01 20:38:55 1.4 *************** *** 29,42 **** import popen2 cmd = "cat" ! teststr = "abc\n" ! resultstr = teststr if os.name == "nt": cmd = "more" ! resultstr = "\n" + resultstr print "testing popen2..." w, r = os.popen2(cmd) w.write(teststr) w.close() ! assert r.read() == resultstr print "testing popen3..." try: --- 29,46 ---- import popen2 cmd = "cat" ! teststr = "ab cd\n" if os.name == "nt": cmd = "more" ! # "more" doesn't act the same way across Windows flavors, ! # sometimes adding an extra newline at the start or the ! # end. So we strip whitespace off both ends for comparison. ! expected = teststr.strip() print "testing popen2..." w, r = os.popen2(cmd) w.write(teststr) w.close() ! got = r.read() ! if got.strip() != expected: ! raise ValueError("wrote %s read %s" % (`teststr`, `got`)) print "testing popen3..." try: *************** *** 46,54 **** w.write(teststr) w.close() ! assert r.read() == resultstr ! assert e.read() == "" for inst in popen2._active[:]: inst.wait() ! assert not popen2._active print "All OK" --- 50,63 ---- w.write(teststr) w.close() ! got = r.read() ! if got.strip() != expected: ! raise ValueError("wrote %s read %s" % (`teststr`, `got`)) ! got = e.read() ! if got: ! raise ValueError("unexected %s on stderr" % `got`) for inst in popen2._active[:]: inst.wait() ! if popen2._active: ! raise ValueError("_active not empty") print "All OK" From python-dev@python.org Fri Sep 1 21:38:57 2000 From: python-dev@python.org (Tim Peters) Date: Fri, 1 Sep 2000 13:38:57 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib popen2.py,1.14,1.15 Message-ID: <200009012038.NAA06234@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv5897/python/dist/src/lib Modified Files: popen2.py Log Message: The "more" cmd varies across Windows flavors, sometimes adding stray newlines at the start or end. Fiddle test_popen2 and popen2._test() to tolerate this. Also change all "assert"s in these tests to raise explicit exceptions, so that python -O doesn't render them useless. Also, in case of error, make the msg display the reprs of what we wrote and what we read, so we can tell exactly why it's failing. Index: popen2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/popen2.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** popen2.py 2000/08/28 17:20:04 1.14 --- popen2.py 2000/09/01 20:38:54 1.15 *************** *** 144,157 **** def _test(): cmd = "cat" ! teststr = "abc\n" ! resultstr = teststr if os.name == "nt": cmd = "more" ! resultstr = "\n" + resultstr print "testing popen2..." r, w = popen2(cmd) w.write(teststr) w.close() ! assert r.read() == resultstr print "testing popen3..." try: --- 144,161 ---- def _test(): cmd = "cat" ! teststr = "ab cd\n" if os.name == "nt": cmd = "more" ! # "more" doesn't act the same way across Windows flavors, ! # sometimes adding an extra newline at the start or the ! # end. So we strip whitespace off both ends for comparison. ! expected = teststr.strip() print "testing popen2..." r, w = popen2(cmd) w.write(teststr) w.close() ! got = r.read() ! if got.strip() != expected: ! raise ValueError("wrote %s read %s" % (`teststr`, `got`)) print "testing popen3..." try: *************** *** 161,169 **** w.write(teststr) w.close() ! assert r.read() == resultstr ! assert e.read() == "" for inst in _active[:]: inst.wait() ! assert not _active print "All OK" --- 165,178 ---- w.write(teststr) w.close() ! got = r.read() ! if got.strip() != expected: ! raise ValueError("wrote %s read %s" % (`teststr`, `got`)) ! got = e.read() ! if got: ! raise ValueError("unexected %s on stderr" % `got`) for inst in _active[:]: inst.wait() ! if _active: ! raise ValueError("_active not empty") print "All OK" From python-dev@python.org Fri Sep 1 21:47:40 2000 From: python-dev@python.org (Jeremy Hylton) Date: Fri, 1 Sep 2000 13:47:40 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/compiler/compiler pyassem.py,1.10,1.11 pycodegen.py,1.23,1.24 Message-ID: <200009012047.NAA07014@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Tools/compiler/compiler In directory slayer.i.sourceforge.net:/tmp/cvs-serv6990/compiler Modified Files: pyassem.py pycodegen.py Log Message: patch by Neil Schemenauer to improve (fix?) line number generation Index: pyassem.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pyassem.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** pyassem.py 2000/08/12 20:32:46 1.10 --- pyassem.py 2000/09/01 20:47:37 1.11 *************** *** 420,438 **** addr = self.codeOffset - self.lastoff line = lineno - self.lastline ! while addr > 0 or line > 0: ! # write the values in 1-byte chunks that sum ! # to desired value ! trunc_addr = addr ! trunc_line = line ! if trunc_addr > 255: ! trunc_addr = 255 ! if trunc_line > 255: ! trunc_line = 255 ! self.lnotab.append(trunc_addr) ! self.lnotab.append(trunc_line) ! addr = addr - trunc_addr ! line = line - trunc_line ! self.lastline = lineno ! self.lastoff = self.codeOffset def getCode(self): --- 420,449 ---- addr = self.codeOffset - self.lastoff line = lineno - self.lastline ! # Python assumes that lineno always increases with ! # increasing bytecode address (lnotab is unsigned char). ! # Depending on when SET_LINENO instructions are emitted ! # this is not always true. Consider the code: ! # a = (1, ! # b) ! # In the bytecode stream, the assignment to "a" occurs ! # after the loading of "b". This works with the C Python ! # compiler because it only generates a SET_LINENO instruction ! # for the assignment. ! if line > 0: ! while addr > 0 or line > 0: ! # write the values in 1-byte chunks that sum ! # to desired value ! trunc_addr = addr ! trunc_line = line ! if trunc_addr > 255: ! trunc_addr = 255 ! if trunc_line > 255: ! trunc_line = 255 ! self.lnotab.append(trunc_addr) ! self.lnotab.append(trunc_line) ! addr = addr - trunc_addr ! line = line - trunc_line ! self.lastline = lineno ! self.lastoff = self.codeOffset def getCode(self): Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/compiler/compiler/pycodegen.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** pycodegen.py 2000/09/01 20:33:26 1.23 --- pycodegen.py 2000/09/01 20:47:37 1.24 *************** *** 71,74 **** --- 71,75 ---- self.curStack = 0 self.maxStack = 0 + self.last_lineno = None self._setupGraphDelegation() *************** *** 108,112 **** def set_lineno(self, node): ! """Emit SET_LINENO if node has lineno attribute Returns true if SET_LINENO was emitted. --- 109,114 ---- def set_lineno(self, node): ! """Emit SET_LINENO if node has lineno attribute and it is ! different than the last lineno emitted. Returns true if SET_LINENO was emitted. *************** *** 118,123 **** """ lineno = getattr(node, 'lineno', None) ! if lineno is not None: self.emit('SET_LINENO', lineno) return 1 return 0 --- 120,126 ---- """ lineno = getattr(node, 'lineno', None) ! if lineno is not None and lineno != self.last_lineno: self.emit('SET_LINENO', lineno) + self.last_lineno = lineno return 1 return 0 *************** *** 415,418 **** --- 418,422 ---- def visitName(self, node): + self.set_lineno(node) self.loadName(node.name) From python-dev@python.org Fri Sep 1 21:48:00 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 13:48:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules threadmodule.c,2.37,2.38 Message-ID: <200009012048.NAA07043@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv7036 Modified Files: threadmodule.c Log Message: The second argument to start_new_thread() is not a tuple, as pointed out by Curtis Jensen on c.l.py and forwarded by Fredrik Lundh. Index: threadmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/threadmodule.c,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -r2.37 -r2.38 *** threadmodule.c 2000/08/03 02:34:44 2.37 --- threadmodule.c 2000/09/01 20:47:58 2.38 *************** *** 222,226 **** thread_PyThread_start_new_thread(PyObject *self, PyObject *fargs) { ! PyObject *func, *args = NULL, *keyw = NULL; struct bootstate *boot; --- 222,226 ---- thread_PyThread_start_new_thread(PyObject *self, PyObject *fargs) { ! PyObject *func, *args, *keyw = NULL; struct bootstate *boot; *************** *** 234,238 **** if (!PyTuple_Check(args)) { PyErr_SetString(PyExc_TypeError, ! "optional 2nd arg must be a tuple"); return NULL; } --- 234,238 ---- if (!PyTuple_Check(args)) { PyErr_SetString(PyExc_TypeError, ! "2nd arg must be a tuple"); return NULL; } From python-dev@python.org Fri Sep 1 22:52:53 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 01 Sep 2000 16:52:53 -0500 Subject: [Python-checkins] CVS: python/dist/src/Modules threadmodule.c,2.37,2.38 In-Reply-To: Your message of "Fri, 01 Sep 2000 13:48:00 MST." <200009012048.NAA07043@slayer.i.sourceforge.net> References: <200009012048.NAA07043@slayer.i.sourceforge.net> Message-ID: <200009012152.QAA08211@cj20424-a.reston1.va.home.com> > Modified Files: > threadmodule.c > Log Message: > The second argument to start_new_thread() is not a tuple, as pointed > out by Curtis Jensen on c.l.py and forwarded by Fredrik Lundh. Sigh. I meant "is not optional", not "is not a tuple". Sorry. --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/) From python-dev@python.org Fri Sep 1 23:17:34 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 15:17:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc COPYRIGHT,1.6,NONE Message-ID: <200009012217.PAA31352@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv31294 Removed Files: COPYRIGHT Log Message: Deleted. This information is now in ../LICENSE. --- COPYRIGHT DELETED --- From python-dev@python.org Fri Sep 1 23:26:54 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 15:26:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc HISTORY,1.7,1.8 Message-ID: <200009012226.PAA11081@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv10966 Modified Files: HISTORY Log Message: Moved NEWS from 1.5.2 here. Index: HISTORY =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/HISTORY,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** HISTORY 1998/12/21 21:41:14 1.7 --- HISTORY 2000/09/01 22:26:44 1.8 *************** *** 9,12 **** --- 9,2346 ---- + From 1.5.2c1 to 1.5.2 (final) + ============================= + + Tue Apr 13 15:44:49 1999 Guido van Rossum + + * PCbuild/python15.wse: Bump version to 1.5.2 (final) + [...2309 lines suppressed...] + - Reformatted abstract.c to give it a more familiar "look" and fixed + many error checking bugs. + + - Add NULL pointer checks to all calls of a C function through a type + object and extensions (e.g. nb_add). + + - The code that initializes sys.path now calls Py_GetPythonHome() + instead of getenv("PYTHONHOME"). This, together with the new API + Py_SetPythonHome(), makes it easier for embedding applications to + change the notion of Python's "home" directory (where the libraries + etc. are sought). + + - Fixed a very old bug in the parsing of "O?" format specifiers. + + + ====================================================================== + + From 1.5 to 1.5.1 ================= From python-dev@python.org Fri Sep 1 23:33:35 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 15:33:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.51,1.51.4.1 Message-ID: <200009012233.PAA17567@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv17514 Modified Files: Tag: cnri-16-start NEWS Log Message: Remove the 1.5.2 news. 1.6 news is still to be done. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.51 retrieving revision 1.51.4.1 diff -C2 -r1.51 -r1.51.4.1 *** NEWS 1999/04/13 15:52:45 1.51 --- NEWS 2000/09/01 22:33:33 1.51.4.1 *************** *** 2,6 **** =========================== ! Below is a list of all relevant changes since release 1.5.1. Older changes are in the file HISTORY. The most recent changes are listed first. --- 2,6 ---- =========================== ! Below is a list of all relevant changes since release 1.5.2. Older changes are in the file HISTORY. The most recent changes are listed [...2335 lines suppressed...] - - - The code that initializes sys.path now calls Py_GetPythonHome() - instead of getenv("PYTHONHOME"). This, together with the new API - Py_SetPythonHome(), makes it easier for embedding applications to - change the notion of Python's "home" directory (where the libraries - etc. are sought). - - - Fixed a very old bug in the parsing of "O?" format specifiers. ====================================================================== --- 11,18 ---- credit, let me know and I'll add you to the list! ====================================================================== + ====================================================================== From python-dev@python.org Fri Sep 1 23:34:35 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 15:34:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.51,1.52 Message-ID: <200009012234.PAA18536@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv18490 Modified Files: NEWS Log Message: Remove the 1.5.2 news. 2.0 news is still to be done. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -r1.51 -r1.52 *** NEWS 1999/04/13 15:52:45 1.51 --- NEWS 2000/09/01 22:34:33 1.52 *************** *** 2,6 **** =========================== ! Below is a list of all relevant changes since release 1.5.1. Older changes are in the file HISTORY. The most recent changes are listed first. --- 2,6 ---- =========================== ! Below is a list of all relevant changes since release 1.6. Older changes are in the file HISTORY. The most recent changes are listed [...2335 lines suppressed...] - - - The code that initializes sys.path now calls Py_GetPythonHome() - instead of getenv("PYTHONHOME"). This, together with the new API - Py_SetPythonHome(), makes it easier for embedding applications to - change the notion of Python's "home" directory (where the libraries - etc. are sought). - - - Fixed a very old bug in the parsing of "O?" format specifiers. ====================================================================== --- 11,18 ---- credit, let me know and I'll add you to the list! ====================================================================== + ====================================================================== From python-dev@python.org Fri Sep 1 23:50:04 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 15:50:04 -0700 Subject: [Python-checkins] CVS: python/dist/src README,1.92,1.93 Message-ID: <200009012250.PAA32538@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv32476 Modified Files: README Log Message: Ready to go. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -r1.92 -r1.93 *** README 2000/08/29 21:36:40 1.92 --- README 2000/09/01 22:50:02 1.93 *************** *** 1,14 **** ! This is Python version 2.0 ! ========================== ! There are various beta versions -- these are distinguishable through ! Include/patchlevel.h or by the name of the top-level directory and the ! tar file. What's new in this release? --------------------------- ! See http://www.pythonlabs.com/tech/python2.html . --- 1,31 ---- ! This is Python version 2.0 beta 1 ! ================================= ! Copyright (c) 2000 BeOpen.com. ! All rights reserved. + Copyright (c) 1995-2000 Corporation for National Research Initiatives. + All rights reserved. + Copyright (c) 1991-1995, Stichting Mathematisch Centrum. + All rights reserved. + + License information + ------------------- + + See the file "LICENSE" for information on terms & conditions for + accessing and otherwise using this software, and for a DISCLAIMER OF + ALL WARRANTIES. + + The Python distribution is *not* affected by the GNU Public Licence + (GPL). There are interfaces to some GNU code but these are entirely + optional and no GNU code is distributed with Python. + + What's new in this release? --------------------------- ! See the file Misc/NEWS; see also this URL: ! http://www.pythonlabs.com/tech/python2.html *************** *** 27,33 **** ---------------------- ! Python is an interpreted object-oriented programming language, and is ! often compared to Tcl, Perl, Java or Scheme. To find out more, point ! your browser to http://www.pythonlabs.com/. --- 44,51 ---- ---------------------- ! Python is an interpreted object-oriented programming language. It is ! often compared to Tcl, Perl, Java, JavaScript, Visual Basic or Scheme. ! To find out more about what Python can do for you, point your browser ! to http://www.pythonlabs.com/. *************** *** 43,58 **** ! Copyright issues ! ---------------- ! Python is COPYRIGHTED but free to use for all. See the full copyright ! notice at the end of this file and in the file Misc/COPYRIGHT. ! The Python distribution is *not* affected by the GNU Public Licence ! (GPL). There are interfaces to some GNU code but these are entirely ! optional and no GNU code is distributed with Python. Build instructions ================== --- 61,141 ---- ! Documentation ! ------------- ! All documentation is provided online in a variety of formats. In ! order of importance for new users: Tutorial, Library Reference, ! Language Reference, Extending & Embedding, and the Python/C API. ! Especially the Library Reference is of immense value since much of ! Python's power (including the built-in data types and functions!) is ! described there. ! All documentation is also available online via the Python web site ! (http://www.python.org/doc/, see below). It is available online for ! occaissional reference, or can be downloaded in many formats for ! faster access. The documents are available in HTML, PostScript, PDF, ! HTML Help, and LaTeX; the LaTeX version is primarily for documentation ! authors or people with special formatting requirements. ! ! ! Web site ! -------- ! ! Python's web site is at http://www.python.org/. The Python core ! development team at BeOpen has its own website at ! http://www.pythonlabs.com/. Come visit us! ! ! ! Newsgroups ! ---------- ! ! Read comp.lang.python, a high-volume discussion newsgroup about ! Python, or comp.lang.python.announce, a low-volume moderated newsgroup ! for Python-related announcements. These are also accessible as ! mailing lists, see the next item. ! ! Archives are accessible via Deja News; the Python website has a ! query form for the archives at http://www.python.org/search/. + Mailing lists + ------------- + + See http://www.python.org/psa/MailingLists.html for an overview of the + many Python related mailing lists. + + + Bug reports + ----------- + + To report or search for bugs, please use the SourceForge Bugs + Tracker at http://sourceforge.net/bugs/?group_id=5470 . + + + Patches and contributions + ------------------------- + + To submit a patch or other contribution, please use the SourceForge + Patch Manager at http://sourceforge.net/patch/?group_id=5470 . + + If you have a proposal to change Python, it's best to submit a Python + Enhancement Proposal (PEP) first. All current PEPs, as well as + guidelines for submitting a new PEP, are here: + http://python.sourceforge.net/peps/. + + + Questions + --------- + + For help, if you can't find it in the manuals or on the web site, it's + best to post to the comp.lang.python or the Python mailing list (see + above). If you specifically don't want to involve the newsgroup or + mailing list, send questions to (a group of + volunteers which does *not* include me). Because of my work and email + volume, I'm often be slow in answering questions sent to me directly; + I prefer to answer questions posted to the newsgroup. + + Build instructions ================== *************** *** 622,643 **** ==================== - Documentation - ------------- - - All documentation is provided online in a variety of formats. In - order of importance for new users: Tutorial, Library Reference, - Language Reference, Extending & Embedding, and the Python/C API. - Especially the Library Reference is of immense value since much of - Python's power (including the built-in data types and functions!) is - described there. - - All documentation is also available online via the Python web site - (http://www.python.org/doc/, see below). It is available online for - occaissional reference, or can be downloaded in many formats for - faster access. The documents are available in HTML, PostScript, PDF, - HTML Help, and LaTeX; the LaTeX version is primarily for documentation - authors or people with special formatting requirements. - - Emacs mode ---------- --- 705,708 ---- *************** *** 645,717 **** There's an excellent Emacs editing mode for Python code; see the file Misc/python-mode.el. Originally written by the famous Tim Peters, it ! is now maintained by the equally famous Barry Warsaw ! . The latest version, along with various other ! contributed Python-related Emacs goodies, is online at ! . And if you are planning to ! edit the Python C code, please pick up the latest version of CC Mode ! ; it contains a "python" style ! used throughout most of the Python C source files. (Newer versions of ! Emacs or XEmacs may already come with the latest version of ! python-mode.) - Web site - -------- - - Python's web site is at http://www.python.org/. The Python core - development team at BeOpen has its own website at - http://www.pythonlabs.com/. Come visit us! - - - Newsgroups - ---------- - - Read comp.lang.python, a high-volume discussion newsgroup about - Python, or comp.lang.python.announce, a low-volume moderated newsgroup - for Python-related announcements. These are also accessible as - mailing lists, see the next item. - - Archives are accessible via Deja News; the Python website has a - query form for the archives at http://www.python.org/search/. - - - Mailing lists - ------------- - - See http://www.python.org/psa/MailingLists.html for an overview of the - many Python related mailing lists. - - - Bug reports - ----------- - - To report or search for bugs, please use the SourceForge Bugs - Tracker at http://sourceforge.net/bugs/?group_id=5470 . - - - Patches and contributions - ------------------------- - - To submit a patch or other contribution, please use the SourceForge - Patch Manager at http://sourceforge.net/patch/?group_id=5470 . - - If you have a proposal to change Python, it's best to submit a Python - Enhancement Proposal (PEP) first. All current PEPs, as well as - guidelines for submitting a new PEP, are here: - http://python.sourceforge.net/peps/. - - - Questions - --------- - - For help, if you can't find it in the manuals or on the web site, it's - best to post to the comp.lang.python or the Python mailing list (see - above). If you specifically don't want to involve the newsgroup or - mailing list, send questions to (a group of - volunteers which does *not* include me). Because of my work and email - volume, I'm often be slow in answering questions sent to me directly; - I prefer to answer questions posted to the newsgroup. - - The Tk interface ---------------- --- 710,723 ---- There's an excellent Emacs editing mode for Python code; see the file Misc/python-mode.el. Originally written by the famous Tim Peters, it ! is now maintained by the equally famous Barry Warsaw. The latest ! version, along with various other contributed Python-related Emacs ! goodies, is online at . And ! if you are planning to edit the Python C code, please pick up the ! latest version of CC Mode ; it ! contains a "python" style used throughout most of the Python C source ! files. (Newer versions of Emacs or XEmacs may already come with the ! latest version of python-mode.) The Tk interface ---------------- *************** *** 741,745 **** Note that there's a Python module called "Tkinter" (capital T) which ! lives in Lib/tkinter/Tkinter.py, and a C module called "_tkinter" (lower case t and leading underscore) which lives in Modules/_tkinter.c. Demos and normal Tk applications only import the --- 747,751 ---- Note that there's a Python module called "Tkinter" (capital T) which ! lives in Lib/lib-tk/Tkinter.py, and a C module called "_tkinter" (lower case t and leading underscore) which lives in Modules/_tkinter.c. Demos and normal Tk applications only import the *************** *** 761,767 **** --- 767,777 ---- comments. + .cvsignore Additional filename matching patterns for CVS to ignore + BeOS/ Files specific to the BeOS port Demo/ Demonstration scripts, modules and programs + Doc/ Documentation sources (LaTeX) Grammar/ Input for the parser generator Include/ Public header files + LICENSE Licensing information Lib/ Python library modules Makefile.in Source from which config.status creates Makefile *************** *** 769,782 **** Modules/ Implementation of most built-in modules Objects/ Implementation of most built-in object types ! PC/ PC porting files (DOS, Windows, OS/2) ! PCbuild/ Directory where you should build for Windows NT/95 Parser/ The parser and tokenizer and their input handling Python/ The "compiler" and interpreter README The file you're reading now Tools/ Some useful programs written in Python ! acconfig.h Additional input for the autoheader program ! config.h.in Source from which config.status creates config.h configure Configuration shell script (GNU autoconf output) ! configure.in Configuration specification (GNU autoconf input) install-sh Shell script used to install files --- 779,792 ---- Modules/ Implementation of most built-in modules Objects/ Implementation of most built-in object types ! PC/ Files specific to PC ports (DOS, Windows, OS/2) ! PCbuild/ Build directory for Microsoft Visual C++ Parser/ The parser and tokenizer and their input handling Python/ The "compiler" and interpreter README The file you're reading now Tools/ Some useful programs written in Python ! acconfig.h Additional input for the GNU autoheader program ! config.h.in Source from which config.h is created (GNU autoheader output) configure Configuration shell script (GNU autoconf output) ! configure.in Configuration specification (input for GNU autoconf) install-sh Shell script used to install files *************** *** 785,809 **** Makefile Build rules ! config.cache cache of configuration variables config.h Configuration header config.log Log from last configure run config.status Status from last run of configure script libpython2.0.a The library archive python The executable interpreter tags, TAGS Tags files for vi and Emacs - - - How to reach the author - ======================= - - Guido van Rossum - BeOpen.com - 160 Saratoga Avenue, Suite 46 - Santa Clara, CA 95051 - - E-mail: guido@beopen.com or guido@python.org ! --Guido van Rossum (home page: http://www.python.org/~guido/) --- 795,812 ---- Makefile Build rules ! buildno Keeps track of the build number ! config.cache Cache of configuration variables config.h Configuration header config.log Log from last configure run config.status Status from last run of configure script + getbuildinfo.o Object file from Modules/getbuildinfo.c libpython2.0.a The library archive python The executable interpreter tags, TAGS Tags files for vi and Emacs + That's all, folks! + ------------------ ! --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/) From python-dev@python.org Sat Sep 2 00:12:15 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:12:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc Fixcprt.py,1.3,NONE Message-ID: <200009012312.QAA26816@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv26728 Removed Files: Fixcprt.py Log Message: Deleted. This is obsoleted by Tools/scripts/fixnotice.py. --- Fixcprt.py DELETED --- From python-dev@python.org Sat Sep 2 00:15:41 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:15:41 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc RENAME,1.7,NONE Message-ID: <200009012315.QAA32005@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv31930 Removed Files: RENAME Log Message: Deleted; this is ancient info. --- RENAME DELETED --- From python-dev@python.org Sat Sep 2 00:16:43 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:16:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc bugrelease.txt,3.1,NONE wetsign.txt,3.1,NONE Message-ID: <200009012316.QAA00724@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv678 Removed Files: bugrelease.txt wetsign.txt Log Message: Deleted. We no longer require disclaimers on contributions. --- bugrelease.txt DELETED --- --- wetsign.txt DELETED --- From python-dev@python.org Sat Sep 2 00:18:25 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:18:25 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc ccpy-style.el,1.24,NONE Message-ID: <200009012318.QAA02460@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv2411 Removed Files: ccpy-style.el Log Message: Deleted. Long obsolete. --- ccpy-style.el DELETED --- From python-dev@python.org Sat Sep 2 00:21:06 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:21:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc legalfaq.txt,3.1,NONE Message-ID: <200009012321.QAA05086@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv5044 Removed Files: legalfaq.txt Log Message: Delete too. --- legalfaq.txt DELETED --- From python-dev@python.org Sat Sep 2 00:22:15 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:22:15 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc README,1.13,1.14 Message-ID: <200009012322.QAA06260@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv6212 Modified Files: README Log Message: Updated to include all files here. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/README,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** README 1998/08/10 16:38:58 1.13 --- README 2000/09/01 23:22:12 1.14 *************** *** 14,20 **** BLURB A quick description of Python for newcomers BLURB.LUTZ A testimonial from a converted Tcl/Perl hacker :-) ! COPYRIGHT The Python copyright notice ! FAQ (deleted -- see http://www.python.org for the online FAQ) ! Fixcprt.py Fix the copyright message (a yearly chore :-) HISTORY News from previous releases -- oldest last HPUX-NOTES Notes about dynamic loading under HP-UX --- 14,18 ---- BLURB A quick description of Python for newcomers BLURB.LUTZ A testimonial from a converted Tcl/Perl hacker :-) ! BLURB.WINDOWS First announcement of Python for Windows HISTORY News from previous releases -- oldest last HPUX-NOTES Notes about dynamic loading under HP-UX *************** *** 23,31 **** --- 21,34 ---- Makefile.pre.in Generic Makefile template for building extensions NEWS News for this release + NEXT-NOTES Porting notes for NeXT + PURIFY.README Information for Purify users Porting Mini-FAQ on porting to new platforms README The file you're reading now RFD Request For Discussion about a Python newsgroup cheatsheet Quick summary of Python by Ken Manheimer + comparisons (Old) comparisons to some other languages editline-fix A news article on how to fix R$'s editline for Python + faq2html FAQ to HTML converter by Ka-Ping Yee + find_recursionlimit.py Script to find a value for sys.maxrecursionlimit fixfuncptrs.sh Shell script to fix function pointer initializers indent.pro GNU indent profile approximating my C style *************** *** 34,36 **** --- 37,40 ---- renumber.py Script to renumber the sections in the FAQ setuid-prog.c C helper program for set-uid Python scripts + unicode.txt Marc-Andre Lemburg's specification of the Unicode API vgrindefs Python configuration for vgrind (a generic pretty printer) From python-dev@python.org Sat Sep 2 00:27:35 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:27:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects abstract.c,2.52,2.53 Message-ID: <200009012327.QAA11287@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Objects In directory slayer.i.sourceforge.net:/tmp/cvs-serv11237 Modified Files: abstract.c Log Message: Rewritten some pieces of PyNumber_InPlaceAdd() for clarity. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.52 retrieving revision 2.53 diff -C2 -r2.52 -r2.53 *** abstract.c 2000/09/01 07:53:25 2.52 --- abstract.c 2000/09/01 23:27:32 2.53 *************** *** 811,836 **** if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__iadd__", &x, ! PyNumber_Add, 0) <= 0) return x; } ! else if (HASINPLACE(v) ! && ((v->ob_type->tp_as_sequence != NULL && ! (f = v->ob_type->tp_as_sequence->sq_inplace_concat) ! != NULL) ! || (v->ob_type->tp_as_number != NULL && ! (f = v->ob_type->tp_as_number->nb_inplace_add) != NULL))) ! return (*f)(v, w); BINOP(v, w, "__add__", "__radd__", PyNumber_Add); ! if (v->ob_type->tp_as_sequence != NULL && ! (f = v->ob_type->tp_as_sequence->sq_concat) != NULL) ! return (*f)(v, w); ! else if (v->ob_type->tp_as_number != NULL) { if (PyNumber_Coerce(&v, &w) != 0) return NULL; ! if (v->ob_type->tp_as_number != NULL && ! (f = v->ob_type->tp_as_number->nb_add) != NULL) ! x = (*f)(v, w); Py_DECREF(v); Py_DECREF(w); --- 811,841 ---- if (PyInstance_Check(v)) { if (PyInstance_HalfBinOp(v, w, "__iadd__", &x, ! PyNumber_Add, 0) <= 0) return x; } ! else if (HASINPLACE(v)) { ! if (v->ob_type->tp_as_sequence != NULL) ! f = v->ob_type->tp_as_sequence->sq_inplace_concat; ! if (f == NULL && v->ob_type->tp_as_number != NULL) ! f = v->ob_type->tp_as_number->nb_inplace_add; ! if (f != NULL) ! return (*f)(v, w); ! } BINOP(v, w, "__add__", "__radd__", PyNumber_Add); ! if (v->ob_type->tp_as_sequence != NULL) { ! f = v->ob_type->tp_as_sequence->sq_concat; ! if (f != NULL) ! return (*f)(v, w); ! } ! if (v->ob_type->tp_as_number != NULL) { if (PyNumber_Coerce(&v, &w) != 0) return NULL; ! if (v->ob_type->tp_as_number != NULL) { ! f = v->ob_type->tp_as_number->nb_add; ! if (f != NULL) ! x = (*f)(v, w); ! } Py_DECREF(v); Py_DECREF(w); From python-dev@python.org Sat Sep 2 00:29:30 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:29:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/PC config.c,1.27,1.28 getpathp.c,1.19,1.20 Message-ID: <200009012329.QAA13141@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/PC In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117/PC Modified Files: config.c getpathp.c Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: config.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/config.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** config.c 2000/07/22 19:25:51 1.27 --- config.c 2000/09/01 23:29:27 1.28 *************** *** 1,12 **** - /* -*- C -*- *********************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ - /* Module configuration */ --- 1,2 ---- Index: getpathp.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/getpathp.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** getpathp.c 2000/07/22 23:59:33 1.19 --- getpathp.c 2000/09/01 23:29:27 1.20 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Return the initial module search path. */ --- 1,2 ---- From python-dev@python.org Sat Sep 2 00:29:30 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:29:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/PC/os2vacpp getpathp.c,1.9,1.10 Message-ID: <200009012329.QAA13140@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/PC/os2vacpp In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117/PC/os2vacpp Modified Files: getpathp.c Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: getpathp.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2vacpp/getpathp.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** getpathp.c 2000/07/22 23:59:33 1.9 --- getpathp.c 2000/09/01 23:29:28 1.10 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Return the initial module search path. */ --- 1,2 ---- From python-dev@python.org Sat Sep 2 00:29:31 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:29:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/modulator/Templates copyright,1.4,1.5 Message-ID: <200009012329.QAA13185@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Tools/modulator/Templates In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117/Tools/modulator/Templates Modified Files: copyright Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: copyright =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/modulator/Templates/copyright,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** copyright 2000/06/30 23:58:06 1.4 --- copyright 2000/09/01 23:29:29 1.5 *************** *** 1,9 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ --- 0 ---- From python-dev@python.org Sat Sep 2 00:29:31 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:29:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts fixnotice.py,1.3,1.4 Message-ID: <200009012329.QAA13189@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Tools/scripts In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117/Tools/scripts Modified Files: fixnotice.py Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: fixnotice.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/fixnotice.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** fixnotice.py 2000/06/30 23:50:40 1.3 --- fixnotice.py 2000/09/01 23:29:29 1.4 *************** *** 1,23 **** #! /usr/bin/env python ! OLD_NOTICE = """ ! Permission to use, copy, modify, and distribute this software and its ! documentation for any purpose and without fee is hereby granted, ! provided that the above copyright notice appear in all copies and that ! both that copyright notice and this permission notice appear in ! supporting documentation, and that the names of Stichting Mathematisch ! Centrum or CWI not be used in advertising or publicity pertaining to ! distribution of the software without specific, written prior permission. ! ! STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO ! THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND ! FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE ! FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ! WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ! ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT ! OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ! """ ! ! NEW_NOTICE = """ Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. --- 1,5 ---- #! /usr/bin/env python ! OLD_NOTICE = """/*********************************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. *************** *** 27,31 **** --- 9,16 ---- See the file "Misc/COPYRIGHT" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. + ******************************************************************/ """ + + NEW_NOTICE = "" # " <-- Help Emacs From python-dev@python.org Sat Sep 2 00:29:32 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:29:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Parser acceler.c,2.16,2.17 assert.h,2.9,2.10 bitset.c,2.10,2.11 firstsets.c,2.11,2.12 grammar.c,2.18,2.19 grammar1.c,2.11,2.12 intrcheck.c,2.41,2.42 listnode.c,2.13,2.14 metagrammar.c,2.10,2.11 myreadline.c,2.23,2.24 node.c,2.13,2.14 parser.c,2.16,2.17 parser.h,2.13,2.14 parsetok.c,2.24,2.25 pgen.c,2.17,2.18 pgen.h,2.12,2.13 pgenmain.c,2.21,2.22 printgrammar.c,2.12,2.13 tokenizer.c,2.48,2.49 tokenizer.h,2.15,2.16 Message-ID: <200009012329.QAA13243@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Parser In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117/Parser Modified Files: acceler.c assert.h bitset.c firstsets.c grammar.c grammar1.c intrcheck.c listnode.c metagrammar.c myreadline.c node.c parser.c parser.h parsetok.c pgen.c pgen.h pgenmain.c printgrammar.c tokenizer.c tokenizer.h Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: acceler.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/acceler.c,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -r2.16 -r2.17 *** acceler.c 2000/07/22 19:20:54 2.16 --- acceler.c 2000/09/01 23:29:28 2.17 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Parser accelerator module */ --- 1,2 ---- Index: assert.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/assert.h,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -r2.9 -r2.10 *** assert.h 2000/06/30 23:58:05 2.9 --- assert.h 2000/09/01 23:29:28 2.10 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifdef MPW /* This is for MPW's File command */ --- 5,8 ---- Index: bitset.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/bitset.c,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -r2.10 -r2.11 *** bitset.c 2000/07/22 19:20:54 2.10 --- bitset.c 2000/09/01 23:29:28 2.11 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Bitset primitives used by the parser generator */ --- 1,2 ---- Index: firstsets.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/firstsets.c,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -r2.11 -r2.12 *** firstsets.c 2000/07/22 19:20:54 2.11 --- firstsets.c 2000/09/01 23:29:28 2.12 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Computation of FIRST stets */ --- 1,2 ---- Index: grammar.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/grammar.c,v retrieving revision 2.18 retrieving revision 2.19 diff -C2 -r2.18 -r2.19 *** grammar.c 2000/08/24 20:11:31 2.18 --- grammar.c 2000/09/01 23:29:28 2.19 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Grammar implementation */ --- 1,2 ---- Index: grammar1.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/grammar1.c,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -r2.11 -r2.12 *** grammar1.c 2000/07/22 19:20:54 2.11 --- grammar1.c 2000/09/01 23:29:28 2.12 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Grammar subroutines needed by parser */ --- 1,2 ---- Index: intrcheck.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/intrcheck.c,v retrieving revision 2.41 retrieving revision 2.42 diff -C2 -r2.41 -r2.42 *** intrcheck.c 2000/08/27 17:34:07 2.41 --- intrcheck.c 2000/09/01 23:29:28 2.42 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Check for interrupts */ --- 1,2 ---- Index: listnode.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/listnode.c,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -r2.13 -r2.14 *** listnode.c 2000/07/22 19:20:54 2.13 --- listnode.c 2000/09/01 23:29:28 2.14 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* List a node on a file */ --- 1,2 ---- Index: metagrammar.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/metagrammar.c,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -r2.10 -r2.11 *** metagrammar.c 2000/07/22 19:20:54 2.10 --- metagrammar.c 2000/09/01 23:29:28 2.11 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #include "pgenheaders.h" --- 1,2 ---- Index: myreadline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/myreadline.c,v retrieving revision 2.23 retrieving revision 2.24 diff -C2 -r2.23 -r2.24 *** myreadline.c 2000/07/22 19:20:54 2.23 --- myreadline.c 2000/09/01 23:29:28 2.24 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Readline interface for tokenizer.c and [raw_]input() in bltinmodule.c. --- 1,2 ---- Index: node.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/node.c,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -r2.13 -r2.14 *** node.c 2000/08/24 00:32:09 2.13 --- node.c 2000/09/01 23:29:28 2.14 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifdef HAVE_LIMITS_H --- 1,2 ---- Index: parser.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/parser.c,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -r2.16 -r2.17 *** parser.c 2000/07/22 19:20:54 2.16 --- parser.c 2000/09/01 23:29:28 2.17 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Parser implementation */ --- 1,2 ---- Index: parser.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/parser.h,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -r2.13 -r2.14 *** parser.h 2000/07/11 17:52:59 2.13 --- parser.h 2000/09/01 23:29:28 2.14 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Parser interface */ --- 5,8 ---- Index: parsetok.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/parsetok.c,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -r2.24 -r2.25 *** parsetok.c 2000/08/18 05:04:08 2.24 --- parsetok.c 2000/09/01 23:29:28 2.25 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Parser-tokenizer link implementation */ --- 1,2 ---- Index: pgen.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/pgen.c,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -r2.17 -r2.18 *** pgen.c 2000/07/22 19:20:54 2.17 --- pgen.c 2000/09/01 23:29:28 2.18 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Parser generator */ --- 1,2 ---- Index: pgen.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/pgen.h,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** pgen.h 2000/07/09 03:09:56 2.12 --- pgen.h 2000/09/01 23:29:28 2.13 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Parser generator interface */ --- 5,8 ---- Index: pgenmain.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/pgenmain.c,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -r2.21 -r2.22 *** pgenmain.c 2000/07/22 19:20:54 2.21 --- pgenmain.c 2000/09/01 23:29:28 2.22 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Parser generator main program */ --- 1,2 ---- Index: printgrammar.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/printgrammar.c,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** printgrammar.c 2000/07/22 19:20:54 2.12 --- printgrammar.c 2000/09/01 23:29:28 2.13 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Print a bunch of C initializers that represent a grammar */ --- 1,2 ---- Index: tokenizer.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/tokenizer.c,v retrieving revision 2.48 retrieving revision 2.49 diff -C2 -r2.48 -r2.49 *** tokenizer.c 2000/08/24 20:11:31 2.48 --- tokenizer.c 2000/09/01 23:29:28 2.49 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Tokenizer implementation */ --- 1,2 ---- Index: tokenizer.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/tokenizer.h,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -r2.15 -r2.16 *** tokenizer.h 2000/07/09 03:09:56 2.15 --- tokenizer.h 2000/09/01 23:29:28 2.16 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Tokenizer interface */ --- 5,8 ---- From python-dev@python.org Sat Sep 2 00:29:32 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:29:32 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects bufferobject.c,2.12,2.13 classobject.c,2.107,2.108 cobject.c,2.12,2.13 complexobject.c,2.30,2.31 dictobject.c,2.64,2.65 fileobject.c,2.86,2.87 floatobject.c,2.68,2.69 frameobject.c,2.42,2.43 funcobject.c,2.29,2.30 intobject.c,2.48,2.49 listobject.c,2.86,2.87 longobject.c,1.66,1.67 methodobject.c,2.32,2.33 moduleobject.c,2.28,2.29 object.c,2.98,2.99 rangeobject.c,2.19,2.20 stringobject.c,2.85,2.86 tupleobject.c,2.43,2.44 typeobject.c,2.15,2.16 xxobject.c,2.18,2.19 Message-ID: <200009012329.QAA13228@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Objects In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117/Objects Modified Files: bufferobject.c classobject.c cobject.c complexobject.c dictobject.c fileobject.c floatobject.c frameobject.c funcobject.c intobject.c listobject.c longobject.c methodobject.c moduleobject.c object.c rangeobject.c stringobject.c tupleobject.c typeobject.c xxobject.c Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: bufferobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/bufferobject.c,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** bufferobject.c 2000/08/04 15:36:13 2.12 --- bufferobject.c 2000/09/01 23:29:27 2.13 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Buffer object implementation */ --- 1,2 ---- Index: classobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/classobject.c,v retrieving revision 2.107 retrieving revision 2.108 diff -C2 -r2.107 -r2.108 *** classobject.c 2000/09/01 02:47:25 2.107 --- classobject.c 2000/09/01 23:29:27 2.108 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Class object implementation */ --- 1,2 ---- Index: cobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/cobject.c,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** cobject.c 2000/07/09 04:14:42 2.12 --- cobject.c 2000/09/01 23:29:27 2.13 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Wrap void* pointers to be passed between C modules */ --- 1,2 ---- Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.30 retrieving revision 2.31 diff -C2 -r2.30 -r2.31 *** complexobject.c 2000/08/15 03:34:48 2.30 --- complexobject.c 2000/09/01 23:29:27 2.31 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Complex object implementation */ --- 1,2 ---- Index: dictobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/dictobject.c,v retrieving revision 2.64 retrieving revision 2.65 diff -C2 -r2.64 -r2.65 *** dictobject.c 2000/08/31 19:31:38 2.64 --- dictobject.c 2000/09/01 23:29:27 2.65 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Dictionary object implementation using a hash table */ --- 1,2 ---- Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.86 retrieving revision 2.87 diff -C2 -r2.86 -r2.87 *** fileobject.c 2000/08/31 05:18:54 2.86 --- fileobject.c 2000/09/01 23:29:27 2.87 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* File object implementation */ --- 1,2 ---- Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.68 retrieving revision 2.69 diff -C2 -r2.68 -r2.69 *** floatobject.c 2000/08/18 05:00:03 2.68 --- floatobject.c 2000/09/01 23:29:27 2.69 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Float object implementation */ --- 1,2 ---- Index: frameobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/frameobject.c,v retrieving revision 2.42 retrieving revision 2.43 diff -C2 -r2.42 -r2.43 *** frameobject.c 2000/07/09 05:40:56 2.42 --- frameobject.c 2000/09/01 23:29:27 2.43 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Frame object implementation */ --- 1,2 ---- Index: funcobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/funcobject.c,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -r2.29 -r2.30 *** funcobject.c 2000/07/09 06:03:25 2.29 --- funcobject.c 2000/09/01 23:29:27 2.30 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Function object implementation */ --- 1,2 ---- Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.48 retrieving revision 2.49 diff -C2 -r2.48 -r2.49 *** intobject.c 2000/07/16 12:04:31 2.48 --- intobject.c 2000/09/01 23:29:27 2.49 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Integer object implementation */ --- 1,2 ---- Index: listobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/listobject.c,v retrieving revision 2.86 retrieving revision 2.87 diff -C2 -r2.86 -r2.87 *** listobject.c 2000/08/24 20:08:19 2.86 --- listobject.c 2000/09/01 23:29:27 2.87 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* List object implementation */ --- 1,2 ---- Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -r1.66 -r1.67 *** longobject.c 2000/08/15 03:34:48 1.66 --- longobject.c 2000/09/01 23:29:27 1.67 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Long (arbitrary precision) integer object implementation */ --- 1,2 ---- Index: methodobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/methodobject.c,v retrieving revision 2.32 retrieving revision 2.33 diff -C2 -r2.32 -r2.33 *** methodobject.c 2000/07/09 06:03:25 2.32 --- methodobject.c 2000/09/01 23:29:27 2.33 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Method object implementation */ --- 1,2 ---- Index: moduleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/moduleobject.c,v retrieving revision 2.28 retrieving revision 2.29 diff -C2 -r2.28 -r2.29 *** moduleobject.c 2000/07/09 06:03:25 2.28 --- moduleobject.c 2000/09/01 23:29:27 2.29 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Module object implementation */ --- 1,2 ---- Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.98 retrieving revision 2.99 diff -C2 -r2.98 -r2.99 *** object.c 2000/08/30 15:53:50 2.98 --- object.c 2000/09/01 23:29:27 2.99 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Generic object operations; and implementation of None (NoObject) */ --- 1,2 ---- Index: rangeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/rangeobject.c,v retrieving revision 2.19 retrieving revision 2.20 diff -C2 -r2.19 -r2.20 *** rangeobject.c 2000/08/04 03:05:40 2.19 --- rangeobject.c 2000/09/01 23:29:27 2.20 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Range object implementation */ --- 1,2 ---- Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.85 retrieving revision 2.86 diff -C2 -r2.85 -r2.86 *** stringobject.c 2000/08/16 23:41:01 2.85 --- stringobject.c 2000/09/01 23:29:27 2.86 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* String object implementation */ --- 1,2 ---- Index: tupleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v retrieving revision 2.43 retrieving revision 2.44 diff -C2 -r2.43 -r2.44 *** tupleobject.c 2000/07/09 07:04:36 2.43 --- tupleobject.c 2000/09/01 23:29:27 2.44 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Tuple object implementation */ --- 1,2 ---- Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -r2.15 -r2.16 *** typeobject.c 2000/07/09 06:21:27 2.15 --- typeobject.c 2000/09/01 23:29:27 2.16 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Type object implementation */ --- 1,2 ---- Index: xxobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/xxobject.c,v retrieving revision 2.18 retrieving revision 2.19 diff -C2 -r2.18 -r2.19 *** xxobject.c 2000/07/09 07:04:36 2.18 --- xxobject.c 2000/09/01 23:29:27 2.19 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Use this file as a template to start implementing a new object type. --- 1,2 ---- From python-dev@python.org Sat Sep 2 00:29:33 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:29:33 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _tkinter.c,1.110,1.111 almodule.c,1.31,1.32 arraymodule.c,2.54,2.55 audioop.c,1.43,1.44 binascii.c,2.26,2.27 bsddbmodule.c,1.24,1.25 cdmodule.c,1.24,1.25 cgensupport.c,2.14,2.15 cgensupport.h,2.14,2.15 clmodule.c,2.23,2.24 cstubs,2.21,2.22 dbmmodule.c,2.21,2.22 dlmodule.c,2.12,2.13 errnomodule.c,2.14,2.15 fcntlmodule.c,2.25,2.26 flmodule.c,1.44,1.45 fmmodule.c,1.16,1.17 gdbmmodule.c,2.26,2.27 getpath.c,1.29,1.30 glmodule.c,2.8,2.9 grpmodule.c,2.13,2.14 imageop.c,2.24,2.25 imgfile.c,1.27,1.28 main.c,1.42,1.43 mathmodule.c,2.54,2.55 md5module.c,2.23,2.24 mpzmodule.c,2.32,2.33 newmodule.c,2.26,2.27 parsermodule.c,2.55,2.56 pcremodule.c,2.24,2.25 posixmodule.c,2.168,2.169 pwdmodule.c,1.23,1.24 pyexpat.c,2.16,2.17 regexmodule.c,1.39,1.40 resource.c,2.17,2.18 selectmodule.c,2.45,2.46 sgimodule.c,1.15,1.16 shamodule.c,2.11,2.12 signalmodule.c,2.54,2.55 stropmodule.c,2.73,2.74 structmodule.c,2.37,2.38 sunaudiodev.c,1.23,1.24 svmodule.c,2.16,2.17! threadmodule.c,2.38,2.39 timemodule.c,2.102,2.103 xxmodule.c,2.21,2.22 yuv.h,2.7,2.8 yuvconvert.c,2.6,2.7 Message-ID: <200009012329.QAA13287@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117/Modules Modified Files: _tkinter.c almodule.c arraymodule.c audioop.c binascii.c bsddbmodule.c cdmodule.c cgensupport.c cgensupport.h clmodule.c cstubs dbmmodule.c dlmodule.c errnomodule.c fcntlmodule.c flmodule.c fmmodule.c gdbmmodule.c getpath.c glmodule.c grpmodule.c imageop.c imgfile.c main.c mathmodule.c md5module.c mpzmodule.c newmodule.c parsermodule.c pcremodule.c posixmodule.c pwdmodule.c pyexpat.c regexmodule.c resource.c selectmodule.c sgimodule.c shamodule.c signalmodule.c stropmodule.c structmodule.c sunaudiodev.c svmodule.c threadmodule.c timemodule.c xxmodule.c yuv.h yuvconvert.c Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: _tkinter.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -r1.110 -r1.111 *** _tkinter.c 2000/07/31 15:28:04 1.110 --- _tkinter.c 2000/09/01 23:29:26 1.111 *************** *** 1,16 **** /*********************************************************** Copyright (C) 1994 Steen Lumholt. - Copyright 1994-1995 by Stichting Mathematisch Centrum, Amsterdam, - The Netherlands. All Rights Reserved - - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ******************************************************************/ --- 1,6 ---- Index: almodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/almodule.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** almodule.c 2000/09/01 09:01:32 1.31 --- almodule.c 2000/09/01 23:29:26 1.32 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #define OLD_INTERFACE /* define for pre-Irix 6 interface */ --- 1,2 ---- Index: arraymodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/arraymodule.c,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -r2.54 -r2.55 *** arraymodule.c 2000/08/31 05:18:53 2.54 --- arraymodule.c 2000/09/01 23:29:26 2.55 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Array object implementation */ --- 1,2 ---- Index: audioop.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/audioop.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -r1.43 -r1.44 *** audioop.c 2000/08/31 05:07:19 1.43 --- audioop.c 2000/09/01 23:29:26 1.44 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* audioopmodule - Module to detect peak values in arrays */ --- 1,2 ---- Index: binascii.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/binascii.c,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -r2.26 -r2.27 *** binascii.c 2000/08/15 16:41:26 2.26 --- binascii.c 2000/09/01 23:29:26 2.27 *************** *** 1,18 **** - /*********************************************************** - Copyright 1991, 1992, 1993, 1994 by Stichting Mathematisch Centrum, - Amsterdam, The Netherlands. - - All Rights Reserved - - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - ******************************************************************/ - /* ** Routines to represent binary data in ASCII and vice-versa --- 1,2 ---- Index: bsddbmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/bsddbmodule.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** bsddbmodule.c 2000/08/31 16:11:07 1.24 --- bsddbmodule.c 2000/09/01 23:29:26 1.25 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Berkeley DB interface. --- 1,2 ---- Index: cdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cdmodule.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** cdmodule.c 2000/09/01 09:01:32 1.24 --- cdmodule.c 2000/09/01 23:29:26 1.25 *************** *** 1,12 **** - /********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ - /* CD module -- interface to Mark Callow's and Roger Chickering's */ /* CD Audio Library (CD). */ --- 1,2 ---- Index: cgensupport.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cgensupport.c,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** cgensupport.c 2000/07/10 17:04:33 2.14 --- cgensupport.c 2000/09/01 23:29:26 2.15 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Functions used by cgen output */ --- 1,2 ---- Index: cgensupport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cgensupport.h,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** cgensupport.h 2000/07/09 03:09:55 2.14 --- cgensupport.h 2000/09/01 23:29:26 2.15 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Definitions used by cgen output */ --- 5,8 ---- Index: clmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/clmodule.c,v retrieving revision 2.23 retrieving revision 2.24 diff -C2 -r2.23 -r2.24 *** clmodule.c 2000/07/21 06:00:07 2.23 --- clmodule.c 2000/09/01 23:29:26 2.24 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ --- 1,2 ---- Index: cstubs =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cstubs,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -r2.21 -r2.22 *** cstubs 2000/08/18 10:00:28 2.21 --- cstubs 2000/09/01 23:29:26 2.22 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* --- 1,2 ---- Index: dbmmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/dbmmodule.c,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -r2.21 -r2.22 *** dbmmodule.c 2000/07/24 14:43:35 2.21 --- dbmmodule.c 2000/09/01 23:29:26 2.22 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* DBM module using dictionary interface */ --- 1,2 ---- Index: dlmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/dlmodule.c,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** dlmodule.c 2000/07/25 12:56:37 2.12 --- dlmodule.c 2000/09/01 23:29:26 2.13 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* dl module */ --- 1,2 ---- Index: errnomodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/errnomodule.c,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** errnomodule.c 2000/09/01 09:01:32 2.14 --- errnomodule.c 2000/09/01 23:29:26 2.15 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Errno module */ --- 1,2 ---- Index: fcntlmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/fcntlmodule.c,v retrieving revision 2.25 retrieving revision 2.26 diff -C2 -r2.25 -r2.26 *** fcntlmodule.c 2000/09/01 09:01:32 2.25 --- fcntlmodule.c 2000/09/01 23:29:26 2.26 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* fcntl module */ --- 1,2 ---- Index: flmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/flmodule.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -r1.44 -r1.45 *** flmodule.c 2000/07/22 23:57:55 1.44 --- flmodule.c 2000/09/01 23:29:26 1.45 *************** *** 1,12 **** - /********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ - /* FL module -- interface to Mark Overmars' FORMS Library. */ --- 1,2 ---- Index: fmmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/fmmodule.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** fmmodule.c 2000/07/21 06:00:07 1.16 --- fmmodule.c 2000/09/01 23:29:26 1.17 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Font Manager module */ --- 1,2 ---- Index: gdbmmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gdbmmodule.c,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -r2.26 -r2.27 *** gdbmmodule.c 2000/07/24 14:43:35 2.26 --- gdbmmodule.c 2000/09/01 23:29:26 2.27 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* DBM module using dictionary interface */ --- 1,2 ---- Index: getpath.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/getpath.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -r1.29 -r1.30 *** getpath.c 2000/07/22 23:57:55 1.29 --- getpath.c 2000/09/01 23:29:26 1.30 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Return the initial module search path. */ --- 1,2 ---- Index: glmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/glmodule.c,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -r2.8 -r2.9 *** glmodule.c 2000/07/21 06:00:07 2.8 --- glmodule.c 2000/09/01 23:29:26 2.9 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* --- 1,2 ---- Index: grpmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/grpmodule.c,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -r2.13 -r2.14 *** grpmodule.c 2000/07/21 06:00:07 2.13 --- grpmodule.c 2000/09/01 23:29:26 2.14 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* UNIX group file access module */ --- 1,2 ---- Index: imageop.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/imageop.c,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -r2.24 -r2.25 *** imageop.c 2000/07/21 06:00:07 2.24 --- imageop.c 2000/09/01 23:29:26 2.25 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* imageopmodule - Various operations on pictures */ --- 1,2 ---- Index: imgfile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/imgfile.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** imgfile.c 2000/07/21 06:00:07 1.27 --- imgfile.c 2000/09/01 23:29:26 1.28 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* IMGFILE module - Interface to sgi libimage */ --- 1,2 ---- Index: main.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/main.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -r1.42 -r1.43 *** main.c 2000/08/27 19:21:04 1.42 --- main.c 2000/09/01 23:29:26 1.43 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Python interpreter main program */ --- 1,2 ---- Index: mathmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mathmodule.c,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -r2.54 -r2.55 *** mathmodule.c 2000/09/01 09:01:32 2.54 --- mathmodule.c 2000/09/01 23:29:26 2.55 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Math module -- standard C math library functions, pi and e */ --- 1,2 ---- Index: md5module.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/md5module.c,v retrieving revision 2.23 retrieving revision 2.24 diff -C2 -r2.23 -r2.24 *** md5module.c 2000/08/15 05:59:44 2.23 --- md5module.c 2000/09/01 23:29:26 2.24 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* MD5 module */ --- 1,2 ---- Index: mpzmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mpzmodule.c,v retrieving revision 2.32 retrieving revision 2.33 diff -C2 -r2.32 -r2.33 *** mpzmodule.c 2000/09/01 09:01:32 2.32 --- mpzmodule.c 2000/09/01 23:29:26 2.33 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* MPZ module */ --- 1,2 ---- Index: newmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/newmodule.c,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -r2.26 -r2.27 *** newmodule.c 2000/08/03 02:06:16 2.26 --- newmodule.c 2000/09/01 23:29:26 2.27 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Module new -- create new objects of various types */ --- 1,2 ---- Index: parsermodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/parsermodule.c,v retrieving revision 2.55 retrieving revision 2.56 diff -C2 -r2.55 -r2.56 *** parsermodule.c 2000/09/01 09:01:32 2.55 --- parsermodule.c 2000/09/01 23:29:26 2.56 *************** *** 76,88 **** */ - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ static PyObject* --- 76,79 ---- Index: pcremodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pcremodule.c,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -r2.24 -r2.25 *** pcremodule.c 2000/09/01 09:01:32 2.24 --- pcremodule.c 2000/09/01 23:29:27 2.25 *************** *** 1,18 **** - /*********************************************************** - Copyright 1997 by Stichting Mathematisch Centrum, Amsterdam, - The Netherlands. - - All Rights Reserved - - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - ******************************************************************/ - /* Pcre objects */ --- 1,2 ---- Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.168 retrieving revision 2.169 diff -C2 -r2.168 -r2.169 *** posixmodule.c 2000/09/01 19:26:36 2.168 --- posixmodule.c 2000/09/01 23:29:27 2.169 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* POSIX module implementation */ --- 1,2 ---- Index: pwdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pwdmodule.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** pwdmodule.c 2000/08/15 18:52:33 1.23 --- pwdmodule.c 2000/09/01 23:29:27 1.24 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* UNIX password file access module */ --- 1,2 ---- Index: pyexpat.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -r2.16 -r2.17 *** pyexpat.c 2000/08/26 07:38:06 2.16 --- pyexpat.c 2000/09/01 23:29:27 2.17 *************** *** 1,18 **** - /*********************************************************** - Copyright 2000 by Stichting Mathematisch Centrum, Amsterdam, - The Netherlands. - - All Rights Reserved - - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - ******************************************************************/ - #include "Python.h" #include "xmlparse.h" --- 1,2 ---- Index: regexmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/regexmodule.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** regexmodule.c 2000/07/21 06:00:07 1.39 --- regexmodule.c 2000/09/01 23:29:27 1.40 *************** *** 4,16 **** */ - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Regular expression objects */ --- 4,7 ---- Index: resource.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/resource.c,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -r2.17 -r2.18 *** resource.c 2000/07/31 15:28:04 2.17 --- resource.c 2000/09/01 23:29:27 2.18 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #include "Python.h" --- 1,2 ---- Index: selectmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/selectmodule.c,v retrieving revision 2.45 retrieving revision 2.46 diff -C2 -r2.45 -r2.46 *** selectmodule.c 2000/08/31 05:18:53 2.45 --- selectmodule.c 2000/09/01 23:29:27 2.46 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* select - Module containing unix select(2) call. --- 1,2 ---- Index: sgimodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/sgimodule.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** sgimodule.c 2000/07/21 06:00:07 1.15 --- sgimodule.c 2000/09/01 23:29:27 1.16 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* SGI module -- random SGI-specific things */ --- 1,2 ---- Index: shamodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/shamodule.c,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -r2.11 -r2.12 *** shamodule.c 2000/09/01 09:01:32 2.11 --- shamodule.c 2000/09/01 23:29:27 2.12 *************** *** 1,18 **** - /*********************************************************** - Copyright 1999 by Stichting Mathematisch Centrum, Amsterdam, - The Netherlands. - - All Rights Reserved - - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - ******************************************************************/ - /* SHA module */ --- 1,2 ---- Index: signalmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/signalmodule.c,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -r2.54 -r2.55 *** signalmodule.c 2000/08/27 17:33:43 2.54 --- signalmodule.c 2000/09/01 23:29:27 2.55 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Signal module -- many thanks to Lance Ellinghaus */ --- 1,2 ---- Index: stropmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/stropmodule.c,v retrieving revision 2.73 retrieving revision 2.74 diff -C2 -r2.73 -r2.74 *** stropmodule.c 2000/09/01 09:01:32 2.73 --- stropmodule.c 2000/09/01 23:29:27 2.74 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* strop module */ --- 1,2 ---- Index: structmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/structmodule.c,v retrieving revision 2.37 retrieving revision 2.38 diff -C2 -r2.37 -r2.38 *** structmodule.c 2000/07/31 15:28:04 2.37 --- structmodule.c 2000/09/01 23:29:27 2.38 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* struct module -- pack values into and (out of) strings */ --- 1,2 ---- Index: sunaudiodev.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/sunaudiodev.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** sunaudiodev.c 2000/07/24 14:43:35 1.23 --- sunaudiodev.c 2000/09/01 23:29:27 1.24 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Sad objects */ --- 1,2 ---- Index: svmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/svmodule.c,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -r2.16 -r2.17 *** svmodule.c 2000/07/21 06:00:07 2.16 --- svmodule.c 2000/09/01 23:29:27 2.17 *************** *** 1,12 **** - /********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ - /* SV module -- interface to the Indigo video board */ --- 1,2 ---- Index: threadmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/threadmodule.c,v retrieving revision 2.38 retrieving revision 2.39 diff -C2 -r2.38 -r2.39 *** threadmodule.c 2000/09/01 20:47:58 2.38 --- threadmodule.c 2000/09/01 23:29:27 2.39 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Thread module */ --- 1,2 ---- Index: timemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/timemodule.c,v retrieving revision 2.102 retrieving revision 2.103 diff -C2 -r2.102 -r2.103 *** timemodule.c 2000/09/01 09:01:32 2.102 --- timemodule.c 2000/09/01 23:29:27 2.103 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Time module */ --- 1,2 ---- Index: xxmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/xxmodule.c,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -r2.21 -r2.22 *** xxmodule.c 2000/08/19 15:36:41 2.21 --- xxmodule.c 2000/09/01 23:29:27 2.22 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Use this file as a template to start implementing a module that --- 1,2 ---- Index: yuv.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/yuv.h,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -r2.7 -r2.8 *** yuv.h 2000/06/30 23:58:05 2.7 --- yuv.h 2000/09/01 23:29:27 2.8 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifndef Py_YUV_H --- 1,2 ---- Index: yuvconvert.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/yuvconvert.c,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -r2.6 -r2.7 *** yuvconvert.c 2000/06/30 23:58:05 2.6 --- yuvconvert.c 2000/09/01 23:29:27 2.7 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #include "yuv.h" --- 1,2 ---- From python-dev@python.org Sat Sep 2 00:29:35 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:29:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python atof.c,2.6,2.7 bltinmodule.c,2.177,2.178 ceval.c,2.204,2.205 compile.c,2.138,2.139 dynload_aix.c,2.8,2.9 dynload_beos.c,2.4,2.5 dynload_dl.c,2.5,2.6 dynload_hpux.c,2.4,2.5 dynload_mac.c,2.7,2.8 dynload_next.c,2.6,2.7 dynload_os2.c,2.4,2.5 dynload_shlib.c,2.4,2.5 dynload_stub.c,2.3,2.4 dynload_win.c,2.5,2.6 errors.c,2.55,2.56 fmod.c,2.12,2.13 frozen.c,1.8,1.9 frozenmain.c,2.24,2.25 getargs.c,2.44,2.45 getcompiler.c,1.8,1.9 getcopyright.c,1.8,1.9 getcwd.c,1.13,1.14 getmtime.c,2.14,2.15 getplatform.c,1.7,1.8 getversion.c,1.13,1.14 import.c,2.149,2.150 importdl.c,2.67,2.68 importdl.h,2.15,2.16 marshal.c,1.55,1.56 memmove.c,2.7,2.8 modsupport.c,2.50,2.51 mystrtoul.c,2.20,2.21 pystate.c,2.13,2.14 pythonrun.c,2.113,2.114 sigcheck.c,2.7,2.8 strerror.c,2.9,2.10 structmember.c,2.17,2.18 sysmodule.c,2.77,2.78 thread.c,2.33,2.34 thread_beos.h,2.5,2.6 thread_cthread.h,2.12,2.13 thread_foobar.h,2.10,2.11 thread_lwp.h,2.13,2.14 thread_nt.h,2.16,2.17 thr! ead_os2.h,2.9,2.10 thread_pth.h,2.5,2.6 thread_pthread.h,2.29,2.30 thread_sgi.h,2.13,2.14 thread_solaris.h,2.14,2.15 thread_wince.h,2.5,2.6 traceback.c,2.31,2.32 Message-ID: <200009012329.QAA13329@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117/Python Modified Files: atof.c bltinmodule.c ceval.c compile.c dynload_aix.c dynload_beos.c dynload_dl.c dynload_hpux.c dynload_mac.c dynload_next.c dynload_os2.c dynload_shlib.c dynload_stub.c dynload_win.c errors.c fmod.c frozen.c frozenmain.c getargs.c getcompiler.c getcopyright.c getcwd.c getmtime.c getplatform.c getversion.c import.c importdl.c importdl.h marshal.c memmove.c modsupport.c mystrtoul.c pystate.c pythonrun.c sigcheck.c strerror.c structmember.c sysmodule.c thread.c thread_beos.h thread_cthread.h thread_foobar.h thread_lwp.h thread_nt.h thread_os2.h thread_pth.h thread_pthread.h thread_sgi.h thread_solaris.h thread_wince.h traceback.c Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: atof.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/atof.c,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -r2.6 -r2.7 *** atof.c 2000/07/22 18:47:25 2.6 --- atof.c 2000/09/01 23:29:28 2.7 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Just in case you haven't got an atof() around... --- 1,2 ---- Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.177 retrieving revision 2.178 diff -C2 -r2.177 -r2.178 *** bltinmodule.c 2000/08/27 19:21:52 2.177 --- bltinmodule.c 2000/09/01 23:29:28 2.178 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Built-in functions */ --- 1,2 ---- Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.204 retrieving revision 2.205 diff -C2 -r2.204 -r2.205 *** ceval.c 2000/09/01 11:07:19 2.204 --- ceval.c 2000/09/01 23:29:28 2.205 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Execute compiled code */ --- 1,2 ---- Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.138 retrieving revision 2.139 diff -C2 -r2.138 -r2.139 *** compile.c 2000/08/27 20:31:27 2.138 --- compile.c 2000/09/01 23:29:28 2.139 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Compile an expression node to intermediate code */ --- 1,2 ---- Index: dynload_aix.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_aix.c,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -r2.8 -r2.9 *** dynload_aix.c 2000/07/22 23:38:01 2.8 --- dynload_aix.c 2000/09/01 23:29:28 2.9 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Support for dynamic loading of extension modules */ --- 1,2 ---- Index: dynload_beos.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_beos.c,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -r2.4 -r2.5 *** dynload_beos.c 2000/06/30 23:58:06 2.4 --- dynload_beos.c 2000/09/01 23:29:28 2.5 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Support for dynamic loading of extension modules */ --- 1,2 ---- Index: dynload_dl.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_dl.c,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -r2.5 -r2.6 *** dynload_dl.c 2000/07/22 23:38:01 2.5 --- dynload_dl.c 2000/09/01 23:29:28 2.6 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Support for dynamic loading of extension modules */ --- 1,2 ---- Index: dynload_hpux.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_hpux.c,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -r2.4 -r2.5 *** dynload_hpux.c 2000/06/30 23:58:06 2.4 --- dynload_hpux.c 2000/09/01 23:29:28 2.5 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Support for dynamic loading of extension modules */ --- 1,2 ---- Index: dynload_mac.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_mac.c,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -r2.7 -r2.8 *** dynload_mac.c 2000/07/12 17:21:42 2.7 --- dynload_mac.c 2000/09/01 23:29:28 2.8 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Support for dynamic loading of extension modules */ --- 1,2 ---- Index: dynload_next.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_next.c,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -r2.6 -r2.7 *** dynload_next.c 2000/07/16 12:04:32 2.6 --- dynload_next.c 2000/09/01 23:29:28 2.7 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Support for dynamic loading of extension modules */ --- 1,2 ---- Index: dynload_os2.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_os2.c,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -r2.4 -r2.5 *** dynload_os2.c 2000/06/30 23:58:06 2.4 --- dynload_os2.c 2000/09/01 23:29:28 2.5 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Support for dynamic loading of extension modules */ --- 1,2 ---- Index: dynload_shlib.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_shlib.c,v retrieving revision 2.4 retrieving revision 2.5 diff -C2 -r2.4 -r2.5 *** dynload_shlib.c 2000/06/30 23:58:06 2.4 --- dynload_shlib.c 2000/09/01 23:29:28 2.5 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Support for dynamic loading of extension modules */ --- 1,2 ---- Index: dynload_stub.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_stub.c,v retrieving revision 2.3 retrieving revision 2.4 diff -C2 -r2.3 -r2.4 *** dynload_stub.c 2000/06/30 23:58:06 2.3 --- dynload_stub.c 2000/09/01 23:29:28 2.4 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* This module provides the necessary stubs for when dynamic loading is --- 1,2 ---- Index: dynload_win.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_win.c,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -r2.5 -r2.6 *** dynload_win.c 2000/06/30 23:58:06 2.5 --- dynload_win.c 2000/09/01 23:29:28 2.6 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Support for dynamic loading of extension modules */ --- 1,2 ---- Index: errors.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v retrieving revision 2.55 retrieving revision 2.56 diff -C2 -r2.55 -r2.56 *** errors.c 2000/09/01 03:49:47 2.55 --- errors.c 2000/09/01 23:29:28 2.56 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Error handling */ --- 1,2 ---- Index: fmod.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/fmod.c,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** fmod.c 2000/07/31 15:28:04 2.12 --- fmod.c 2000/09/01 23:29:28 2.13 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Portable fmod(x, y) implementation for systems that don't have it */ --- 1,2 ---- Index: frozen.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/frozen.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** frozen.c 2000/06/30 23:58:06 1.8 --- frozen.c 2000/09/01 23:29:28 1.9 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Dummy frozen modules initializer */ --- 1,2 ---- Index: frozenmain.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/frozenmain.c,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -r2.24 -r2.25 *** frozenmain.c 2000/07/22 23:38:01 2.24 --- frozenmain.c 2000/09/01 23:29:28 2.25 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Python interpreter main program for frozen scripts */ --- 1,2 ---- Index: getargs.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v retrieving revision 2.44 retrieving revision 2.45 diff -C2 -r2.44 -r2.45 *** getargs.c 2000/08/05 21:29:58 2.44 --- getargs.c 2000/09/01 23:29:28 2.45 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* New getargs implementation */ --- 1,2 ---- Index: getcompiler.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getcompiler.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** getcompiler.c 2000/07/22 18:47:25 1.8 --- getcompiler.c 2000/09/01 23:29:28 1.9 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Return the compiler identification, if possible. */ --- 1,2 ---- Index: getcopyright.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getcopyright.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** getcopyright.c 2000/07/22 18:47:25 1.8 --- getcopyright.c 2000/09/01 23:29:28 1.9 *************** *** 1,18 **** - /*********************************************************** - Copyright 1991-1996 by Stichting Mathematisch Centrum, Amsterdam, - The Netherlands. - - All Rights Reserved - - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - ******************************************************************/ - /* Return the copyright string. This is updated manually. */ --- 1,2 ---- Index: getcwd.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getcwd.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** getcwd.c 2000/07/22 18:47:25 1.13 --- getcwd.c 2000/09/01 23:29:28 1.14 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Two PD getcwd() implementations. --- 1,2 ---- Index: getmtime.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getmtime.c,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** getmtime.c 2000/07/22 18:47:25 2.14 --- getmtime.c 2000/09/01 23:29:28 2.15 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Subroutine to get the last modification time of a file */ --- 1,2 ---- Index: getplatform.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getplatform.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** getplatform.c 2000/07/22 18:47:25 1.7 --- getplatform.c 2000/09/01 23:29:28 1.8 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #include "Python.h" --- 1,2 ---- Index: getversion.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getversion.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** getversion.c 2000/07/22 18:47:25 1.13 --- getversion.c 2000/09/01 23:29:28 1.14 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Return the full version string. */ --- 1,2 ---- Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.149 retrieving revision 2.150 diff -C2 -r2.149 -r2.150 *** import.c 2000/08/27 20:31:27 2.149 --- import.c 2000/09/01 23:29:28 2.150 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Module definition and import implementation */ --- 1,2 ---- Index: importdl.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/importdl.c,v retrieving revision 2.67 retrieving revision 2.68 diff -C2 -r2.67 -r2.68 *** importdl.c 2000/07/22 18:47:25 2.67 --- importdl.c 2000/09/01 23:29:28 2.68 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Support for dynamic loading of extension modules */ --- 1,2 ---- Index: importdl.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/importdl.h,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -r2.15 -r2.16 *** importdl.h 2000/07/09 03:09:56 2.15 --- importdl.h 2000/09/01 23:29:28 2.16 *************** *** 6,18 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Definitions for dynamic loading of extension modules */ --- 6,9 ---- Index: marshal.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/marshal.c,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -r1.55 -r1.56 *** marshal.c 2000/07/23 19:28:35 1.55 --- marshal.c 2000/09/01 23:29:28 1.56 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Write Python objects to files and read them back. --- 1,2 ---- Index: memmove.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/memmove.c,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -r2.7 -r2.8 *** memmove.c 2000/07/22 18:47:25 2.7 --- memmove.c 2000/09/01 23:29:28 2.8 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* A perhaps slow but I hope correct implementation of memmove */ --- 1,2 ---- Index: modsupport.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/modsupport.c,v retrieving revision 2.50 retrieving revision 2.51 diff -C2 -r2.50 -r2.51 *** modsupport.c 2000/08/04 14:00:14 2.50 --- modsupport.c 2000/09/01 23:29:28 2.51 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Module support implementation */ --- 1,2 ---- Index: mystrtoul.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/mystrtoul.c,v retrieving revision 2.20 retrieving revision 2.21 diff -C2 -r2.20 -r2.21 *** mystrtoul.c 2000/07/22 18:47:25 2.20 --- mystrtoul.c 2000/09/01 23:29:28 2.21 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #include "Python.h" --- 1,2 ---- Index: pystate.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pystate.c,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -r2.13 -r2.14 *** pystate.c 2000/08/04 21:27:47 2.13 --- pystate.c 2000/09/01 23:29:28 2.14 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Thread and interpreter state structures and their interfaces */ --- 1,2 ---- Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.113 retrieving revision 2.114 diff -C2 -r2.113 -r2.114 *** pythonrun.c 2000/08/31 05:52:44 2.113 --- pythonrun.c 2000/09/01 23:29:28 2.114 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Python interpreter top-level routines, including init/exit */ --- 1,2 ---- Index: sigcheck.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sigcheck.c,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -r2.7 -r2.8 *** sigcheck.c 2000/07/22 18:47:25 2.7 --- sigcheck.c 2000/09/01 23:29:28 2.8 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Sigcheck is similar to intrcheck() but sets an exception when an --- 1,2 ---- Index: strerror.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/strerror.c,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -r2.9 -r2.10 *** strerror.c 2000/07/22 18:47:25 2.9 --- strerror.c 2000/09/01 23:29:28 2.10 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* PD implementation of strerror() for systems that don't have it. --- 1,2 ---- Index: structmember.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/structmember.c,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -r2.17 -r2.18 *** structmember.c 2000/07/22 18:47:25 2.17 --- structmember.c 2000/09/01 23:29:28 2.18 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Map C struct members to Python object attributes */ --- 1,2 ---- Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.77 retrieving revision 2.78 diff -C2 -r2.77 -r2.78 *** sysmodule.c 2000/08/31 19:23:01 2.77 --- sysmodule.c 2000/09/01 23:29:28 2.78 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* System module */ --- 1,2 ---- Index: thread.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread.c,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -r2.33 -r2.34 *** thread.c 2000/07/24 14:39:50 2.33 --- thread.c 2000/09/01 23:29:28 2.34 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Thread package. --- 1,2 ---- Index: thread_beos.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_beos.h,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -r2.5 -r2.6 *** thread_beos.h 2000/06/30 23:58:06 2.5 --- thread_beos.h 2000/09/01 23:29:28 2.6 *************** *** 1,13 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - BeOS thread support by Chris Herborth (chrish@qnx.com) - ******************************************************************/ - #include #include --- 1,2 ---- Index: thread_cthread.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_cthread.h,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** thread_cthread.h 2000/07/22 18:47:25 2.12 --- thread_cthread.h 2000/09/01 23:29:28 2.13 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #include --- 1,2 ---- Index: thread_foobar.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_foobar.h,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -r2.10 -r2.11 *** thread_foobar.h 2000/07/22 18:47:25 2.10 --- thread_foobar.h 2000/09/01 23:29:28 2.11 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* --- 1,2 ---- Index: thread_lwp.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_lwp.h,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -r2.13 -r2.14 *** thread_lwp.h 2000/07/22 23:38:01 2.13 --- thread_lwp.h 2000/09/01 23:29:28 2.14 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #include --- 1,2 ---- Index: thread_nt.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_nt.h,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -r2.16 -r2.17 *** thread_nt.h 2000/08/07 20:16:28 2.16 --- thread_nt.h 2000/09/01 23:29:28 2.17 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* This code implemented by Dag.Gruneau@elsa.preseco.comm.se */ --- 1,2 ---- Index: thread_os2.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_os2.h,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -r2.9 -r2.10 *** thread_os2.h 2000/07/22 18:47:25 2.9 --- thread_os2.h 2000/09/01 23:29:28 2.10 *************** *** 1,18 **** - /*********************************************************** - Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, - The Netherlands. - - All Rights Reserved - - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - - ******************************************************************/ - /* This code implemented by cvale@netcom.com */ --- 1,2 ---- Index: thread_pth.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_pth.h,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -r2.5 -r2.6 *** thread_pth.h 2000/07/22 18:47:25 2.5 --- thread_pth.h 2000/09/01 23:29:28 2.6 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* GNU pth threads interface --- 1,2 ---- Index: thread_pthread.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_pthread.h,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -r2.29 -r2.30 *** thread_pthread.h 2000/08/23 21:33:05 2.29 --- thread_pthread.h 2000/09/01 23:29:28 2.30 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Posix threads interface */ --- 1,2 ---- Index: thread_sgi.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_sgi.h,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -r2.13 -r2.14 *** thread_sgi.h 2000/07/22 18:47:25 2.13 --- thread_sgi.h 2000/09/01 23:29:29 2.14 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifdef WITH_SGI_DL --- 1,2 ---- Index: thread_solaris.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_solaris.h,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** thread_solaris.h 2000/07/22 18:47:25 2.14 --- thread_solaris.h 2000/09/01 23:29:29 2.15 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #include --- 1,2 ---- Index: thread_wince.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_wince.h,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -r2.5 -r2.6 *** thread_wince.h 2000/07/22 18:47:25 2.5 --- thread_wince.h 2000/09/01 23:29:29 2.6 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* This code implemented by Mark Hammond (MHammond@skippinet.com.au) */ --- 1,2 ---- Index: traceback.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/traceback.c,v retrieving revision 2.31 retrieving revision 2.32 diff -C2 -r2.31 -r2.32 *** traceback.c 2000/07/22 18:47:25 2.31 --- traceback.c 2000/09/01 23:29:29 2.32 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Traceback implementation */ --- 1,2 ---- From python-dev@python.org Sat Sep 2 00:29:58 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:29:58 -0700 Subject: [Python-checkins] CVS: python/dist/src Makefile.in,1.99,1.100 Message-ID: <200009012329.QAA13702@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117 Modified Files: Makefile.in Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: Makefile.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.in,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -r1.99 -r1.100 *** Makefile.in 2000/08/31 22:02:46 1.99 --- Makefile.in 2000/09/01 23:29:25 1.100 *************** *** 1,12 **** - ######################################################################## - # Copyright (c) 2000, BeOpen.com. - # Copyright (c) 1995-2000, Corporation for National Research Initiatives. - # Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - # All rights reserved. - # - # See the file "Misc/COPYRIGHT" for information on usage and - # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ######################################################################## - # Top-level Makefile for Python # --- 1,2 ---- From python-dev@python.org Sat Sep 2 00:29:58 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:29:58 -0700 Subject: [Python-checkins] CVS: python/dist/src/BeOS dl_export.h,1.2,1.3 Message-ID: <200009012329.QAA13707@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/BeOS In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117/BeOS Modified Files: dl_export.h Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: dl_export.h =================================================================== RCS file: /cvsroot/python/python/dist/src/BeOS/dl_export.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** dl_export.h 2000/07/01 00:10:03 1.2 --- dl_export.h 2000/09/01 23:29:26 1.3 *************** *** 8,20 **** * * This trivial header is released under the same license as the rest of ! * Python: ! * ! * Copyright (c) 2000, BeOpen.com. ! * Copyright (c) 1995-2000, Corporation for National Research Initiatives. ! * Copyright (c) 1990-1995, Stichting Mathematisch Centrum. ! * All rights reserved. ! * ! * See the file "Misc/COPYRIGHT" for information on usage and ! * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. * * - Chris Herborth (chrish@beoscentral.com) --- 8,12 ---- * * This trivial header is released under the same license as the rest of ! * Python. * * - Chris Herborth (chrish@beoscentral.com) From python-dev@python.org Sat Sep 2 00:30:00 2000 From: python-dev@python.org (Guido van Rossum) Date: Fri, 1 Sep 2000 16:30:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include Python.h,2.26,2.27 bitset.h,2.12,2.13 bufferobject.h,2.5,2.6 ceval.h,2.38,2.39 classobject.h,2.32,2.33 cobject.h,2.9,2.10 compile.h,2.22,2.23 dictobject.h,2.19,2.20 errcode.h,2.13,2.14 eval.h,2.13,2.14 fileobject.h,2.21,2.22 floatobject.h,2.16,2.17 frameobject.h,2.27,2.28 funcobject.h,2.19,2.20 grammar.h,2.14,2.15 import.h,2.26,2.27 intobject.h,2.20,2.21 intrcheck.h,2.8,2.9 listobject.h,2.20,2.21 longintrepr.h,2.10,2.11 longobject.h,2.17,2.18 marshal.h,2.9,2.10 metagrammar.h,2.9,2.10 methodobject.h,2.21,2.22 modsupport.h,2.33,2.34 moduleobject.h,2.16,2.17 node.h,2.17,2.18 object.h,2.64,2.65 objimpl.h,2.26,2.27 opcode.h,2.30,2.31 osdefs.h,2.12,2.13 parsetok.h,2.14,2.15 patchlevel.h,2.38,2.39 pgenheaders.h,2.23,2.24 pydebug.h,2.14,2.15 pyerrors.h,2.40,2.41 pymem.h,2.2,2.3 pyport.h,2.15,2.16 pystate.h,2.12,2.13 pythonrun.h,2.34,2.35 pythread.h,2.16,2.17 rangeobject.h,2.14,2.15 stringobject.h,2.21,2.22 structmember.h,2.15,2.16 sysmodule.h,2.! 21,2.22 token.h,2.17,2.18 traceback.h,2.17,2.18 tupleobject.h,2.23,2.24 Message-ID: <200009012330.QAA13790@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Include In directory slayer.i.sourceforge.net:/tmp/cvs-serv12117/Include Modified Files: Python.h bitset.h bufferobject.h ceval.h classobject.h cobject.h compile.h dictobject.h errcode.h eval.h fileobject.h floatobject.h frameobject.h funcobject.h grammar.h import.h intobject.h intrcheck.h listobject.h longintrepr.h longobject.h marshal.h metagrammar.h methodobject.h modsupport.h moduleobject.h node.h object.h objimpl.h opcode.h osdefs.h parsetok.h patchlevel.h pgenheaders.h pydebug.h pyerrors.h pymem.h pyport.h pystate.h pythonrun.h pythread.h rangeobject.h stringobject.h structmember.h sysmodule.h token.h traceback.h tupleobject.h Log Message: REMOVED all CWI, CNRI and BeOpen copyright markings. This should match the situation in the 1.6b1 tree. Index: Python.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/Python.h,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -r2.26 -r2.27 *** Python.h 2000/07/31 22:19:30 2.26 --- Python.h 2000/09/01 23:29:26 2.27 *************** *** 3,15 **** /* Since this is a "meta-include" file, no #ifdef __cplusplus / extern "C" { */ - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Enable compiler features; switching on C lib defines doesn't work --- 3,6 ---- Index: bitset.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/bitset.h,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** bitset.h 2000/07/08 23:37:28 2.12 --- bitset.h 2000/09/01 23:29:26 2.13 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifndef Py_BITSET_H --- 1,2 ---- Index: bufferobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/bufferobject.h,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -r2.5 -r2.6 *** bufferobject.h 2000/07/09 00:20:36 2.5 --- bufferobject.h 2000/09/01 23:29:26 2.6 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Buffer object interface */ --- 1,2 ---- Index: ceval.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/ceval.h,v retrieving revision 2.38 retrieving revision 2.39 diff -C2 -r2.38 -r2.39 *** ceval.h 2000/09/01 00:01:58 2.38 --- ceval.h 2000/09/01 23:29:26 2.39 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Interface to random parts in ceval.c */ --- 5,8 ---- Index: classobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/classobject.h,v retrieving revision 2.32 retrieving revision 2.33 diff -C2 -r2.32 -r2.33 *** classobject.h 2000/08/24 20:09:45 2.32 --- classobject.h 2000/09/01 23:29:26 2.33 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Class object interface */ --- 1,2 ---- Index: cobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/cobject.h,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -r2.9 -r2.10 *** cobject.h 2000/07/16 12:04:30 2.9 --- cobject.h 2000/09/01 23:29:26 2.10 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* C objects to be exported from one extension module to another. --- 1,2 ---- Index: compile.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/compile.h,v retrieving revision 2.22 retrieving revision 2.23 diff -C2 -r2.22 -r2.23 *** compile.h 2000/07/09 00:20:36 2.22 --- compile.h 2000/09/01 23:29:26 2.23 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Definitions for bytecode */ --- 1,2 ---- Index: dictobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/dictobject.h,v retrieving revision 2.19 retrieving revision 2.20 diff -C2 -r2.19 -r2.20 *** dictobject.h 2000/07/04 17:44:48 2.19 --- dictobject.h 2000/09/01 23:29:26 2.20 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Dictionary object type -- mapping from hashable object to object */ --- 5,8 ---- Index: errcode.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/errcode.h,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -r2.13 -r2.14 *** errcode.h 2000/07/11 19:49:15 2.13 --- errcode.h 2000/09/01 23:29:26 2.14 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Error codes passed around between file input, tokenizer, parser and --- 5,8 ---- Index: eval.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/eval.h,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -r2.13 -r2.14 *** eval.h 2000/07/08 23:37:28 2.13 --- eval.h 2000/09/01 23:29:26 2.14 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Interface to execute compiled code */ --- 1,2 ---- Index: fileobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/fileobject.h,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -r2.21 -r2.22 *** fileobject.h 2000/07/13 23:56:54 2.21 --- fileobject.h 2000/09/01 23:29:26 2.22 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* File object interface */ --- 1,2 ---- Index: floatobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/floatobject.h,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -r2.16 -r2.17 *** floatobject.h 2000/07/09 00:20:36 2.16 --- floatobject.h 2000/09/01 23:29:26 2.17 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Float object interface */ --- 1,2 ---- Index: frameobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/frameobject.h,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -r2.27 -r2.28 *** frameobject.h 2000/07/09 00:20:36 2.27 --- frameobject.h 2000/09/01 23:29:26 2.28 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Frame object interface */ --- 1,2 ---- Index: funcobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/funcobject.h,v retrieving revision 2.19 retrieving revision 2.20 diff -C2 -r2.19 -r2.20 *** funcobject.h 2000/07/09 00:20:36 2.19 --- funcobject.h 2000/09/01 23:29:26 2.20 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Function object interface */ --- 1,2 ---- Index: grammar.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/grammar.h,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** grammar.h 2000/07/24 10:58:31 2.14 --- grammar.h 2000/09/01 23:29:26 2.15 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Grammar interface */ --- 1,2 ---- Index: import.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/import.h,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -r2.26 -r2.27 *** import.h 2000/07/22 23:30:03 2.26 --- import.h 2000/09/01 23:29:26 2.27 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Module definition and import interface */ --- 1,2 ---- Index: intobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/intobject.h,v retrieving revision 2.20 retrieving revision 2.21 diff -C2 -r2.20 -r2.21 *** intobject.h 2000/07/09 00:20:36 2.20 --- intobject.h 2000/09/01 23:29:26 2.21 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Integer object interface */ --- 1,2 ---- Index: intrcheck.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/intrcheck.h,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -r2.8 -r2.9 *** intrcheck.h 2000/07/08 23:37:28 2.8 --- intrcheck.h 2000/09/01 23:29:26 2.9 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifndef Py_INTRCHECK_H --- 1,2 ---- Index: listobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/listobject.h,v retrieving revision 2.20 retrieving revision 2.21 diff -C2 -r2.20 -r2.21 *** listobject.h 2000/07/09 00:20:36 2.20 --- listobject.h 2000/09/01 23:29:26 2.21 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* List object interface */ --- 1,2 ---- Index: longintrepr.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/longintrepr.h,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -r2.10 -r2.11 *** longintrepr.h 2000/07/16 12:04:30 2.10 --- longintrepr.h 2000/09/01 23:29:26 2.11 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* This is published for the benefit of "friend" marshal.c only. */ --- 5,8 ---- Index: longobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/longobject.h,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -r2.17 -r2.18 *** longobject.h 2000/08/18 04:48:56 2.17 --- longobject.h 2000/09/01 23:29:26 2.18 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Long (arbitrary precision) integer object interface */ --- 5,8 ---- Index: marshal.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/marshal.h,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -r2.9 -r2.10 *** marshal.h 2000/07/08 23:37:28 2.9 --- marshal.h 2000/09/01 23:29:26 2.10 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Interface for marshal.c */ --- 1,2 ---- Index: metagrammar.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/metagrammar.h,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -r2.9 -r2.10 *** metagrammar.h 2000/06/30 23:58:04 2.9 --- metagrammar.h 2000/09/01 23:29:26 2.10 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #define MSTART 256 --- 5,8 ---- Index: methodobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/methodobject.h,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -r2.21 -r2.22 *** methodobject.h 2000/08/03 02:28:54 2.21 --- methodobject.h 2000/09/01 23:29:26 2.22 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Method object interface */ --- 1,2 ---- Index: modsupport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/modsupport.h,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -r2.33 -r2.34 *** modsupport.h 2000/07/22 23:30:03 2.33 --- modsupport.h 2000/09/01 23:29:26 2.34 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifndef Py_MODSUPPORT_H --- 1,2 ---- Index: moduleobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/moduleobject.h,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -r2.16 -r2.17 *** moduleobject.h 2000/07/09 00:55:06 2.16 --- moduleobject.h 2000/09/01 23:29:26 2.17 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Module object interface */ --- 1,2 ---- Index: node.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/node.h,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -r2.17 -r2.18 *** node.h 2000/08/24 00:32:09 2.17 --- node.h 2000/09/01 23:29:26 2.18 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Parse tree node interface */ --- 1,2 ---- Index: object.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/object.h,v retrieving revision 2.64 retrieving revision 2.65 diff -C2 -r2.64 -r2.65 *** object.h 2000/08/24 20:09:45 2.64 --- object.h 2000/09/01 23:29:26 2.65 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Object and type object interface */ --- 5,8 ---- Index: objimpl.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/objimpl.h,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -r2.26 -r2.27 *** objimpl.h 2000/08/16 12:27:23 2.26 --- objimpl.h 2000/09/01 23:29:26 2.27 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifndef Py_OBJIMPL_H --- 1,2 ---- Index: opcode.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/opcode.h,v retrieving revision 2.30 retrieving revision 2.31 diff -C2 -r2.30 -r2.31 *** opcode.h 2000/08/24 20:09:45 2.30 --- opcode.h 2000/09/01 23:29:26 2.31 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Instruction opcodes for compiled code */ --- 5,8 ---- Index: osdefs.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/osdefs.h,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** osdefs.h 2000/06/30 23:58:04 2.12 --- osdefs.h 2000/09/01 23:29:26 2.13 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Operating system dependencies */ --- 5,8 ---- Index: parsetok.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/parsetok.h,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** parsetok.h 2000/07/11 17:52:59 2.14 --- parsetok.h 2000/09/01 23:29:26 2.15 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Parser-tokenizer link interface */ --- 1,2 ---- Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.38 retrieving revision 2.39 diff -C2 -r2.38 -r2.39 *** patchlevel.h 2000/06/30 23:58:04 2.38 --- patchlevel.h 2000/09/01 23:29:26 2.39 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Newfangled version identification scheme. --- 1,2 ---- Index: pgenheaders.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pgenheaders.h,v retrieving revision 2.23 retrieving revision 2.24 diff -C2 -r2.23 -r2.24 *** pgenheaders.h 2000/07/31 22:19:30 2.23 --- pgenheaders.h 2000/09/01 23:29:26 2.24 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Include files and extern declarations used by most of the parser. */ --- 5,8 ---- Index: pydebug.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pydebug.h,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** pydebug.h 2000/07/08 23:37:28 2.14 --- pydebug.h 2000/09/01 23:29:26 2.15 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifndef Py_PYDEBUG_H --- 1,2 ---- Index: pyerrors.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyerrors.h,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -r2.40 -r2.41 *** pyerrors.h 2000/09/01 02:47:24 2.40 --- pyerrors.h 2000/09/01 23:29:26 2.41 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Error handling definitions */ --- 5,8 ---- Index: pymem.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pymem.h,v retrieving revision 2.2 retrieving revision 2.3 diff -C2 -r2.2 -r2.3 *** pymem.h 2000/08/13 11:59:08 2.2 --- pymem.h 2000/09/01 23:29:26 2.3 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Lowest-level memory allocation interface */ --- 1,2 ---- Index: pyport.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyport.h,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -r2.15 -r2.16 *** pyport.h 2000/08/18 04:48:18 2.15 --- pyport.h 2000/09/01 23:29:26 2.16 *************** *** 1,10 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ - #ifndef Py_PYPORT_H #define Py_PYPORT_H --- 1,2 ---- Index: pystate.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pystate.h,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -r2.12 -r2.13 *** pystate.h 2000/07/08 23:37:28 2.12 --- pystate.h 2000/09/01 23:29:26 2.13 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Thread and interpreter state structures and their interfaces */ --- 1,2 ---- Index: pythonrun.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v retrieving revision 2.34 retrieving revision 2.35 diff -C2 -r2.34 -r2.35 *** pythonrun.h 2000/08/27 19:19:26 2.34 --- pythonrun.h 2000/09/01 23:29:26 2.35 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Interfaces to parse and execute pieces of python code */ --- 1,2 ---- Index: pythread.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythread.h,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -r2.16 -r2.17 *** pythread.h 2000/07/09 00:55:06 2.16 --- pythread.h 2000/09/01 23:29:26 2.17 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifndef Py_PYTHREAD_H --- 1,2 ---- Index: rangeobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/rangeobject.h,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** rangeobject.h 2000/07/09 00:55:06 2.14 --- rangeobject.h 2000/09/01 23:29:26 2.15 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Range object interface */ --- 1,2 ---- Index: stringobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/stringobject.h,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -r2.21 -r2.22 *** stringobject.h 2000/07/09 00:55:06 2.21 --- stringobject.h 2000/09/01 23:29:26 2.22 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* String object interface */ --- 1,2 ---- Index: structmember.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/structmember.h,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -r2.15 -r2.16 *** structmember.h 2000/07/08 23:37:28 2.15 --- structmember.h 2000/09/01 23:29:26 2.16 *************** *** 5,17 **** #endif - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Interface to map C struct members to Python object attributes */ --- 5,8 ---- Index: sysmodule.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/sysmodule.h,v retrieving revision 2.21 retrieving revision 2.22 diff -C2 -r2.21 -r2.22 *** sysmodule.h 2000/07/22 23:30:03 2.21 --- sysmodule.h 2000/09/01 23:29:26 2.22 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* System module interface */ --- 1,2 ---- Index: token.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/token.h,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -r2.17 -r2.18 *** token.h 2000/08/31 05:09:57 2.17 --- token.h 2000/09/01 23:29:26 2.18 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Token types */ --- 1,2 ---- Index: traceback.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/traceback.h,v retrieving revision 2.17 retrieving revision 2.18 diff -C2 -r2.17 -r2.18 *** traceback.h 2000/07/08 23:37:28 2.17 --- traceback.h 2000/09/01 23:29:26 2.18 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ #ifndef Py_TRACEBACK_H --- 1,2 ---- Index: tupleobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/tupleobject.h,v retrieving revision 2.23 retrieving revision 2.24 diff -C2 -r2.23 -r2.24 *** tupleobject.h 2000/07/09 00:55:06 2.23 --- tupleobject.h 2000/09/01 23:29:26 2.24 *************** *** 1,11 **** - /*********************************************************** - Copyright (c) 2000, BeOpen.com. - Copyright (c) 1995-2000, Corporation for National Research Initiatives. - Copyright (c) 1990-1995, Stichting Mathematisch Centrum. - All rights reserved. - - See the file "Misc/COPYRIGHT" for information on usage and - redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. - ******************************************************************/ /* Tuple object interface */ --- 1,2 ---- From python-dev@python.org Sat Sep 2 08:13:21 2000 From: python-dev@python.org (Thomas Wouters) Date: Sat, 2 Sep 2000 09:13:21 +0200 Subject: [Python-checkins] CVS: python/dist/src/Objects abstract.c,2.52,2.53 In-Reply-To: <200009012327.QAA11287@slayer.i.sourceforge.net>; from gvanrossum@users.sourceforge.net on Fri, Sep 01, 2000 at 04:27:35PM -0700 References: <200009012327.QAA11287@slayer.i.sourceforge.net> Message-ID: <20000902091321.P12695@xs4all.nl> On Fri, Sep 01, 2000 at 04:27:35PM -0700, Guido van Rossum wrote: > Modified Files: > abstract.c > Log Message: > Rewritten some pieces of PyNumber_InPlaceAdd() for clarity. My my, aren't we impatient ? ;-) I was about to check it in last night (together with a bunch of cosmetic cleanups by Vladimir), when I decided to do a cvs update, make distclean, reconfigure, and test the whole thing. And then sleep caught up on me, I'll update, un-collide and checkin Vladimir's changes in a minute (after some more testing ;-) -- Thomas Wouters Hi! I'm a .signature virus! copy me into your .signature file to help me spread! From python-dev@python.org Sat Sep 2 08:44:35 2000 From: python-dev@python.org (Tim Peters) Date: Sat, 2 Sep 2000 00:44:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib sre_parse.py,1.31,1.32 Message-ID: <200009020744.AAA18405@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv18372/python/dist/src/lib Modified Files: sre_parse.py Log Message: SourceForge patch 101396, by an anonymous friend. "sre_parse.py missing '7' in DIGITS" Index: sre_parse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -r1.31 -r1.32 *** sre_parse.py 2000/08/31 22:57:54 1.31 --- sre_parse.py 2000/09/02 07:44:32 1.32 *************** *** 18,22 **** REPEAT_CHARS = "*+?{" ! DIGITS = tuple("012345689") OCTDIGITS = tuple("01234567") --- 18,22 ---- REPEAT_CHARS = "*+?{" ! DIGITS = tuple("0123456789") OCTDIGITS = tuple("01234567") From python-dev@python.org Sat Sep 2 09:34:43 2000 From: python-dev@python.org (Thomas Wouters) Date: Sat, 2 Sep 2000 01:34:43 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects abstract.c,2.53,2.54 Message-ID: <200009020834.BAA30374@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Objects In directory slayer.i.sourceforge.net:/tmp/cvs-serv30096/Objects Modified Files: abstract.c Log Message: Cosmetic cleanup by Vladimir. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.53 retrieving revision 2.54 diff -C2 -r2.53 -r2.54 *** abstract.c 2000/09/01 23:27:32 2.53 --- abstract.c 2000/09/02 08:34:40 2.54 *************** *** 655,663 **** if (PyInstance_Check(v)) { ! if (PyInstance_HalfBinOp(v, w, "__ior__", &x, PyNumber_Or, ! 0) <= 0) return x; ! } else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_or) != NULL) return (*f)(v, w); --- 655,664 ---- if (PyInstance_Check(v)) { ! if (PyInstance_HalfBinOp(v, w, "__ior__", &x, ! PyNumber_Or, 0) <= 0) return x; ! } ! else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_or) != NULL) return (*f)(v, w); *************** *** 686,694 **** if (PyInstance_Check(v)) { ! if (PyInstance_HalfBinOp(v, w, "__ixor__", &x, PyNumber_Xor, ! 0) <= 0) return x; ! } else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_xor) != NULL) return (*f)(v, w); --- 687,696 ---- if (PyInstance_Check(v)) { ! if (PyInstance_HalfBinOp(v, w, "__ixor__", &x, ! PyNumber_Xor, 0) <= 0) return x; ! } ! else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_xor) != NULL) return (*f)(v, w); *************** *** 717,725 **** if (PyInstance_Check(v)) { ! if (PyInstance_HalfBinOp(v, w, "__iand__", &x, PyNumber_And, ! 0) <= 0) return x; ! } else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_and) != NULL) return (*f)(v, w); --- 719,728 ---- if (PyInstance_Check(v)) { ! if (PyInstance_HalfBinOp(v, w, "__iand__", &x, ! PyNumber_And, 0) <= 0) return x; ! } ! else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_and) != NULL) return (*f)(v, w); *************** *** 751,756 **** PyNumber_Lshift, 0) <= 0) return x; ! } else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_lshift) != NULL) return (*f)(v, w); --- 754,760 ---- PyNumber_Lshift, 0) <= 0) return x; ! } ! else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_lshift) != NULL) return (*f)(v, w); *************** *** 782,787 **** PyNumber_Rshift, 0) <= 0) return x; ! } else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_rshift) != NULL) return (*f)(v, w); --- 786,792 ---- PyNumber_Rshift, 0) <= 0) return x; ! } ! else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_rshift) != NULL) return (*f)(v, w); *************** *** 857,862 **** PyNumber_Subtract, 0) <= 0) return x; ! } else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_subtract) != NULL) return (*f)(v, w); --- 862,868 ---- PyNumber_Subtract, 0) <= 0) return x; ! } ! else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_subtract) != NULL) return (*f)(v, w); *************** *** 882,886 **** { PyObject * (*f)(PyObject *, PyObject *) = NULL; ! PyObject * (*f2)(PyObject *, int) = NULL; PyObject *x; --- 888,892 ---- { PyObject * (*f)(PyObject *, PyObject *) = NULL; ! PyObject * (*g)(PyObject *, int) = NULL; PyObject *x; *************** *** 889,897 **** PyNumber_Multiply, 0) <= 0) return x; ! } else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_multiply) != NULL) return (*f)(v, w); else if (v->ob_type->tp_as_sequence != NULL && HASINPLACE(v) && ! (f2 = v->ob_type->tp_as_sequence->sq_inplace_repeat) != NULL) { long mul_value; --- 895,904 ---- PyNumber_Multiply, 0) <= 0) return x; ! } ! else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_multiply) != NULL) return (*f)(v, w); else if (v->ob_type->tp_as_sequence != NULL && HASINPLACE(v) && ! (g = v->ob_type->tp_as_sequence->sq_inplace_repeat) != NULL) { long mul_value; *************** *** 908,923 **** "can't multiply sequence with non-int"); } ! return (*f2)(v, (int)mul_value); } BINOP(v, w, "__mul__", "__rmul__", PyNumber_Multiply); - /* if (tp->tp_as_number != NULL && - w->ob_type->tp_as_sequence != NULL) { */ - /* number*sequence -- swap v and w */ - /* PyObject *tmp = v; - v = w; - w = tmp; - tp = v->ob_type; - } */ if (v->ob_type->tp_as_number != NULL) { if (PyNumber_Coerce(&v, &w) != 0) --- 915,923 ---- "can't multiply sequence with non-int"); } ! return (*g)(v, (int)mul_value); } + BINOP(v, w, "__mul__", "__rmul__", PyNumber_Multiply); if (v->ob_type->tp_as_number != NULL) { if (PyNumber_Coerce(&v, &w) != 0) *************** *** 930,935 **** if (f != NULL) return x; ! } else if (v->ob_type->tp_as_sequence != NULL && ! (f2 = v->ob_type->tp_as_sequence->sq_repeat) != NULL) { long mul_value; --- 930,936 ---- if (f != NULL) return x; ! } ! else if (v->ob_type->tp_as_sequence != NULL && ! (g = v->ob_type->tp_as_sequence->sq_repeat) != NULL) { long mul_value; *************** *** 946,950 **** "can't multiply sequence with non-int"); } ! return (*f2)(v, (int)mul_value); } return type_error("bad operand type(s) for *="); --- 947,951 ---- "can't multiply sequence with non-int"); } ! return (*g)(v, (int)mul_value); } return type_error("bad operand type(s) for *="); *************** *** 961,966 **** PyNumber_Divide, 0) <= 0) return x; ! } else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_divide) != NULL) return (*f)(v, w); --- 962,968 ---- PyNumber_Divide, 0) <= 0) return x; ! } ! else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_divide) != NULL) return (*f)(v, w); *************** *** 992,997 **** PyNumber_Remainder, 0) <= 0) return x; ! } else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_remainder) != NULL) return (*f)(v, w); --- 994,1000 ---- PyNumber_Remainder, 0) <= 0) return x; ! } ! else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_remainder) != NULL) return (*f)(v, w); *************** *** 1029,1034 **** if (PyInstance_HalfBinOp(v, w, "__ipow__", &x, do_pow, 0) <= 0) return x; ! } else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_power) != NULL) return (*f)(v, w, Py_None); --- 1032,1038 ---- if (PyInstance_HalfBinOp(v, w, "__ipow__", &x, do_pow, 0) <= 0) return x; ! } ! else if (v->ob_type->tp_as_number != NULL && HASINPLACE(v) && ! (f = v->ob_type->tp_as_number->nb_inplace_power) != NULL) return (*f)(v, w, Py_None); *************** *** 1065,1069 **** z->ob_type->tp_as_number == NULL || w->ob_type->tp_as_number == NULL) { ! return type_error("(inplace) pow(x, y, z) requires numeric arguments"); } oldv = v; --- 1069,1074 ---- z->ob_type->tp_as_number == NULL || w->ob_type->tp_as_number == NULL) { ! return type_error( ! "(inplace) pow(x, y, z) requires numeric arguments"); } oldv = v; *************** *** 1080,1084 **** if (PyNumber_Coerce(&w2, &z2) != 0) goto error1; ! if (oldv == v1 && HASINPLACE(v1) && v->ob_type->tp_as_number != NULL && (f = v1->ob_type->tp_as_number->nb_inplace_power) != NULL) res = (*f)(v1, w2, z2); --- 1085,1090 ---- if (PyNumber_Coerce(&w2, &z2) != 0) goto error1; ! if (oldv == v1 && HASINPLACE(v1) && ! v->ob_type->tp_as_number != NULL && (f = v1->ob_type->tp_as_number->nb_inplace_power) != NULL) res = (*f)(v1, w2, z2); *************** *** 1088,1092 **** else res = type_error( ! "(inplace) pow(x, y, z) not defined for these operands"); Py_DECREF(w2); Py_DECREF(z2); --- 1094,1098 ---- else res = type_error( ! "(inplace) pow(x, y, z) not defined for these operands"); Py_DECREF(w2); Py_DECREF(z2); From python-dev@python.org Sat Sep 2 10:16:18 2000 From: python-dev@python.org (Tim Peters) Date: Sat, 2 Sep 2000 02:16:18 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python pystate.c,2.14,2.15 Message-ID: <200009020916.CAA04663@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv4353/python/dist/src/Python Modified Files: pystate.c Log Message: PyInterpreterState_New is not thread-safe, and the recent fix to _PyPclose can cause it to get called by multiple threads simultaneously. Ditto for PyInterpreterState_Delete. Of the former, the docs say "The interpreter lock need not be held, but may be held if it is necessary to serialize calls to this function". This kinda implies it both is and isn't thread-safe. Of the latter, the docs merely say "The interpreter lock need not be held.", and the clause about serializing is absent. I expect it was *believed* these are both thread-safe, and the bit about serializing via the global lock was meant as a permission rather than a caution. I also expect we've never seen a problem here because the Python core (prior to the _PyPclose fix) only calls these functions once per run. The Py_NewInterpreter subsystem exposed by the C API (but not used by Python itself) also calls them, but that subsystem appears to be very rarely used. Whatever, they're both thread-safe now. Index: pystate.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pystate.c,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** pystate.c 2000/09/01 23:29:28 2.14 --- pystate.c 2000/09/02 09:16:15 2.15 *************** *** 41,46 **** --- 41,48 ---- interp->tstate_head = NULL; + HEAD_LOCK(); interp->next = interp_head; interp_head = interp; + HEAD_UNLOCK(); } *************** *** 80,83 **** --- 82,86 ---- PyInterpreterState **p; zapthreads(interp); + HEAD_LOCK(); for (p = &interp_head; ; p = &(*p)->next) { if (*p == NULL) *************** *** 90,93 **** --- 93,97 ---- Py_FatalError("PyInterpreterState_Delete: remaining threads"); *p = interp->next; + HEAD_UNLOCK(); PyMem_DEL(interp); } From python-dev@python.org Sat Sep 2 12:03:37 2000 From: python-dev@python.org (Fredrik Lundh) Date: Sat, 2 Sep 2000 04:03:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib sre_parse.py,1.32,1.33 Message-ID: <200009021103.EAA07122@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv32410/Lib Modified Files: sre_parse.py Log Message: -- tightened up parsing of octal numbers -- improved the SRE test harness: don't use asserts, test a few more things (including more boundary conditions) Index: sre_parse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -r1.32 -r1.33 *** sre_parse.py 2000/09/02 07:44:32 1.32 --- sre_parse.py 2000/09/02 11:03:33 1.33 *************** *** 16,20 **** SPECIAL_CHARS = ".\\[{()*+?^$|" ! REPEAT_CHARS = "*+?{" DIGITS = tuple("0123456789") --- 16,20 ---- SPECIAL_CHARS = ".\\[{()*+?^$|" ! REPEAT_CHARS = "*+?{" DIGITS = tuple("0123456789") *************** *** 260,270 **** while source.next in HEXDIGITS and len(escape) < 4: escape = escape + source.get() ! escape = escape[2:] ! if len(escape) != 2: ! raise error, "bogus escape: %s" % repr("\\" + escape) ! return LITERAL, int(escape, 16) & 0xff elif escape[1:2] == "0": # octal escape ! while source.next in OCTDIGITS and len(escape) < 5: escape = escape + source.get() return LITERAL, int(escape[1:], 8) & 0xff --- 260,269 ---- while source.next in HEXDIGITS and len(escape) < 4: escape = escape + source.get() ! if len(escape) != 4: ! raise ValueError ! return LITERAL, int(escape[2:], 16) & 0xff elif escape[1:2] == "0": # octal escape ! while source.next in OCTDIGITS and len(escape) < 4: escape = escape + source.get() return LITERAL, int(escape[1:], 8) & 0xff *************** *** 274,278 **** if source.next in DIGITS: escape = escape + source.get() ! if escape[2] in OCTDIGITS and source.next in OCTDIGITS: # got three octal digits; this is an octal escape escape = escape + source.get() --- 273,278 ---- if source.next in DIGITS: escape = escape + source.get() ! if (escape[1] in OCTDIGITS and escape[2] in OCTDIGITS and ! source.next in OCTDIGITS): # got three octal digits; this is an octal escape escape = escape + source.get() *************** *** 282,286 **** if group: return GROUPREF, group ! raise error, "bogus escape: %s" % repr(escape) if len(escape) == 2: return LITERAL, ord(escape[1]) --- 282,286 ---- if group: return GROUPREF, group ! raise ValueError if len(escape) == 2: return LITERAL, ord(escape[1]) From python-dev@python.org Sat Sep 2 12:03:37 2000 From: python-dev@python.org (Fredrik Lundh) Date: Sat, 2 Sep 2000 04:03:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_sre.py,1.7,1.8 re_tests.py,1.16,1.17 Message-ID: <200009021103.EAA07132@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/test In directory slayer.i.sourceforge.net:/tmp/cvs-serv32410/Lib/test Modified Files: test_sre.py re_tests.py Log Message: -- tightened up parsing of octal numbers -- improved the SRE test harness: don't use asserts, test a few more things (including more boundary conditions) Index: test_sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** test_sre.py 2000/08/09 09:14:35 1.7 --- test_sre.py 2000/09/02 11:03:34 1.8 *************** *** 1,4 **** ! # FIXME: this is basically test_re.py, with a few minor changes import sys sys.path=['.']+sys.path --- 1,7 ---- ! # SRE test harness for the Python regression suite + # this is based on test_re.py, but uses a test function instead + # of all those asserts + import sys sys.path=['.']+sys.path *************** *** 8,11 **** --- 11,60 ---- import sys, os, string, traceback + # + # test support + + def test(expression, result, exception=None): + try: + r = eval(expression) + except: + if exception: + if not isinstance(sys.exc_value, exception): + print expression, "FAILED" + # display name, not actual value + if exception is sre.error: + print "expected", "sre.error" + else: + print "expected", exception.__name__ + print "got", sys.exc_type.__name__, str(sys.exc_value) + else: + print expression, "FAILED" + traceback.print_exc(file=sys.stdout) + else: + if exception: + print expression, "FAILED" + if exception is sre.error: + print "expected", "sre.error" + else: + print "expected", exception.__name__ + print "got result", repr(r) + else: + if r != result: + print expression, "FAILED" + print "expected", repr(result) + print "got result", repr(r) + + if verbose: + print 'Running tests on character literals' + + for i in range(0, 256): + test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1) + test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1) + test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1) + test(r"""sre.match("\x%02x" % i, chr(i)) != None""", 1) + test(r"""sre.match("\x%02x0" % i, chr(i)+"0") != None""", 1) + test(r"""sre.match("\x%02xz" % i, chr(i)+"z") != None""", 1) + test(r"""sre.match("\911", "")""", None, sre.error) + + # # Misc tests from Tim Peters' re.doc *************** *** 13,232 **** print 'Running tests on sre.search and sre.match' ! try: ! assert sre.search('x*', 'axx').span(0) == (0, 0) ! assert sre.search('x*', 'axx').span() == (0, 0) ! assert sre.search('x+', 'axx').span(0) == (1, 3) ! assert sre.search('x+', 'axx').span() == (1, 3) ! assert sre.search('x', 'aaa') == None ! except: ! raise TestFailed, "sre.search" ! ! try: ! assert sre.match('a*', 'xxx').span(0) == (0, 0) ! assert sre.match('a*', 'xxx').span() == (0, 0) ! assert sre.match('x*', 'xxxa').span(0) == (0, 3) ! assert sre.match('x*', 'xxxa').span() == (0, 3) ! assert sre.match('a+', 'xxx') == None ! except: ! raise TestFailed, "sre.search" if verbose: print 'Running tests on sre.sub' ! try: ! assert sre.sub("(?i)b+", "x", "bbbb BBBB") == 'x x' ! def bump_num(matchobj): ! int_value = int(matchobj.group(0)) ! return str(int_value + 1) ! ! assert sre.sub(r'\d+', bump_num, '08.2 -2 23x99y') == '9.3 -3 24x100y' ! assert sre.sub(r'\d+', bump_num, '08.2 -2 23x99y', 3) == '9.3 -3 23x99y' ! ! assert sre.sub('.', lambda m: r"\n", 'x') == '\\n' ! assert sre.sub('.', r"\n", 'x') == '\n' ! ! s = r"\1\1" ! assert sre.sub('(.)', s, 'x') == 'xx' ! assert sre.sub('(.)', sre.escape(s), 'x') == s ! assert sre.sub('(.)', lambda m: s, 'x') == s ! ! assert sre.sub('(?Px)', '\g\g', 'xx') == 'xxxx' ! assert sre.sub('(?Px)', '\g\g<1>', 'xx') == 'xxxx' ! assert sre.sub('(?Px)', '\g\g', 'xx') == 'xxxx' ! assert sre.sub('(?Px)', '\g<1>\g<1>', 'xx') == 'xxxx' ! ! assert sre.sub('a', r'\t\n\v\r\f\a\b\B\Z\a\A\w\W\s\S\d\D', 'a') == '\t\n\v\r\f\a\b\\B\\Z\a\\A\\w\\W\\s\\S\\d\\D' ! assert sre.sub('a', '\t\n\v\r\f\a', 'a') == '\t\n\v\r\f\a' ! assert sre.sub('a', '\t\n\v\r\f\a', 'a') == (chr(9)+chr(10)+chr(11)+chr(13)+chr(12)+chr(7)) ! ! assert sre.sub('^\s*', 'X', 'test') == 'Xtest' ! except AssertionError: ! raise TestFailed, "sre.sub" ! try: ! assert sre.sub('a', 'b', 'aaaaa') == 'bbbbb' ! assert sre.sub('a', 'b', 'aaaaa', 1) == 'baaaa' ! except AssertionError: ! raise TestFailed, "qualified sre.sub" ! if verbose: ! print 'Running tests on symbolic references' ! try: ! sre.sub('(?Px)', '\gx)', '\g<', 'xx') ! except sre.error, reason: ! pass ! else: ! raise TestFailed, "symbolic reference" ! try: ! sre.sub('(?Px)', '\g', 'xx') ! except sre.error, reason: ! pass ! else: ! raise TestFailed, "symbolic reference" ! try: ! sre.sub('(?Px)', '\g', 'xx') ! except sre.error, reason: ! pass ! else: ! raise TestFailed, "symbolic reference" ! try: ! sre.sub('(?Px)', '\g<1a1>', 'xx') ! except sre.error, reason: ! pass ! else: ! raise TestFailed, "symbolic reference" ! try: ! sre.sub('(?Px)', '\g', 'xx') ! except IndexError, reason: ! pass ! else: ! raise TestFailed, "symbolic reference" ! try: ! sre.sub('(?Px)|(?Py)', '\g', 'xx') ! except sre.error, reason: ! pass ! else: ! raise TestFailed, "symbolic reference" ! try: ! sre.sub('(?Px)|(?Py)', '\\2', 'xx') ! except sre.error, reason: ! pass ! else: ! raise TestFailed, "symbolic reference" if verbose: print 'Running tests on sre.subn' ! try: ! assert sre.subn("(?i)b+", "x", "bbbb BBBB") == ('x x', 2) ! assert sre.subn("b+", "x", "bbbb BBBB") == ('x BBBB', 1) ! assert sre.subn("b+", "x", "xyz") == ('xyz', 0) ! assert sre.subn("b*", "x", "xyz") == ('xxxyxzx', 4) ! assert sre.subn("b*", "x", "xyz", 2) == ('xxxyz', 2) ! except AssertionError: ! raise TestFailed, "sre.subn" if verbose: print 'Running tests on sre.split' ! try: ! assert sre.split(":", ":a:b::c") == ['', 'a', 'b', '', 'c'] ! assert sre.split(":*", ":a:b::c") == ['', 'a', 'b', 'c'] ! assert sre.split("(:*)", ":a:b::c") == ['', ':', 'a', ':', 'b', '::', 'c'] ! assert sre.split("(?::*)", ":a:b::c") == ['', 'a', 'b', 'c'] ! assert sre.split("(:)*", ":a:b::c") == ['', ':', 'a', ':', 'b', ':', 'c'] ! assert sre.split("([b:]+)", ":a:b::c") == ['', ':', 'a', ':b::', 'c'] ! assert sre.split("(b)|(:+)", ":a:b::c") == \ ! ['', None, ':', 'a', None, ':', '', 'b', None, '', None, '::', 'c'] ! assert sre.split("(?:b)|(?::+)", ":a:b::c") == ['', 'a', '', '', 'c'] ! except AssertionError: ! raise TestFailed, "sre.split" ! try: ! assert sre.split(":", ":a:b::c", 2) == ['', 'a', 'b::c'] ! assert sre.split(':', 'a:b:c:d', 2) == ['a', 'b', 'c:d'] ! assert sre.split("(:)", ":a:b::c", 2) == ['', ':', 'a', ':', 'b::c'] ! assert sre.split("(:*)", ":a:b::c", 2) == ['', ':', 'a', ':', 'b::c'] ! except AssertionError: ! raise TestFailed, "qualified sre.split" if verbose: print "Running tests on sre.findall" ! try: ! assert sre.findall(":+", "abc") == [] ! assert sre.findall(":+", "a:b::c:::d") == [":", "::", ":::"] ! assert sre.findall("(:+)", "a:b::c:::d") == [":", "::", ":::"] ! assert sre.findall("(:)(:*)", "a:b::c:::d") == [(":", ""), ! (":", ":"), ! (":", "::")] ! assert sre.findall("(a)|(b)", "abc") == [("a", ""), ("", "b")] ! except AssertionError: ! raise TestFailed, "sre.findall" if verbose: print "Running tests on sre.match" ! try: ! # No groups at all ! m = sre.match('a', 'a') ; assert m.groups() == () ! # A single group ! m = sre.match('(a)', 'a') ; assert m.groups() == ('a',) ! ! pat = sre.compile('((a)|(b))(c)?') ! assert pat.match('a').groups() == ('a', 'a', None, None) ! assert pat.match('b').groups() == ('b', None, 'b', None) ! assert pat.match('ac').groups() == ('a', 'a', None, 'c') ! assert pat.match('bc').groups() == ('b', None, 'b', 'c') ! assert pat.match('bc').groups("") == ('b', "", 'b', 'c') ! except AssertionError: ! raise TestFailed, "match .groups() method" ! ! try: ! # A single group ! m = sre.match('(a)', 'a') ! assert m.group(0) == 'a' ; assert m.group(0) == 'a' ! assert m.group(1) == 'a' ; assert m.group(1, 1) == ('a', 'a') ! ! pat = sre.compile('(?:(?Pa)|(?Pb))(?Pc)?') ! assert pat.match('a').group(1, 2, 3) == ('a', None, None) ! assert pat.match('b').group('a1', 'b2', 'c3') == (None, 'b', None) ! assert pat.match('ac').group(1, 'b2', 3) == ('a', None, 'c') ! except AssertionError: ! raise TestFailed, "match .group() method" if verbose: print "Running tests on sre.escape" ! try: ! p="" ! for i in range(0, 256): ! p = p + chr(i) ! assert sre.match(sre.escape(chr(i)), chr(i)) != None ! assert sre.match(sre.escape(chr(i)), chr(i)).span() == (0,1) ! ! pat=sre.compile( sre.escape(p) ) ! assert pat.match(p) != None ! assert pat.match(p).span() == (0,256) ! except AssertionError: ! raise TestFailed, "sre.escape" ! if verbose: --- 62,196 ---- print 'Running tests on sre.search and sre.match' ! test(r"""sre.search('x*', 'axx').span(0)""", (0, 0)) ! test(r"""sre.search('x*', 'axx').span()""", (0, 0)) ! test(r"""sre.search('x+', 'axx').span(0)""", (1, 3)) ! test(r"""sre.search('x+', 'axx').span()""", (1, 3)) ! test(r"""sre.search('x', 'aaa')""", None) ! ! test(r"""sre.match('a*', 'xxx').span(0)""", (0, 0)) ! test(r"""sre.match('a*', 'xxx').span()""", (0, 0)) ! test(r"""sre.match('x*', 'xxxa').span(0)""", (0, 3)) ! test(r"""sre.match('x*', 'xxxa').span()""", (0, 3)) ! test(r"""sre.match('a+', 'xxx')""", None) if verbose: print 'Running tests on sre.sub' ! test(r"""sre.sub("(?i)b+", "x", "bbbb BBBB")""", 'x x') ! def bump_num(matchobj): ! int_value = int(matchobj.group(0)) ! return str(int_value + 1) + test(r"""sre.sub(r'\d+', bump_num, '08.2 -2 23x99y')""", '9.3 -3 24x100y') + test(r"""sre.sub(r'\d+', bump_num, '08.2 -2 23x99y', 3)""", '9.3 -3 23x99y') ! test(r"""sre.sub('.', lambda m: r"\n", 'x')""", '\\n') ! test(r"""sre.sub('.', r"\n", 'x')""", '\n') ! s = r"\1\1" ! test(r"""sre.sub('(.)', s, 'x')""", 'xx') ! test(r"""sre.sub('(.)', sre.escape(s), 'x')""", s) ! test(r"""sre.sub('(.)', lambda m: s, 'x')""", s) ! test(r"""sre.sub('(?Px)', '\g\g', 'xx')""", 'xxxx') ! test(r"""sre.sub('(?Px)', '\g\g<1>', 'xx')""", 'xxxx') ! test(r"""sre.sub('(?Px)', '\g\g', 'xx')""", 'xxxx') ! test(r"""sre.sub('(?Px)', '\g<1>\g<1>', 'xx')""", 'xxxx') ! test(r"""sre.sub('a', r'\t\n\v\r\f\a\b\B\Z\a\A\w\W\s\S\d\D', 'a')""", '\t\n\v\r\f\a\b\\B\\Z\a\\A\\w\\W\\s\\S\\d\\D') ! test(r"""sre.sub('a', '\t\n\v\r\f\a', 'a')""", '\t\n\v\r\f\a') ! test(r"""sre.sub('a', '\t\n\v\r\f\a', 'a')""", (chr(9)+chr(10)+chr(11)+chr(13)+chr(12)+chr(7))) ! test(r"""sre.sub('^\s*', 'X', 'test')""", 'Xtest') ! # qualified sub ! test(r"""sre.sub('a', 'b', 'aaaaa')""", 'bbbbb') ! test(r"""sre.sub('a', 'b', 'aaaaa', 1)""", 'baaaa') ! if verbose: ! print 'Running tests on symbolic references' ! test(r"""sre.sub('(?Px)', '\gx)', '\g<', 'xx')""", None, sre.error) ! test(r"""sre.sub('(?Px)', '\g', 'xx')""", None, sre.error) ! test(r"""sre.sub('(?Px)', '\g', 'xx')""", None, sre.error) ! test(r"""sre.sub('(?Px)', '\g<1a1>', 'xx')""", None, sre.error) ! test(r"""sre.sub('(?Px)', '\g', 'xx')""", None, IndexError) ! test(r"""sre.sub('(?Px)|(?Py)', '\g', 'xx')""", None, sre.error) ! test(r"""sre.sub('(?Px)|(?Py)', '\\2', 'xx')""", None, sre.error) if verbose: print 'Running tests on sre.subn' ! test(r"""sre.subn("(?i)b+", "x", "bbbb BBBB")""", ('x x', 2)) ! test(r"""sre.subn("b+", "x", "bbbb BBBB")""", ('x BBBB', 1)) ! test(r"""sre.subn("b+", "x", "xyz")""", ('xyz', 0)) ! test(r"""sre.subn("b*", "x", "xyz")""", ('xxxyxzx', 4)) ! test(r"""sre.subn("b*", "x", "xyz", 2)""", ('xxxyz', 2)) if verbose: print 'Running tests on sre.split' ! test(r"""sre.split(":", ":a:b::c")""", ['', 'a', 'b', '', 'c']) ! test(r"""sre.split(":*", ":a:b::c")""", ['', 'a', 'b', 'c']) ! test(r"""sre.split("(:*)", ":a:b::c")""", ['', ':', 'a', ':', 'b', '::', 'c']) ! test(r"""sre.split("(?::*)", ":a:b::c")""", ['', 'a', 'b', 'c']) ! test(r"""sre.split("(:)*", ":a:b::c")""", ['', ':', 'a', ':', 'b', ':', 'c']) ! test(r"""sre.split("([b:]+)", ":a:b::c")""", ['', ':', 'a', ':b::', 'c']) ! test(r"""sre.split("(b)|(:+)", ":a:b::c")""", ! ['', None, ':', 'a', None, ':', '', 'b', None, '', None, '::', 'c']) ! test(r"""sre.split("(?:b)|(?::+)", ":a:b::c")""", ['', 'a', '', '', 'c']) ! test(r"""sre.split(":", ":a:b::c", 2)""", ['', 'a', 'b::c']) ! test(r"""sre.split(':', 'a:b:c:d', 2)""", ['a', 'b', 'c:d']) ! test(r"""sre.split("(:)", ":a:b::c", 2)""", ['', ':', 'a', ':', 'b::c']) ! test(r"""sre.split("(:*)", ":a:b::c", 2)""", ['', ':', 'a', ':', 'b::c']) if verbose: print "Running tests on sre.findall" ! test(r"""sre.findall(":+", "abc")""", []) ! test(r"""sre.findall(":+", "a:b::c:::d")""", [":", "::", ":::"]) ! test(r"""sre.findall("(:+)", "a:b::c:::d")""", [":", "::", ":::"]) ! test(r"""sre.findall("(:)(:*)", "a:b::c:::d")""", ! [(":", ""), (":", ":"), (":", "::")]) ! test(r"""sre.findall("(a)|(b)", "abc")""", [("a", ""), ("", "b")]) if verbose: print "Running tests on sre.match" ! test(r"""sre.match('a', 'a').groups()""", ()) ! test(r"""sre.match('(a)', 'a').groups()""", ('a',)) ! test(r"""sre.match('(a)', 'a').group(0)""", 'a') ! test(r"""sre.match('(a)', 'a').group(1)""", 'a') ! test(r"""sre.match('(a)', 'a').group(1, 1)""", ('a', 'a')) ! ! pat = sre.compile('((a)|(b))(c)?') ! test(r"""pat.match('a').groups()""", ('a', 'a', None, None)) ! test(r"""pat.match('b').groups()""", ('b', None, 'b', None)) ! test(r"""pat.match('ac').groups()""", ('a', 'a', None, 'c')) ! test(r"""pat.match('bc').groups()""", ('b', None, 'b', 'c')) ! test(r"""pat.match('bc').groups("")""", ('b', "", 'b', 'c')) ! ! pat = sre.compile('(?:(?Pa)|(?Pb))(?Pc)?') ! test(r"""pat.match('a').group(1, 2, 3)""", ('a', None, None)) ! test(r"""pat.match('b').group('a1', 'b2', 'c3')""", (None, 'b', None)) ! test(r"""pat.match('ac').group(1, 'b2', 3)""", ('a', None, 'c')) if verbose: print "Running tests on sre.escape" ! p = "" ! for i in range(0, 256): ! p = p + chr(i) ! test(r"""sre.match(sre.escape(chr(i)), chr(i)) != None""", 1) ! test(r"""sre.match(sre.escape(chr(i)), chr(i)).span()""", (0,1)) ! ! pat = sre.compile(sre.escape(p)) ! test(r"""pat.match(p) != None""", 1) ! test(r"""pat.match(p).span()""", (0,256)) if verbose: *************** *** 249,262 **** print TestFailed, 're module cPickle' # expected ! try: ! assert sre.I == sre.IGNORECASE ! assert sre.L == sre.LOCALE ! assert sre.M == sre.MULTILINE ! assert sre.S == sre.DOTALL ! assert sre.X == sre.VERBOSE ! assert sre.T == sre.TEMPLATE ! assert sre.U == sre.UNICODE ! except AssertionError: ! raise TestFailed, 're module constants' for flags in [sre.I, sre.M, sre.X, sre.S, sre.L, sre.T, sre.U]: --- 213,224 ---- print TestFailed, 're module cPickle' # expected ! # constants ! test(r"""sre.I""", sre.IGNORECASE) ! test(r"""sre.L""", sre.LOCALE) ! test(r"""sre.M""", sre.MULTILINE) ! test(r"""sre.S""", sre.DOTALL) ! test(r"""sre.X""", sre.VERBOSE) ! test(r"""sre.T""", sre.TEMPLATE) ! test(r"""sre.U""", sre.UNICODE) for flags in [sre.I, sre.M, sre.X, sre.S, sre.L, sre.T, sre.U]: *************** *** 271,278 **** # Try nasty case that overflows the straightforward recursive # implementation of repeated groups. ! try: ! assert sre.match('(x)*', 50000*'x').span() == (0, 50000) ! except RuntimeError, v: ! print v from re_tests import * --- 233,239 ---- # Try nasty case that overflows the straightforward recursive # implementation of repeated groups. ! test(r"""sre.match('(x)*', 50000*'x').span()""", (0, 50000), RuntimeError) ! test(r"""sre.match('(x)*y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) ! test(r"""sre.match('(x)*?y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) from re_tests import * Index: re_tests.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/re_tests.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 From python-dev@python.org Sat Sep 2 12:03:37 2000 From: python-dev@python.org (Fredrik Lundh) Date: Sat, 2 Sep 2000 04:03:37 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_sre,1.9,1.10 Message-ID: <200009021103.EAA07129@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/test/output In directory slayer.i.sourceforge.net:/tmp/cvs-serv32410/Lib/test/output Modified Files: test_sre Log Message: -- tightened up parsing of octal numbers -- improved the SRE test harness: don't use asserts, test a few more things (including more boundary conditions) Index: test_sre =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_sre,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** test_sre 2000/08/03 16:29:50 1.9 --- test_sre 2000/09/02 11:03:34 1.10 *************** *** 1,2 **** test_sre - maximum recursion limit exceeded --- 1 ---- From python-dev@python.org Sat Sep 2 12:40:12 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 04:40:12 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib sre_parse.py,1.30,1.30.2.1 Message-ID: <200009021140.EAA16814@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv16747 Modified Files: Tag: cnri-16-start sre_parse.py Log Message: DIGITS was missing '7'... Index: sre_parse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v retrieving revision 1.30 retrieving revision 1.30.2.1 diff -C2 -r1.30 -r1.30.2.1 *** sre_parse.py 2000/08/07 20:59:04 1.30 --- sre_parse.py 2000/09/02 11:40:09 1.30.2.1 *************** *** 22,26 **** REPEAT_CHARS = "*+?{" ! DIGITS = tuple("012345689") OCTDIGITS = tuple("01234567") --- 22,26 ---- REPEAT_CHARS = "*+?{" ! DIGITS = tuple("0123456789") OCTDIGITS = tuple("01234567") From python-dev@python.org Sat Sep 2 16:01:53 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 08:01:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.59,1.60 Message-ID: <200009021501.IAA29466@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv29440 Modified Files: ACKS Log Message: Patch by Martin von Löwis to give him his umlaut, to remove Christian Tismer's clone, and to list Hajime Saitou's real name. Added a note that the file uses Latin-1 (as distributed). Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -r1.59 -r1.60 *** ACKS 2000/08/30 03:30:28 1.59 --- ACKS 2000/09/02 15:01:50 1.60 *************** *** 9,12 **** --- 9,14 ---- --Guido + PS: In the standard Python distribution this file is encoded in Latin-1. + Jim Ahlstrom Jyrki Alakuijala *************** *** 215,219 **** Nick Lockwood Stephanie Lockwood ! Martin von Loewis Anne Lord Ray Loyzaga --- 217,221 ---- Nick Lockwood Stephanie Lockwood ! Martin von Löwis Anne Lord Ray Loyzaga *************** *** 331,334 **** --- 333,337 ---- Dan Pierson François Pinard + Hajime Saitou RajGopal Srinivasan Jim St. Pierre *************** *** 345,349 **** Tracy Tims Christian Tismer - Christian Tismer R Lindsay Todd Bennett Todd --- 348,351 ---- *************** *** 390,392 **** Siebren van der Zee Uwe Zessin - hajime@jsk.t.u-tokyo.ac.jp --- 392,393 ---- From python-dev@python.org Sat Sep 2 17:36:59 2000 From: python-dev@python.org (Fredrik Lundh) Date: Sat, 2 Sep 2000 09:36:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_sre.py,1.8,1.9 re_tests.py,1.17,1.18 Message-ID: <200009021636.JAA26110@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/test In directory slayer.i.sourceforge.net:/tmp/cvs-serv24513/Lib/test Modified Files: test_sre.py re_tests.py Log Message: return -1 for undefined groups (as implemented in 1.5.2) instead of None (as documented) from start/end/span. closes bug #113254 Index: test_sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** test_sre.py 2000/09/02 11:03:34 1.8 --- test_sre.py 2000/09/02 16:36:57 1.9 *************** *** 47,51 **** print 'Running tests on character literals' ! for i in range(0, 256): test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1) test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1) --- 47,51 ---- print 'Running tests on character literals' ! for i in [0, 8, 16, 32, 64, 127, 128, 255]: test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1) test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1) *************** *** 73,76 **** --- 73,81 ---- test(r"""sre.match('x*', 'xxxa').span()""", (0, 3)) test(r"""sre.match('a+', 'xxx')""", None) + + # bug 113254 + test(r"""sre.match('(a)|(b)', 'b').start(1)""", -1) + test(r"""sre.match('(a)|(b)', 'b').end(1)""", -1) + test(r"""sre.match('(a)|(b)', 'b').span(1)""", (-1, -1)) if verbose: Index: re_tests.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/re_tests.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 From python-dev@python.org Sat Sep 2 17:36:59 2000 From: python-dev@python.org (Fredrik Lundh) Date: Sat, 2 Sep 2000 09:36:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Modules _sre.c,2.40,2.41 Message-ID: <200009021636.JAA26102@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Modules In directory slayer.i.sourceforge.net:/tmp/cvs-serv24513/Modules Modified Files: _sre.c Log Message: return -1 for undefined groups (as implemented in 1.5.2) instead of None (as documented) from start/end/span. closes bug #113254 Index: _sre.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_sre.c,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -r2.40 -r2.41 *** _sre.c 2000/08/27 21:32:46 2.40 --- _sre.c 2000/09/02 16:36:57 2.41 *************** *** 18,21 **** --- 18,22 ---- * 00-08-08 fl changed findall to return empty strings instead of None * 00-08-27 fl properly propagate memory errors + * 00-09-02 fl return -1 instead of None for start/end/span * * Copyright (c) 1997-2000 by Secret Labs AB. All rights reserved. *************** *** 1984,1992 **** } ! if (self->mark[index*2] < 0) { ! Py_INCREF(Py_None); ! return Py_None; ! } ! return Py_BuildValue("i", self->mark[index*2]); } --- 1985,1989 ---- } ! /* mark is -1 if group is undefined */ return Py_BuildValue("i", self->mark[index*2]); } *************** *** 2010,2019 **** return NULL; } - - if (self->mark[index*2] < 0) { - Py_INCREF(Py_None); - return Py_None; - } return Py_BuildValue("i", self->mark[index*2+1]); } --- 2007,2012 ---- return NULL; } + /* mark is -1 if group is undefined */ return Py_BuildValue("i", self->mark[index*2+1]); } *************** *** 2064,2074 **** return NULL; } - - if (self->mark[index*2] < 0) { - Py_INCREF(Py_None); - Py_INCREF(Py_None); - return Py_BuildValue("OO", Py_None, Py_None); - } return _pair(self->mark[index*2], self->mark[index*2+1]); } --- 2057,2062 ---- return NULL; } + /* marks are -1 if group is undefined */ return _pair(self->mark[index*2], self->mark[index*2+1]); } From python-dev@python.org Sat Sep 2 21:11:30 2000 From: python-dev@python.org (Fredrik Lundh) Date: Sat, 2 Sep 2000 13:11:30 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.139,2.140 Message-ID: <200009022011.NAA05991@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv5035/Python Modified Files: compile.c Log Message: changed \x to consume exactly two hex digits. implements PEP-223 for 8-bit strings. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.139 retrieving revision 2.140 diff -C2 -r2.139 -r2.140 *** compile.c 2000/09/01 23:29:28 2.139 --- compile.c 2000/09/02 20:11:27 2.140 *************** *** 874,881 **** s, len, NULL); } ! else if (rawmode || strchr(s, '\\') == NULL) { return PyString_FromStringAndSize(s, len); - } v = PyString_FromStringAndSize((char *)NULL, len); p = buf = PyString_AsString(v); end = s + len; --- 874,882 ---- s, len, NULL); } ! if (rawmode || strchr(s, '\\') == NULL) return PyString_FromStringAndSize(s, len); v = PyString_FromStringAndSize((char *)NULL, len); + if (v == NULL) + return NULL; p = buf = PyString_AsString(v); end = s + len; *************** *** 910,931 **** break; case 'x': ! if (isxdigit(Py_CHARMASK(*s))) { unsigned int x = 0; ! do { ! c = Py_CHARMASK(*s); ! s++; ! x = (x<<4) & ~0xF; ! if (isdigit(c)) ! x += c - '0'; ! else if (islower(c)) ! x += 10 + c - 'a'; ! else ! x += 10 + c - 'A'; ! } while (isxdigit(Py_CHARMASK(*s))); *p++ = x; break; } ! /* FALLTHROUGH */ ! default: *p++ = '\\'; *p++ = s[-1]; break; } } --- 911,943 ---- break; case 'x': ! if (isxdigit(Py_CHARMASK(s[0])) && isxdigit(Py_CHARMASK(s[1]))) { unsigned int x = 0; ! c = Py_CHARMASK(*s); ! s++; ! if (isdigit(c)) ! x = c - '0'; ! else if (islower(c)) ! x = 10 + c - 'a'; ! else ! x = 10 + c - 'A'; ! x = x << 4; ! c = Py_CHARMASK(*s); ! s++; ! if (isdigit(c)) ! x += c - '0'; ! else if (islower(c)) ! x += 10 + c - 'a'; ! else ! x += 10 + c - 'A'; *p++ = x; break; } ! PyErr_SetString(PyExc_ValueError, "invalid \\x escape"); ! Py_DECREF(v); ! return NULL; ! default: ! *p++ = '\\'; ! *p++ = s[-1]; ! break; } } From python-dev@python.org Sun Sep 3 03:28:14 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 19:28:14 -0700 Subject: [Python-checkins] CVS: python/dist/src LICENSE,1.1.2.7,1.1.2.8 Message-ID: <200009030228.TAA12677@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv12626 Modified Files: Tag: cnri-16-start LICENSE Log Message: Set a release date, now that there's agreement between CNRI and the FSF. Index: LICENSE =================================================================== RCS file: /cvsroot/python/python/dist/src/LICENSE,v retrieving revision 1.1.2.7 retrieving revision 1.1.2.8 diff -C2 -r1.1.2.7 -r1.1.2.8 *** LICENSE 2000/09/01 20:04:23 1.1.2.7 --- LICENSE 2000/09/03 02:28:11 1.1.2.8 *************** *** 30,34 **** ("Licensee") accessing and otherwise using Python 1.6 software in source or binary form and its associated documentation, as released at ! the www.python.org Internet site on ("Python 1.6"). 2. Subject to the terms and conditions of this License Agreement, CNRI --- 30,34 ---- ("Licensee") accessing and otherwise using Python 1.6 software in source or binary form and its associated documentation, as released at ! the www.python.org Internet site on September 5, 2000 ("Python 1.6"). 2. Subject to the terms and conditions of this License Agreement, CNRI *************** *** 110,112 **** ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - --- 110,111 ---- From python-dev@python.org Sun Sep 3 04:13:47 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 20:13:47 -0700 Subject: [Python-checkins] CVS: python/dist/src LICENSE,1.2,1.3 Message-ID: <200009030313.UAA10719@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv10710 Modified Files: LICENSE Log Message: Various edits. Most importantly, added dual licensing. Also some changes suggested by BobW. Index: LICENSE =================================================================== RCS file: /cvsroot/python/python/dist/src/LICENSE,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** LICENSE 2000/09/01 19:51:14 1.2 --- LICENSE 2000/09/03 03:13:44 1.3 *************** *** 5,42 **** Mathematisch Centrum (CWI) in the Netherlands as a successor of a language called ABC. Guido is Python's principal author, although it ! includes many contributions by others. The last version released from ! CWI was Python 1.2. In 1995, Guido continued his work on Python at ! the Corporation for National Research Initiatives (CNRI) in Reston, Virginia where he released several versions of the software. Python 1.6 was the last of the versions released by CNRI. In 2000, Guido and ! the Python core developement team moved to BeOpen.com to form tbe ! BeOpen PythonLabs group. Python 2.0 is a derivative work of Python ! 1.6, developed by PythonLabs and many outside volunteers, under ! Guido's direction. - TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON 2.0 - ================================================================ ! BEOPEN LICENSE AGREEMENT ! ------------------------ BEOPEN OPEN SOURCE LICENSE AGREEMENT ! 1. This LICENSE AGREEMENT is between BeOpen.com, having an office at ! 160 Saratoga Avenue, Santa Clara, CA 95051 ("BeOpen"), and the Individual or Organization ("Licensee") accessing and otherwise using this software in source or binary form and its associated documentation ("the Software"). ! 2. Subject to the terms and conditions of this License Agreement, ! BeOpen hereby grants Licensee a non-exclusive, royalty-free, ! world-wide license to reproduce, analyze, test, perform and/or display ! publicly, prepare derivative works, distribute, and otherwise use the ! Software alone or in any derivative version, provided, however, that ! BeOpen's License Agreement is retained in the Software, alone or in ! any derivative version prepared by Licensee. ! 3. BeOpen is making the Software available to Licensee on an "AS IS" basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND --- 5,49 ---- Mathematisch Centrum (CWI) in the Netherlands as a successor of a language called ABC. Guido is Python's principal author, although it ! includes many contributions from others. The last version released ! from CWI was Python 1.2. In 1995, Guido continued his work on Python ! at the Corporation for National Research Initiatives (CNRI) in Reston, Virginia where he released several versions of the software. Python 1.6 was the last of the versions released by CNRI. In 2000, Guido and ! the Python core developement team moved to BeOpen.com to form the ! BeOpen PythonLabs team (www.pythonlabs.com). Python 2.0 is the first ! release from PythonLabs. Thanks to the many outside volunteers who ! have worked under Guido's direction to make this release possible. ! BEOPEN.COM TERMS AND CONDITIONS FOR PYTHON 2.0 ! ============================================== + BEOPEN PYTHON LICENSE AGREEMENT + ------------------------------- + BEOPEN OPEN SOURCE LICENSE AGREEMENT ! 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an ! office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the Individual or Organization ("Licensee") accessing and otherwise using this software in source or binary form and its associated documentation ("the Software"). ! 2. Subject to the terms and conditions of this BeOpen Python License ! Agreement, BeOpen hereby grants Licensee a non-exclusive, ! royalty-free, world-wide license to reproduce, analyze, test, perform ! and/or display publicly, prepare derivative works, distribute, and ! otherwise use the Software alone or in any derivative version, ! provided, however, that the BeOpen Python License is retained in the ! Software, alone or in any derivative version prepared by Licensee. ! ! 3. Instead of using this License, you can redistribute and/or modify ! the Software under the terms of the GNU General Public License as ! published by the Free Software Foundation; either version 2, or (at ! your option) any later version. For a copy of the GPL, see ! http://www.gnu.org/copyleft/gpl.html. ! 4. BeOpen is making the Software available to Licensee on an "AS IS" basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND *************** *** 45,57 **** INFRINGE ANY THIRD PARTY RIGHTS. ! 4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. ! 5. This License Agreement will automatically terminate upon a material breach of its terms and conditions. ! 6. This License Agreement shall be governed by and interpreted in all respects by the law of the State of California, excluding conflict of law provisions. Nothing in this License Agreement shall be deemed to --- 52,64 ---- INFRINGE ANY THIRD PARTY RIGHTS. ! 5. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. ! 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. ! 7. This License Agreement shall be governed by and interpreted in all respects by the law of the State of California, excluding conflict of law provisions. Nothing in this License Agreement shall be deemed to *************** *** 60,67 **** permission to use BeOpen trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third ! party. The "BeOpen Python" logos may be downloaded and used according ! to the permissions granted on the logo download page. ! 7. By copying, installing or otherwise using the software, Licensee agrees to be bound by the terms and conditions of this License Agreement. --- 67,75 ---- permission to use BeOpen trademarks or trade name in a trademark sense to endorse or promote products or services of Licensee, or any third ! party. As an exception, the "BeOpen Python" logos available at ! http://www.pythonlabs.com/logos.html may be used according to the ! permissions granted on that web page. ! 8. By copying, installing or otherwise using the software, Licensee agrees to be bound by the terms and conditions of this License Agreement. *************** *** 72,81 **** Python 1.6 is made available subject to the terms and conditions in ! CNRI's License Agreement. This Agreement may be located on the ! Internet using the following unique, persistent identifier (known as a ! handle): 1895.22/1011. This Agreement may also be obtained from a ! proxy server on the Internet using the ! URL:http://hdl.handle.net/1895.22/1011" ! --- 80,88 ---- Python 1.6 is made available subject to the terms and conditions in ! CNRI's License Agreement. This Agreement together with Python 1.6 may ! be located on the Internet using the following unique, persistent ! identifier (known as a handle): 1895.22/1012. This Agreement may also ! be obtained from a proxy server on the Internet using the following ! URL: http://hdl.handle.net/1895.22/1012. From python-dev@python.org Sun Sep 3 04:31:55 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 20:31:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python getcopyright.c,1.6.2.2,1.6.2.3 Message-ID: <200009030331.UAA11661@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv11654 Modified Files: Tag: cnri-16-start getcopyright.c Log Message: Change the copyright notice according to CNRI's wishes. Index: getcopyright.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getcopyright.c,v retrieving revision 1.6.2.2 retrieving revision 1.6.2.3 diff -C2 -r1.6.2.2 -r1.6.2.3 *** getcopyright.c 2000/08/04 13:18:12 1.6.2.2 --- getcopyright.c 2000/09/03 03:31:52 1.6.2.3 *************** *** 4,9 **** static char cprt[] = ! "Copyright (c) Corporation for National Research Initiatives.\n\ ! Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam."; const char * --- 4,11 ---- static char cprt[] = ! "Copyright (c) 1995-2000 Corporation for National Research Initiatives;\n\ ! All Rights Reserved.\n\ ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam;\n\ ! All Rights Reserved."; const char * From python-dev@python.org Sun Sep 3 04:35:53 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 20:35:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python getcopyright.c,1.9,1.10 Message-ID: <200009030335.UAA11854@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv11846 Modified Files: getcopyright.c Log Message: Change the copyright notice according to CNRI's wishes, with BeOpen.com added to the front. (Even if maybe we won't print this long banner at startup, the string must still be defined for sys.copyright.) Index: getcopyright.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getcopyright.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** getcopyright.c 2000/09/01 23:29:28 1.9 --- getcopyright.c 2000/09/03 03:35:50 1.10 *************** *** 4,9 **** static char cprt[] = ! "Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam\n\ ! Copyright 1995-2000 Corporation for National Research Initiatives (CNRI)"; const char * --- 4,12 ---- static char cprt[] = ! "Copyright (c) 2000 BeOpen.com; All Rights Reserved.\n\ ! Copyright (c) 1995-2000 Corporation for National Research Initiatives;\n\ ! All Rights Reserved.\n\ ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam;\n\ ! All Rights Reserved."; const char * From python-dev@python.org Sun Sep 3 04:53:46 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 20:53:46 -0700 Subject: [Python-checkins] CVS: python/dist/src/Include patchlevel.h,2.35.2.2,2.35.2.3 Message-ID: <200009030353.UAA13096@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Include In directory slayer.i.sourceforge.net:/tmp/cvs-serv13089 Modified Files: Tag: cnri-16-start patchlevel.h Log Message: 1.6 final. Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.35.2.2 retrieving revision 2.35.2.3 diff -C2 -r2.35.2.2 -r2.35.2.3 *** patchlevel.h 2000/08/03 16:48:06 2.35.2.2 --- patchlevel.h 2000/09/03 03:53:43 2.35.2.3 *************** *** 22,33 **** #define PY_MINOR_VERSION 6 #define PY_MICRO_VERSION 0 ! #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA ! #define PY_RELEASE_SERIAL 1 /* Version as a string */ ! #define PY_VERSION "1.6b1" /* Historic */ ! #define PATCHLEVEL "1.6b1" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. --- 22,33 ---- #define PY_MINOR_VERSION 6 #define PY_MICRO_VERSION 0 ! #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_FINAL ! #define PY_RELEASE_SERIAL 0 /* Version as a string */ ! #define PY_VERSION "1.6" /* Historic */ ! #define PATCHLEVEL "1.6" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From python-dev@python.org Sun Sep 3 05:44:31 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 21:44:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs copyright.tex,1.6,1.6.6.1 Message-ID: <200009030444.VAA24775@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory slayer.i.sourceforge.net:/tmp/cvs-serv24745/texinputs Modified Files: Tag: cnri-16-start copyright.tex Log Message: Updated copyright notices. Should be good for 1.6 release. Index: copyright.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/copyright.tex,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -r1.6 -r1.6.6.1 *** copyright.tex 1998/02/11 14:42:06 1.6 --- copyright.tex 2000/09/03 04:44:28 1.6.6.1 *************** *** 1,29 **** ! Copyright \copyright{} 1991-1995 by Stichting Mathematisch Centrum, ! Amsterdam, The Netherlands. ! \begin{center} ! All Rights Reserved ! \end{center} ! ! Permission to use, copy, modify, and distribute this software and its ! documentation for any purpose and without fee is hereby granted, ! provided that the above copyright notice appear in all copies and that ! both that copyright notice and this permission notice appear in ! supporting documentation, and that the names of Stichting Mathematisch ! Centrum or CWI or Corporation for National Research Initiatives or ! CNRI not be used in advertising or publicity pertaining to ! distribution of the software without specific, written prior ! permission. ! ! While CWI is the initial source for this software, a modified version ! is made available by the Corporation for National Research Initiatives ! (CNRI) at the Internet address \url{ftp://ftp.python.org}. ! ! STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH ! REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF ! MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH ! CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL ! DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR ! PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER ! TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR ! PERFORMANCE OF THIS SOFTWARE. --- 1,74 ---- ! Copyright \copyright{} 1995-2000 Corporation for National Research ! Initiatives. All rights reserved. ! Copyright \copyright{} 1991-1995 Stichting Mathematisch Centrum. All ! rights reserved. ! ! CNRI OPEN SOURCE LICENSE AGREEMENT ! ! ! IMPORTANT: PLEASE READ THE FOLLOWING AGREEMENT CAREFULLY. ! ! BY CLICKING ON "ACCEPT" WHERE INDICATED BELOW, OR BY COPYING, ! INSTALLING OR OTHERWISE USING PYTHON 1.6 SOFTWARE, YOU ARE DEEMED TO ! HAVE AGREED TO THE TERMS AND CONDITIONS OF THIS LICENSE AGREEMENT. ! ! 1. This LICENSE AGREEMENT is between the Corporation for National ! Research Initiatives, having an office at 1895 Preston White Drive, ! Reston, VA 20191 ("CNRI"), and the Individual or Organization ! ("Licensee") accessing and otherwise using Python 1.6 software in ! source or binary form and its associated documentation, as released at ! the www.python.org Internet site on September 5, 2000 ("Python 1.6"). ! ! 2. Subject to the terms and conditions of this License Agreement, CNRI ! hereby grants Licensee a nonexclusive, royalty-free, world-wide ! license to reproduce, analyze, test, perform and/or display publicly, ! prepare derivative works, distribute, and otherwise use Python 1.6 ! alone or in any derivative version, provided, however, that CNRI's ! License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) ! 1995-2000 Corporation for National Research Initiatives; All Rights ! Reserved" are retained in Python 1.6 alone or in any derivative ! version prepared by Licensee. ! ! Alternately, in lieu of CNRI's License Agreement, Licensee may ! substitute the following text (omitting the quotes): "Python 1.6 is ! made available subject to the terms and conditions in CNRI's License ! Agreement. This Agreement together with Python 1.6 may be located on ! the Internet using the following unique, persistent identifier (known ! as a handle): 1895.22/1012. This Agreement may also be obtained from a ! proxy server on the Internet using the following URL: ! http://hdl.handle.net/1895.22/1012". ! ! 3. In the event Licensee prepares a derivative work that is based on ! or incorporates Python 1.6 or any part thereof, and wants to make the ! derivative work available to others as provided herein, then Licensee ! hereby agrees to indicate in any such work the nature of the ! modifications made to Python 1.6. ! ! 4. CNRI is making Python 1.6 available to Licensee on an "AS IS" ! basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR ! IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND ! DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS ! FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6 WILL NOT ! INFRINGE ANY THIRD PARTY RIGHTS. ! ! 5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON ! 1.6 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A ! RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6, OR ! ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. ! ! 6. This License Agreement will automatically terminate upon a material ! breach of its terms and conditions. ! ! 7. This License Agreement shall be governed by and interpreted in all ! respects by the law of the State of Virginia, excluding conflict of ! law provisions. Nothing in this License Agreement shall be deemed to ! create any relationship of agency, partnership, or joint venture ! between CNRI and Licensee. This License Agreement does not grant ! permission to use CNRI trademarks or trade name in a trademark sense ! to endorse or promote products or services of Licensee, or any third ! party. ! ! 8. By clicking on the "ACCEPT" button where indicated, or by copying, ! installing or otherwise using Python 1.6, Licensee agrees to be bound ! by the terms and conditions of this License Agreement. From python-dev@python.org Sun Sep 3 05:44:31 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 21:44:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.65,1.65.2.1 Message-ID: <200009030444.VAA24767@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/api In directory slayer.i.sourceforge.net:/tmp/cvs-serv24745/api Modified Files: Tag: cnri-16-start api.tex Log Message: Updated copyright notices. Should be good for 1.6 release. Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.65 retrieving revision 1.65.2.1 diff -C2 -r1.65 -r1.65.2.1 *** api.tex 2000/04/10 18:50:14 1.65 --- api.tex 2000/09/03 04:44:28 1.65.2.1 *************** *** 3729,3733 **** for example ! \code{"Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam"} The returned string points into static storage; the caller should not --- 3729,3736 ---- for example ! \code{"Copyright (c) 1995-2000 Corporation for National Research Initiatives;\n\ ! All Rights Reserved.\n\ ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam;\n\ ! All Rights Reserved."} The returned string points into static storage; the caller should not From python-dev@python.org Sun Sep 3 05:44:31 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 21:44:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/inst inst.tex,1.16,1.16.2.1 Message-ID: <200009030444.VAA24771@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/inst In directory slayer.i.sourceforge.net:/tmp/cvs-serv24745/inst Modified Files: Tag: cnri-16-start inst.tex Log Message: Updated copyright notices. Should be good for 1.6 release. Index: inst.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/inst/inst.tex,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -C2 -r1.16 -r1.16.2.1 *** inst.tex 2000/06/30 03:36:41 1.16 --- inst.tex 2000/09/03 04:44:28 1.16.2.1 *************** *** 322,327 **** \begin{verbatim} ! Python 1.5.2 (#1, Apr 18 1999, 16:03:16) [GCC pgcc-2.91.60 19981201 (egcs-1.1.1 on linux2 ! Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import sys >>> sys.prefix --- 322,330 ---- \begin{verbatim} ! Python 1.6 (#22, Sep 2 2000, 23:54:55) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 ! Copyright (c) 1995-2000 Corporation for National Research Initiatives; ! All Rights Reserved. ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam; ! All Rights Reserved. >>> import sys >>> sys.prefix From python-dev@python.org Sun Sep 3 05:44:31 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 21:44:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/tut tut.tex,1.107,1.107.2.1 Message-ID: <200009030444.VAA24783@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/tut In directory slayer.i.sourceforge.net:/tmp/cvs-serv24745/tut Modified Files: Tag: cnri-16-start tut.tex Log Message: Updated copyright notices. Should be good for 1.6 release. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.107 retrieving revision 1.107.2.1 diff -C2 -r1.107 -r1.107.2.1 *** tut.tex 2000/04/17 14:56:31 1.107 --- tut.tex 2000/09/03 04:44:28 1.107.2.1 *************** *** 245,250 **** \begin{verbatim} python ! Python 1.5.2b2 (#1, Feb 28 1999, 00:02:06) [GCC 2.8.1] on sunos5 ! Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> \end{verbatim} --- 245,253 ---- \begin{verbatim} python ! Python 1.6 (#22, Sep 2 2000, 23:54:55) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 ! Copyright (c) 1995-2000 Corporation for National Research Initiatives; ! All Rights Reserved. ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam; ! All Rights Reserved. >>> \end{verbatim} From python-dev@python.org Sun Sep 3 05:46:59 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 21:46:59 -0700 Subject: [Python-checkins] CVS: python/dist/src README,1.85.2.2,1.85.2.3 Message-ID: <200009030446.VAA24871@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv24864 Modified Files: Tag: cnri-16-start README Log Message: Mark-up as requested by CNRI. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.85.2.2 retrieving revision 1.85.2.3 diff -C2 -r1.85.2.2 -r1.85.2.3 *** README 2000/08/14 16:58:06 1.85.2.2 --- README 2000/09/03 04:46:56 1.85.2.3 *************** *** 2,14 **** ========================== ! License information ! ------------------- ! Copyright (c) 1991-1995, Stichting Mathematisch Centrum. All rights reserved. See the file "LICENSE" for information on terms & conditions for ! accessing and otherwise using Python 1.6b1 and for a DISCLAIMER OF ALL ! WARRANTIES. --- 2,17 ---- ========================== ! Copyright (c) 1995-2000 Corporation for National Research Initiatives. ! All rights reserved. ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved. + License information + ------------------- + See the file "LICENSE" for information on terms & conditions for ! accessing and otherwise using this software, and for a DISCLAIMER OF ! ALL WARRANTIES. From python-dev@python.org Sun Sep 3 05:47:49 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 21:47:49 -0700 Subject: [Python-checkins] CVS: python/dist/src README,1.93,1.94 Message-ID: <200009030447.VAA24912@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv24905 Modified Files: README Log Message: Remove a comma from CWI's copyright notice. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -r1.93 -r1.94 *** README 2000/09/01 22:50:02 1.93 --- README 2000/09/03 04:47:47 1.94 *************** *** 8,12 **** All rights reserved. ! Copyright (c) 1991-1995, Stichting Mathematisch Centrum. All rights reserved. --- 8,12 ---- All rights reserved. ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum. All rights reserved. From python-dev@python.org Sun Sep 3 05:56:01 2000 From: python-dev@python.org (Guido van Rossum) Date: Sat, 2 Sep 2000 21:56:01 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs copyright.tex,1.6.6.1,1.6.6.2 Message-ID: <200009030456.VAA25409@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory slayer.i.sourceforge.net:/tmp/cvs-serv25399 Modified Files: Tag: cnri-16-start copyright.tex Log Message: The silly "ACCEPT" "button" is part of the license so let's keep it. Index: copyright.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/copyright.tex,v retrieving revision 1.6.6.1 retrieving revision 1.6.6.2 diff -C2 -r1.6.6.1 -r1.6.6.2 *** copyright.tex 2000/09/03 04:44:28 1.6.6.1 --- copyright.tex 2000/09/03 04:55:58 1.6.6.2 *************** *** 73,74 **** --- 73,76 ---- installing or otherwise using Python 1.6, Licensee agrees to be bound by the terms and conditions of this License Agreement. + + ACCEPT From python-dev@python.org Sun Sep 3 09:15:22 2000 From: python-dev@python.org (Tim Peters) Date: Sun, 3 Sep 2000 01:15:22 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_sre.py,1.9,1.10 Message-ID: <200009030815.BAA03944@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/test In directory slayer.i.sourceforge.net:/tmp/cvs-serv3723/python/dist/src/lib/test Modified Files: test_sre.py Log Message: Repair failing test_sre.py. This was a funny one! The test very subtly relied on 1.5.2's behavior of treating "\x%" as "\x%", i.e. ignoring that was an \x escape that didn't make sense. But /F implemented PEP 223, which causes 2.0 to raise an exception on the bad escape. Fixed by merely making the 3 such strings of this kind into raw strings. Index: test_sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** test_sre.py 2000/09/02 16:36:57 1.9 --- test_sre.py 2000/09/03 08:15:19 1.10 *************** *** 51,57 **** test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1) test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1) ! test(r"""sre.match("\x%02x" % i, chr(i)) != None""", 1) ! test(r"""sre.match("\x%02x0" % i, chr(i)+"0") != None""", 1) ! test(r"""sre.match("\x%02xz" % i, chr(i)+"z") != None""", 1) test(r"""sre.match("\911", "")""", None, sre.error) --- 51,57 ---- test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1) test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1) ! test(r"""sre.match(r"\x%02x" % i, chr(i)) != None""", 1) ! test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") != None""", 1) ! test(r"""sre.match(r"\x%02xz" % i, chr(i)+"z") != None""", 1) test(r"""sre.match("\911", "")""", None, sre.error) From python-dev@python.org Sun Sep 3 11:43:19 2000 From: python-dev@python.org (Fredrik Lundh) Date: Sun, 3 Sep 2000 03:43:19 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_sre.py,1.10,1.11 re_tests.py,1.18,1.19 Message-ID: <200009031043.DAA03769@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/test In directory slayer.i.sourceforge.net:/tmp/cvs-serv2426/Lib/test Modified Files: test_sre.py re_tests.py Log Message: updated SRE test suite (fixes PEP223 problem, shows syntax errors) Index: test_sre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_sre.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** test_sre.py 2000/09/03 08:15:19 1.10 --- test_sre.py 2000/09/03 10:43:16 1.11 *************** *** 48,54 **** for i in [0, 8, 16, 32, 64, 127, 128, 255]: ! test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1) ! test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1) ! test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1) test(r"""sre.match(r"\x%02x" % i, chr(i)) != None""", 1) test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") != None""", 1) --- 48,54 ---- for i in [0, 8, 16, 32, 64, 127, 128, 255]: ! test(r"""sre.match(r"\%03o" % i, chr(i)) != None""", 1) ! test(r"""sre.match(r"\%03o0" % i, chr(i)+"0") != None""", 1) ! test(r"""sre.match(r"\%03o8" % i, chr(i)+"8") != None""", 1) test(r"""sre.match(r"\x%02x" % i, chr(i)) != None""", 1) test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") != None""", 1) *************** *** 62,86 **** print 'Running tests on sre.search and sre.match' ! test(r"""sre.search('x*', 'axx').span(0)""", (0, 0)) ! test(r"""sre.search('x*', 'axx').span()""", (0, 0)) ! test(r"""sre.search('x+', 'axx').span(0)""", (1, 3)) ! test(r"""sre.search('x+', 'axx').span()""", (1, 3)) ! test(r"""sre.search('x', 'aaa')""", None) ! ! test(r"""sre.match('a*', 'xxx').span(0)""", (0, 0)) ! test(r"""sre.match('a*', 'xxx').span()""", (0, 0)) ! test(r"""sre.match('x*', 'xxxa').span(0)""", (0, 3)) ! test(r"""sre.match('x*', 'xxxa').span()""", (0, 3)) ! test(r"""sre.match('a+', 'xxx')""", None) # bug 113254 ! test(r"""sre.match('(a)|(b)', 'b').start(1)""", -1) ! test(r"""sre.match('(a)|(b)', 'b').end(1)""", -1) ! test(r"""sre.match('(a)|(b)', 'b').span(1)""", (-1, -1)) if verbose: print 'Running tests on sre.sub' ! test(r"""sre.sub("(?i)b+", "x", "bbbb BBBB")""", 'x x') def bump_num(matchobj): --- 62,86 ---- print 'Running tests on sre.search and sre.match' ! test(r"""sre.search(r'x*', 'axx').span(0)""", (0, 0)) ! test(r"""sre.search(r'x*', 'axx').span()""", (0, 0)) ! test(r"""sre.search(r'x+', 'axx').span(0)""", (1, 3)) ! test(r"""sre.search(r'x+', 'axx').span()""", (1, 3)) ! test(r"""sre.search(r'x', 'aaa')""", None) ! ! test(r"""sre.match(r'a*', 'xxx').span(0)""", (0, 0)) ! test(r"""sre.match(r'a*', 'xxx').span()""", (0, 0)) ! test(r"""sre.match(r'x*', 'xxxa').span(0)""", (0, 3)) ! test(r"""sre.match(r'x*', 'xxxa').span()""", (0, 3)) ! test(r"""sre.match(r'a+', 'xxx')""", None) # bug 113254 ! test(r"""sre.match(r'(a)|(b)', 'b').start(1)""", -1) ! test(r"""sre.match(r'(a)|(b)', 'b').end(1)""", -1) ! test(r"""sre.match(r'(a)|(b)', 'b').span(1)""", (-1, -1)) if verbose: print 'Running tests on sre.sub' ! test(r"""sre.sub(r"(?i)b+", "x", "bbbb BBBB")""", 'x x') def bump_num(matchobj): *************** *** 91,178 **** test(r"""sre.sub(r'\d+', bump_num, '08.2 -2 23x99y', 3)""", '9.3 -3 23x99y') ! test(r"""sre.sub('.', lambda m: r"\n", 'x')""", '\\n') ! test(r"""sre.sub('.', r"\n", 'x')""", '\n') s = r"\1\1" ! test(r"""sre.sub('(.)', s, 'x')""", 'xx') ! test(r"""sre.sub('(.)', sre.escape(s), 'x')""", s) ! test(r"""sre.sub('(.)', lambda m: s, 'x')""", s) ! ! test(r"""sre.sub('(?Px)', '\g\g', 'xx')""", 'xxxx') ! test(r"""sre.sub('(?Px)', '\g\g<1>', 'xx')""", 'xxxx') ! test(r"""sre.sub('(?Px)', '\g\g', 'xx')""", 'xxxx') ! test(r"""sre.sub('(?Px)', '\g<1>\g<1>', 'xx')""", 'xxxx') ! ! test(r"""sre.sub('a', r'\t\n\v\r\f\a\b\B\Z\a\A\w\W\s\S\d\D', 'a')""", '\t\n\v\r\f\a\b\\B\\Z\a\\A\\w\\W\\s\\S\\d\\D') ! test(r"""sre.sub('a', '\t\n\v\r\f\a', 'a')""", '\t\n\v\r\f\a') ! test(r"""sre.sub('a', '\t\n\v\r\f\a', 'a')""", (chr(9)+chr(10)+chr(11)+chr(13)+chr(12)+chr(7))) ! test(r"""sre.sub('^\s*', 'X', 'test')""", 'Xtest') # qualified sub ! test(r"""sre.sub('a', 'b', 'aaaaa')""", 'bbbbb') ! test(r"""sre.sub('a', 'b', 'aaaaa', 1)""", 'baaaa') if verbose: print 'Running tests on symbolic references' ! test(r"""sre.sub('(?Px)', '\gx)', '\g<', 'xx')""", None, sre.error) ! test(r"""sre.sub('(?Px)', '\g', 'xx')""", None, sre.error) ! test(r"""sre.sub('(?Px)', '\g', 'xx')""", None, sre.error) ! test(r"""sre.sub('(?Px)', '\g<1a1>', 'xx')""", None, sre.error) ! test(r"""sre.sub('(?Px)', '\g', 'xx')""", None, IndexError) ! test(r"""sre.sub('(?Px)|(?Py)', '\g', 'xx')""", None, sre.error) ! test(r"""sre.sub('(?Px)|(?Py)', '\\2', 'xx')""", None, sre.error) if verbose: print 'Running tests on sre.subn' ! test(r"""sre.subn("(?i)b+", "x", "bbbb BBBB")""", ('x x', 2)) ! test(r"""sre.subn("b+", "x", "bbbb BBBB")""", ('x BBBB', 1)) ! test(r"""sre.subn("b+", "x", "xyz")""", ('xyz', 0)) ! test(r"""sre.subn("b*", "x", "xyz")""", ('xxxyxzx', 4)) ! test(r"""sre.subn("b*", "x", "xyz", 2)""", ('xxxyz', 2)) if verbose: print 'Running tests on sre.split' ! test(r"""sre.split(":", ":a:b::c")""", ['', 'a', 'b', '', 'c']) ! test(r"""sre.split(":*", ":a:b::c")""", ['', 'a', 'b', 'c']) ! test(r"""sre.split("(:*)", ":a:b::c")""", ['', ':', 'a', ':', 'b', '::', 'c']) ! test(r"""sre.split("(?::*)", ":a:b::c")""", ['', 'a', 'b', 'c']) ! test(r"""sre.split("(:)*", ":a:b::c")""", ['', ':', 'a', ':', 'b', ':', 'c']) ! test(r"""sre.split("([b:]+)", ":a:b::c")""", ['', ':', 'a', ':b::', 'c']) ! test(r"""sre.split("(b)|(:+)", ":a:b::c")""", ['', None, ':', 'a', None, ':', '', 'b', None, '', None, '::', 'c']) ! test(r"""sre.split("(?:b)|(?::+)", ":a:b::c")""", ['', 'a', '', '', 'c']) ! test(r"""sre.split(":", ":a:b::c", 2)""", ['', 'a', 'b::c']) ! test(r"""sre.split(':', 'a:b:c:d', 2)""", ['a', 'b', 'c:d']) ! test(r"""sre.split("(:)", ":a:b::c", 2)""", ['', ':', 'a', ':', 'b::c']) ! test(r"""sre.split("(:*)", ":a:b::c", 2)""", ['', ':', 'a', ':', 'b::c']) if verbose: print "Running tests on sre.findall" ! test(r"""sre.findall(":+", "abc")""", []) ! test(r"""sre.findall(":+", "a:b::c:::d")""", [":", "::", ":::"]) ! test(r"""sre.findall("(:+)", "a:b::c:::d")""", [":", "::", ":::"]) ! test(r"""sre.findall("(:)(:*)", "a:b::c:::d")""", [(":", ""), (":", ":"), (":", "::")]) ! test(r"""sre.findall("(a)|(b)", "abc")""", [("a", ""), ("", "b")]) if verbose: print "Running tests on sre.match" ! test(r"""sre.match('a', 'a').groups()""", ()) ! test(r"""sre.match('(a)', 'a').groups()""", ('a',)) ! test(r"""sre.match('(a)', 'a').group(0)""", 'a') ! test(r"""sre.match('(a)', 'a').group(1)""", 'a') ! test(r"""sre.match('(a)', 'a').group(1, 1)""", ('a', 'a')) ! pat = sre.compile('((a)|(b))(c)?') test(r"""pat.match('a').groups()""", ('a', 'a', None, None)) test(r"""pat.match('b').groups()""", ('b', None, 'b', None)) --- 91,178 ---- test(r"""sre.sub(r'\d+', bump_num, '08.2 -2 23x99y', 3)""", '9.3 -3 23x99y') ! test(r"""sre.sub(r'.', lambda m: r"\n", 'x')""", '\\n') ! test(r"""sre.sub(r'.', r"\n", 'x')""", '\n') s = r"\1\1" ! test(r"""sre.sub(r'(.)', s, 'x')""", 'xx') ! test(r"""sre.sub(r'(.)', sre.escape(s), 'x')""", s) ! test(r"""sre.sub(r'(.)', lambda m: s, 'x')""", s) ! ! test(r"""sre.sub(r'(?Px)', '\g\g', 'xx')""", 'xxxx') ! test(r"""sre.sub(r'(?Px)', '\g\g<1>', 'xx')""", 'xxxx') ! test(r"""sre.sub(r'(?Px)', '\g\g', 'xx')""", 'xxxx') ! test(r"""sre.sub(r'(?Px)', '\g<1>\g<1>', 'xx')""", 'xxxx') ! ! test(r"""sre.sub(r'a', r'\t\n\v\r\f\a\b\B\Z\a\A\w\W\s\S\d\D', 'a')""", '\t\n\v\r\f\a\b\\B\\Z\a\\A\\w\\W\\s\\S\\d\\D') ! test(r"""sre.sub(r'a', '\t\n\v\r\f\a', 'a')""", '\t\n\v\r\f\a') ! test(r"""sre.sub(r'a', '\t\n\v\r\f\a', 'a')""", (chr(9)+chr(10)+chr(11)+chr(13)+chr(12)+chr(7))) ! test(r"""sre.sub(r'^\s*', 'X', 'test')""", 'Xtest') # qualified sub ! test(r"""sre.sub(r'a', 'b', 'aaaaa')""", 'bbbbb') ! test(r"""sre.sub(r'a', 'b', 'aaaaa', 1)""", 'baaaa') if verbose: print 'Running tests on symbolic references' ! test(r"""sre.sub(r'(?Px)', '\gx)', '\g<', 'xx')""", None, sre.error) ! test(r"""sre.sub(r'(?Px)', '\g', 'xx')""", None, sre.error) ! test(r"""sre.sub(r'(?Px)', '\g', 'xx')""", None, sre.error) ! test(r"""sre.sub(r'(?Px)', '\g<1a1>', 'xx')""", None, sre.error) ! test(r"""sre.sub(r'(?Px)', '\g', 'xx')""", None, IndexError) ! test(r"""sre.sub(r'(?Px)|(?Py)', '\g', 'xx')""", None, sre.error) ! test(r"""sre.sub(r'(?Px)|(?Py)', '\\2', 'xx')""", None, sre.error) if verbose: print 'Running tests on sre.subn' ! test(r"""sre.subn(r"(?i)b+", "x", "bbbb BBBB")""", ('x x', 2)) ! test(r"""sre.subn(r"b+", "x", "bbbb BBBB")""", ('x BBBB', 1)) ! test(r"""sre.subn(r"b+", "x", "xyz")""", ('xyz', 0)) ! test(r"""sre.subn(r"b*", "x", "xyz")""", ('xxxyxzx', 4)) ! test(r"""sre.subn(r"b*", "x", "xyz", 2)""", ('xxxyz', 2)) if verbose: print 'Running tests on sre.split' ! test(r"""sre.split(r":", ":a:b::c")""", ['', 'a', 'b', '', 'c']) ! test(r"""sre.split(r":*", ":a:b::c")""", ['', 'a', 'b', 'c']) ! test(r"""sre.split(r"(:*)", ":a:b::c")""", ['', ':', 'a', ':', 'b', '::', 'c']) ! test(r"""sre.split(r"(?::*)", ":a:b::c")""", ['', 'a', 'b', 'c']) ! test(r"""sre.split(r"(:)*", ":a:b::c")""", ['', ':', 'a', ':', 'b', ':', 'c']) ! test(r"""sre.split(r"([b:]+)", ":a:b::c")""", ['', ':', 'a', ':b::', 'c']) ! test(r"""sre.split(r"(b)|(:+)", ":a:b::c")""", ['', None, ':', 'a', None, ':', '', 'b', None, '', None, '::', 'c']) ! test(r"""sre.split(r"(?:b)|(?::+)", ":a:b::c")""", ['', 'a', '', '', 'c']) ! test(r"""sre.split(r":", ":a:b::c", 2)""", ['', 'a', 'b::c']) ! test(r"""sre.split(r':', 'a:b:c:d', 2)""", ['a', 'b', 'c:d']) ! test(r"""sre.split(r"(:)", ":a:b::c", 2)""", ['', ':', 'a', ':', 'b::c']) ! test(r"""sre.split(r"(:*)", ":a:b::c", 2)""", ['', ':', 'a', ':', 'b::c']) if verbose: print "Running tests on sre.findall" ! test(r"""sre.findall(r":+", "abc")""", []) ! test(r"""sre.findall(r":+", "a:b::c:::d")""", [":", "::", ":::"]) ! test(r"""sre.findall(r"(:+)", "a:b::c:::d")""", [":", "::", ":::"]) ! test(r"""sre.findall(r"(:)(:*)", "a:b::c:::d")""", [(":", ""), (":", ":"), (":", "::")]) ! test(r"""sre.findall(r"(a)|(b)", "abc")""", [("a", ""), ("", "b")]) if verbose: print "Running tests on sre.match" ! test(r"""sre.match(r'a', 'a').groups()""", ()) ! test(r"""sre.match(r'(a)', 'a').groups()""", ('a',)) ! test(r"""sre.match(r'(a)', 'a').group(0)""", 'a') ! test(r"""sre.match(r'(a)', 'a').group(1)""", 'a') ! test(r"""sre.match(r'(a)', 'a').group(1, 1)""", ('a', 'a')) ! pat = sre.compile(r'((a)|(b))(c)?') test(r"""pat.match('a').groups()""", ('a', 'a', None, None)) test(r"""pat.match('b').groups()""", ('b', None, 'b', None)) *************** *** 181,185 **** test(r"""pat.match('bc').groups("")""", ('b', "", 'b', 'c')) ! pat = sre.compile('(?:(?Pa)|(?Pb))(?Pc)?') test(r"""pat.match('a').group(1, 2, 3)""", ('a', None, None)) test(r"""pat.match('b').group('a1', 'b2', 'c3')""", (None, 'b', None)) --- 181,185 ---- test(r"""pat.match('bc').groups("")""", ('b', "", 'b', 'c')) ! pat = sre.compile(r'(?:(?Pa)|(?Pb))(?Pc)?') test(r"""pat.match('a').group(1, 2, 3)""", ('a', None, None)) test(r"""pat.match('b').group('a1', 'b2', 'c3')""", (None, 'b', None)) *************** *** 204,208 **** try: import pickle ! pat = sre.compile('a(?:b|(c|e){1,2}?|d)+?(.)') s = pickle.dumps(pat) pat = pickle.loads(s) --- 204,208 ---- try: import pickle ! pat = sre.compile(r'a(?:b|(c|e){1,2}?|d)+?(.)') s = pickle.dumps(pat) pat = pickle.loads(s) *************** *** 212,216 **** try: import cPickle ! pat = sre.compile('a(?:b|(c|e){1,2}?|d)+?(.)') s = cPickle.dumps(pat) pat = cPickle.loads(s) --- 212,216 ---- try: import cPickle ! pat = sre.compile(r'a(?:b|(c|e){1,2}?|d)+?(.)') s = cPickle.dumps(pat) pat = cPickle.loads(s) *************** *** 238,244 **** # Try nasty case that overflows the straightforward recursive # implementation of repeated groups. ! test(r"""sre.match('(x)*', 50000*'x').span()""", (0, 50000), RuntimeError) ! test(r"""sre.match('(x)*y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) ! test(r"""sre.match('(x)*?y', 50000*'x'+'y').span()""", (0, 50001), RuntimeError) from re_tests import * --- 238,247 ---- # Try nasty case that overflows the straightforward recursive # implementation of repeated groups. ! test(r"""sre.match(r'(x)*', 50000*'x').span()""", ! (0, 50000), RuntimeError) ! test(r"""sre.match(r'(x)*y', 50000*'x'+'y').span()""", ! (0, 50001), RuntimeError) ! test(r"""sre.match(r'(x)*?y', 50000*'x'+'y').span()""", ! (0, 50001), RuntimeError) from re_tests import * *************** *** 278,283 **** print '=== Unexpected exception', t, repr(msg) if outcome==SYNTAX_ERROR: ! # This should have been a syntax error; forget it. ! pass elif outcome==FAIL: if result is None: pass # No match, as expected --- 281,285 ---- print '=== Unexpected exception', t, repr(msg) if outcome==SYNTAX_ERROR: ! print '=== Compiled incorrectly', t elif outcome==FAIL: if result is None: pass # No match, as expected Index: re_tests.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/re_tests.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 From python-dev@python.org Sun Sep 3 12:29:55 2000 From: python-dev@python.org (Fredrik Lundh) Date: Sun, 3 Sep 2000 04:29:55 -0700 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.60,2.61 Message-ID: <200009031129.EAA19842@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Objects In directory slayer.i.sourceforge.net:/tmp/cvs-serv17379/Objects Modified Files: unicodeobject.c Log Message: changed \x to consume exactly two hex digits, also for unicode strings. closes PEP-223. also added \U escape (eight hex digits). Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.60 retrieving revision 2.61 diff -C2 -r2.60 -r2.61 *** unicodeobject.c 2000/08/18 19:30:40 2.60 --- unicodeobject.c 2000/09/03 11:29:49 2.61 *************** *** 1164,1167 **** --- 1164,1168 ---- Py_UNICODE *p = NULL, *buf = NULL; const char *end; + Py_UCS4 chr; /* Escaped strings will always be longer than the resulting *************** *** 1215,1240 **** break; ! /* \xXXXX escape with 1-n hex digits. for compatibility ! with 8-bit strings, this code ignores all but the last ! two digits */ case 'x': ! x = 0; ! c = (unsigned char)*s; ! if (isxdigit(c)) { ! do { ! x = (x<<4) & 0xF0; ! if ('0' <= c && c <= '9') ! x += c - '0'; ! else if ('a' <= c && c <= 'f') ! x += 10 + c - 'a'; ! else ! x += 10 + c - 'A'; ! c = (unsigned char)*++s; ! } while (isxdigit(c)); ! *p++ = (unsigned char) x; ! } else { ! *p++ = '\\'; ! *p++ = (unsigned char)s[-1]; } break; --- 1216,1240 ---- break; ! /* \xXX with two hex digits */ case 'x': ! for (x = 0, i = 0; i < 2; i++) { ! c = (unsigned char)s[i]; ! if (!isxdigit(c)) { ! if (unicodeescape_decoding_error(&s, &x, errors, ! "truncated \\xXX")) ! goto onError; ! i++; ! break; ! } ! x = (x<<4) & ~0xF; ! if (c >= '0' && c <= '9') ! x += c - '0'; ! else if (c >= 'a' && c <= 'f') ! x += 10 + c - 'a'; ! else ! x += 10 + c - 'A'; } + s += i; + *p++ = x; break; *************** *** 1262,1273 **** break; case 'N': /* Ok, we need to deal with Unicode Character Names now, * make sure we've imported the hash table data... */ ! if (pucnHash == NULL) ! { PyObject *mod = 0, *v = 0; - mod = PyImport_ImportModule("ucnhash"); if (mod == NULL) --- 1262,1293 ---- break; + /* \UXXXXXXXX with 8 hex digits */ + case 'U': + for (chr = 0, i = 0; i < 8; i++) { + c = (unsigned char)s[i]; + if (!isxdigit(c)) { + if (unicodeescape_decoding_error(&s, &x, errors, + "truncated \\uXXXX")) + goto onError; + i++; + break; + } + chr = (chr<<4) & ~0xF; + if (c >= '0' && c <= '9') + chr += c - '0'; + else if (c >= 'a' && c <= 'f') + chr += 10 + c - 'a'; + else + chr += 10 + c - 'A'; + } + s += i; + goto store; + case 'N': /* Ok, we need to deal with Unicode Character Names now, * make sure we've imported the hash table data... */ ! if (pucnHash == NULL) { PyObject *mod = 0, *v = 0; mod = PyImport_ImportModule("ucnhash"); if (mod == NULL) *************** *** 1276,1295 **** Py_DECREF(mod); if (v == NULL) - { goto onError; - } pucnHash = PyCObject_AsVoidPtr(v); Py_DECREF(v); if (pucnHash == NULL) - { goto onError; - } } ! if (*s == '{') ! { const char *start = s + 1; const char *endBrace = start; - Py_UCS4 value; unsigned long j; --- 1296,1309 ---- Py_DECREF(mod); if (v == NULL) goto onError; pucnHash = PyCObject_AsVoidPtr(v); Py_DECREF(v); if (pucnHash == NULL) goto onError; } ! if (*s == '{') { const char *start = s + 1; const char *endBrace = start; unsigned long j; *************** *** 1304,1309 **** endBrace++; } ! if (endBrace != end && *endBrace == '}') ! { j = pucnHash->hash(start, endBrace - start); if (j > pucnHash->cKeys || --- 1318,1322 ---- endBrace++; } ! if (endBrace != end && *endBrace == '}') { j = pucnHash->hash(start, endBrace - start); if (j > pucnHash->cKeys || *************** *** 1321,1349 **** } goto ucnFallthrough; - } - value = ((_Py_UnicodeCharacterName *) - (pucnHash->getValue(j)))->value; - if (value < 1<<16) - { - /* In UCS-2 range, easy solution.. */ - *p++ = value; } ! else ! { ! /* Oops, its in UCS-4 space, */ ! /* compute and append the two surrogates: */ ! /* translate from 10000..10FFFF to 0..FFFFF */ ! value -= 0x10000; ! ! /* high surrogate = top 10 bits added to D800 */ ! *p++ = 0xD800 + (value >> 10); ! ! /* low surrogate = bottom 10 bits added to DC00 */ ! *p++ = 0xDC00 + (value & ~0xFC00); ! } s = endBrace + 1; ! } ! else ! { if (unicodeescape_decoding_error( &s, &x, errors, --- 1334,1343 ---- } goto ucnFallthrough; } ! chr = ((_Py_UnicodeCharacterName *) ! (pucnHash->getValue(j)))->value; s = endBrace + 1; ! goto store; ! } else { if (unicodeescape_decoding_error( &s, &x, errors, *************** *** 1364,1367 **** --- 1358,1378 ---- *p++ = (unsigned char)s[-1]; break; + store: + /* when we get here, chr is a 32-bit unicode character */ + if (chr <= 0xffff) + /* UCS-2 character */ + *p++ = (Py_UNICODE) chr; + else if (chr <= 0x10ffff) { + /* UCS-4 character. store as two surrogate characters */ + chr -= 0x10000L; + *p++ = 0xD800 + (Py_UNICODE) (chr >> 10); + *p++ = 0xDC00 + (Py_UNICODE) (chr & ~0xFC00); + } else { + if (unicodeescape_decoding_error( + &s, &x, errors, + "Illegal Unicode character") + ) + goto onError; + } } } From python-dev@python.org Sun Sep 3 14:21:42 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 06:21:42 -0700 Subject: [Python-checkins] CVS: python/dist/src LICENSE,1.3,1.4 Message-ID: <200009031321.GAA12960@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv12899 Modified Files: LICENSE Log Message: Properly name and number the BEOPEN OPEN SOURCE PYTHON LICENSE AGREEMENT VERSION 1. trade name -> trade names. Note: depending on community feedback, we may end up taking the dual licensing clause out for 2.0b1, and put it back into 2.0final, if there's no other solution for assuring GPL compatibility by then. See my message to python-dev and license-py20. Index: LICENSE =================================================================== RCS file: /cvsroot/python/python/dist/src/LICENSE,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** LICENSE 2000/09/03 03:13:44 1.3 --- LICENSE 2000/09/03 13:21:38 1.4 *************** *** 20,28 **** ============================================== ! BEOPEN PYTHON LICENSE AGREEMENT ! ------------------------------- - BEOPEN OPEN SOURCE LICENSE AGREEMENT - 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the --- 20,26 ---- ============================================== ! BEOPEN OPEN SOURCE PYTHON LICENSE AGREEMENT VERSION 1 ! ----------------------------------------------------- 1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the *************** *** 65,71 **** create any relationship of agency, partnership, or joint venture between BeOpen and Licensee. This License Agreement does not grant ! permission to use BeOpen trademarks or trade name in a trademark sense ! to endorse or promote products or services of Licensee, or any third ! party. As an exception, the "BeOpen Python" logos available at http://www.pythonlabs.com/logos.html may be used according to the permissions granted on that web page. --- 63,69 ---- create any relationship of agency, partnership, or joint venture between BeOpen and Licensee. This License Agreement does not grant ! permission to use BeOpen trademarks or trade names in a trademark ! sense to endorse or promote products or services of Licensee, or any ! third party. As an exception, the "BeOpen Python" logos available at http://www.pythonlabs.com/logos.html may be used according to the permissions granted on that web page. From python-dev@python.org Sun Sep 3 15:47:03 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 07:47:03 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python16.wse,1.8.2.2.2.2,1.8.2.2.2.3 Message-ID: <200009031447.HAA29463@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/PCbuild In directory slayer.i.sourceforge.net:/tmp/cvs-serv28592 Modified Files: Tag: cnri-16-start python16.wse Log Message: Install LICENSE.txt and README.txt. Change version to 1.6 (final). Change location of source tree to match Tim Peters's setup. Index: python16.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/Attic/python16.wse,v retrieving revision 1.8.2.2.2.2 retrieving revision 1.8.2.2.2.3 diff -C2 -r1.8.2.2.2.2 -r1.8.2.2.2.3 *** python16.wse 2000/08/22 14:12:58 1.8.2.2.2.2 --- python16.wse 2000/09/03 14:46:58 1.8.2.2.2.3 *************** *** 2,6 **** item: Global Version=5.0 ! Title=Python 1.6 beta 1 Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 --- 2,6 ---- item: Global Version=5.0 ! Title=Python 1.6 (final) Flags=00010100 Languages=65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 *************** *** 27,35 **** Variable Name3=_SRC_ Variable Description3=Python source directory ! Variable Default3=C:\src\Python-1.6 Variable Flags3=00001001 Variable Name4=_DOC_ Variable Description4=HTML documentation tree directory ! Variable Default4=C:\src\Python-1.6\html Variable Flags4=00001001 Variable Name5=_TCLMINOR_ --- 27,35 ---- Variable Name3=_SRC_ Variable Description3=Python source directory ! Variable Default3=C:\code\python\dist\src16 Variable Flags3=00001001 Variable Name4=_DOC_ Variable Description4=HTML documentation tree directory ! Variable Default4=C:\code\python\dist\src16\html Variable Flags4=00001001 Variable Name5=_TCLMINOR_ *************** *** 60,64 **** item: Set Variable Variable=APPTITLE ! Value=Python 1.6 beta 1 end item: Set Variable --- 60,64 ---- item: Set Variable Variable=APPTITLE ! Value=Python 1.6 (final) end item: Set Variable *************** *** 650,653 **** --- 650,665 ---- Value=D Flags=00001010 + end + item: Install File + Source=%_SRC_%\README + Destination=%MAINDIR%\README.txt + Description=Readme file + Flags=0000000000000010 + end + item: Install File + Source=%_SRC_%\LICENSE + Destination=%MAINDIR%\LICENSE.txt + Description=License file + Flags=0000000000000010 end item: Install File From python-dev@python.org Sun Sep 3 16:11:01 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 08:11:01 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0214.txt,1.6,1.7 Message-ID: <200009031511.IAA18703@slayer.i.sourceforge.net> Update of /cvsroot/python/python/nondist/peps In directory slayer.i.sourceforge.net:/tmp/cvs-serv18674 Modified Files: pep-0214.txt Log Message: Extend justifications. Add print>>None. Index: pep-0214.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0214.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** pep-0214.txt 2000/08/25 14:15:49 1.6 --- pep-0214.txt 2000/09/03 15:10:58 1.7 *************** *** 252,255 **** --- 252,353 ---- file. + Challenge: Why not > instead of >>? + + Response: To DOS and Unix users, >> suggests "append", while > + suggests "overwrite"; the semantics are closest to append. Also, + for C++ programmers, >> and << are I/O operators. + + Challenge: But in C++, >> is input and << is output! + + Response: doesn't matter; C++ clearly took it from Unix and + reversed the arrows. The important thing is that for output, the + arrow points to the file. + + Challenge: Surely you can design a println() function can do all + what print>>file can do; why isn't that enough? + + Response: I think of this in terms of a simple programming + exercise. Suppose a beginning programmer is asked to write a + function that prints the tables of multiplication. A reasonable + solution is: + + def tables(n): + for j in range(1, n+1): + for i in range(1, n+1): + print i, 'x', j, '=', i*j + print + + Now suppose the second exercise is to add printing to a different + file. With the new syntax, the programmer only needs to learn one + new thing: print >> file, and the answer can be like this: + + def tables(n, file=sys.stdout): + for j in range(1, n+1): + for i in range(1, n+1): + print >> file, i, 'x', j, '=', i*j + print >> file + + With only a print statement and a println() function, the + programmer first has to learn about println(), transforming the + original program to using println(): + + def tables(n): + for j in range(1, n+1): + for i in range(1, n+1): + println(i, 'x', j, '=', i*j) + println() + + and *then* about the file keyword argument: + + def tables(n, file=sys.stdout): + for j in range(1, n+1): + for i in range(1, n+1): + println(i, 'x', j, '=', i*j, file=sys.stdout) + println(file=sys.stdout) + + Thus, the transformation path is longer: + + (1) print + (2) print >> file + + vs. + + (1) print + (2) println() + (3) println(file=...) + + Note: defaulting the file argument to sys.stdout at compile time + is wrong, because it doesn't work right when the caller assigns to + sys.stdout and then uses tables() without specifying the file. + This is a common problem (and would occur with a println() + function too). The standard solution so far has been: + + def tables(n, file=None): + if file is None: + file = sys.stdout + for j in range(1, n+1): + for i in range(1, n+1): + print >> file, i, 'x', j, '=', i*j + print >> file + + I've added a feature to the implementation (which I would also + recommend to println()) whereby if the file argument is None, + sys.stdout is automatically used. Thus, + + print >> None, foo bar + + (or, of course, print >> x where x is a variable whose value is + None) means the same as + + print foo, bar + + and the tables() function can be written as follows: + + def tables(n, file=None): + for j in range(1, n+1): + for i in range(1, n+1): + print >> file, i, 'x', j, '=', i*j + print >> file + References From python-dev@python.org Sun Sep 3 17:06:31 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 09:06:31 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/dos-8x3 basehttp.py,1.5,1.5.2.1 configpa.py,1.6,1.6.2.1 simpleht.py,1.5,1.5.2.1 socketse.py,1.9,1.9.2.1 sre_comp.py,1.1,1.1.2.1 sre_cons.py,1.1,1.1.2.1 sre_pars.py,1.1,1.1.2.1 test_str.py,1.8,1.8.4.1 test_uni.py,1.1,1.1.2.1 test_win.py,1.1,1.1.2.1 threadst.py,1.1,NONE Message-ID: <200009031606.JAA32761@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/dos-8x3 In directory slayer.i.sourceforge.net:/tmp/cvs-serv32685 Modified Files: Tag: cnri-16-start basehttp.py configpa.py simpleht.py socketse.py sre_comp.py sre_cons.py sre_pars.py test_str.py test_uni.py test_win.py Removed Files: Tag: cnri-16-start threadst.py Log Message: The usual Index: basehttp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/basehttp.py,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -r1.5 -r1.5.2.1 *** basehttp.py 2000/05/08 17:30:59 1.5 --- basehttp.py 2000/09/03 16:06:27 1.5.2.1 *************** *** 88,91 **** --- 88,93 ---- class HTTPServer(SocketServer.TCPServer): + allow_reuse_address = 1 # Seems to make sense in testing environment + def server_bind(self): """Override server_bind to store the server name.""" Index: configpa.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/configpa.py,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -r1.6 -r1.6.2.1 *** configpa.py 2000/05/08 17:30:59 1.6 --- configpa.py 2000/09/03 16:06:27 1.6.2.1 *************** *** 198,202 **** filename may also be given. """ ! if type(filenames) is type(''): filenames = [filenames] for filename in filenames: --- 198,202 ---- filename may also be given. """ ! if type(filenames) in [type(''), type(u'')]: filenames = [filenames] for filename in filenames: Index: simpleht.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/simpleht.py,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -r1.5 -r1.5.2.1 *** simpleht.py 2000/05/08 17:31:01 1.5 --- simpleht.py 2000/09/03 16:06:27 1.5.2.1 *************** *** 7,11 **** ! __version__ = "0.3" --- 7,11 ---- ! __version__ = "0.4" *************** *** 15,18 **** --- 15,20 ---- import BaseHTTPServer import urllib + import cgi + from StringIO import StringIO *************** *** 59,72 **** path = self.translate_path(self.path) if os.path.isdir(path): ! self.send_error(403, "Directory listing not supported") ! return None ! try: ! f = open(path, 'rb') ! except IOError: ! self.send_error(404, "File not found") ! return None self.send_response(200) ! self.send_header("Content-type", self.guess_type(path)) self.end_headers() return f --- 61,101 ---- path = self.translate_path(self.path) if os.path.isdir(path): ! f = self.list_directory(path) ! if f is None: ! return None ! ctype = "text/HTML" ! else: ! try: ! f = open(path, 'rb') ! except IOError: ! self.send_error(404, "File not found") ! return None ! ctype = self.guess_type(path) self.send_response(200) ! self.send_header("Content-type", ctype) self.end_headers() + return f + + def list_directory(self, path): + try: + list = os.listdir(path) + except os.error: + self.send_error(404, "No permission to list directory"); + return None + list.sort(lambda a, b: cmp(a.lower(), b.lower())) + f = StringIO() + f.write("

Directory listing for %s

\n" % self.path) + f.write("
\n
\n
\n") + f.seek(0) return f Index: socketse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/socketse.py,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -r1.9 -r1.9.2.1 *** socketse.py 2000/05/08 17:31:01 1.9 --- socketse.py 2000/09/03 16:06:27 1.9.2.1 *************** *** 142,145 **** --- 142,146 ---- - socket_type - request_queue_size (only for stream sockets) + - reuse_address Instance variables: *************** *** 157,160 **** --- 158,163 ---- request_queue_size = 5 + allow_reuse_address = 0 + def __init__(self, server_address, RequestHandlerClass): """Constructor. May be extended, do not override.""" *************** *** 172,175 **** --- 175,180 ---- """ + if self.allow_reuse_address: + self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self.socket.bind(self.server_address) Index: sre_comp.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/sre_comp.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -r1.1 -r1.1.2.1 *** sre_comp.py 2000/05/08 17:31:01 1.1 --- sre_comp.py 2000/09/03 16:06:27 1.1.2.1 *************** *** 1,5 **** # # Secret Labs' Regular Expression Engine - # $Id$ # # convert template to internal format --- 1,4 ---- *************** *** 7,187 **** # Copyright (c) 1997-2000 by Secret Labs AB. All rights reserved. # ! # This code can only be used for 1.6 alpha testing. All other use ! # require explicit permission from Secret Labs AB. # - # Portions of this engine have been developed in cooperation with - # CNRI. Hewlett-Packard provided funding for 1.6 integration and - # other compatibility work. - # - - # FIXME: formalize (objectify?) and document the compiler code - # format, so that other frontends can use this compiler - import array, string, sys - import _sre from sre_constants import * ! # find an array type code that matches the engine's code size ! for WORDSIZE in "BHil": ! if len(array.array(WORDSIZE, [0]).tostring()) == _sre.getcodesize(): ! break ! else: ! raise RuntimeError, "cannot find a useable array type" ! ! # FIXME: should move some optimizations from the parser to here! ! ! class Code: ! def __init__(self): ! self.data = [] ! def __len__(self): ! return len(self.data) ! def __getitem__(self, index): ! return self.data[index] ! def __setitem__(self, index, code): ! self.data[index] = code ! def append(self, code): ! self.data.append(code) ! def todata(self): ! # print self.data ! return array.array(WORDSIZE, self.data).tostring() ! ! def _lower(literal): ! # return _sre._lower(literal) # FIXME ! return string.lower(literal) def _compile(code, pattern, flags): ! append = code.append for op, av in pattern: ! if op is ANY: ! if "s" in flags: ! append(CODES[op]) # any character at all! ! else: ! append(CODES[NOT_LITERAL]) ! append(10) ! elif op in (SUCCESS, FAILURE): ! append(CODES[op]) ! elif op is AT: ! append(CODES[op]) ! append(POSITIONS[av]) ! elif op is BRANCH: ! append(CODES[op]) ! tail = [] ! for av in av[1]: ! skip = len(code); append(0) ! _compile(code, av, flags) ! append(CODES[JUMP]) ! tail.append(len(code)); append(0) ! code[skip] = len(code) - skip ! append(0) # end of branch ! for tail in tail: ! code[tail] = len(code) - tail ! elif op is CALL: ! append(CODES[op]) ! skip = len(code); append(0) ! _compile(code, av, flags) ! append(CODES[SUCCESS]) ! code[skip] = len(code) - skip ! elif op is CATEGORY: # not used by current parser ! append(CODES[op]) ! append(CATEGORIES[av]) ! elif op is GROUP: ! if "i" in flags: ! append(CODES[MAP_IGNORE[op]]) ! else: ! append(CODES[op]) ! append(av) ! elif op is IN: ! if "i" in flags: ! append(CODES[MAP_IGNORE[op]]) ! def fixup(literal): ! return ord(_lower(literal)) ! else: ! append(CODES[op]) ! fixup = ord ! skip = len(code); append(0) ! for op, av in av: ! append(CODES[op]) ! if op is NEGATE: ! pass ! elif op is LITERAL: ! append(fixup(av)) ! elif op is RANGE: ! append(fixup(av[0])) ! append(fixup(av[1])) ! elif op is CATEGORY: ! append(CATEGORIES[av]) ! else: ! raise ValueError, "unsupported set operator" ! append(CODES[FAILURE]) ! code[skip] = len(code) - skip ! elif op in (LITERAL, NOT_LITERAL): ! if "i" in flags: ! append(CODES[MAP_IGNORE[op]]) ! append(ord(_lower(av))) ! else: ! append(CODES[op]) ! append(ord(av)) ! elif op is MARK: ! append(CODES[op]) ! append(av) ! elif op in (REPEAT, MIN_REPEAT, MAX_REPEAT): ! lo, hi = av[2].getwidth() ! if lo == 0: ! raise SyntaxError, "cannot repeat zero-width items" ! if lo == hi == 1 and op is MAX_REPEAT: ! append(CODES[MAX_REPEAT_ONE]) ! skip = len(code); append(0) ! append(av[0]) ! append(av[1]) ! _compile(code, av[2], flags) ! append(CODES[SUCCESS]) ! code[skip] = len(code) - skip ! else: ! append(CODES[op]) ! skip = len(code); append(0) ! append(av[0]) ! append(av[1]) ! _compile(code, av[2], flags) ! if op is MIN_REPEAT: ! append(CODES[MIN_UNTIL]) ! else: ! # FIXME: MAX_REPEAT PROBABLY DOESN'T WORK (?) ! append(CODES[MAX_UNTIL]) ! code[skip] = len(code) - skip ! elif op is SUBPATTERN: ! ## group = av[0] ! ## if group: ! ## append(CODES[MARK]) ! ## append((group-1)*2) ! _compile(code, av[1], flags) ! ## if group: ! ## append(CODES[MARK]) ! ## append((group-1)*2+1) ! else: ! raise ValueError, ("unsupported operand type", op) ! ! def compile(p, flags=()): ! # convert pattern list to internal format ! if type(p) in (type(""), type(u"")): ! import sre_parse ! pattern = p ! p = sre_parse.parse(p) else: ! pattern = None ! # print p.getwidth() ! # print p ! code = Code() ! _compile(code, p.data, p.pattern.flags) ! code.append(CODES[SUCCESS]) ! # print list(code.data) ! data = code.todata() ! if 0: # debugging ! print ! print "-" * 68 ! import sre_disasm ! sre_disasm.disasm(data) ! print "-" * 68 ! # print len(data), p.pattern.groups, len(p.pattern.groupdict) ! return _sre.compile(pattern, data, p.pattern.groups-1, p.pattern.groupdict) --- 6,381 ---- # Copyright (c) 1997-2000 by Secret Labs AB. All rights reserved. # ! # See the sre.py file for information on usage and redistribution. # import _sre from sre_constants import * ! MAXCODE = 65535 def _compile(code, pattern, flags): ! # internal: compile a (sub)pattern ! emit = code.append for op, av in pattern: ! if op in (LITERAL, NOT_LITERAL): ! if flags & SRE_FLAG_IGNORECASE: ! emit(OPCODES[OP_IGNORE[op]]) ! else: ! emit(OPCODES[op]) ! emit(av) ! elif op is IN: ! if flags & SRE_FLAG_IGNORECASE: ! emit(OPCODES[OP_IGNORE[op]]) ! def fixup(literal, flags=flags): ! return _sre.getlower(literal, flags) ! else: ! emit(OPCODES[op]) ! fixup = lambda x: x ! skip = len(code); emit(0) ! _compile_charset(av, flags, code, fixup) ! code[skip] = len(code) - skip ! elif op is ANY: ! if flags & SRE_FLAG_DOTALL: ! emit(OPCODES[ANY_ALL]) ! else: ! emit(OPCODES[ANY]) ! elif op in (REPEAT, MIN_REPEAT, MAX_REPEAT): ! if flags & SRE_FLAG_TEMPLATE: ! raise error, "internal: unsupported template operator" ! emit(OPCODES[REPEAT]) ! skip = len(code); emit(0) ! emit(av[0]) ! emit(av[1]) ! _compile(code, av[2], flags) ! emit(OPCODES[SUCCESS]) ! code[skip] = len(code) - skip ! elif _simple(av) and op == MAX_REPEAT: ! emit(OPCODES[REPEAT_ONE]) ! skip = len(code); emit(0) ! emit(av[0]) ! emit(av[1]) ! _compile(code, av[2], flags) ! emit(OPCODES[SUCCESS]) ! code[skip] = len(code) - skip ! else: ! emit(OPCODES[REPEAT]) ! skip = len(code); emit(0) ! emit(av[0]) ! emit(av[1]) ! _compile(code, av[2], flags) ! code[skip] = len(code) - skip ! if op == MAX_REPEAT: ! emit(OPCODES[MAX_UNTIL]) ! else: ! emit(OPCODES[MIN_UNTIL]) ! elif op is SUBPATTERN: ! if av[0]: ! emit(OPCODES[MARK]) ! emit((av[0]-1)*2) ! # _compile_info(code, av[1], flags) ! _compile(code, av[1], flags) ! if av[0]: ! emit(OPCODES[MARK]) ! emit((av[0]-1)*2+1) ! elif op in (SUCCESS, FAILURE): ! emit(OPCODES[op]) ! elif op in (ASSERT, ASSERT_NOT): ! emit(OPCODES[op]) ! skip = len(code); emit(0) ! if av[0] >= 0: ! emit(0) # look ahead ! else: ! lo, hi = av[1].getwidth() ! if lo != hi: ! raise error, "look-behind requires fixed-width pattern" ! emit(lo) # look behind ! _compile(code, av[1], flags) ! emit(OPCODES[SUCCESS]) ! code[skip] = len(code) - skip ! elif op is CALL: ! emit(OPCODES[op]) ! skip = len(code); emit(0) ! _compile(code, av, flags) ! emit(OPCODES[SUCCESS]) ! code[skip] = len(code) - skip ! elif op is AT: ! emit(OPCODES[op]) ! if flags & SRE_FLAG_MULTILINE: ! emit(ATCODES[AT_MULTILINE.get(av, av)]) ! else: ! emit(ATCODES[av]) ! elif op is BRANCH: ! emit(OPCODES[op]) ! tail = [] ! for av in av[1]: ! skip = len(code); emit(0) ! # _compile_info(code, av, flags) ! _compile(code, av, flags) ! emit(OPCODES[JUMP]) ! tail.append(len(code)); emit(0) ! code[skip] = len(code) - skip ! emit(0) # end of branch ! for tail in tail: ! code[tail] = len(code) - tail ! elif op is CATEGORY: ! emit(OPCODES[op]) ! if flags & SRE_FLAG_LOCALE: ! emit(CHCODES[CH_LOCALE[av]]) ! elif flags & SRE_FLAG_UNICODE: ! emit(CHCODES[CH_UNICODE[av]]) ! else: ! emit(CHCODES[av]) ! elif op is GROUPREF: ! if flags & SRE_FLAG_IGNORECASE: ! emit(OPCODES[OP_IGNORE[op]]) ! else: ! emit(OPCODES[op]) ! emit(av-1) ! else: ! raise ValueError, ("unsupported operand type", op) ! ! def _compile_charset(charset, flags, code, fixup=None): ! # compile charset subprogram ! emit = code.append ! if not fixup: ! fixup = lambda x: x ! for op, av in _optimize_charset(charset, fixup): ! emit(OPCODES[op]) ! if op is NEGATE: ! pass ! elif op is LITERAL: ! emit(fixup(av)) ! elif op is RANGE: ! emit(fixup(av[0])) ! emit(fixup(av[1])) ! elif op is CHARSET: ! code.extend(av) ! elif op is CATEGORY: ! if flags & SRE_FLAG_LOCALE: ! emit(CHCODES[CH_LOCALE[av]]) ! elif flags & SRE_FLAG_UNICODE: ! emit(CHCODES[CH_UNICODE[av]]) ! else: ! emit(CHCODES[av]) ! else: ! raise error, "internal: unsupported set operator" ! emit(OPCODES[FAILURE]) ! ! def _optimize_charset(charset, fixup): ! # internal: optimize character set ! out = [] ! charmap = [0]*256 ! try: ! for op, av in charset: ! if op is NEGATE: ! out.append((op, av)) ! elif op is LITERAL: ! charmap[fixup(av)] = 1 ! elif op is RANGE: ! for i in range(fixup(av[0]), fixup(av[1])+1): ! charmap[i] = 1 ! elif op is CATEGORY: ! # FIXME: could append to charmap tail ! return charset # cannot compress ! except IndexError: ! # character set contains unicode characters ! return charset ! # compress character map ! i = p = n = 0 ! runs = [] ! for c in charmap: ! if c: ! if n == 0: ! p = i ! n = n + 1 ! elif n: ! runs.append((p, n)) ! n = 0 ! i = i + 1 ! if n: ! runs.append((p, n)) ! if len(runs) <= 2: ! # use literal/range ! for p, n in runs: ! if n == 1: ! out.append((LITERAL, p)) ! else: ! out.append((RANGE, (p, p+n-1))) ! if len(out) < len(charset): ! return out else: ! # use bitmap ! data = [] ! m = 1; v = 0 ! for c in charmap: ! if c: ! v = v + m ! m = m << 1 ! if m > MAXCODE: ! data.append(v) ! m = 1; v = 0 ! out.append((CHARSET, data)) ! return out ! return charset ! ! def _simple(av): ! # check if av is a "simple" operator ! lo, hi = av[2].getwidth() ! if lo == 0: ! raise error, "nothing to repeat" ! return lo == hi == 1 and av[2][0][0] != SUBPATTERN ! ! def _compile_info(code, pattern, flags): ! # internal: compile an info block. in the current version, ! # this contains min/max pattern width, and an optional literal ! # prefix or a character map ! lo, hi = pattern.getwidth() ! if lo == 0: ! return # not worth it ! # look for a literal prefix ! prefix = [] ! prefix_skip = 0 ! charset = [] # not used ! if not (flags & SRE_FLAG_IGNORECASE): ! # look for literal prefix ! for op, av in pattern.data: ! if op is LITERAL: ! if len(prefix) == prefix_skip: ! prefix_skip = prefix_skip + 1 ! prefix.append(av) ! elif op is SUBPATTERN and len(av[1]) == 1: ! op, av = av[1][0] ! if op is LITERAL: ! prefix.append(av) ! else: ! break ! else: ! break ! # if no prefix, look for charset prefix ! if not prefix and pattern.data: ! op, av = pattern.data[0] ! if op is SUBPATTERN and av[1]: ! op, av = av[1][0] ! if op is LITERAL: ! charset.append((op, av)) ! elif op is BRANCH: ! c = [] ! for p in av[1]: ! if not p: ! break ! op, av = p[0] ! if op is LITERAL: ! c.append((op, av)) ! else: ! break ! else: ! charset = c ! elif op is BRANCH: ! c = [] ! for p in av[1]: ! if not p: ! break ! op, av = p[0] ! if op is LITERAL: ! c.append((op, av)) ! else: ! break ! else: ! charset = c ! elif op is IN: ! charset = av ! ## if prefix: ! ## print "*** PREFIX", prefix, prefix_skip ! ## if charset: ! ## print "*** CHARSET", charset ! # add an info block ! emit = code.append ! emit(OPCODES[INFO]) ! skip = len(code); emit(0) ! # literal flag ! mask = 0 ! if prefix: ! mask = SRE_INFO_PREFIX ! if len(prefix) == prefix_skip == len(pattern.data): ! mask = mask + SRE_INFO_LITERAL ! elif charset: ! mask = mask + SRE_INFO_CHARSET ! emit(mask) ! # pattern length ! if lo < MAXCODE: ! emit(lo) ! else: ! emit(MAXCODE) ! prefix = prefix[:MAXCODE] ! if hi < MAXCODE: ! emit(hi) ! else: ! emit(0) ! # add literal prefix ! if prefix: ! emit(len(prefix)) # length ! emit(prefix_skip) # skip ! code.extend(prefix) ! # generate overlap table ! table = [-1] + ([0]*len(prefix)) ! for i in range(len(prefix)): ! table[i+1] = table[i]+1 ! while table[i+1] > 0 and prefix[i] != prefix[table[i+1]-1]: ! table[i+1] = table[table[i+1]-1]+1 ! code.extend(table[1:]) # don't store first entry ! elif charset: ! _compile_charset(charset, 0, code) ! code[skip] = len(code) - skip ! ! STRING_TYPES = [type("")] ! ! try: ! STRING_TYPES.append(type(unicode(""))) ! except NameError: ! pass ! ! def _code(p, flags): ! ! flags = p.pattern.flags | flags ! code = [] ! ! # compile info block ! _compile_info(code, p, flags) ! ! # compile the pattern ! _compile(code, p.data, flags) ! ! code.append(OPCODES[SUCCESS]) ! ! return code ! ! def compile(p, flags=0): ! # internal: convert pattern list to internal format ! ! if type(p) in STRING_TYPES: ! import sre_parse ! pattern = p ! p = sre_parse.parse(p, flags) ! else: ! pattern = None ! ! code = _code(p, flags) ! ! # print code ! ! # FIXME: get rid of this limitation! ! assert p.pattern.groups <= 100,\ ! "sorry, but this version only supports 100 named groups" ! ! # map in either direction ! groupindex = p.pattern.groupdict ! indexgroup = [None] * p.pattern.groups ! for k, i in groupindex.items(): ! indexgroup[i] = k ! ! return _sre.compile( ! pattern, flags, code, ! p.pattern.groups-1, ! groupindex, indexgroup ! ) Index: sre_cons.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/sre_cons.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -r1.1 -r1.1.2.1 *** sre_cons.py 2000/05/08 17:31:01 1.1 --- sre_cons.py 2000/09/03 16:06:27 1.1.2.1 *************** *** 1,5 **** # # Secret Labs' Regular Expression Engine - # $Id$ # # various symbols used by the regular expression engine. --- 1,4 ---- *************** *** 8,18 **** # Copyright (c) 1998-2000 by Secret Labs AB. All rights reserved. # ! # This code can only be used for 1.6 alpha testing. All other use ! # require explicit permission from Secret Labs AB. # ! # Portions of this engine have been developed in cooperation with ! # CNRI. Hewlett-Packard provided funding for 1.6 integration and ! # other compatibility work. ! # # operators --- 7,17 ---- # Copyright (c) 1998-2000 by Secret Labs AB. All rights reserved. # ! # See the sre.py file for information on usage and redistribution. # ! ! # should this really be here? ! ! class error(Exception): ! pass # operators *************** *** 22,34 **** ANY = "any" ASSERT = "assert" AT = "at" BRANCH = "branch" CALL = "call" CATEGORY = "category" ! GROUP = "group" ! GROUP_IGNORE = "group_ignore" IN = "in" IN_IGNORE = "in_ignore" JUMP = "jump" LITERAL = "literal" --- 21,37 ---- ANY = "any" + ANY_ALL = "any_all" ASSERT = "assert" + ASSERT_NOT = "assert_not" AT = "at" BRANCH = "branch" CALL = "call" CATEGORY = "category" ! CHARSET = "charset" ! GROUPREF = "groupref" ! GROUPREF_IGNORE = "groupref_ignore" IN = "in" IN_IGNORE = "in_ignore" + INFO = "info" JUMP = "jump" LITERAL = "literal" *************** *** 36,40 **** MARK = "mark" MAX_REPEAT = "max_repeat" - MAX_REPEAT_ONE = "max_repeat_one" MAX_UNTIL = "max_until" MIN_REPEAT = "min_repeat" --- 39,42 ---- *************** *** 45,58 **** RANGE = "range" REPEAT = "repeat" SUBPATTERN = "subpattern" # positions AT_BEGINNING = "at_beginning" AT_BOUNDARY = "at_boundary" AT_NON_BOUNDARY = "at_non_boundary" AT_END = "at_end" # categories - CATEGORY_DIGIT = "category_digit" CATEGORY_NOT_DIGIT = "category_not_digit" --- 47,62 ---- RANGE = "range" REPEAT = "repeat" + REPEAT_ONE = "repeat_one" SUBPATTERN = "subpattern" # positions AT_BEGINNING = "at_beginning" + AT_BEGINNING_LINE = "at_beginning_line" AT_BOUNDARY = "at_boundary" AT_NON_BOUNDARY = "at_non_boundary" AT_END = "at_end" + AT_END_LINE = "at_end_line" # categories CATEGORY_DIGIT = "category_digit" CATEGORY_NOT_DIGIT = "category_not_digit" *************** *** 61,131 **** CATEGORY_WORD = "category_word" CATEGORY_NOT_WORD = "category_not_word" ! CODES = [ # failure=0 success=1 (just because it looks better that way :-) FAILURE, SUCCESS, ! ANY, ! ASSERT, AT, BRANCH, CALL, CATEGORY, ! GROUP, GROUP_IGNORE, IN, IN_IGNORE, JUMP, LITERAL, LITERAL_IGNORE, MARK, ! MAX_REPEAT, MAX_UNTIL, ! MAX_REPEAT_ONE, ! MIN_REPEAT, MIN_UNTIL, NOT_LITERAL, NOT_LITERAL_IGNORE, NEGATE, RANGE, ! REPEAT ] ! # convert to dictionary ! c = {} ! i = 0 ! for code in CODES: ! c[code] = i ! i = i + 1 ! CODES = c # replacement operations for "ignore case" mode ! MAP_IGNORE = { ! GROUP: GROUP_IGNORE, IN: IN_IGNORE, LITERAL: LITERAL_IGNORE, NOT_LITERAL: NOT_LITERAL_IGNORE } ! POSITIONS = { ! AT_BEGINNING: ord("a"), ! AT_BOUNDARY: ord("b"), ! AT_NON_BOUNDARY: ord("B"), ! AT_END: ord("z"), } ! CATEGORIES = { ! CATEGORY_DIGIT: ord("d"), ! CATEGORY_NOT_DIGIT: ord("D"), ! CATEGORY_SPACE: ord("s"), ! CATEGORY_NOT_SPACE: ord("S"), ! CATEGORY_WORD: ord("w"), ! CATEGORY_NOT_WORD: ord("W"), } if __name__ == "__main__": import string ! items = CODES.items() ! items.sort(lambda a, b: cmp(a[1], b[1])) f = open("sre_constants.h", "w") ! f.write("/* generated by sre_constants.py */\n") ! for k, v in items: ! f.write("#define SRE_OP_" + string.upper(k) + " " + str(v) + "\n") f.close() print "done" --- 65,226 ---- CATEGORY_WORD = "category_word" CATEGORY_NOT_WORD = "category_not_word" + CATEGORY_LINEBREAK = "category_linebreak" + CATEGORY_NOT_LINEBREAK = "category_not_linebreak" + CATEGORY_LOC_WORD = "category_loc_word" + CATEGORY_LOC_NOT_WORD = "category_loc_not_word" + CATEGORY_UNI_DIGIT = "category_uni_digit" + CATEGORY_UNI_NOT_DIGIT = "category_uni_not_digit" + CATEGORY_UNI_SPACE = "category_uni_space" + CATEGORY_UNI_NOT_SPACE = "category_uni_not_space" + CATEGORY_UNI_WORD = "category_uni_word" + CATEGORY_UNI_NOT_WORD = "category_uni_not_word" + CATEGORY_UNI_LINEBREAK = "category_uni_linebreak" + CATEGORY_UNI_NOT_LINEBREAK = "category_uni_not_linebreak" ! OPCODES = [ # failure=0 success=1 (just because it looks better that way :-) FAILURE, SUCCESS, ! ANY, ANY_ALL, ! ASSERT, ASSERT_NOT, AT, BRANCH, CALL, CATEGORY, ! CHARSET, ! GROUPREF, GROUPREF_IGNORE, IN, IN_IGNORE, + INFO, JUMP, LITERAL, LITERAL_IGNORE, MARK, ! MAX_UNTIL, ! MIN_UNTIL, NOT_LITERAL, NOT_LITERAL_IGNORE, NEGATE, RANGE, ! REPEAT, ! REPEAT_ONE, ! SUBPATTERN ! ! ] + ATCODES = [ + AT_BEGINNING, AT_BEGINNING_LINE, AT_BOUNDARY, + AT_NON_BOUNDARY, AT_END, AT_END_LINE ] ! CHCODES = [ ! CATEGORY_DIGIT, CATEGORY_NOT_DIGIT, CATEGORY_SPACE, ! CATEGORY_NOT_SPACE, CATEGORY_WORD, CATEGORY_NOT_WORD, ! CATEGORY_LINEBREAK, CATEGORY_NOT_LINEBREAK, CATEGORY_LOC_WORD, ! CATEGORY_LOC_NOT_WORD, CATEGORY_UNI_DIGIT, CATEGORY_UNI_NOT_DIGIT, ! CATEGORY_UNI_SPACE, CATEGORY_UNI_NOT_SPACE, CATEGORY_UNI_WORD, ! CATEGORY_UNI_NOT_WORD, CATEGORY_UNI_LINEBREAK, ! CATEGORY_UNI_NOT_LINEBREAK ! ] ! ! def makedict(list): ! d = {} ! i = 0 ! for item in list: ! d[item] = i ! i = i + 1 ! return d ! ! OPCODES = makedict(OPCODES) ! ATCODES = makedict(ATCODES) ! CHCODES = makedict(CHCODES) # replacement operations for "ignore case" mode ! OP_IGNORE = { ! GROUPREF: GROUPREF_IGNORE, IN: IN_IGNORE, LITERAL: LITERAL_IGNORE, NOT_LITERAL: NOT_LITERAL_IGNORE } + + AT_MULTILINE = { + AT_BEGINNING: AT_BEGINNING_LINE, + AT_END: AT_END_LINE + } ! CH_LOCALE = { ! CATEGORY_DIGIT: CATEGORY_DIGIT, ! CATEGORY_NOT_DIGIT: CATEGORY_NOT_DIGIT, ! CATEGORY_SPACE: CATEGORY_SPACE, ! CATEGORY_NOT_SPACE: CATEGORY_NOT_SPACE, ! CATEGORY_WORD: CATEGORY_LOC_WORD, ! CATEGORY_NOT_WORD: CATEGORY_LOC_NOT_WORD, ! CATEGORY_LINEBREAK: CATEGORY_LINEBREAK, ! CATEGORY_NOT_LINEBREAK: CATEGORY_NOT_LINEBREAK } ! CH_UNICODE = { ! CATEGORY_DIGIT: CATEGORY_UNI_DIGIT, ! CATEGORY_NOT_DIGIT: CATEGORY_UNI_NOT_DIGIT, ! CATEGORY_SPACE: CATEGORY_UNI_SPACE, ! CATEGORY_NOT_SPACE: CATEGORY_UNI_NOT_SPACE, ! CATEGORY_WORD: CATEGORY_UNI_WORD, ! CATEGORY_NOT_WORD: CATEGORY_UNI_NOT_WORD, ! CATEGORY_LINEBREAK: CATEGORY_UNI_LINEBREAK, ! CATEGORY_NOT_LINEBREAK: CATEGORY_UNI_NOT_LINEBREAK } + # flags + SRE_FLAG_TEMPLATE = 1 # template mode (disable backtracking) + SRE_FLAG_IGNORECASE = 2 # case insensitive + SRE_FLAG_LOCALE = 4 # honour system locale + SRE_FLAG_MULTILINE = 8 # treat target as multiline string + SRE_FLAG_DOTALL = 16 # treat target as a single string + SRE_FLAG_UNICODE = 32 # use unicode locale + SRE_FLAG_VERBOSE = 64 # ignore whitespace and comments + + # flags for INFO primitive + SRE_INFO_PREFIX = 1 # has prefix + SRE_INFO_LITERAL = 2 # entire pattern is literal (given by prefix) + SRE_INFO_CHARSET = 4 # pattern starts with character from given set + if __name__ == "__main__": import string ! def dump(f, d, prefix): ! items = d.items() ! items.sort(lambda a, b: cmp(a[1], b[1])) ! for k, v in items: ! f.write("#define %s_%s %s\n" % (prefix, string.upper(k), v)) f = open("sre_constants.h", "w") ! f.write("""\ ! /* ! * Secret Labs' Regular Expression Engine ! * ! * regular expression matching engine ! * ! * NOTE: This file is generated by sre_constants.py. If you need ! * to change anything in here, edit sre_constants.py and run it. ! * ! * Copyright (c) 1997-2000 by Secret Labs AB. All rights reserved. ! * ! * See the _sre.c file for information on usage and redistribution. ! */ ! ! """) ! ! dump(f, OPCODES, "SRE_OP") ! dump(f, ATCODES, "SRE") ! dump(f, CHCODES, "SRE") ! ! f.write("#define SRE_FLAG_TEMPLATE %d\n" % SRE_FLAG_TEMPLATE) ! f.write("#define SRE_FLAG_IGNORECASE %d\n" % SRE_FLAG_IGNORECASE) ! f.write("#define SRE_FLAG_LOCALE %d\n" % SRE_FLAG_LOCALE) ! f.write("#define SRE_FLAG_MULTILINE %d\n" % SRE_FLAG_MULTILINE) ! f.write("#define SRE_FLAG_DOTALL %d\n" % SRE_FLAG_DOTALL) ! f.write("#define SRE_FLAG_UNICODE %d\n" % SRE_FLAG_UNICODE) ! f.write("#define SRE_FLAG_VERBOSE %d\n" % SRE_FLAG_VERBOSE) ! ! f.write("#define SRE_INFO_PREFIX %d\n" % SRE_INFO_PREFIX) ! f.write("#define SRE_INFO_LITERAL %d\n" % SRE_INFO_LITERAL) ! f.write("#define SRE_INFO_CHARSET %d\n" % SRE_INFO_CHARSET) ! f.close() print "done" Index: sre_pars.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/sre_pars.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -r1.1 -r1.1.2.1 *** sre_pars.py 2000/05/08 17:31:01 1.1 --- sre_pars.py 2000/09/03 16:06:27 1.1.2.1 *************** *** 1,22 **** # # Secret Labs' Regular Expression Engine - # $Id$ # ! # convert re-style regular expression to SRE template. the current ! # implementation is somewhat incomplete, and not very fast. should ! # definitely be rewritten before Python 1.6 goes beta. # # Copyright (c) 1998-2000 by Secret Labs AB. All rights reserved. # [...1127 lines suppressed...] ! def expand_template(template, match): ! # FIXME: this is sooooo slow. drop in the slicelist ! # code instead ! p = [] ! a = p.append ! sep = match.string[:0] ! if type(sep) is type(""): ! char = chr ! else: ! char = unichr ! for c, s in template: ! if c is LITERAL: ! a(char(s)) ! elif c is MARK: ! s = match.group(s) ! if s is None: ! raise error, "empty group" ! a(s) ! return string.join(p, sep) Index: test_str.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_str.py,v retrieving revision 1.8 retrieving revision 1.8.4.1 diff -C2 -r1.8 -r1.8.4.1 *** test_str.py 1998/03/26 22:14:05 1.8 --- test_str.py 2000/09/03 16:06:27 1.8.4.1 *************** *** 1,87 **** from test_support import verbose ! import strop, sys ! def test(name, input, output, *args): if verbose: ! print 'string.%s%s =? %s... ' % (name, (input,) + args, output), ! f = getattr(strop, name) try: ! value = apply(f, (input,) + args) ! except: ! value = sys.exc_type ! if value != output: ! if verbose: ! print 'no' ! print f, `input`, `output`, `value` ! else: ! if verbose: ! print 'yes' ! ! test('atoi', " 1 ", 1) ! test('atoi', " 1x", ValueError) ! test('atoi', " x1 ", ValueError) ! test('atol', " 1 ", 1L) ! test('atol', " 1x ", ValueError) ! test('atol', " x1 ", ValueError) ! test('atof', " 1 ", 1.0) ! test('atof', " 1x ", ValueError) ! test('atof', " x1 ", ValueError) ! ! test('capitalize', ' hello ', ' hello ') ! test('capitalize', 'hello ', 'Hello ') ! test('find', 'abcdefghiabc', 0, 'abc') ! test('find', 'abcdefghiabc', 9, 'abc', 1) ! test('find', 'abcdefghiabc', -1, 'def', 4) ! test('rfind', 'abcdefghiabc', 9, 'abc') ! test('lower', 'HeLLo', 'hello') ! test('upper', 'HeLLo', 'HELLO') ! ! transtable = '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377' ! ! test('maketrans', 'abc', transtable, 'xyz') ! test('maketrans', 'abc', ValueError, 'xyzq') ! ! test('split', 'this is the split function', ! ['this', 'is', 'the', 'split', 'function']) ! test('split', 'a|b|c|d', ['a', 'b', 'c', 'd'], '|') ! test('split', 'a|b|c|d', ['a', 'b', 'c|d'], '|', 2) ! test('split', 'a b c d', ['a', 'b c d'], None, 1) ! test('split', 'a b c d', ['a', 'b', 'c d'], None, 2) ! test('split', 'a b c d', ['a', 'b', 'c', 'd'], None, 3) ! test('split', 'a b c d', ['a', 'b', 'c', 'd'], None, 4) ! test('split', 'a b c d', ['a', 'b', 'c', 'd'], None, 0) ! test('split', 'a b c d', ['a', 'b', 'c d'], None, 2) ! ! # join now works with any sequence type ! class Sequence: ! def __init__(self): self.seq = 'wxyz' ! def __len__(self): return len(self.seq) ! def __getitem__(self, i): return self.seq[i] ! ! test('join', ['a', 'b', 'c', 'd'], 'a b c d') ! test('join', ('a', 'b', 'c', 'd'), 'abcd', '') ! test('join', Sequence(), 'w x y z') ! ! # try a few long ones ! print strop.join(['x' * 100] * 100, ':') ! print strop.join(('x' * 100,) * 100, ':') ! ! test('strip', ' hello ', 'hello') ! test('lstrip', ' hello ', 'hello ') ! test('rstrip', ' hello ', ' hello') ! ! test('swapcase', 'HeLLo cOmpUteRs', 'hEllO CoMPuTErS') ! test('translate', 'xyzabcdef', 'xyzxyz', transtable, 'def') ! ! test('replace', 'one!two!three!', 'one@two!three!', '!', '@', 1) ! test('replace', 'one!two!three!', 'one@two@three!', '!', '@', 2) ! test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 3) ! test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 4) ! test('replace', 'one!two!three!', 'one@two@three@', '!', '@', 0) ! test('replace', 'one!two!three!', 'one@two@three@', '!', '@') ! test('replace', 'one!two!three!', 'one!two!three!', 'x', '@') ! test('replace', 'one!two!three!', 'one!two!three!', 'x', '@', 2) ! ! strop.whitespace ! strop.lowercase ! strop.uppercase --- 1,134 ---- + #! /usr/bin/env python + + # Sanity checker for time.strftime + + import time, calendar, sys, string, os, re from test_support import verbose ! ! def main(): ! global verbose ! now = time.time() ! strftest(now) ! verbose = 0 ! # Try a bunch of dates and times, chosen to vary through time of ! # day and daylight saving time ! for j in range(-5, 5): ! for i in range(25): ! strftest(now + (i + j*100)*23*3603) ! def strftest(now): if verbose: ! print "strftime test for", time.ctime(now) ! nowsecs = str(long(now))[:-1] ! gmt = time.gmtime(now) ! now = time.localtime(now) ! ! if now[3] < 12: ampm='AM' ! else: ampm='PM' ! ! jan1 = time.localtime(time.mktime((now[0], 1, 1) + (0,)*6)) ! try: ! if now[8]: tz = time.tzname[1] ! else: tz = time.tzname[0] ! except AttributeError: ! tz = '' ! ! if now[3] > 12: clock12 = now[3] - 12 ! elif now[3] > 0: clock12 = now[3] ! else: clock12 = 12 ! ! expectations = ( ! ('%a', calendar.day_abbr[now[6]], 'abbreviated weekday name'), ! ('%A', calendar.day_name[now[6]], 'full weekday name'), ! ('%b', calendar.month_abbr[now[1]], 'abbreviated month name'), ! ('%B', calendar.month_name[now[1]], 'full month name'), ! # %c see below ! ('%d', '%02d' % now[2], 'day of month as number (00-31)'), ! ('%H', '%02d' % now[3], 'hour (00-23)'), ! ('%I', '%02d' % clock12, 'hour (01-12)'), ! ('%j', '%03d' % now[7], 'julian day (001-366)'), ! ('%m', '%02d' % now[1], 'month as number (01-12)'), ! ('%M', '%02d' % now[4], 'minute, (00-59)'), ! ('%p', ampm, 'AM or PM as appropriate'), ! ('%S', '%02d' % now[5], 'seconds of current time (00-60)'), ! ('%U', '%02d' % ((now[7] + jan1[6])/7), ! 'week number of the year (Sun 1st)'), ! ('%w', '0?%d' % ((1+now[6]) % 7), 'weekday as a number (Sun 1st)'), ! ('%W', '%02d' % ((now[7] + (jan1[6] - 1)%7)/7), ! 'week number of the year (Mon 1st)'), ! # %x see below ! ('%X', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ! ('%y', '%02d' % (now[0]%100), 'year without century'), ! ('%Y', '%d' % now[0], 'year with century'), ! # %Z see below ! ('%%', '%', 'single percent sign'), ! ) ! ! nonstandard_expectations = ( ! # These are standard but don't have predictable output ! ('%c', fixasctime(time.asctime(now)), 'near-asctime() format'), ! ('%x', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), ! '%m/%d/%y %H:%M:%S'), ! ('%Z', '%s' % tz, 'time zone name'), ! ! # These are some platform specific extensions ! ('%D', '%02d/%02d/%02d' % (now[1], now[2], (now[0]%100)), 'mm/dd/yy'), ! ('%e', '%2d' % now[2], 'day of month as number, blank padded ( 0-31)'), ! ('%h', calendar.month_abbr[now[1]], 'abbreviated month name'), ! ('%k', '%2d' % now[3], 'hour, blank padded ( 0-23)'), ! ('%n', '\n', 'newline character'), ! ('%r', '%02d:%02d:%02d %s' % (clock12, now[4], now[5], ampm), ! '%I:%M:%S %p'), ! ('%R', '%02d:%02d' % (now[3], now[4]), '%H:%M'), ! ('%s', nowsecs, 'seconds since the Epoch in UCT'), ! ('%t', '\t', 'tab character'), ! ('%T', '%02d:%02d:%02d' % (now[3], now[4], now[5]), '%H:%M:%S'), ! ('%3y', '%03d' % (now[0]%100), ! 'year without century rendered using fieldwidth'), ! ) ! ! if verbose: ! print "Strftime test, platform: %s, Python version: %s" % \ ! (sys.platform, string.split(sys.version)[0]) ! ! for e in expectations: ! try: ! result = time.strftime(e[0], now) ! except ValueError, error: ! print "Standard '%s' format gave error:" % e[0], error ! continue ! if re.match(e[1], result): continue ! if not result or result[0] == '%': ! print "Does not support standard '%s' format (%s)" % (e[0], e[2]) ! else: ! print "Conflict for %s (%s):" % (e[0], e[2]) ! print " Expected %s, but got %s" % (e[1], result) ! ! for e in nonstandard_expectations: ! try: ! result = time.strftime(e[0], now) ! except ValueError, result: ! if verbose: ! print "Error for nonstandard '%s' format (%s): %s" % \ ! (e[0], e[2], str(result)) ! continue ! if re.match(e[1], result): ! if verbose: ! print "Supports nonstandard '%s' format (%s)" % (e[0], e[2]) ! elif not result or result[0] == '%': ! if verbose: ! print "Does not appear to support '%s' format (%s)" % (e[0], ! e[2]) ! else: ! if verbose: ! print "Conflict for nonstandard '%s' format (%s):" % (e[0], ! e[2]) ! print " Expected %s, but got %s" % (e[1], result) ! ! def fixasctime(s): ! if s[8] == ' ': ! s = s[:8] + '0' + s[9:] ! return s ! ! main() Index: test_uni.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_uni.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -r1.1 -r1.1.2.1 *** test_uni.py 2000/05/08 17:31:03 1.1 --- test_uni.py 2000/09/03 16:06:27 1.1.2.1 *************** *** 1,3 **** ! """ Test script for the Unicode implementation. Written by Marc-Andre Lemburg (mal@lemburg.com). --- 1,3 ---- ! """ Test script for the unicodedata module. Written by Marc-Andre Lemburg (mal@lemburg.com). *************** *** 5,401 **** (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. ! """ from test_support import verbose import sys ! def test(method, input, output, *args): ! if verbose: ! print '%s.%s%s =? %s... ' % (repr(input), method, args, output), ! try: ! f = getattr(input, method) ! value = apply(f, args) ! except: ! value = sys.exc_type ! exc = sys.exc_info()[:2] ! else: ! exc = None ! if value != output: ! if verbose: ! print 'no' ! print '*',f, `input`, `output`, `value` ! if exc: ! print ' value == %s: %s' % (exc) ! else: ! if verbose: ! print 'yes' ! ! test('capitalize', u' hello ', u' hello ') ! test('capitalize', u'hello ', u'Hello ') ! ! test('title', u' hello ', u' Hello ') ! test('title', u'hello ', u'Hello ') ! test('title', u"fOrMaT thIs aS titLe String", u'Format This As Title String') ! test('title', u"fOrMaT,thIs-aS*titLe;String", u'Format,This-As*Title;String') ! test('title', u"getInt", u'Getint') ! ! test('find', u'abcdefghiabc', 0, u'abc') ! test('find', u'abcdefghiabc', 9, u'abc', 1) ! test('find', u'abcdefghiabc', -1, u'def', 4) ! ! test('rfind', u'abcdefghiabc', 9, u'abc') ! ! test('lower', u'HeLLo', u'hello') ! test('lower', u'hello', u'hello') ! ! test('upper', u'HeLLo', u'HELLO') ! test('upper', u'HELLO', u'HELLO') ! ! if 0: ! transtable = '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037 !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`xyzdefghijklmnopqrstuvwxyz{|}~\177\200\201\202\203\204\205\206\207\210\211\212\213\214\215\216\217\220\221\222\223\224\225\226\227\230\231\232\233\234\235\236\237\240\241\242\243\244\245\246\247\250\251\252\253\254\255\256\257\260\261\262\263\264\265\266\267\270\271\272\273\274\275\276\277\300\301\302\303\304\305\306\307\310\311\312\313\314\315\316\317\320\321\322\323\324\325\326\327\330\331\332\333\334\335\336\337\340\341\342\343\344\345\346\347\350\351\352\353\354\355\356\357\360\361\362\363\364\365\366\367\370\371\372\373\374\375\376\377' ! ! test('maketrans', u'abc', transtable, u'xyz') ! test('maketrans', u'abc', ValueError, u'xyzq') ! ! test('split', u'this is the split function', ! [u'this', u'is', u'the', u'split', u'function']) ! test('split', u'a|b|c|d', [u'a', u'b', u'c', u'd'], u'|') ! test('split', u'a|b|c|d', [u'a', u'b', u'c|d'], u'|', 2) ! test('split', u'a b c d', [u'a', u'b c d'], None, 1) ! test('split', u'a b c d', [u'a', u'b', u'c d'], None, 2) ! test('split', u'a b c d', [u'a', u'b', u'c', u'd'], None, 3) ! test('split', u'a b c d', [u'a', u'b', u'c', u'd'], None, 4) ! test('split', u'a b c d', [u'a b c d'], None, 0) ! test('split', u'a b c d', [u'a', u'b', u'c d'], None, 2) ! test('split', u'a b c d ', [u'a', u'b', u'c', u'd']) ! ! # join now works with any sequence type ! class Sequence: ! def __init__(self): self.seq = 'wxyz' ! def __len__(self): return len(self.seq) ! def __getitem__(self, i): return self.seq[i] ! ! test('join', u' ', u'a b c d', [u'a', u'b', u'c', u'd']) ! test('join', u'', u'abcd', (u'a', u'b', u'c', u'd')) ! test('join', u' ', u'w x y z', Sequence()) ! test('join', u' ', TypeError, 7) ! ! class BadSeq(Sequence): ! def __init__(self): self.seq = [7, u'hello', 123L] ! ! test('join', u' ', TypeError, BadSeq()) ! ! result = u'' ! for i in range(10): ! if i > 0: ! result = result + u':' ! result = result + u'x'*10 ! test('join', u':', result, [u'x' * 10] * 10) ! test('join', u':', result, (u'x' * 10,) * 10) ! ! test('strip', u' hello ', u'hello') ! test('lstrip', u' hello ', u'hello ') ! test('rstrip', u' hello ', u' hello') ! test('strip', u'hello', u'hello') ! ! test('swapcase', u'HeLLo cOmpUteRs', u'hEllO CoMPuTErS') ! ! if 0: ! test('translate', u'xyzabcdef', u'xyzxyz', transtable, u'def') ! ! table = string.maketrans('a', u'A') ! test('translate', u'abc', u'Abc', table) ! test('translate', u'xyz', u'xyz', table) ! ! test('replace', u'one!two!three!', u'one@two!three!', u'!', u'@', 1) ! test('replace', u'one!two!three!', u'onetwothree', '!', '') ! test('replace', u'one!two!three!', u'one@two@three!', u'!', u'@', 2) ! test('replace', u'one!two!three!', u'one@two@three@', u'!', u'@', 3) ! test('replace', u'one!two!three!', u'one@two@three@', u'!', u'@', 4) ! test('replace', u'one!two!three!', u'one!two!three!', u'!', u'@', 0) ! test('replace', u'one!two!three!', u'one@two@three@', u'!', u'@') ! test('replace', u'one!two!three!', u'one!two!three!', u'x', u'@') ! test('replace', u'one!two!three!', u'one!two!three!', u'x', u'@', 2) ! ! test('startswith', u'hello', 1, u'he') ! test('startswith', u'hello', 1, u'hello') ! test('startswith', u'hello', 0, u'hello world') ! test('startswith', u'hello', 1, u'') ! test('startswith', u'hello', 0, u'ello') ! test('startswith', u'hello', 1, u'ello', 1) ! test('startswith', u'hello', 1, u'o', 4) ! test('startswith', u'hello', 0, u'o', 5) ! test('startswith', u'hello', 1, u'', 5) ! test('startswith', u'hello', 0, u'lo', 6) ! test('startswith', u'helloworld', 1, u'lowo', 3) ! test('startswith', u'helloworld', 1, u'lowo', 3, 7) ! test('startswith', u'helloworld', 0, u'lowo', 3, 6) ! ! test('endswith', u'hello', 1, u'lo') ! test('endswith', u'hello', 0, u'he') ! test('endswith', u'hello', 1, u'') ! test('endswith', u'hello', 0, u'hello world') ! test('endswith', u'helloworld', 0, u'worl') ! test('endswith', u'helloworld', 1, u'worl', 3, 9) ! test('endswith', u'helloworld', 1, u'world', 3, 12) ! test('endswith', u'helloworld', 1, u'lowo', 1, 7) ! test('endswith', u'helloworld', 1, u'lowo', 2, 7) ! test('endswith', u'helloworld', 1, u'lowo', 3, 7) ! test('endswith', u'helloworld', 0, u'lowo', 4, 7) ! test('endswith', u'helloworld', 0, u'lowo', 3, 8) ! test('endswith', u'ab', 0, u'ab', 0, 1) ! test('endswith', u'ab', 0, u'ab', 0, 0) ! ! test('expandtabs', u'abc\rab\tdef\ng\thi', u'abc\rab def\ng hi') ! test('expandtabs', u'abc\rab\tdef\ng\thi', u'abc\rab def\ng hi', 8) ! test('expandtabs', u'abc\rab\tdef\ng\thi', u'abc\rab def\ng hi', 4) ! test('expandtabs', u'abc\r\nab\tdef\ng\thi', u'abc\r\nab def\ng hi', 4) ! ! if 0: ! test('capwords', u'abc def ghi', u'Abc Def Ghi') ! test('capwords', u'abc\tdef\nghi', u'Abc Def Ghi') ! test('capwords', u'abc\t def \nghi', u'Abc Def Ghi') ! ! # Comparisons: ! print 'Testing Unicode comparisons...', ! assert u'abc' == 'abc' ! assert 'abc' == u'abc' ! assert u'abc' == u'abc' ! assert u'abcd' > 'abc' ! assert 'abcd' > u'abc' ! assert u'abcd' > u'abc' ! assert u'abc' < 'abcd' ! assert 'abc' < u'abcd' ! assert u'abc' < u'abcd' ! print 'done.' ! ! test('ljust', u'abc', u'abc ', 10) ! test('rjust', u'abc', u' abc', 10) ! test('center', u'abc', u' abc ', 10) ! test('ljust', u'abc', u'abc ', 6) ! test('rjust', u'abc', u' abc', 6) ! test('center', u'abc', u' abc ', 6) ! test('ljust', u'abc', u'abc', 2) ! test('rjust', u'abc', u'abc', 2) ! test('center', u'abc', u'abc', 2) ! ! test('islower', u'a', 1) ! test('islower', u'A', 0) ! test('islower', u'\n', 0) ! test('islower', u'\u1FFc', 0) ! test('islower', u'abc', 1) ! test('islower', u'aBc', 0) ! test('islower', u'abc\n', 1) ! ! test('isupper', u'a', 0) ! test('isupper', u'A', 1) ! test('isupper', u'\n', 0) ! test('isupper', u'\u1FFc', 0) ! test('isupper', u'ABC', 1) ! test('isupper', u'AbC', 0) ! test('isupper', u'ABC\n', 1) ! ! test('istitle', u'a', 0) ! test('istitle', u'A', 1) ! test('istitle', u'\n', 0) ! test('istitle', u'\u1FFc', 1) ! test('istitle', u'A Titlecased Line', 1) ! test('istitle', u'A\nTitlecased Line', 1) ! test('istitle', u'A Titlecased, Line', 1) ! test('istitle', u'Greek \u1FFcitlecases ...', 1) ! test('istitle', u'Not a capitalized String', 0) ! test('istitle', u'Not\ta Titlecase String', 0) ! test('istitle', u'Not--a Titlecase String', 0) ! ! test('splitlines', u"abc\ndef\n\rghi", [u'abc', u'def', u'', u'ghi']) ! test('splitlines', u"abc\ndef\n\r\nghi", [u'abc', u'def', u'', u'ghi']) ! test('splitlines', u"abc\ndef\r\nghi", [u'abc', u'def', u'ghi']) ! test('splitlines', u"abc\ndef\r\nghi\n", [u'abc', u'def', u'ghi']) ! test('splitlines', u"abc\ndef\r\nghi\n\r", [u'abc', u'def', u'ghi', u'']) ! test('splitlines', u"\nabc\ndef\r\nghi\n\r", [u'', u'abc', u'def', u'ghi', u'']) ! test('splitlines', u"\nabc\ndef\r\nghi\n\r", [u'\n', u'abc\n', u'def\r\n', u'ghi\n', u'\r'], 1) ! ! test('translate', u"abababc", u'bbbc', {ord('a'):None}) ! test('translate', u"abababc", u'iiic', {ord('a'):None, ord('b'):ord('i')}) ! test('translate', u"abababc", u'iiix', {ord('a'):None, ord('b'):ord('i'), ord('c'):u'x'}) ! ! # Contains: ! print 'Testing Unicode contains method...', ! assert ('a' in u'abdb') == 1 ! assert ('a' in u'bdab') == 1 ! assert ('a' in u'bdaba') == 1 ! assert ('a' in u'bdba') == 1 ! assert ('a' in u'bdba') == 1 ! assert (u'a' in u'bdba') == 1 ! assert (u'a' in u'bdb') == 0 ! assert (u'a' in 'bdb') == 0 ! assert (u'a' in 'bdba') == 1 ! assert (u'a' in ('a',1,None)) == 1 ! assert (u'a' in (1,None,'a')) == 1 ! assert (u'a' in (1,None,u'a')) == 1 ! assert ('a' in ('a',1,None)) == 1 ! assert ('a' in (1,None,'a')) == 1 ! assert ('a' in (1,None,u'a')) == 1 ! assert ('a' in ('x',1,u'y')) == 0 ! assert ('a' in ('x',1,None)) == 0 ! print 'done.' ! ! # Formatting: ! print 'Testing Unicode formatting strings...', ! assert u"%s, %s" % (u"abc", "abc") == u'abc, abc' ! assert u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", 1, 2, 3) == u'abc, abc, 1, 2.000000, 3.00' ! assert u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", 1, -2, 3) == u'abc, abc, 1, -2.000000, 3.00' ! assert u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", -1, -2, 3.5) == u'abc, abc, -1, -2.000000, 3.50' ! assert u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", -1, -2, 3.57) == u'abc, abc, -1, -2.000000, 3.57' ! assert u"%s, %s, %i, %f, %5.2f" % (u"abc", "abc", -1, -2, 1003.57) == u'abc, abc, -1, -2.000000, 1003.57' ! assert u"%c" % (u"abc",) == u'a' ! assert u"%c" % ("abc",) == u'a' ! assert u"%c" % (34,) == u'"' ! assert u"%c" % (36,) == u'$' ! assert u"%r, %r" % (u"abc", "abc") == u"u'abc', 'abc'" ! assert u"%(x)s, %(y)s" % {'x':u"abc", 'y':"def"} == u'abc, def' ! assert u"%(x)s, %(ä)s" % {'x':u"abc", u'ä'.encode('utf-8'):"def"} == u'abc, def' ! # formatting jobs delegated from the string implementation: ! assert '...%(foo)s...' % {'foo':u"abc"} == u'...abc...' ! assert '...%(foo)s...' % {'foo':"abc"} == '...abc...' ! assert '...%(foo)s...' % {u'foo':"abc"} == '...abc...' ! assert '...%(foo)s...' % {u'foo':u"abc"} == u'...abc...' ! assert '...%(foo)s...' % {u'foo':u"abc",'def':123} == u'...abc...' ! assert '...%(foo)s...' % {u'foo':u"abc",u'def':123} == u'...abc...' ! assert '...%s...%s...%s...%s...' % (1,2,3,u"abc") == u'...1...2...3...abc...' ! assert '...%s...' % u"abc" == u'...abc...' ! print 'done.' ! ! # Test builtin codecs ! print 'Testing builtin codecs...', ! ! assert unicode('hello','ascii') == u'hello' ! assert unicode('hello','utf-8') == u'hello' ! assert unicode('hello','utf8') == u'hello' ! assert unicode('hello','latin-1') == u'hello' ! ! try: ! u'Andr\202 x'.encode('ascii') ! u'Andr\202 x'.encode('ascii','strict') ! except ValueError: ! pass ! else: ! raise AssertionError, "u'Andr\202'.encode('ascii') failed to raise an exception" ! assert u'Andr\202 x'.encode('ascii','ignore') == "Andr x" ! assert u'Andr\202 x'.encode('ascii','replace') == "Andr? x" ! ! try: ! unicode('Andr\202 x','ascii') ! unicode('Andr\202 x','ascii','strict') ! except ValueError: ! pass ! else: ! raise AssertionError, "unicode('Andr\202') failed to raise an exception" ! assert unicode('Andr\202 x','ascii','ignore') == u"Andr x" ! assert unicode('Andr\202 x','ascii','replace') == u'Andr\uFFFD x' ! ! assert u'hello'.encode('ascii') == 'hello' ! assert u'hello'.encode('utf-8') == 'hello' ! assert u'hello'.encode('utf8') == 'hello' ! assert u'hello'.encode('utf-16-le') == 'h\000e\000l\000l\000o\000' ! assert u'hello'.encode('utf-16-be') == '\000h\000e\000l\000l\000o' ! assert u'hello'.encode('latin-1') == 'hello' ! ! u = u''.join(map(unichr, range(1024))) ! for encoding in ('utf-8', 'utf-16', 'utf-16-le', 'utf-16-be', ! 'raw_unicode_escape', 'unicode_escape', 'unicode_internal'): ! assert unicode(u.encode(encoding),encoding) == u ! ! u = u''.join(map(unichr, range(256))) ! for encoding in ( ! 'latin-1', ! ): ! try: ! assert unicode(u.encode(encoding),encoding) == u ! except AssertionError: ! print '*** codec "%s" failed round-trip' % encoding ! except ValueError,why: ! print '*** codec for "%s" failed: %s' % (encoding, why) ! ! u = u''.join(map(unichr, range(128))) ! for encoding in ( ! 'ascii', ! ): ! try: ! assert unicode(u.encode(encoding),encoding) == u ! except AssertionError: ! print '*** codec "%s" failed round-trip' % encoding ! except ValueError,why: ! print '*** codec for "%s" failed: %s' % (encoding, why) ! ! print 'done.' ! ! print 'Testing standard mapping codecs...', ! ! print '0-127...', ! s = ''.join(map(chr, range(128))) ! for encoding in ( ! 'cp037', 'cp1026', ! 'cp437', 'cp500', 'cp737', 'cp775', 'cp850', ! 'cp852', 'cp855', 'cp860', 'cp861', 'cp862', ! 'cp863', 'cp865', 'cp866', ! 'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15', ! 'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6', ! 'iso8859_7', 'iso8859_9', 'koi8_r', 'latin_1', ! 'mac_cyrillic', 'mac_latin2', ! ! 'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', ! 'cp1256', 'cp1257', 'cp1258', ! 'cp856', 'cp857', 'cp864', 'cp869', 'cp874', ! ! 'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish', ! 'cp1006', 'cp875', 'iso8859_8', ! ! ### These have undefined mappings: ! #'cp424', ! ! ): ! try: ! assert unicode(s,encoding).encode(encoding) == s ! except AssertionError: ! print '*** codec "%s" failed round-trip' % encoding ! except ValueError,why: ! print '*** codec for "%s" failed: %s' % (encoding, why) ! ! print '128-255...', ! s = ''.join(map(chr, range(128,256))) ! for encoding in ( ! 'cp037', 'cp1026', ! 'cp437', 'cp500', 'cp737', 'cp775', 'cp850', ! 'cp852', 'cp855', 'cp860', 'cp861', 'cp862', ! 'cp863', 'cp865', 'cp866', ! 'iso8859_10', 'iso8859_13', 'iso8859_14', 'iso8859_15', ! 'iso8859_2', 'iso8859_3', 'iso8859_4', 'iso8859_5', 'iso8859_6', ! 'iso8859_7', 'iso8859_9', 'koi8_r', 'latin_1', ! 'mac_cyrillic', 'mac_latin2', ! ! ### These have undefined mappings: ! #'cp1250', 'cp1251', 'cp1252', 'cp1253', 'cp1254', 'cp1255', ! #'cp1256', 'cp1257', 'cp1258', ! #'cp424', 'cp856', 'cp857', 'cp864', 'cp869', 'cp874', ! #'mac_greek', 'mac_iceland','mac_roman', 'mac_turkish', ! ! ### These fail the round-trip: ! #'cp1006', 'cp875', 'iso8859_8', ! ! ): ! try: ! assert unicode(s,encoding).encode(encoding) == s ! except AssertionError: ! print '*** codec "%s" failed round-trip' % encoding ! except ValueError,why: ! print '*** codec for "%s" failed: %s' % (encoding, why) ! ! print 'done.' ! ! print 'Testing Unicode string concatenation...', ! assert (u"abc" u"def") == u"abcdef" ! assert ("abc" u"def") == u"abcdef" ! assert (u"abc" "def") == u"abcdef" ! assert (u"abc" u"def" "ghi") == u"abcdefghi" ! assert ("abc" "def" u"ghi") == u"abcdefghi" print 'done.' --- 5,50 ---- (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. ! """#" from test_support import verbose import sys ! # Test Unicode database APIs ! import unicodedata ! ! print 'Testing unicodedata module...', ! ! assert unicodedata.digit(u'A',None) is None ! assert unicodedata.digit(u'9') == 9 ! assert unicodedata.digit(u'\u215b',None) is None ! assert unicodedata.digit(u'\u2468') == 9 ! ! assert unicodedata.numeric(u'A',None) is None ! assert unicodedata.numeric(u'9') == 9 ! assert unicodedata.numeric(u'\u215b') == 0.125 ! assert unicodedata.numeric(u'\u2468') == 9.0 ! ! assert unicodedata.decimal(u'A',None) is None ! assert unicodedata.decimal(u'9') == 9 ! assert unicodedata.decimal(u'\u215b',None) is None ! assert unicodedata.decimal(u'\u2468',None) is None ! ! assert unicodedata.category(u'\uFFFE') == 'Cn' ! assert unicodedata.category(u'a') == 'Ll' ! assert unicodedata.category(u'A') == 'Lu' ! ! assert unicodedata.bidirectional(u'\uFFFE') == '' ! assert unicodedata.bidirectional(u' ') == 'WS' ! assert unicodedata.bidirectional(u'A') == 'L' ! ! assert unicodedata.decomposition(u'\uFFFE') == '' ! assert unicodedata.decomposition(u'\u00bc') == ' 0031 2044 0034' ! ! assert unicodedata.mirrored(u'\uFFFE') == 0 ! assert unicodedata.mirrored(u'a') == 0 ! assert unicodedata.mirrored(u'\u2201') == 1 ! ! assert unicodedata.combining(u'\uFFFE') == 0 ! assert unicodedata.combining(u'a') == 0 ! assert unicodedata.combining(u'\u20e1') == 230 ! print 'done.' Index: test_win.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/dos-8x3/test_win.py,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -r1.1 -r1.1.2.1 *** test_win.py 2000/05/08 17:31:03 1.1 --- test_win.py 2000/09/03 16:06:27 1.1.2.1 *************** *** 2,6 **** # Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey ! from winreg import * import os, sys --- 2,6 ---- # Only win32reg functions not hit here: FlushKey, LoadKey and SaveKey ! from _winreg import * import os, sys *************** *** 43,63 **** CloseKey(sub_key) try: ! QueryInfoKey(int_sub_key) ! raise RuntimeError, "It appears the CloseKey() function does not close the actual key!" except EnvironmentError: ! pass # ... and close that key that way :-) int_key = int(key) key.Close() try: ! QueryInfoKey(int_key) ! raise RuntimeError, "It appears the key.Close() function does not close the actual key!" except EnvironmentError: ! pass def ReadTestData(root_key): # Check we can get default value for this key. val = QueryValue(root_key, test_key_name) ! assert val=="Default value", "Registry didnt give back the correct value" key = OpenKey(root_key, test_key_name) --- 43,63 ---- CloseKey(sub_key) try: ! QueryInfoKey(int_sub_key) ! raise RuntimeError, "It appears the CloseKey() function does not close the actual key!" except EnvironmentError: ! pass # ... and close that key that way :-) int_key = int(key) key.Close() try: ! QueryInfoKey(int_key) ! raise RuntimeError, "It appears the key.Close() function does not close the actual key!" except EnvironmentError: ! pass def ReadTestData(root_key): # Check we can get default value for this key. val = QueryValue(root_key, test_key_name) ! assert val=="Default value", "Registry didn't give back the correct value" key = OpenKey(root_key, test_key_name) *************** *** 71,77 **** except EnvironmentError: break ! assert data in test_data, "didnt read back the correct test data." index = index + 1 ! assert index==len(test_data), "Didnt read the correct number of items" # Check I can directly access each item for value_name, value_data, value_type in test_data: --- 71,77 ---- except EnvironmentError: break ! assert data in test_data, "Didn't read back the correct test data" index = index + 1 ! assert index==len(test_data), "Didn't read the correct number of items" # Check I can directly access each item for value_name, value_data, value_type in test_data: *************** *** 116,120 **** try: key = OpenKey(root_key, test_key_name) ! assert 0, "Could open the non-existant key" except WindowsError: # Use this error name this time pass --- 116,120 ---- try: key = OpenKey(root_key, test_key_name) ! assert 0, "Could open the non-existent key" except WindowsError: # Use this error name this time pass --- threadst.py DELETED --- From python-dev@python.org Sun Sep 3 18:12:54 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 10:12:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib webbrowser.py,1.1,1.2 Message-ID: <200009031712.KAA20776@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv20475 Modified Files: webbrowser.py Log Message: Hack the Windows code to use os.popen(). The returned file is assigned to an instance variable; otherwise the implied close hangs for a long time. Index: webbrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** webbrowser.py 2000/07/09 16:45:56 1.1 --- webbrowser.py 2000/09/03 17:12:50 1.2 *************** *** 184,190 **** class WindowsDefault: def open(self, url, new=0): ! import win32api, win32con ! win32api.ShellExecute(0, "open", url, None, ".", ! win32con.SW_SHOWNORMAL) def open_new(self, url): --- 184,188 ---- class WindowsDefault: def open(self, url, new=0): ! self.junk = os.popen("start " + url) def open_new(self, url): From python-dev@python.org Sun Sep 3 20:17:29 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 12:17:29 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.51.4.1,1.51.4.2 Message-ID: <200009031917.MAA15834@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv15810 Modified Files: Tag: cnri-16-start NEWS Log Message: Checking this in just so Jeremy can see where to pick up with the 2.0 What's new if he wants to. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.51.4.1 retrieving revision 1.51.4.2 diff -C2 -r1.51.4.1 -r1.51.4.2 *** NEWS 2000/09/01 22:33:33 1.51.4.1 --- NEWS 2000/09/03 19:17:26 1.51.4.2 *************** *** 14,18 **** ====================================================================== ! ====================================================================== --- 14,109 ---- ====================================================================== ! Overview of changes ! ------------------- ! ! For the list of change below, I have borrowed from the document ! "What's New in Python 2.0" by Andrew Kuchling and Moshe Zadka: ! http://starship.python.net/crew/amk/python/writing/new-python/. ! ! There are lots of new modules and lots of bugs have been fixed. To ! find out about new modules, check out the library manual, which has ! been enhanced significantly. ! ! Probably the most pervasive change is the addition of Unicode support. ! We've added a new fundamental datatype, the Unicode string, a new ! build-in function unicode(), an numerous C APIs to deal with Unicode ! and encodings. See the file Misc/unicode.txt for details, or ! http://starship.python.net/crew/lemburg/unicode-proposal.txt. ! ! Two other big changes, related to the Unicode support, are the ! addition of string methods and (yet another) new regular expression ! engine. ! ! - String methods mean that you can now say s.lower() etc. instead of ! importing the string module and saying string.lower(s) etc. One ! peculiarity is that the equivalent of string.join(sequence, ! delimiter) is delimiter.join(sequence). Use " ".join(sequence) for ! the effect of string.join(sequence); to make this more readable, try ! space=" " first. ! ! - The new regular expression engine, SRE by Fredrik Lundh, is fully ! backwards compatible with the old engine, and is in fact invoked ! using the same interface (the "re" module). You can explicitly ! invoke the old engine by import pre, or the SRE engine by importing ! sre. SRE is faster than pre, and supports Unicode (which was the ! main reason to put effort in yet another new regular expression ! engine -- this is at least the fourth!). ! ! Several small incompatible library changes may trip you up: ! ! - The append() method for lists can no longer be invoked with more ! than one argument. This used to append a single tuple made out of ! all arguments, but was undocumented. To append a tuple, use ! e.g. l.append((a, b, c)). ! ! - The connect(), connect_ex() and bind() methods for sockets require ! exactly one argument. Previously, you could call s.connect(host, ! port), but this was undocumented. You must now write ! s.connect((host, port)). ! ! - The str() and repr() functions are now different more often. For ! long integers, str() no longer appends a 'L'. Thus, str(1L) == '1', ! which used to be '1L'; repr(1L) is unchanged and still returns '1L'. ! For floats, repr() now gives 17 digits of precision, to ensure no ! precision is lost (on all current hardware). ! ! - The -X option is gone. Built-in exceptions are now always ! classes. Many more library modules also have been converted to ! class-based exceptions. ! ! Other changes that won't break code but are nice to know about: ! ! - Greg Ward's "distutils" package is included: this will make ! installing, building and distributing third party packages much ! simpler. ! ! - There's now special syntax that you can use instead of the apply() ! function. f(*args, **kwds) is equivalent to apply(f, args, kwds). ! You can also use variations f(a1, a2, *args, **kwds) and you can leave ! one or the other out: f(*args), f(**kwds). ! ! - The built-ins int() and long() take an optional second argument to ! indicate the conversion base -- of course only if the first argument ! is a string. This makes string.atoi() and string.atol() obsolete. ! (string.atof() was already obsolete). ! ! - When a local variable is known to the compiler but undefined when ! used, a new exception UnboundLocalError is raised. This is a class ! derived from NameError so code catching NameError should still work. ! The purpose is to provide better diagnostics in the following example: ! ! x = 1 ! def f(): ! print x ! x = x+1 ! ! This used to raise a NameError on the print statement, which confused ! even experienced Python programmers (especially if there are several ! hundreds of lines of code between the reference and the assignment to ! x :-). ! ! - You can now override the 'in' operator by defining a __contains__ ! method. Note that it has its arguments backwards: x in a causes ! a.__contains__(x) to be called. That's why the name isn't __in__. ====================================================================== From python-dev@python.org Mon Sep 4 00:47:10 2000 From: python-dev@python.org (Vladimir Marangozov) Date: Sun, 3 Sep 2000 16:47:10 -0700 Subject: [Python-checkins] CVS: python/dist/src/Parser node.c,2.14,2.15 Message-ID: <200009032347.QAA20884@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Parser In directory slayer.i.sourceforge.net:/tmp/cvs-serv16939/Parser Modified Files: node.c Log Message: Move down the INT_MAX logic, because HAVE_LIMITS_H was always undefined and this breaks the AIX build with an INT_MAX redefinition error. "config.h" is included in pgenheaders.h, so moving this down fixes the problem. Index: node.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/node.c,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -r2.14 -r2.15 *** node.c 2000/09/01 23:29:28 2.14 --- node.c 2000/09/03 23:47:08 2.15 *************** *** 1,3 **** --- 1,9 ---- + /* Parse tree node implementation */ + + #include "pgenheaders.h" + #include "node.h" + #include "errcode.h" + #ifdef HAVE_LIMITS_H #include *************** *** 6,15 **** #define INT_MAX 2147483647 #endif - - /* Parse tree node implementation */ - - #include "pgenheaders.h" - #include "node.h" - #include "errcode.h" node * --- 12,15 ---- From python-dev@python.org Mon Sep 4 01:54:59 2000 From: python-dev@python.org (Vladimir Marangozov) Date: Sun, 3 Sep 2000 17:54:59 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_aix.c,2.9,2.10 Message-ID: <200009040054.RAA29681@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv28922 Modified Files: dynload_aix.c Log Message: Fix the char* vs. const char* mismatch for the argument of aix_loaderror() Index: dynload_aix.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_aix.c,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -r2.9 -r2.10 *** dynload_aix.c 2000/09/01 23:29:28 2.9 --- dynload_aix.c 2000/09/04 00:54:56 2.10 *************** *** 120,124 **** static void ! aix_loaderror(char *pathname) { --- 120,124 ---- static void ! aix_loaderror(const char *pathname) { From python-dev@python.org Mon Sep 4 01:58:50 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 17:58:50 -0700 Subject: [Python-checkins] CVS: python/dist/src LICENSE,1.4,1.5 Message-ID: <200009040058.RAA00951@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv905 Modified Files: LICENSE Log Message: Changes in license names by BobW. Index: LICENSE =================================================================== RCS file: /cvsroot/python/python/dist/src/LICENSE,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** LICENSE 2000/09/03 13:21:38 1.4 --- LICENSE 2000/09/04 00:58:48 1.5 *************** *** 20,24 **** ============================================== ! BEOPEN OPEN SOURCE PYTHON LICENSE AGREEMENT VERSION 1 ----------------------------------------------------- --- 20,24 ---- ============================================== ! BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 ----------------------------------------------------- *************** *** 74,79 **** ! CNRI LICENSE AGREEMENT ! ---------------------- Python 1.6 is made available subject to the terms and conditions in --- 74,79 ---- ! CNRI OPEN SOURCE LICENSE AGREEMENT ! ---------------------------------- Python 1.6 is made available subject to the terms and conditions in From python-dev@python.org Mon Sep 4 02:22:14 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 18:22:14 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python getcopyright.c,1.10,1.11 Message-ID: <200009040122.SAA27781@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv27727 Modified Files: getcopyright.c Log Message: Use periods, not semicolons between Copyright and All Rights Reserved. Index: getcopyright.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getcopyright.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** getcopyright.c 2000/09/03 03:35:50 1.10 --- getcopyright.c 2000/09/04 01:22:12 1.11 *************** *** 4,11 **** static char cprt[] = ! "Copyright (c) 2000 BeOpen.com; All Rights Reserved.\n\ ! Copyright (c) 1995-2000 Corporation for National Research Initiatives;\n\ All Rights Reserved.\n\ ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam;\n\ All Rights Reserved."; --- 4,11 ---- static char cprt[] = ! "Copyright (c) 2000 BeOpen.com. All Rights Reserved.\n\ ! Copyright (c) 1995-2000 Corporation for National Research Initiatives.\n\ All Rights Reserved.\n\ ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\n\ All Rights Reserved."; From python-dev@python.org Mon Sep 4 02:23:00 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 18:23:00 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python getcopyright.c,1.6.2.3,1.6.2.4 Message-ID: <200009040123.SAA28451@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv28410 Modified Files: Tag: cnri-16-start getcopyright.c Log Message: Use periods, not semicolons between Copyright and All Rights Reserved. Index: getcopyright.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getcopyright.c,v retrieving revision 1.6.2.3 retrieving revision 1.6.2.4 diff -C2 -r1.6.2.3 -r1.6.2.4 *** getcopyright.c 2000/09/03 03:31:52 1.6.2.3 --- getcopyright.c 2000/09/04 01:22:58 1.6.2.4 *************** *** 4,10 **** static char cprt[] = ! "Copyright (c) 1995-2000 Corporation for National Research Initiatives;\n\ All Rights Reserved.\n\ ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam;\n\ All Rights Reserved."; --- 4,10 ---- static char cprt[] = ! "Copyright (c) 1995-2000 Corporation for National Research Initiatives.\n\ All Rights Reserved.\n\ ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\n\ All Rights Reserved."; From python-dev@python.org Mon Sep 4 02:27:06 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 18:27:06 -0700 Subject: [Python-checkins] CVS: python/dist/src/Python getcopyright.c,1.11,1.12 Message-ID: <200009040127.SAA32399@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Python In directory slayer.i.sourceforge.net:/tmp/cvs-serv32352 Modified Files: getcopyright.c Log Message: All right. More uniformity, and extra blank lines. Index: getcopyright.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getcopyright.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** getcopyright.c 2000/09/04 01:22:12 1.11 --- getcopyright.c 2000/09/04 01:27:04 1.12 *************** *** 4,10 **** static char cprt[] = ! "Copyright (c) 2000 BeOpen.com. All Rights Reserved.\n\ Copyright (c) 1995-2000 Corporation for National Research Initiatives.\n\ All Rights Reserved.\n\ Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\n\ All Rights Reserved."; --- 4,13 ---- static char cprt[] = ! "Copyright (c) 2000 BeOpen.com.\n\ ! All Rights Reserved.\n\ ! \n\ Copyright (c) 1995-2000 Corporation for National Research Initiatives.\n\ All Rights Reserved.\n\ + \n\ Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\n\ All Rights Reserved."; From python-dev@python.org Mon Sep 4 04:19:51 2000 From: python-dev@python.org (A.M. Kuchling) Date: Sun, 3 Sep 2000 20:19:51 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib pre.py,1.2,1.3 Message-ID: <200009040319.UAA30470@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv30435 Modified Files: pre.py Log Message: Correct docstring about return value when group didn't participate in match (pointed out by /F) Index: pre.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pre.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** pre.py 2000/07/16 12:04:30 1.2 --- pre.py 2000/09/04 03:19:48 1.3 *************** *** 527,531 **** Return the index of the start of the substring matched by group; group defaults to zero (meaning the whole matched ! substring). Return None if group exists but did not contribute to the match. --- 527,531 ---- Return the index of the start of the substring matched by group; group defaults to zero (meaning the whole matched ! substring). Return -1 if group exists but did not contribute to the match. *************** *** 543,547 **** Return the indices of the end of the substring matched by group; group defaults to zero (meaning the whole matched ! substring). Return None if group exists but did not contribute to the match. --- 543,547 ---- Return the indices of the end of the substring matched by group; group defaults to zero (meaning the whole matched ! substring). Return -1 if group exists but did not contribute to the match. *************** *** 558,563 **** Return the 2-tuple (m.start(group), m.end(group)). Note that ! if group did not contribute to the match, this is (None, ! None). Group defaults to zero (meaning the whole matched substring). --- 558,563 ---- Return the 2-tuple (m.start(group), m.end(group)). Note that ! if group did not contribute to the match, this is (-1, ! -1). Group defaults to zero (meaning the whole matched substring). From python-dev@python.org Mon Sep 4 04:22:47 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 20:22:47 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.51.4.2,1.51.4.3 Message-ID: <200009040322.UAA30762@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv30753 Modified Files: Tag: cnri-16-start NEWS Log Message: Minor edits of the intro; added my signature line. Added a complete list of changes from 1.6b1 to 1.6. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.51.4.2 retrieving revision 1.51.4.3 diff -C2 -r1.51.4.2 -r1.51.4.3 *** NEWS 2000/09/03 19:17:26 1.51.4.2 --- NEWS 2000/09/04 03:22:45 1.51.4.3 *************** *** 11,21 **** credit, let me know and I'll add you to the list! ====================================================================== ! Overview of changes ! ------------------- ! For the list of change below, I have borrowed from the document "What's New in Python 2.0" by Andrew Kuchling and Moshe Zadka: http://starship.python.net/crew/amk/python/writing/new-python/. --- 11,22 ---- credit, let me know and I'll add you to the list! + --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/) ====================================================================== ! Changes from 1.5.2 to 1.6 ! ------------------------- ! For this overview of changes, I have borrowed from the document "What's New in Python 2.0" by Andrew Kuchling and Moshe Zadka: http://starship.python.net/crew/amk/python/writing/new-python/. *************** *** 106,109 **** --- 107,166 ---- method. Note that it has its arguments backwards: x in a causes a.__contains__(x) to be called. That's why the name isn't __in__. + + + Changes from 1.6b1 to 1.6 + ------------------------- + + - Slight changes to the CNRI license. A copyright notice has been + added; the requirement to indicate the nature of modifications now + applies when making a derivative work available "to others" instead of + just "to the public"; the version and date are updated. The new + license has a new handle. + + - Added the Tools/compiler package. This is a project led by Jeremy + Hylton to write the Python bytecode generator in Python. + + - The function math.rint() is removed. + + - In Python.h, "#define _GNU_SOURCE 1" was added. + + - Version 0.9.1 of Greg Ward's distutils is included (instead of + version 0.9). + + - A new version of SRE is included. It is more stable, and more + compatible with the old RE module. Non-matching ranges are indicated + by -1, not None. (The documentation said None, but the PRE + implementation used -1; changing to None would break existing code.) + + - The winreg module has been renamed to _winreg. (There are plans for + a higher-level API called winreg, but this has not yet materialized in + a form that is acceptable to the experts.) + + - The _locale module is enabled by default. + + - Fixed the configuration line for the _curses module. + + - A few crashes have been fixed, notably .writelines() with a + list containing non-string objects would crash, and there were + situations where a lost SyntaxError could dump core. + + - The .extend() method now accepts an arbitrary sequence + argument. + + - If __str__() or __repr__() returns a Unicode object, this is + converted to an 8-bit string. + + - Unicode string comparisons is no longer aware of UTF-16 + encoding peculiarities; it's a straight 16-bit compare. + + - The Windows installer now installs the LICENSE file and no longer + registers the Python DLL version in the registry (this is no longer + needed). It now uses Tcl/Tk 8.3.2. + + - A few portability problems have been fixed, in particular a + compilation error involving socklen_t. + + - The PC configuration is slightly friendlier to non-Microsoft + compilers. ====================================================================== From python-dev@python.org Mon Sep 4 04:49:54 2000 From: python-dev@python.org (Guido van Rossum) Date: Sun, 3 Sep 2000 20:49:54 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.51.4.3,1.51.4.4 Message-ID: <200009040349.UAA32005@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv31998 Modified Files: Tag: cnri-16-start NEWS Log Message: Reorganized a bit and finished based on what was on the website. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.51.4.3 retrieving revision 1.51.4.4 diff -C2 -r1.51.4.3 -r1.51.4.4 *** NEWS 2000/09/04 03:22:45 1.51.4.3 --- NEWS 2000/09/04 03:49:51 1.51.4.4 *************** *** 1,28 **** ! What's new in this release? ! =========================== Below is a list of all relevant changes since release 1.5.2. Older ! changes are in the file HISTORY. The most recent changes are listed ! first. - A note on attributions: while I have sprinkled some names throughout - here, I'm grateful to many more people who remain unnamed. You may - find your name in the ACKS file. If you believe you deserve more - credit, let me know and I'll add you to the list! - --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/) ====================================================================== - Changes from 1.5.2 to 1.6 - ------------------------- ! For this overview of changes, I have borrowed from the document ! "What's New in Python 2.0" by Andrew Kuchling and Moshe Zadka: http://starship.python.net/crew/amk/python/writing/new-python/. ! There are lots of new modules and lots of bugs have been fixed. To ! find out about new modules, check out the library manual, which has ! been enhanced significantly. Probably the most pervasive change is the addition of Unicode support. --- 1,58 ---- ! What's new in release 1.6? ! ========================== Below is a list of all relevant changes since release 1.5.2. Older ! changes are in the file HISTORY. --Guido van Rossum (home page: http://www.pythonlabs.com/~guido/) ====================================================================== + + Source Incompatibilities + ------------------------ + + Several small incompatible library changes may trip you up: + + - The append() method for lists can no longer be invoked with more + than one argument. This used to append a single tuple made out of + all arguments, but was undocumented. To append a tuple, use + e.g. l.append((a, b, c)). + + - The connect(), connect_ex() and bind() methods for sockets require + exactly one argument. Previously, you could call s.connect(host, + port), but this was undocumented. You must now write + s.connect((host, port)). + + - The str() and repr() functions are now different more often. For + long integers, str() no longer appends a 'L'. Thus, str(1L) == '1', + which used to be '1L'; repr(1L) is unchanged and still returns '1L'. + For floats, repr() now gives 17 digits of precision, to ensure no + precision is lost (on all current hardware). + + - The -X option is gone. Built-in exceptions are now always + classes. Many more library modules also have been converted to + class-based exceptions. ! Binary Incompatibilities ! ------------------------ ! ! - Third party extensions built for Python 1.5.x cannot be used with ! Python 1.6; these extensions will have to be rebuilt for Python 1.6. ! ! - On Windows, attempting to import a third party extension built for ! Python 1.5.x results in an immediate crash; there's not much we can do ! about this. Check your PYTHONPATH environment variable! ! ! ! Overview of Changes since 1.5.2 ! ------------------------------- ! ! For this overview, I have borrowed from the document "What's New in ! Python 2.0" by Andrew Kuchling and Moshe Zadka: http://starship.python.net/crew/amk/python/writing/new-python/. ! There are lots of new modules and lots of bugs have been fixed. A ! list of all new modules is included below. Probably the most pervasive change is the addition of Unicode support. *************** *** 41,45 **** delimiter) is delimiter.join(sequence). Use " ".join(sequence) for the effect of string.join(sequence); to make this more readable, try ! space=" " first. - The new regular expression engine, SRE by Fredrik Lundh, is fully --- 71,76 ---- delimiter) is delimiter.join(sequence). Use " ".join(sequence) for the effect of string.join(sequence); to make this more readable, try ! space=" " first. Note that the maxsplit argument defaults in ! split() and replace() have changed from 0 to -1. - The new regular expression engine, SRE by Fredrik Lundh, is fully *************** *** 51,102 **** engine -- this is at least the fourth!). - Several small incompatible library changes may trip you up: ! - The append() method for lists can no longer be invoked with more ! than one argument. This used to append a single tuple made out of ! all arguments, but was undocumented. To append a tuple, use ! e.g. l.append((a, b, c)). ! - The connect(), connect_ex() and bind() methods for sockets require ! exactly one argument. Previously, you could call s.connect(host, ! port), but this was undocumented. You must now write ! s.connect((host, port)). ! - The str() and repr() functions are now different more often. For ! long integers, str() no longer appends a 'L'. Thus, str(1L) == '1', ! which used to be '1L'; repr(1L) is unchanged and still returns '1L'. ! For floats, repr() now gives 17 digits of precision, to ensure no ! precision is lost (on all current hardware). ! - The -X option is gone. Built-in exceptions are now always ! classes. Many more library modules also have been converted to ! class-based exceptions. ! Other changes that won't break code but are nice to know about: ! - Greg Ward's "distutils" package is included: this will make installing, building and distributing third party packages much simpler. ! - There's now special syntax that you can use instead of the apply() function. f(*args, **kwds) is equivalent to apply(f, args, kwds). You can also use variations f(a1, a2, *args, **kwds) and you can leave one or the other out: f(*args), f(**kwds). ! - The built-ins int() and long() take an optional second argument to indicate the conversion base -- of course only if the first argument is a string. This makes string.atoi() and string.atol() obsolete. (string.atof() was already obsolete). ! - When a local variable is known to the compiler but undefined when used, a new exception UnboundLocalError is raised. This is a class derived from NameError so code catching NameError should still work. The purpose is to provide better diagnostics in the following example: - x = 1 def f(): print x x = x+1 - This used to raise a NameError on the print statement, which confused even experienced Python programmers (especially if there are several --- 82,122 ---- engine -- this is at least the fourth!). ! Other Changes ! ------------- ! Other changes that won't break code but are nice to know about: ! Deleting objects is now safe even for deeply nested data structures. ! Long/int unifications: long integers can be used in seek() calls, as ! slice indexes. ! String formatting (s % args) has a new formatting option, '%r', which ! acts like '%s' but inserts repr(arg) instead of str(arg). (Not yet in ! alpha 1.) ! Greg Ward's "distutils" package is included: this will make installing, building and distributing third party packages much simpler. ! There's now special syntax that you can use instead of the apply() function. f(*args, **kwds) is equivalent to apply(f, args, kwds). You can also use variations f(a1, a2, *args, **kwds) and you can leave one or the other out: f(*args), f(**kwds). ! The built-ins int() and long() take an optional second argument to indicate the conversion base -- of course only if the first argument is a string. This makes string.atoi() and string.atol() obsolete. (string.atof() was already obsolete). ! When a local variable is known to the compiler but undefined when used, a new exception UnboundLocalError is raised. This is a class derived from NameError so code catching NameError should still work. The purpose is to provide better diagnostics in the following example: x = 1 def f(): print x x = x+1 This used to raise a NameError on the print statement, which confused even experienced Python programmers (especially if there are several *************** *** 104,115 **** x :-). ! - You can now override the 'in' operator by defining a __contains__ method. Note that it has its arguments backwards: x in a causes a.__contains__(x) to be called. That's why the name isn't __in__. - Changes from 1.6b1 to 1.6 - ------------------------- - Slight changes to the CNRI license. A copyright notice has been added; the requirement to indicate the nature of modifications now --- 124,254 ---- x :-). ! You can now override the 'in' operator by defining a __contains__ method. Note that it has its arguments backwards: x in a causes a.__contains__(x) to be called. That's why the name isn't __in__. + The exception AttributeError will have a more friendly error message, + e.g.: 'Spam' instance has no attribute 'eggs'. This may + break code that expects the message to be exactly the attribute + name. + + + New Modules in 1.6 + ------------------ + + UserString - base class for deriving from the string type. + + distutils - tools for distributing Python modules. + + robotparser - parse a robots.txt file, for writing web spiders. + (Moved from Tools/webchecker/.) + + linuxaudiodev - audio for Linux. + + mmap - treat a file as a memory buffer. (Windows and Unix.) + + sre - regular expressions (fast, supports unicode). Currently, this + code is very rough. Eventually, the re module will be reimplemented + using sre (without changes to the re API). + + filecmp - supersedes the old cmp.py and dircmp.py modules. + + tabnanny - check Python sources for tab-width dependance. (Moved from + Tools/scripts/.) + + urllib2 - new and improved but incompatible version of urllib (still + experimental). + + zipfile - read and write zip archives. + + codecs - support for Unicode encoders/decoders. + + unicodedata - provides access to the Unicode 3.0 database. + + _winreg - Windows registry access. + + encodings - package which provides a large set of standard codecs -- + currently only for the new Unicode support. It has a drop-in extension + mechanism which allows you to add new codecs by simply copying them + into the encodings package directory. Asian codec support will + probably be made available as separate distribution package built upon + this technique and the new distutils package. + + + Changed Modules + --------------- + + readline, ConfigParser, cgi, calendar, posix, readline, xmllib, aifc, + chunk, wave, random, shelve, nntplib - minor enhancements. + + socket, httplib, urllib - optional OpenSSL support (Unix only). + + _tkinter - support for 8.0 up to 8.3. Support for versions older than + 8.0 has been dropped. + + string - most of this module is deprecated now that strings have + methods. This no longer uses the built-in strop module, but takes + advantage of the new string methods to provide transparent support for + both Unicode and ordinary strings. + Changes on Windows + ------------------ + + The installer no longer runs a separate Tcl/Tk installer; instead, it + installs the needed Tcl/Tk files directly in the Python directory. If + you already have a Tcl/Tk installation, this wastes some disk space + (about 4 Megs) but avoids problems with conflincting Tcl/Tk + installations, and makes it much easier for Python to ensure that + Tcl/Tk can find all its files. Note: the alpha installers don't + include the documentation. + + The Windows installer now installs by default in \Python16\ on the + default volume, instead of \Program Files\Python-1.6\. + + + Changed Tools + ------------- + + IDLE - complete overhaul. See the IDLE home + page for more information. (Python 1.6 alpha 1 will come with + IDLE 0.6.) + + Tools/i18n/pygettext.py - Python equivalent of xgettext(1). A message + text extraction tool used for internationalizing applications written + in Python. + + + Obsolete Modules + ---------------- + + stdwin and everything that uses it. (Get Python 1.5.2 if you need + it. :-) + + soundex. (Skip Montanaro has a version in Python but it won't be + included in the Python release.) + + cmp, cmpcache, dircmp. (Replaced by filecmp.) + + dump. (Use pickle.) + + find. (Easily coded using os.walk().) + + grep. (Not very useful as a library module.) + + packmail. (No longer has any use.) + + poly, zmod. (These were poor examples at best.) + + strop. (No longer needed by the string module.) + + util. (This functionality was long ago built in elsewhere). + + whatsound. (Use sndhdr.) + + + Detailed Changes from 1.6b1 to 1.6 + ---------------------------------- + - Slight changes to the CNRI license. A copyright notice has been added; the requirement to indicate the nature of modifications now *************** *** 163,166 **** --- 302,306 ---- - The PC configuration is slightly friendlier to non-Microsoft compilers. + ====================================================================== From python-dev@python.org Mon Sep 4 05:03:25 2000 From: python-dev@python.org (Skip Montanaro) Date: Sun, 3 Sep 2000 21:03:25 -0700 Subject: [Python-checkins] CVS: python/dist/src configure.in,1.154,1.155 Message-ID: <200009040403.VAA01704@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv1606 Modified Files: configure.in Log Message: Fixes bug in --with-libdb. If --with-libdb was not specified (default is to enable it), but db.h was not found, the WITH_LIBDB macros was still being defined, resulting in compilation errors. Also added a short explain when bsddb support wasn't enabled (because db.h wasn't found) when the user explicitly used --with-libdb on the configure command line. Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -r1.154 -r1.155 *** configure.in 2000/08/31 17:45:35 1.154 --- configure.in 2000/09/04 04:03:22 1.155 *************** *** 814,825 **** [ --with(out)-libdb disable/enable bsddb module]) ! # default is enabled ! if test -z "$with_libdb" ! then with_libdb="yes" fi ! # if we found db.h, enable, unless with_libdb is expressly set to "no" ! if test "$ac_cv_header_db_h" = "yes" -a "$with_libdb" != "no" ! then with_libdb="yes" ! fi if test "$with_libdb" = "no" then --- 814,832 ---- [ --with(out)-libdb disable/enable bsddb module]) ! # enabled by default, but db.h must be found ! if test "$ac_cv_header_db_h" = "yes" ! then ! if test "$with_libdb" != "no" ! then with_libdb="yes" ! fi ! else ! # make sure user knows why bsddb support wasn't enabled event ! # though s/he requested it ! if test "$with_libdb" = "yes" ! then echo $ac_n "(requested, but db.h was not found) $ac_c" ! fi ! with_libdb="no" fi ! if test "$with_libdb" = "no" then From python-dev@python.org Mon Sep 4 05:06:08 2000 From: python-dev@python.org (Skip Montanaro) Date: Sun, 3 Sep 2000 21:06:08 -0700 Subject: [Python-checkins] CVS: python/dist/src configure,1.144,1.145 Message-ID: <200009040406.VAA03388@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv3093 Modified Files: configure Log Message: Fixes bug in --with-libdb. If --with-libdb was not specified (default is to enable it), but db.h was not found, the WITH_LIBDB macros was still being defined, resulting in compilation errors. Also added a short explain when bsddb support wasn't enabled (because db.h wasn't found) when the user explicitly used --with-libdb on the configure command line. Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -r1.144 -r1.145 *** configure 2000/09/01 19:22:55 1.144 --- configure 2000/09/04 04:06:05 1.145 *************** *** 4,8 **** # Guess values for system-dependent variables and create Makefiles. ! # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # --- 4,8 ---- # Guess values for system-dependent variables and create Makefiles. ! # Generated automatically using autoconf version 2.14.1 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. [...4122 lines suppressed...] ! echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) --- 5979,5983 ---- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ! echo "$CONFIG_STATUS generated by autoconf version 2.14.1" exit 0 ;; -help | --help | --hel | --he | --h) *************** *** 6249,6252 **** chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files ! test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 --- 6281,6284 ---- chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files ! test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1 From python-dev@python.org Mon Sep 4 08:34:09 2000 From: python-dev@python.org (Tim Peters) Date: Mon, 4 Sep 2000 00:34:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.dsp,1.7,1.8 Message-ID: <200009040734.AAA15017@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/PCbuild In directory slayer.i.sourceforge.net:/tmp/cvs-serv14470/python/dist/src/PCbuild Modified Files: python20.dsp Log Message: test_mmap wrote null bytes into its expected-output file; this caused me to waste an hour tracking down an illusion; repaired it; writing/reading non- printable characters (except \t\r\n) into/outof text-mode files ain't defined x-platform, and at least some Windows text editors do surprising things in their presence. Also added a by-hand "build humber" to the Windows build, in an approximation of Python's inexplicable BUILD-number Unix scheme. I'll try to remember to increment it each time I make a Windows installer available. It's starting at 2, cuz I've put 2 installers out so far (both with BUILD #0). Index: python20.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.dsp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** python20.dsp 2000/08/13 22:59:26 1.7 --- python20.dsp 2000/09/04 07:34:06 1.8 *************** *** 695,699 **** --- 695,703 ---- !IF "$(CFG)" == "python20 - Win32 Release" + # ADD CPP /D BUILD=2 + !ELSEIF "$(CFG)" == "python20 - Win32 Debug" + + # ADD CPP /D BUILD=2 !ELSEIF "$(CFG)" == "python20 - Win32 Alpha Debug" From python-dev@python.org Mon Sep 4 08:34:09 2000 From: python-dev@python.org (Tim Peters) Date: Mon, 4 Sep 2000 00:34:09 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_mmap,1.3,1.4 Message-ID: <200009040734.AAA15013@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/test/output In directory slayer.i.sourceforge.net:/tmp/cvs-serv14470/python/dist/src/Lib/test/output Modified Files: test_mmap Log Message: test_mmap wrote null bytes into its expected-output file; this caused me to waste an hour tracking down an illusion; repaired it; writing/reading non- printable characters (except \t\r\n) into/outof text-mode files ain't defined x-platform, and at least some Windows text editors do surprising things in their presence. Also added a by-hand "build humber" to the Windows build, in an approximation of Python's inexplicable BUILD-number Unix scheme. I'll try to remember to increment it each time I make a Windows installer available. It's starting at 2, cuz I've put 2 installers out so far (both with BUILD #0). Index: test_mmap =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_mmap,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 Binary files /tmp/cvsJA5ItT and /tmp/cvs6uhBPC differ From python-dev@python.org Mon Sep 4 08:34:08 2000 From: python-dev@python.org (Tim Peters) Date: Mon, 4 Sep 2000 00:34:08 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_mmap.py,1.9,1.10 Message-ID: <200009040734.AAA15010@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib/test In directory slayer.i.sourceforge.net:/tmp/cvs-serv14470/python/dist/src/Lib/test Modified Files: test_mmap.py Log Message: test_mmap wrote null bytes into its expected-output file; this caused me to waste an hour tracking down an illusion; repaired it; writing/reading non- printable characters (except \t\r\n) into/outof text-mode files ain't defined x-platform, and at least some Windows text editors do surprising things in their presence. Also added a by-hand "build humber" to the Windows build, in an approximation of Python's inexplicable BUILD-number Unix scheme. I'll try to remember to increment it each time I make a Windows installer available. It's starting at 2, cuz I've put 2 installers out so far (both with BUILD #0). Index: test_mmap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mmap.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** test_mmap.py 2000/07/30 15:38:35 1.9 --- test_mmap.py 2000/09/04 07:34:05 1.10 *************** *** 41,45 **** print ' Contents of first 3 bytes:', repr(m[0:3]) assert m[0:3] == '3\0\0' ! print ' Contents of second page:', m[PAGESIZE-1 : PAGESIZE + 7] assert m[PAGESIZE-1 : PAGESIZE + 7] == '\0foobar\0' --- 41,45 ---- print ' Contents of first 3 bytes:', repr(m[0:3]) assert m[0:3] == '3\0\0' ! print ' Contents of second page:', repr(m[PAGESIZE-1 : PAGESIZE + 7]) assert m[PAGESIZE-1 : PAGESIZE + 7] == '\0foobar\0' *************** *** 120,122 **** test_both() - --- 120,121 ---- From python-dev@python.org Mon Sep 4 10:20:33 2000 From: python-dev@python.org (Tim Peters) Date: Mon, 4 Sep 2000 02:20:33 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0200.txt,1.39,1.40 Message-ID: <200009040920.CAA02926@slayer.i.sourceforge.net> Update of /cvsroot/python/python/nondist/peps In directory slayer.i.sourceforge.net:/tmp/cvs-serv2797 Modified Files: pep-0200.txt Log Message: Many updates; 'twas getting confusingly out-of-date. Index: pep-0200.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0200.txt,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** pep-0200.txt 2000/09/01 11:46:11 1.39 --- pep-0200.txt 2000/09/04 09:20:29 1.40 *************** *** 91,95 **** test case platform date reported --------- -------- ------------- ! [None currently failing.] Open items -- Need to be resolved before 2.0b1 release --- 91,103 ---- test case platform date reported --------- -------- ------------- ! test_mmap Win ME 03-Sep-2000 Windows 2b1p2 prelease ! [04-Sep-2000 tim ! reported by Audun S. Runde mailto:audun@mindspring.com ! the mmap constructor fails w/ ! WindowsError: [Errno 6] The handle is invalid ! since there are no reports of this failing on other ! flavors of Windows, this looks like to be an ME bug ! ] ! Open items -- Need to be resolved before 2.0b1 release *************** *** 111,126 **** Decide on a license. - [01-Sep-2000 tim: ompleted but untested except on Win98SE] - Windows installer: If HKLM isn't writable, back off to HKCU (so - Python can be installed on NT & 2000 without admin privileges). - - [01-Sep-2000 tim: make a prerelease availabe] - Windows ME: Don't know anything about it. Will the installer - even run? Does it need the w9xpopen hack? Open items -- Need to be resolved before 2.0 final release Update Tools/compiler so that it is compatible with list ! comprehensions, import as, and any other new language features. Improve code coverage of test suite. --- 119,127 ---- Decide on a license. Open items -- Need to be resolved before 2.0 final release Update Tools/compiler so that it is compatible with list ! comprehensions, import as, and any other new language features. Improve code coverage of test suite. *************** *** 137,140 **** --- 138,142 ---- "visible progress" indeed!). + Accepted and in progress *************** *** 142,156 **** Make this function safe from buffer overflows. - * Change meaning of \x escapes - PEP 223 - Fredrik Lundh - - * Add \U1234678 escapes in u"" strings - Fredrik Lundh Open: proposed but not accepted or rejected - * Extended slicing on lists - Michael Hudson - Make lists (and other builtin types) handle extended slices. - * Problems reported with Tkinter, Tk 8.3.2, and Unicode (?) Previously failing test cases --- 144,153 ---- Make this function safe from buffer overflows. Open: proposed but not accepted or rejected * Problems reported with Tkinter, Tk 8.3.2, and Unicode (?) + Previously failing test cases *************** *** 160,164 **** test case platform date reported --------- -------- ------------- ! test_fork1 Linux 26-Jul-2000 [28-aug-2000 fixed by cgw; solution is to create copies of lock in child process] --- 157,161 ---- test case platform date reported --------- -------- ------------- ! test_fork1 Linux 26-Jul-2000 [28-aug-2000 fixed by cgw; solution is to create copies of lock in child process] *************** *** 177,183 **** [31-Aug-2000 tim This died again, but for an entirely different reason: it uses a ! dict to map file pointers to process handles, and calls a dict access function during popen.close(). But .close releases threads, ! which left the internal popen code accessing the dict without a valid thread state. The dict implementation changed so that's no longer accepted. Fixed by creating a temporary thread state in the --- 174,180 ---- [31-Aug-2000 tim This died again, but for an entirely different reason: it uses a ! dict to map file pointers to process handles, and calls a dict access function during popen.close(). But .close releases threads, ! which left the internal popen code accessing the dict without a valid thread state. The dict implementation changed so that's no longer accepted. Fixed by creating a temporary thread state in the *************** *** 245,248 **** --- 242,255 ---- Open items -- completed/fixed + [04-Sep-2000 tim: done; installer runs; w9xpopen not an issue] + [01-Sep-2000 tim: make a prerelease availabe] + Windows ME: Don't know anything about it. Will the installer + even run? Does it need the w9xpopen hack? + + [04-Sep-2000 tim: done; tested on several Windows flavors now] + [01-Sep-2000 tim: completed but untested except on Win98SE] + Windows installer: If HKLM isn't writable, back off to HKCU (so + Python can be installed on NT & 2000 without admin privileges). + [01-Sep-200 tim - as Guido said, runtime code in posixmodule.c doesn't call this on NT/2000, so no need to avoid installing it everywhere. *************** *** 269,272 **** --- 276,283 ---- Accepted and completed + * Change meaning of \x escapes - PEP 223 - Fredrik Lundh + + * Add \U1234678 escapes in u"" strings - Fredrik Lundh + * Support for opcode arguments > 2**16 - Charles Waldman SF Patch 100893 *************** *** 304,308 **** * interface to poll system call - Andrew Kuchling ! SF Patch 100852 * Augmented assignment - Thomas Wouters --- 315,319 ---- * interface to poll system call - Andrew Kuchling ! SF Patch 100852 * Augmented assignment - Thomas Wouters *************** *** 313,316 **** --- 324,330 ---- Postponed + + * Extended slicing on lists - Michael Hudson + Make lists (and other builtin types) handle extended slices. * Compression of Unicode database - Fredrik Lundh From python-dev@python.org Mon Sep 4 13:11:53 2000 From: python-dev@python.org (Guido van Rossum) Date: Mon, 4 Sep 2000 05:11:53 -0700 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.60,1.61 Message-ID: <200009041211.FAA15905@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Misc In directory slayer.i.sourceforge.net:/tmp/cvs-serv15829 Modified Files: ACKS Log Message: Tim Peters: "Audun S. Runde mailto:audun@mindspring.com wins a Fabulous Prize for being our first Windows ME tester! Also our only, and I think he should get another prize just for that." Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -r1.60 -r1.61 *** ACKS 2000/09/02 15:01:50 1.60 --- ACKS 2000/09/04 12:11:50 1.61 *************** *** 296,299 **** --- 296,300 ---- Saskia van Rossum Donald Wallace Rouse II + Audun S. Runde Jeff Rush Sam Rushing From python-dev@python.org Mon Sep 4 14:14:37 2000 From: python-dev@python.org (Guido van Rossum) Date: Mon, 4 Sep 2000 06:14:37 -0700 Subject: [Python-checkins] CVS: python/nondist/peps pep-0200.txt,1.40,1.41 Message-ID: <200009041314.GAA16309@slayer.i.sourceforge.net> Update of /cvsroot/python/python/nondist/peps In directory slayer.i.sourceforge.net:/tmp/cvs-serv16184 Modified Files: pep-0200.txt Log Message: More updates -- things are getting done! Index: pep-0200.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0200.txt,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -r1.40 -r1.41 *** pep-0200.txt 2000/09/04 09:20:29 1.40 --- pep-0200.txt 2000/09/04 13:14:30 1.41 *************** *** 103,121 **** Open items -- Need to be resolved before 2.0b1 release ! Add popen2 support for Linux -- Fred Drake ! Deal with buffering problem with SocketServer -- GvR Make sure there are no tabs in the std library. Get all patches out of Open. Get all patches out of Accepted. Fix all other bugs with priority 7 or higher - Review performance and frequency of garbage collection scans. - Decide on a license. --- 103,130 ---- Open items -- Need to be resolved before 2.0b1 release ! Add popen4 support for Unix -- Fred Drake ! [4-Sep-2000 guido: popen4 is like popen2 with 2>&1 added] ! ! Review performance and frequency of garbage collection scans. ! ! Checklist items -- Need to check on these before releasing Make sure there are no tabs in the std library. + [4-Sep-2000 guido: currently ok -- left here for final check] Get all patches out of Open. + [4-Sep-2000 guido: hopeless -- people keep adding new ones; but + the ones submitted on time before the feature freeze are all gone] Get all patches out of Accepted. + [4-Sep-2000 guido: currently ok -- left here for final check] Fix all other bugs with priority 7 or higher + [4-Sep-2000 guido: currently ok -- left here for final check] Decide on a license. + [4-Sep-2000 guido: looks like done, waiting for legal reviews or + new GPL developments] *************** *** 128,131 **** --- 137,142 ---- Decide on a license. + [4-Sep-2000 guido: looks like done, waiting for legal reviews or + new GPL developments] Finish writing the PEPs for the features that went out with *************** *** 141,146 **** Accepted and in progress ! * PyErr_Format - Fredrik Lundh ! Make this function safe from buffer overflows. --- 152,156 ---- Accepted and in progress ! * Currently none left. [4-Sep-2000 guido] *************** *** 241,244 **** --- 251,264 ---- Open items -- completed/fixed + + [4-Sep-2000 guido: Fredrik finished this on 1-Sep] + * PyErr_Format - Fredrik Lundh + Make this function safe from buffer overflows. + + [4-Sep-2000 guido: Fred has added popen2, popen3 on 28-Sep] + Add popen2 support for Linux -- Fred Drake + + [4-Sep-2000 guido: done on 1-Sep] + Deal with buffering problem with SocketServer [04-Sep-2000 tim: done; installer runs; w9xpopen not an issue] From python-dev@python.org Mon Sep 4 15:34:35 2000 From: python-dev@python.org (Guido van Rossum) Date: Mon, 4 Sep 2000 07:34:35 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/inst inst.tex,1.16.2.1,1.16.2.2 Message-ID: <200009041434.HAA24250@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/inst In directory slayer.i.sourceforge.net:/tmp/cvs-serv24123/inst Modified Files: Tag: cnri-16-start inst.tex Log Message: Sigh. Periods instead of semicolons. I'm gonna cry! Index: inst.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/inst/inst.tex,v retrieving revision 1.16.2.1 retrieving revision 1.16.2.2 diff -C2 -r1.16.2.1 -r1.16.2.2 *** inst.tex 2000/09/03 04:44:28 1.16.2.1 --- inst.tex 2000/09/04 14:34:33 1.16.2.2 *************** *** 323,329 **** \begin{verbatim} Python 1.6 (#22, Sep 2 2000, 23:54:55) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 ! Copyright (c) 1995-2000 Corporation for National Research Initiatives; All Rights Reserved. ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam; All Rights Reserved. >>> import sys --- 323,329 ---- \begin{verbatim} Python 1.6 (#22, Sep 2 2000, 23:54:55) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 ! Copyright (c) 1995-2000 Corporation for National Research Initiatives. All Rights Reserved. ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved. >>> import sys From python-dev@python.org Mon Sep 4 15:34:36 2000 From: python-dev@python.org (Guido van Rossum) Date: Mon, 4 Sep 2000 07:34:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/api api.tex,1.65.2.1,1.65.2.2 Message-ID: <200009041434.HAA24252@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/api In directory slayer.i.sourceforge.net:/tmp/cvs-serv24123/api Modified Files: Tag: cnri-16-start api.tex Log Message: Sigh. Periods instead of semicolons. I'm gonna cry! Index: api.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/api.tex,v retrieving revision 1.65.2.1 retrieving revision 1.65.2.2 diff -C2 -r1.65.2.1 -r1.65.2.2 *** api.tex 2000/09/03 04:44:28 1.65.2.1 --- api.tex 2000/09/04 14:34:32 1.65.2.2 *************** *** 3729,3735 **** for example ! \code{"Copyright (c) 1995-2000 Corporation for National Research Initiatives;\n\ All Rights Reserved.\n\ ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam;\n\ All Rights Reserved."} --- 3729,3735 ---- for example ! \code{"Copyright (c) 1995-2000 Corporation for National Research Initiatives.\n\ All Rights Reserved.\n\ ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam.\n\ All Rights Reserved."} From python-dev@python.org Mon Sep 4 15:34:36 2000 From: python-dev@python.org (Guido van Rossum) Date: Mon, 4 Sep 2000 07:34:36 -0700 Subject: [Python-checkins] CVS: python/dist/src/Doc/tut tut.tex,1.107.2.1,1.107.2.2 Message-ID: <200009041434.HAA24263@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Doc/tut In directory slayer.i.sourceforge.net:/tmp/cvs-serv24123/tut Modified Files: Tag: cnri-16-start tut.tex Log Message: Sigh. Periods instead of semicolons. I'm gonna cry! Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.107.2.1 retrieving revision 1.107.2.2 diff -C2 -r1.107.2.1 -r1.107.2.2 *** tut.tex 2000/09/03 04:44:28 1.107.2.1 --- tut.tex 2000/09/04 14:34:33 1.107.2.2 *************** *** 246,252 **** python Python 1.6 (#22, Sep 2 2000, 23:54:55) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 ! Copyright (c) 1995-2000 Corporation for National Research Initiatives; All Rights Reserved. ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam; All Rights Reserved. >>> --- 246,252 ---- python Python 1.6 (#22, Sep 2 2000, 23:54:55) [GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2 ! Copyright (c) 1995-2000 Corporation for National Research Initiatives. All Rights Reserved. ! Copyright (c) 1991-1995 Stichting Mathematisch Centrum, Amsterdam. All Rights Reserved. >>> From python-dev@python.org Mon Sep 4 16:55:34 2000 From: python-dev@python.org (Guido van Rossum) Date: Mon, 4 Sep 2000 08:55:34 -0700 Subject: [Python-checkins] CVS: python/dist/src/Lib SimpleHTTPServer.py,1.11,1.12 Message-ID: <200009041555.IAA16055@slayer.i.sourceforge.net> Update of /cvsroot/python/python/dist/src/Lib In directory slayer.i.sourceforge.net:/tmp/cvs-serv16048 Modified Files: SimpleHTTPServer.py Log Message: For this server to work on Windows, directories should use "/" as the separator in the href, not os.sep. Added a tag to directory listings. Bumped version to 0.5. Index: SimpleHTTPServer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/SimpleHTTPServer.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** SimpleHTTPServer.py 2000/07/29 05:15:56 1.11 --- SimpleHTTPServer.py 2000/09/04 15:55:31 1.12 *************** *** 7,11 **** ! __version__ = "0.4" --- 7,11 ---- ! __version__ = "0.5" *************** *** 100,103 **** --- 100,104 ---- list.sort(lambda a, b: cmp(a.lower(), b.lower())) f = StringIO() + f.write("<title>Directory listing for %s\n" % self.path) f.write("

Directory listing for %s

\n" % self.path) f.write("
\n