Jeremy Hylton [Sat, 20 Apr 2002 18:21:29 +0000 (18:21 +0000)]
Backport fixes for two nested scopes bugs.
frameobject.c: make sure free and cell vars make it into locals, which
makes eval work.
bltinmodule.c & ceval.c: make sure a code object with free variables
that is passed to exec or eval raises an exception.
Also duplicate the current trunk test suite in the 2.1 branch, except
for certain necessary changes: different warnings raised by 2.1, need
for __future__.
Anthony Baxter [Thu, 18 Apr 2002 05:09:06 +0000 (05:09 +0000)]
backport gvanrossum's patch:
Provisional fix for writefile() [SF bug # 541730].
The problem was that an exception can occur in the text.get() call or
in the write() call, when the text buffer contains non-ASCII
characters. This causes the previous contents of the file to be lost.
The provisional fix is to call str(self.text.get(...)) *before*
opening the file, so that if the exception occurs, we never open the
file.
Two orthogonal better solutions have to wait for policy decisions:
1. We could try to encode the data as Latin-1 or as UTF-8; but that
would require IDLE to grow a notion of file encoding which requires
more thought.
2. We could make backups before overwriting a file. This requires
more thought because it needs to be fast and cross-platform and
configurable.
Original patches were:
python/dist/src/Tools/idle/IOBinding.py:1.6
Tim Peters [Wed, 17 Apr 2002 04:36:16 +0000 (04:36 +0000)]
Windows installer: disabled Wise's "delete in-use files" uninstall
option. It was the cause of at least one way UNWISE.EXE could vanish
(install a python; uninstall it; install it again; reboot the machine;
abracadabra the uinstaller is gone).
Fred Drake [Wed, 17 Apr 2002 01:44:07 +0000 (01:44 +0000)]
Changed last two remaining uses of "./" to "index.html" when referring to the
index file for the top-level directory. This makes it easier to use an
unpacked version of the documentation via file: URLs.
This closes SF bug #541257.
Fred Drake [Thu, 4 Apr 2002 17:59:25 +0000 (17:59 +0000)]
Avoid creating circular references between the ExpatParser and the
ContentHandler. While GC will eventually clean up, it can take longer than
normal for applications that create a lot of strings (or other immutables)
rather without creating many containers.
This closes SF bug #535474.
Guido van Rossum [Thu, 28 Mar 2002 20:41:02 +0000 (20:41 +0000)]
Sort-of backport to 2.1.3 (if we ever release it) of the following.
(The fix looks different, but does the same thing to the 2.1 GC code
that Neil's patch does to the 2.2 GC code.)
This is Neil's fix for SF bug 535905 (Evil Trashcan and GC interaction).
The fix makes it possible to call PyObject_GC_UnTrack() more than once
on the same object, and then move the PyObject_GC_UnTrack() call to
*before* the trashcan code is invoked.
Guido van Rossum [Thu, 28 Mar 2002 20:21:21 +0000 (20:21 +0000)]
Backport for 2.1.3 (if we ever release it; we may have to because
this is what Zope 2 will be using in the foreseeable future).
Fix an issue that was reported in but unrelated to the main problem of
SF bug 535905 (Evil Trashcan and GC interaction).
The SETLOCAL() macro should not DECREF the local variable in-place and
then store the new value; it should copy the old value to a temporary
value, then store the new value, and then DECREF the temporary value.
This is because it is possible that during the DECREF the frame is
accessed by other code (e.g. a __del__ method or gc.collect()) and the
variable would be pointing to already-freed memory.
Fred Drake [Sat, 16 Mar 2002 06:26:20 +0000 (06:26 +0000)]
Clarify the descriptions of the positive and negative lookbehind assertions.
Added examples of positive lookbehind assertions.
This closes SF bug #529708.
Fred Drake [Wed, 13 Mar 2002 05:49:06 +0000 (05:49 +0000)]
Add a test that was added in Python 2.2: test Weak*Dictionary.setdefault().
The purpose is to avoid regression on SF bug #529273.
This test is stronger than the one submitted with the bug report.
Fred Drake [Wed, 13 Mar 2002 05:47:26 +0000 (05:47 +0000)]
Fix SF bug #529273: WeakValueDictionary.setdefault() raised UnboundLocalError
since it used the name of a global function as the name of a local. The
patch is almost identical to that submitted with the bug report.
Fred Drake [Wed, 13 Mar 2002 02:46:17 +0000 (02:46 +0000)]
Change the way \textasciitilde is implemented so it works more consistently
(dropping tildes into data that still goes through LaTeX-like processing is
a bad idea).
Guido van Rossum [Tue, 15 Jan 2002 21:14:38 +0000 (21:14 +0000)]
Backport revision 2.69.
SF patch #471839: Bug when extensions import extensions (Shane Hathaway)
When an extension imports another extension in its
initXXX() function, the variable _Py_PackageContext is
prematurely reset to NULL. If the outer extension then
calls Py_InitModule(), the extension is installed in
sys.modules without its package name. The
manifestation of this bug is a "SystemError:
_PyImport_FixupExtension: module <package>.<extension>
not loaded".
To fix this, importdl.c just needs to retain the old
value of _Py_PackageContext and restore it after the
initXXX() method is called. The attached patch does this.
This patch applies to Python 2.1.1 and the current CVS.
Tim Peters [Fri, 11 Jan 2002 04:21:11 +0000 (04:21 +0000)]
Add blurb about 32-bit Windows installer -- this made the SF release notes,
but apparently didn't get backstitched into NEWS before the release.
Trimmed trailing whitespace.
Tim Peters [Fri, 11 Jan 2002 00:28:56 +0000 (00:28 +0000)]
Remove remaining 2.2-isms:
+ Lib/site-packages wasn't created on Windows in 2.1.
+ The compiler package lived in Tools instead of in Lib.
After this, a directory compare of an installed 2.1.1 and an installation
created by this installer "are close". The remaining differences have to
do with files that the old installer mistakenly never knew existed (like
the distutils README, and pynche's color-name files). All such cases in
2.1.1 were bugs, now repaired in 2.1.2.
Tim Peters [Thu, 10 Jan 2002 23:05:10 +0000 (23:05 +0000)]
Mostly removing stuff the installer does in 2.2 that can't be done in
2.1 (e.g., there was no Lib/test/data directory then, hotshot didn't exist,
ditto the Lib/email package, etc). Also restored the now-obsolete expat
setup.
Fred Drake [Thu, 10 Jan 2002 22:37:18 +0000 (22:37 +0000)]
Adjust the instructions for building large file support so that it works
more cleanly (I think this supports more Linux systems; not sure).
Barry Warsaw & Martin von Loewis actually agree on this!
This closes SF patch #502023.
Anthony Baxter [Thu, 10 Jan 2002 15:51:52 +0000 (15:51 +0000)]
backport 1.14:
Fix the second reincarnation of SF #456395 -- failure on IRIX. This
time use .replace() to change all \r\n into \n, not just the last one.