Thomas Wouters [Thu, 22 Mar 2001 14:50:24 +0000 (14:50 +0000)]
Allow the process of reading back what we wrote to a pty to transform
linefeeds into carriagereturn-linefeeds (which is apparently what IRIX
does.) Also add some comments, an extra test and reorganize it a bit.
Add 'platforms' and 'keywords' attributes to the DistributionMetadata class,
along with options to print them.
Add a finalize_options() method to Distribution to do final processing
on the platform and keyword attributes
Add DistributionMetadata.write_pkg_info() method to write a PKG-INFO file
into the release tree.
Jeremy Hylton [Thu, 22 Mar 2001 02:47:58 +0000 (02:47 +0000)]
Extend support for from __future__ import nested_scopes
If a module has a future statement enabling nested scopes, they are
also enable for the exec statement and the functions compile() and
execfile() if they occur in the module.
If Python is run with the -i option, which enters interactive mode
after executing a script, and the script it runs enables nested
scopes, they are also enabled in interactive mode.
XXX The use of -i with -c "from __future__ import nested_scopes" is
not supported. What's the point?
To support these changes, many function variants have been added to
pythonrun.c. All the variants names end with Flags and they take an
extra PyCompilerFlags * argument. It is possible that this complexity
will be eliminated in a future version of the interpreter in which
nested scopes are not optional.
Neil Schemenauer [Thu, 22 Mar 2001 00:32:32 +0000 (00:32 +0000)]
- Remove WITH makefile variable. Its not used for anything.
- Add CONFIG_ARGS variable and use it to re-run configure rather than
using config.status. This prevents an infinite loop if configure
dies while re-configuring.
Tim Peters [Wed, 21 Mar 2001 23:07:59 +0000 (23:07 +0000)]
Changed doctest to run tests in alphabetic order of name.
This makes verbose-mode output easier to dig thru, and removes an accidental
dependence on the order of dict.items() (made visible by recent changes to
dictobject.c).
Fred Drake [Wed, 21 Mar 2001 22:15:01 +0000 (22:15 +0000)]
Integrated an expanded version of some text from Neil Schemenauer about
supporting cyclic garbage collection. (This is not all of it, but I'm
taking a break!)
Tim Peters [Wed, 21 Mar 2001 19:23:56 +0000 (19:23 +0000)]
Make PyDict_Next safe to use for loops that merely modify the values
associated with existing dict keys.
This is a variant of part of Michael Hudson's patch #409864 "lazy fix for
Pings bizarre scoping crash".
Guido van Rossum [Wed, 21 Mar 2001 19:17:22 +0000 (19:17 +0000)]
Use PyObject_IsInstance() to check whether the first argument to an
unbound method is of the right type. Hopefully this solves SF patch
#409355 (Meta-class inheritance problem); I have no easy way to test.
Guido van Rossum [Wed, 21 Mar 2001 18:40:58 +0000 (18:40 +0000)]
Move the code implementing isinstance() and issubclass() to new C
APIs, PyObject_IsInstance() and PyObject_IsSubclass() -- both
returning an int, or -1 for errors.
Jeremy Hylton [Wed, 21 Mar 2001 16:43:47 +0000 (16:43 +0000)]
Fix PyFrame_FastToLocals() and counterpart to deal with cells and
frees. Note there doesn't seem to be any way to test LocalsToFast(),
because the instructions that trigger it are illegal in nested scopes
with free variables.
Fix allocation strategy for cells that are also formal parameters.
Instead of emitting LOAD_FAST / STORE_DEREF pairs for each parameter,
have the argument handling code in eval_code2() do the right thing.
A side-effect of this change is that cell variables that are also
arguments are listed at the front of co_cellvars in the order they
appear in the argument list.
Martin v. Löwis [Wed, 21 Mar 2001 07:44:53 +0000 (07:44 +0000)]
Remove Tix detection from Tkinter part; lib-tk/Tix attempts to load Tix
by requiring it. Also remove commentary from Setup.dist about commenting
in and out stuff.
Guido van Rossum [Tue, 20 Mar 2001 20:43:34 +0000 (20:43 +0000)]
Lawrence Hudson, SF #401702: Modify co_filename in frozen programs
This patch was developed primarily to reduce the size of the
frozen binary. It is particularly useful when freezing for 'small'
platforms, such as Palm OS, where you really want to save that
last miserable byte.
A limitation of this patch is that it does not provide any feedback
about the replacements being made. As the path matching
is case-sensitive this may lead to unexpected behaviour for DOS
and Windows people, eg
> freeze.py -r C:\Python\Lib\=py\ goats.py
should probably be:
> freeze.py -r c:\python\lib\=py\ goats.py
Guido van Rossum [Tue, 20 Mar 2001 12:41:34 +0000 (12:41 +0000)]
SF patch #408326 by Robin Thomas: slice objects comparable, not
hashable
This patch changes the behavior of slice objects in the following
manner:
- Slice objects are now comparable with other slice objects as though
they were logically tuples of (start,stop,step). The tuple is not
created in the comparison function, but the comparison behavior is
logically equivalent.
- Slice objects are not hashable. With the above change to being
comparable, slice objects now cannot be used as keys in dictionaries.
[I've edited the patch for style. Note that this fixes the problem
that dict[i:j] seemed to work but was meaningless. --GvR]
Jeremy Hylton [Tue, 20 Mar 2001 00:25:43 +0000 (00:25 +0000)]
Fixup handling of free variables in methods when the class scope also
has a binding for the name. The fix is in two places:
- in symtable_update_free_vars, ignore a global stmt in a class scope
- in symtable_load_symbols, add extra handling for names that are
defined at class scope and free in a method
Jeremy Hylton [Mon, 19 Mar 2001 20:42:11 +0000 (20:42 +0000)]
Add test for a list comprehension that is nested in the left-hand part
of another list comp. This caused crashes reported as SF bugs 409230
and 407800.
Note that the new tests are in a function so that the name lookup code
isn't affected by how many *other* list comprehensions are in the same
scope.
Tim Peters [Mon, 19 Mar 2001 19:19:45 +0000 (19:19 +0000)]
When building the installer, prompt for the location of the system directory
on the current machine. Wise doesn't seem to know this itself, and it
varies across Windows flavors.
Tim Peters [Sun, 18 Mar 2001 08:21:57 +0000 (08:21 +0000)]
SF bug [ #409448 ] Complex division is braindead
http://sourceforge.net/tracker/?func=detail&aid=409448&group_id=5470&atid=105470
Now less braindead. Also added test_complex.py, which doesn't test much, but
fails without this patch.
Fix bug #233253: the --define and --undef options didn't work, whether
specified on the command-line or in setup.cfg. The option processing
leaves them as strings, but they're supposed to be lists.
Tidy up the ordering of include and library directories, putting
/usr/local first and leaving /usr/include at the end. This addresses
the comments in bug #232609.
Tim Peters [Sat, 17 Mar 2001 04:50:51 +0000 (04:50 +0000)]
SF bug [ #233200 ] cPickle does not use Py_BEGIN_ALLOW_THREADS.
http://sourceforge.net/tracker/?func=detail&aid=233200&group_id=5470&atid=105470
Wrapped the fread/fwrite calls in thread BEGIN_ALLOW/END_ALLOW brackets
Afraid I hit the "delete trailing whitespace key" too! Only two "real" sections
of code changed here.
Thomas Heller [Fri, 16 Mar 2001 21:00:18 +0000 (21:00 +0000)]
Distutils version number has been changed from 1.0.1 to 1.0.2pre
before this get forgotten again.
Should probably be set to 1.0.2 before final release of python 2.1
Does someone still release distutils separate from python?
Thomas Heller [Fri, 16 Mar 2001 20:57:37 +0000 (20:57 +0000)]
The bdist_wininst.py command has been recreated after wininst.exe
has been changed to include an uninstaller.
I forgot to mention in the uninstaller checkin that the logfile
name (used for uninstalling) has been changed from
<module>.log to <module>-wininst.log. This should prevent
conflicts with a distutils logfile serving the same purpose.
The short form of the --bdist-dir (-d) option has been removed
because it caused conflicts with the short form of the --dist-dir
option.
Fred Drake [Fri, 16 Mar 2001 20:04:57 +0000 (20:04 +0000)]
Change RuntimeError to SGMLParseError, which subclasses RuntimeError
for backward compatibility.
Add support for SGML declaration syntax (<!....>) to some reasonable
degree. This does not support everything allowed in SGML, but should
work with "real" HTML (internal subset in a DOCTYPE is not handled).
The content of the declaration is passed to the .handle_decl() method,
which can be overridden by subclasses.
Neil Schemenauer [Fri, 16 Mar 2001 11:50:43 +0000 (11:50 +0000)]
Install the Python DLL with execute priviledge set. This is required for
Cygwin Python to startup correctly when in ntsec mode. Cygwin operating in
this mode is probably not the only system with this requirement.
Sjoerd Mullender [Wed, 14 Mar 2001 17:03:30 +0000 (17:03 +0000)]
Moved clearing of "literal" flag. The flag is set in setliteral which
can be called from a start tag handler. When the corresponding end
tag is read the flag is cleared. However, it didn't get cleared when
the start tag was for an empty element of the type <tag .../>. This
modification fixes the problem.
Martin v. Löwis [Tue, 13 Mar 2001 10:50:13 +0000 (10:50 +0000)]
Patch #407965: Improve Level 2 conformance of minidom
- addition of a DocumentFragment implementation and createDocumentFragment method
- proper setting of ownerDocument for all nodes
- setting of namespaceURI to None in Element as a class attribute
- addition of setAttributeNodeNS and removeAttributeNodeNS as aliases
for setAttributeNode and removeAttributeNode
- support for inheriting from DOMImplementation to extend it with
additional features (to override the Document class)
in pulldom:
- support for nodes (comment and PI) that occur before he document element;
that became necessary as pulldom now delays creation of the document
until it has the document element.