Martin v. Löwis [Tue, 21 Jan 2003 10:58:18 +0000 (10:58 +0000)]
Merge with PyXML 1.71:
60: Added support for the SkippedEntityHandler, new in Expat 1.95.4.
61: Added support for namespace prefixes, which can be enabled by setting the
"namespace_prefixes" attribute on the parser object.
65: Disable profiling changes for Python 2.0 and 2.1.
66: Update pyexpat to export the Expat 1.95.5 XML_GetFeatureList()
information, and tighten up a type declaration now that Expat is using
an incomplete type rather than a void * for the XML_Parser type.
67: Clarified a comment.
Added support for XML_UseForeignDTD(), new in Expat 1.95.5.
68: Refactor to avoid partial duplication of the code to construct an
ExpatError instance, and actually conform to the API for the exception
instance as well.
69: Remove some spurious trailing whitespace.
Add a special external-entity-ref handler that gets installed once a
handler has raised a Python exception; this can cancel actual parsing
earlier if there's an external entity reference in the input data
after the the Python excpetion has been raised.
70: Untabify APPEND.
71: Backport PyMODINIT_FUNC for 2.2 and earlier.
Kurt B. Kaiser [Tue, 21 Jan 2003 04:42:50 +0000 (04:42 +0000)]
1. Restore the rest of Python IDLE setup.py Rev 1.4 (Python SF 634078)
(Loewis) which uses 'SRCDIR' (if available) in package dir path.
2. Merge Python IDLE setup.py Rev 1.5 (Loewis) to allow installation
from the build directory. IDLEfork SF Patch 668998 (Loewis)
Skip Montanaro [Tue, 21 Jan 2003 01:38:47 +0000 (01:38 +0000)]
* document open() function
* promote the example and the documented restrictions to \subsection status
* document the flag parameter of the DbfilenameShelf class
Tim Peters [Mon, 20 Jan 2003 22:54:38 +0000 (22:54 +0000)]
New rule for tzinfo subclasses handling both standard and daylight time:
When daylight time ends, an hour repeats on the local clock (for example,
in US Eastern, the clock jumps from 1:59 back to 1:00 again). Times in
the repeated hour are ambiguous. A tzinfo subclass that wants to play
with astimezone() needs to treat times in the repeated hour as being
standard time. astimezone() previously required that such times be
treated as daylight time. There seems no killer argument either way,
but Guido wants the standard-time version, and it does seem easier the
new way to code both American (local-time based) and European (UTC-based)
switch rules, and the astimezone() implementation is simpler.
Tim Peters [Mon, 20 Jan 2003 16:54:59 +0000 (16:54 +0000)]
Recursive compare machinery: The code that intended to exempt tuples
was broken because new-in-2.3 code added a tp_as_mapping slot to tuples.
Repaired that.
Added basic docs to check_recursion().
The code that intended to exempt tuples and strings was also broken here,
and in 2.2: these should use PyXYZ_CheckExact(), not PyXYZ_Check() -- we
can't know whether subclass instances are immutable. This part (and this
part alone) is a bugfix candidate.
Kurt B. Kaiser [Mon, 20 Jan 2003 04:49:37 +0000 (04:49 +0000)]
...and the old pyclbr.py faked Function instances with Class instances
which had empty method and super attributes. ClassBrowser.IsExpandable()
could not handle the missing attributes. SF Bug 667787.
Walter Dörwald [Sun, 19 Jan 2003 16:59:20 +0000 (16:59 +0000)]
Port test_unicode.py to PyUnit and add tests for error
cases and a few methods. This increases code coverage
in Objects/unicodeobject.c from 81% to 85%.
(From SF patch #662807)
Walter Dörwald [Sun, 19 Jan 2003 16:23:59 +0000 (16:23 +0000)]
Combine test_b1.py and test_b2.py into test_builtin.py,
port the tests to PyUnit and add many tests for error
cases. This increases code coverage in Python/bltinmodule.c
from 75% to 92%. (From SF patch #662807, with
assert_(not fcmp(x, y)) replaced with assertAlmostEqual(x, y)
where possible)
* Since only two cases remain for DUP_TOPX, replace
the switch-case with if-elseif.
* The in-lined integer compare does a CheckExact on
both arguments. Since the second is a little more
likely to fail, test it first.
* The switch-case for IS/IS_NOT and IN/NOT_IN can
separate the regular and inverted cases with no
additional work. For all four paths, saves a test and
jump.
SF bug #668906: class browser raises AttributeError
The Py2.3 updates to the pyclbr module return both Class and Function
objects. The IDLE ClassBrowser module only knew about Class and could
not handle objects which did not define "super".
SF bug #668906: class browser raises AttributeError
The Py2.3 updates to the pyclbr module return both Class and Function
objects. The IDLE ClassBrowser module only knew about Class and could
not handle objects which did not define "super".
Tim Peters [Sat, 18 Jan 2003 03:53:49 +0000 (03:53 +0000)]
SF patch 670012: Compatibility changes for _strptime.py.
Patch from Brett Cannon:
First, the 'y' directive now handles [00, 68] as a suffix for the
21st century while [69, 99] is treated as the suffix for the 20th
century (this is for Open Group compatibility).
strptime now returns default values that make it a valid date ...
the ability to pass in a regex object to use instead of a format
string (and the inverse ability to have strptime return a regex object)
has been removed. This is in preparation for a future patch that will
add some caching internally to get a speed boost.
Tim Peters [Fri, 17 Jan 2003 20:08:54 +0000 (20:08 +0000)]
When time.localtime() is passed a tick count the platform C localtime()
function can't handle, don't raise IOError -- that doesn't make sense.
Raise ValueError instead.
Jack Jansen [Fri, 17 Jan 2003 16:04:39 +0000 (16:04 +0000)]
Added methods AskFileForOpen(), AskFileForSave() and AskFolder(). These
are going to replace StandardGetFile() and friends. Main differences are
that these allow you to ask for specific datatypes to be returned (FSSpec,
FSRef, string, unicode or subtypes thereof) and that they provide access
to underlying features of Navigation Services through keyword arguments.
Gregory P. Smith [Fri, 17 Jan 2003 08:42:50 +0000 (08:42 +0000)]
bugfix: do not double-close DB cursor during deallocation when the
underlying DB has already been closed (and thus all of its cursors).
This fixes a potential segfault.
SF pybsddb bug id 667343
bugfix: close the DB object when raising an exception due to an error
during DB.open. This prevents an exception when closing the
environment about not all databases being closed.
SF pybsddb bug id 667340
Mark Hammond [Thu, 16 Jan 2003 04:56:52 +0000 (04:56 +0000)]
This test previously failed when run from the 'test' directory. In that
case, the test module created is actually a sub-package of 'test', thus
the module is named 'test.areallylongpackage...' - this caused failure.
Replace the hard-coded module names with __name__ attributes, which
correctly reflects any hierarchy.
Document that __cmp__() is not defined for sets.
Note, that list.sort() is undefined for lists of sets.
Add the ... prompt to the example so it runs in doctest.
Kurt B. Kaiser [Tue, 14 Jan 2003 22:03:31 +0000 (22:03 +0000)]
M Bindings.py
M EditorWindow.py
M NEWS.txt
M config-main.def
M configDialog.py
M configHandler.py
M configHelpSourceEdit.py
M configSectionNameDialog.py
- Change default: IDLE now starts with Python Shell.
- Removed the File Path from the Additional Help Sources scrolled list.
- Add capability to access Additional Help Sources on the web if the
Help File Path begins with //http or www. (Otherwise local path is
validated, as before.)
- Additional Help Sources were not being posted on the Help menu in the
order entered. Implement sorting the list by [HelpFiles] 'option'
number.
- Add Browse button to New Help Source dialog. Arrange to start in
Python/Doc if platform is Windows, otherwise start in current directory.
- Put the Additional Help Sources directly on the Help menu instead of in
an Extra Help cascade menu. Rearrange the Help menu so the Additional
Help Sources come last. Update help.txt appropriately.
- Fix Tk root pop-ups in configSectionNameDialog.py and configDialog.py
Guido van Rossum [Tue, 14 Jan 2003 16:45:04 +0000 (16:45 +0000)]
Explicitly raise an exception in __cmp__ -- this clarifies that cmp()
is not supported on sets. (Unfortunately, sorting a list of sets may
still return random results because it uses < exclusively, but for
sets that inly implements a partial ordering. Oh well.)
Replaced POP() with STACKADJ(-1) on lines where the result wasn't used.
The two are semantically equivalent, but the first triggered a compiler
warning about an unused variable. Note, the preceding steps had already
accessed and decreffed the variable so the reference counts were fine.
Tim Peters [Mon, 13 Jan 2003 21:38:45 +0000 (21:38 +0000)]
A new test here was failing on Windows, because the test before it never
managed to delete the @test file it intended to delete. Also, I don't
see a reason to create a 4MB file in the new test, so cut it back to 16K.
Guido van Rossum [Mon, 13 Jan 2003 21:18:54 +0000 (21:18 +0000)]
Duh. cmdqueue should be an instance variable, not a class variable.
This was introduced in 1998 in rev. 1.13, where I imported extensive
patches that, I am sad to say, I didn't review as carefully as I
should have.