- Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allow
embedders to force a different PYTHONHOME.
- Add new interface PyErr_PrintEx(flag); same as PyErr_Print() but
flag determines whether sys.last_* are set or not. PyErr_Print()
now simply calls PyErr_PrintEx(1).
- Add Py_FrozenFlag, intended to suppress error messages fron
getpath.c in frozen binaries.
- Add Py_GetPythonHome() and Py_SetPythonHome(), intended to allow
embedders to force a different PYTHONHOME.
- Add new interface PyErr_PrintEx(flag); same as PyErr_Print() but
flag determines whether sys.last_* are set or not. PyErr_Print()
now simply calls PyErr_PrintEx(1).
Fred Drake [Fri, 6 Feb 1998 22:19:23 +0000 (22:19 +0000)]
Update two of the \indexsubitem values to use singular rather than plural form
of "variable": each individual variable should be identified as a single
variable and not a collection in the index.
(1) Explicitly clear __builtin__._ and sys.{last,exc}_* before
clearing anything else. These are common places where user values
hide and people complain when their destructors fail. Since the
modules containing them are deleted *last* of all, they would come too
late in the normal destruction order. Sigh.
(2) Add some debugging aid to cleanup (after a suggestion by Marc
Lemburg) -- print the names of the modules being cleaned, and (when
-vv is used) print the names of the variables being cleared.
Barry Warsaw [Thu, 5 Feb 1998 23:35:09 +0000 (23:35 +0000)]
(py-parse-state): When looking for landing inside triple-quoted
string, don't check for indentation at column zero. This will falsely
hit a line inside a docstring that starts at column zero but ends in a
colon.
Retract the statement that all functions called by Python (even method
defs) need to be declared extern "C" -- it seems to have no basis in
truth (any more?).
Fixed bitmaps; added include files and libs;
moved DLLs into their own directory (and added it to default path);
install zlib.dll in SYS32; fixed location of help root.
Fred Drake [Wed, 4 Feb 1998 19:54:40 +0000 (19:54 +0000)]
Use implicit rules to perform DVI->PS and PS->PDF conversions. PDF conversion
requires "distill" from a FrameMaker installation. ;-) Would probably need
to be different for Windows/Mac.
Fred Drake [Wed, 4 Feb 1998 14:43:36 +0000 (14:43 +0000)]
\modindex{}: New macro; index module without declaring it "built-in" or
"standard". This is mostly for documentation of modules outside the
standard library.
Guido van Rossum [Thu, 29 Jan 1998 14:55:24 +0000 (14:55 +0000)]
New version of xmllib from Sjoerd.
The main incompatibility is that the error reporting method is now
called as
parser.syntax_error(msg)
instead of
parser.syntax_error(lineno, msg)
This new version also has some code to deal with the <?xml?> and
<!DOCTYPE> tags at the start of an XML document.
The documentation has been updated, and a small test module has been
created.
Guido van Rossum [Tue, 27 Jan 1998 19:29:45 +0000 (19:29 +0000)]
(This fix is really by Jeremy)
Here's my suggested replacement for gzip.py for 1.5.1. I've
re-implemeted methods readline and readlines, added an _unread, and
tweaked read and _read.
I tried a more complicated buffer scheme for unread (using a list of
strings and string.join), but it was more complicated and slower.
This version is a lot faster than the current version and is still
pretty simple.
Barry Warsaw [Mon, 26 Jan 1998 22:47:35 +0000 (22:47 +0000)]
Unpickler.load_inst(), Unpickler.load_obj(), Unpickler.load_build():
Fixed problems when unpickling in restricted execution environments.
These methods try to assign to an instance's __class__ attribute, or
access the instances __dict__, which are prohibited in REE. For the
first two methods, I re-implemented the old behavior when assignment
to value.__class__ fails.
For the load_build() I also re-implemented the old behavior when
inst.__dict__.update() fails but this means that unpickling in REE is
semantically different than unpickling in unrestricted mode.
Barry Warsaw [Mon, 26 Jan 1998 22:42:48 +0000 (22:42 +0000)]
get(): Fixed a bug in the merge order of the dictionaries. This makes
a copy of the defaults dictionary and merges the section's dictionary
into it so that sections can override the defaults.
Fred Drake [Thu, 22 Jan 1998 18:14:39 +0000 (18:14 +0000)]
Fixed indexing of {datadesc} environments.
Removed " (byte code instruction)" from the output of the {opcodedesc}
environment; this should only appear in the index (which it now does).
Removed some really old cruft related to otherwise removed debugging code.
(I *think* assignments to $* set & clear auto-flush of <STDOUT>, but don't
really remember. Removing them seems to not change anything!)
Fred Drake [Thu, 22 Jan 1998 17:43:15 +0000 (17:43 +0000)]
\seemodule{}: Use logical markup for the module name, to ensure it picks up
any changes introduced there. Also ensure a little more space between
the module name and the parenthesized comment.
Fred Drake [Thu, 22 Jan 1998 15:55:21 +0000 (15:55 +0000)]
Revised new macros after discussion with Guido: Always use full names of
semantic concepts.
Added two new ones (not discussed with Guido:
\constant{}: Markup for constants defined in Python modules.
\cfunction{}: Markup for C functions; these should probably be distinguished
by font, but are not at this time (since they're typically \code{} at
this point).
Barry Warsaw [Wed, 21 Jan 1998 05:14:24 +0000 (05:14 +0000)]
(py-mode-map): Add a binding of C-m to py-newline-and-indent. This is
a religious issue: RMS decrees that the Enter (RET) key should just do
a newline and a LFD (C-j) should do a newline and indent (i.e. the
python-mode version of this). Almost everyone I know disagrees and
finds that RET should do newline and indent. Almost everyone hacks
their modes to do this, if they know how. Because it's hard for
newbies to figure out how to do this, and because most DOS keyboards
lack a LFD (leaving users to the more obscure C-j), I think it makes
better sense to add this default binding.
Fred Drake [Wed, 21 Jan 1998 04:58:10 +0000 (04:58 +0000)]
Simple documentation of the copy_reg module.
Guido, you should probably look at this. The pickle documentation is out of
date; I don't see anything about the __reduce__() stuff or the
__safe_for_unpickling__ attribute.
Barry Warsaw [Tue, 20 Jan 1998 22:52:56 +0000 (22:52 +0000)]
(py-compute-indentation): In the most common case, where indentation
is based on the line above, watch out for landing inside a triple
quoted string. In this case, use iterative search +
parse-partial-sexp backwards to find the beginning of the string.
Note this does affect performance, but very little in the common cases
(I hope). It could be made *much* faster by adding Emacs and XEmacs
dependent code -- different code naturally. :-(
Fixes the following reported bug:
if len(sys.argv) >= 6:
# More lines here
fptr = open('/etc/hosts', 'w')
fptr.write("""# /etc/hosts -- autocreated by /etc/ppp/ip-up
#
# Address from pppd
%-15s %s
Barry Warsaw [Tue, 20 Jan 1998 21:43:34 +0000 (21:43 +0000)]
(py-master-file): New buffer-local variable which can be set in the
file local variable section of a file. When set, and the user hits
C-c C-c, this file gets executed instead of the buffer's file. Idea
given by Roy Dragseth <royd@math.uit.no>, but implemented differently.
(py-execute-buffer): Support py-master-file variable. If this names a
relative path, default-directory is prepended via expand-file-name.
Fred Drake [Tue, 20 Jan 1998 05:26:12 +0000 (05:26 +0000)]
Added index entry and \label{} for exceptions module. This isn't in the
normal modules portion of the manual, but that's the basic effect of this
section with the 1.5 change in exception support.
Fred Drake [Tue, 20 Jan 1998 05:07:19 +0000 (05:07 +0000)]
Proposed new macros: see comments. These are not yet used.
These are intended to support semantic markup. There are a number
of places in the documentation where the exact meaning of an
indentifier marked \code{} in the running text is ambiguous (could
be a module or a class, a function or a method, etc.). These are
intended to clarify the intent of the identifier for processing
applications and more intelligent style processing.
Guido van Rossum [Mon, 19 Jan 1998 22:06:22 +0000 (22:06 +0000)]
Instead of a single exists(), differentiate between files, modules,
executable files, and directories. When expecting a module, we also
look for the .pyc or .pyo file.
Guido van Rossum [Mon, 19 Jan 1998 22:03:52 +0000 (22:03 +0000)]
Better #ifdefs for NetBSD, taking into account that at least on netBSD
1.3, dlopen() etc. are fully implemented, including dlerror().
From Jaromir Dolecek and Ty Sarna.
Guido van Rossum [Mon, 19 Jan 1998 21:58:26 +0000 (21:58 +0000)]
Rewritten PyImport_Cleanup() and its helper, clear_carefully(). They
now implement the following finalization strategy.
1. Whenever this code deletes a module, its directory is cleared
carefully, as follows:
- set all names to None that begin with exactly one underscore
- set all names to None that don't begin with two underscores
- clear the directory
2. Modules are deleted in the following order:
- modules with a reference count of 1, except __builtin__ or __sys__
- repeat until no more are found with a reference count of 1
- __main__ if it's still there
- all remaining modules except __builtin__ or sys
- sys
_ __builtin__