Commit Graph

6637 Commits

Author SHA1 Message Date
Jeremy Hylton cb91404890 Several changes:
1. Fix bug in (de)compression objects.  The final string resize used
zst.total_out to determine the length of the string, but the
(de)compression object will output data a little bit at a time, which
means total_out is not the string size.  Fix: save original value of
total_out at the start of the call.

2. Be sure to Py_DECREF the result value if you exit with an
exception.

3. Use PyInt_FromLong instead of Py_BuildValue

4. include more constants from the zlib header file

5. Use PyErr_Format instead of using a local buffer and sprintf.
1997-09-04 23:39:23 +00:00
Guido van Rossum 898c915a31 Added some try-excepts so that it can be imported in restricted mode
(though some type names are undefined in that case, e.g. CodeType
(inaccessible), FileType (not always accessible), and TracebackType
and FrameType (inaccessible).
1997-09-04 22:12:34 +00:00
Guido van Rossum d807b7589b The re test suite is very slow on slower hosts.
To save time, only run the first and last 10 tests except in verbose mode.
1997-09-04 14:35:45 +00:00
Barry Warsaw c7736b9d49 Added first line to set Emacs makefile mode (pretty colors :-) 1997-09-04 13:05:14 +00:00
Barry Warsaw c12c62ee5a (py-parse-partial-sexp-works-p): Removed as obsolete. All current
Emacs and XEmacs versions should have working parse-partial-sexp's.

(py-emacs-features): Defined as future placeholder.
1997-09-04 04:18:07 +00:00
Guido van Rossum dc5d07d952 Different test for Unix -- rely on os.sep instead of sys.platform. 1997-09-03 23:12:18 +00:00
Guido van Rossum 2b3fd76cc7 One patch from Sjoerd and one from Jack.
Sjoerd: add separate administration of temporary files created y
URLopener.retrieve() so cleanup can properly remove them.  The old
code removed everything in tempcache which was a bad idea if the user
had passed a non-temp file into it.  (I added a line to delete the
tempcache in cleanup() -- it still seems to make sense.)

Jack: in basejoin(), interpret relative paths starting in "../".  This
is necessary if the server uses symbolic links.
1997-09-03 22:36:15 +00:00
Guido van Rossum f01dff7e93 Give in to Mike Meyer -- add *both* lib/python1.5/packages and
lib/site-python to the path (if they exist).  This is a reasonable
compromise.
1997-09-03 22:05:54 +00:00
Guido van Rossum ad87d3e826 Give in to Mike Meyer -- add *both* lib/python1.5/packages and
lib/site-python to the path (if they exist).  This is a reasonable
compromise.
1997-09-03 21:41:30 +00:00
Guido van Rossum 9efe8ef7a1 #Plug small memory leaks in constructors. 1997-09-03 18:19:40 +00:00
Guido van Rossum c3beda2f27 Plug small leaks: the [de]compress object itself was never freed. 1997-09-03 18:14:30 +00:00
Guido van Rossum d5f0ce9f28 Added some symbols (I'm afraid more will come). 1997-09-03 16:12:00 +00:00
Guido van Rossum fd91056d59 Change instructions to require use of PCbuild directory (instead of
just recommending it).  At Mark Hammond's request.
1997-09-03 16:11:19 +00:00
Guido van Rossum 9ca064fbb4 At Mark Hammond's suggestion:
- use the DLL versions of the C runtime (!)
- change path settings so intermediate files go to Debug/temp or Release/temp
- add resource file to python15.dll (can't remember what this does)
- add a separate project to build the parser module
1997-09-03 16:10:52 +00:00
Guido van Rossum 4a78a3cf3b Added empty PCbuild directory for use by the NT build process. 1997-09-03 15:37:50 +00:00
Guido van Rossum 64790de195 Added new flags and exceptions; removed AccessError exception. 1997-09-03 01:09:25 +00:00
Guido van Rossum d19c04a88e Change [_Py_]re_compile_pattern() to return a char*.
Since it only returns an error message (or NULL) there's no reason
for it to be unsigned char *, and various compilers like this better.
1997-09-03 00:47:36 +00:00
Guido van Rossum 5ade084902 Mod suggested by Donn Cave -- invoke makexp_aix relative to $0
so it doesn't have to be on $PATH.
1997-09-03 00:45:30 +00:00
Guido van Rossum 3f0bff666d Disable the portable multimedia modules (audioop, imageop, rgbimg) by
default since they don't work on 64-bit platforms.
1997-09-03 00:44:14 +00:00
Guido van Rossum fc6efffbf9 #Removed debug print that was accidentally left in. 1997-09-03 00:35:38 +00:00
Guido van Rossum 5ed5c4c364 Add the same _keep_alive patch (by Michael Scharff) that was added to
copy.deepcopy() a while ago.  Can't reproduce this but it doesn't
break anything and it looks like the code could have the same problem.
1997-09-03 00:23:54 +00:00
Guido van Rossum 15a40394b0 Fix the bug Jeremy was experiencing: both the close() and the
dealloc() functions contained code to free/DECREF the buffer
(there were differences between I and O objects but the logic bug was
the same).  Fixed this be setting the buffer pointer to NULL and
testing for that.  (This also makes it safe to call close() more than
once.)

XXX Worry: what if you try to read() or write() once the thing is
closed?
1997-09-03 00:09:26 +00:00
Jack Jansen 2d30840b92 Define BUILDNO in macbuildno.h (incremented by fullbuild) 1997-09-01 15:39:07 +00:00
Jack Jansen 68a0ee0a87 Can't remember... 1997-09-01 15:38:24 +00:00
Jack Jansen 898ac1bb46 Added GetTicks() here, so profiling can use a decent timer 1997-09-01 15:38:12 +00:00
Jack Jansen faad995380 Fullbuild now maintains BUILDNO for mac builds 1997-09-01 15:37:07 +00:00
Jack Jansen 04fb06f320 Names changed 1997-09-01 15:36:42 +00:00
Guido van Rossum 625f40de05 #typo 1997-08-30 20:04:42 +00:00
Guido van Rossum 28cad964ec Document newly revamped site configuration mechanism.
Damn the criticism in c.l.p!
1997-08-30 20:03:28 +00:00
Guido van Rossum 36764b8b0e Added docs for 'user' customization module. Renamed libuser.tex
(which had UserDict/UserList) to libuserdict.tex.
1997-08-30 20:02:25 +00:00
Guido van Rossum d7ed683a7e Inline PyObject_CallObject (Marc-Andre Lemburg). 1997-08-30 15:02:50 +00:00
Guido van Rossum b2afc811c2 Added os.altsep; this is '/' on DOS/Windows, and None on systems with
a sane filename syntax.
1997-08-29 22:37:44 +00:00
Guido van Rossum a28dab5ea2 Write out the dynamic OS choice, to avoid exec statements.
Adding support for a new OS is now a bit more work, but I bet that
'dos' or 'nt' will cover most situations...
1997-08-29 22:36:47 +00:00
Guido van Rossum 7922bd7382 Added -X option to suppress default import of site.py. Also split the
usage message in *three* parts under 510 bytes, for low-end ANSI
compatibility.
1997-08-29 22:34:47 +00:00
Guido van Rossum 3d90af967d Added NoSite flag. 1997-08-29 22:34:00 +00:00
Guido van Rossum dcc0c13f74 Two independent changes (oops):
- Changed semantics for initialized flag (again); forget the ref
counting, forget the fatal errors -- redundant calls to
Py_Initialize() or Py_Finalize() calls are simply ignored.

- Automatically import site.py on initialization, unless a flag is set
not to do this by main().
1997-08-29 22:32:42 +00:00
Guido van Rossum f30bec7bb2 New site.py semantics. Searches in
<*prefix>/lib/python<version>/packages for *.pth files containing
directories that are appended to sys.path.
1997-08-29 22:30:45 +00:00
Barry Warsaw 83b6709d8e Swap the sense of the -X option vis-a-vis Py_UseClassExceptionsFlag so
that class based exceptions are enabled by default.  -X disables them
in favor of the old-style string exceptions.
1997-08-29 22:20:16 +00:00
Barry Warsaw 757af0e7bb Removed obsolete exception PyExc_AccessError.
Added PyErr_MemoryErrorInst to hold the pre-instantiated instance when
using class based exceptions.

Simplified the creation of all built-in exceptions, both class based
and string based.  Actually, for class based exceptions, the string
ones are still created just in case there's a problem creating the
class based ones (so you still get *some* exception handling!).  Now
the init and fini functions run through a list of structure elements,
creating the strings (and optionally classes) for every entry.

initerrors(): the new base class exceptions StandardError,
LookupError, and NumberError are initialized when using string
exceptions, to tuples containing the list of derived string
exceptions.  This GvR trick enables forward compatibility!  One bit of
nastiness is that the C code has to know the inheritance tree embodied
in exceptions.py.

Added the two phase init and fini functions.
1997-08-29 22:13:51 +00:00
Barry Warsaw 035574d755 Added Py_UseClassExceptionsFlag, the variable containing the state of
the -X command line option.

Py_Initialize(): Handle the two phase initialization of the built-in
module.

Py_Finalize(): Handle the two phase finalization of the built-in
module.

parse_syntax_error(): New function which parses syntax errors that
PyErr_Print() will catch.  This correctly parses such errors
regardless of whether PyExc_SyntaxError is an old-style string
exception or new-fangled class exception.

PyErr_Print(): Many changes:

    1. Normalize the exception.

    2. Handle SystemExit exceptions which might be class based.  Digs
       the exit code out of the "code" attribute.  String based
       SystemExit is handled the same as before.

    3. Handle SyntaxError exceptions which might be class based.  Digs
       the various information bits out of the instance's attributes
       (see parse_syntax_error() for details).  String based
       SyntaxError still works too.

    4. Don't write the `:' after the exception if the exception is
       class based and has an empty string str() value.
1997-08-29 22:07:17 +00:00
Barry Warsaw d5a0ff972d Added extern definition for -X flag variable. 1997-08-29 22:01:11 +00:00
Barry Warsaw 3e613ce79b New file, which is imported by the built-in module when python is
started with the -X option.  This file contains the definitions for
the built-in exception classes.
1997-08-29 21:59:26 +00:00
Barry Warsaw 6ed41a0a87 Expanded r() function to handle class exceptions. 1997-08-29 21:58:25 +00:00
Barry Warsaw f488af3360 Parse new command line option -X which enables exception classes. 1997-08-29 21:57:49 +00:00
Barry Warsaw 0596c2ac28 Declarations for two phase initialization and finalization functions
for the built-in module.
1997-08-29 21:57:07 +00:00
Barry Warsaw 392d8272bf Added externs for three new exceptions PyExc_StandardError,
PyExc_NumberError, and PyExc_LookupError.  Also added extern for
pre-instantiated exception instance PyExc_MemoryErrorInst.

Removed extern of obsolete exception PyExc_AccessError.
1997-08-29 21:56:07 +00:00
Barry Warsaw 2d8adff10a PyErr_NoMemory(): If the pre-instantiated memory exception is non-null
(PyExc_MemoryErrorInst) raise this instead of PyExc_MemoryError.  This
only happens when exception classes are enabled (e.g. when Python is
started with -X).
1997-08-29 21:54:35 +00:00
Barry Warsaw dd82bb9c14 Added a new variable TESTPYTHON which contains the path (and args) for
the executable to use during regression testing.
1997-08-29 21:52:14 +00:00
Guido van Rossum 45140f97a6 Subtle changes to the AIX shared library things to make them work
when building outside the source directory.  Courtesy Donn Cave.
1997-08-29 18:44:06 +00:00
Guido van Rossum cf0be04b2c Should remove getbuildno.o/buildno files in clobber/distclean targets. 1997-08-29 18:42:35 +00:00