Fred Drake [Thu, 13 Dec 2001 04:53:07 +0000 (04:53 +0000)]
Make tix_configure() work the same way configure() works for the basic
Tkinter classes.
Adjust a lot of docstrings.
Convert a few type checks to use isinstance() instead of type().
This is part of SF patch #485959.
Fred Drake [Wed, 12 Dec 2001 05:38:08 +0000 (05:38 +0000)]
Very small test suite for the calendar module, mostly to check a constraint
on the return values from isleap(). Also checks firstweekday() and
setfirstweekday().
Guido van Rossum [Tue, 11 Dec 2001 22:41:24 +0000 (22:41 +0000)]
Fix SF bug #482171: webchecker dies on file: URLs w/o robots.txt
The cause seems to be that when a file URL doesn't exist,
urllib.urlopen() raises OSError instead of IOError. Simply add this
to the except clause. Not elegant, but effective. :-)
Tim Peters [Tue, 11 Dec 2001 21:43:14 +0000 (21:43 +0000)]
Added -Qnew news about the test_coercion.py failure. That's the only test
that still fails under -Qnew, and is so tied to details of current
behavior that fixing it before new division becomes the default is
impractical.
Fred Drake [Tue, 11 Dec 2001 20:49:23 +0000 (20:49 +0000)]
Remove crufty whitespace in a block of index entries.
Minor, but generates slightly smaller HTML & makes it easier to see what's
happening when debugging the HTML.
Joe VanAndel wrote:
>
> When using 'distutils' (shipped with Python 2.1) I've found that my
> Python scripts installed with a first line of:
>
> #!/usr/bin/python2.1None
>
> This is caused by distutils trying to patch the first line of the python
> script to use the current interpreter.
Tim Peters [Tue, 11 Dec 2001 20:31:34 +0000 (20:31 +0000)]
float_floor_div: An expression like 3.//1j crashed the interpreter, or
delivered bizarre results. Check float_divmod for a Py_NotImplemented
return and pass it along (instead of treating Py_NotImplemented as a
2-tuple).
CONVERT_TO_DOUBLE: Added comments; this macro is obscure.
Tim Peters [Tue, 11 Dec 2001 18:51:08 +0000 (18:51 +0000)]
SF bug #491415 PyDict_UpdateFromSeq2() unused
PyDict_UpdateFromSeq2(): removed it.
PyDict_MergeFromSeq2(): made it public and documented it.
PyDict_Merge() docs: updated to reveal <wink> that the second
argument can be any mapping object.
Fred Drake [Tue, 11 Dec 2001 17:46:38 +0000 (17:46 +0000)]
Fix whitespace in example of bad indentation: a comment indicated that one
line was not indented at all, so the example is no longer indented at all.
All of the errors being shown remain.
Fred Drake [Mon, 10 Dec 2001 23:44:54 +0000 (23:44 +0000)]
Make sure that when we invoke callback functions associated with weak
references, we do not allow any outstanding exceptions "leak" into the
callback's execution state.
This closes SF bug #478534.
Tim Peters [Mon, 10 Dec 2001 22:53:30 +0000 (22:53 +0000)]
Give xxsubtype a module docstring, so its oddball purpose is discoverable
from a prompt without searching the source code (there was an SF bug
report about this, already closed ... "479568 xxsubtype builtin").
Finn Bock [Mon, 10 Dec 2001 20:57:34 +0000 (20:57 +0000)]
Skipping some tests by adding the usual jython conditional test around:
- the repr of unicode. Jython only add the u'' if the string contains char
values > 255.
- A unicode arg to unicode() is perfectly valid in jython.
- A test buffer() test. No buffer() on Jython
This closes patch "[ #490920 ] Jython and test_unicode".
Guido van Rossum [Mon, 10 Dec 2001 18:00:15 +0000 (18:00 +0000)]
property_descr_get(): Fix a curious bug in the property() type: when
no get function was defined, the property's doc string was
inaccessible. This was because the test for prop_get was made
*before* the test for a NULL/None object argument.
Also changed the property class defined in Python in a comment to test
for NULL to decide between get and delete; this makes it less Python
but then, assigning None to a property doesn't delete it!
Guido van Rossum [Mon, 10 Dec 2001 16:42:43 +0000 (16:42 +0000)]
SF patch #491183 (Jeff Epler): ScrolledText.grid() doesn't work
Using grid methods on ScrolledText widgets does not
work as expected. It either fails to pack a widget, or
can even cause Tk to lock up.
The problem is that the .grid method is being called on
the text widget, not the frame widget. This can lead
to the well-known lockup in Tk when a frame's children
are managed by both the pack and grid managers. Even
if it doesn't lock up, the frame is never placed within
the intended widget.
Program fragment:
>>> import ScrolledText
>>> s = ScrolledText.ScrolledText()
>>> s.grid(row=0, column=0, rowspan=2)
The following patch uses the same hack to copy the
'grid' and 'place' geometry manager methods to the
ScrolledText instance as is already used for the 'pack'
manager.
Jack Jansen [Mon, 10 Dec 2001 16:08:14 +0000 (16:08 +0000)]
The new menu initialization code would also add the SIOUX menus if a (frozen) Python program had installed its own menubar previously. We now guard against this, with a bit of a hack: FrameWork uses the same Menu ID as Sioux, and the init code checks that the text in the menu is "About SIOUX" before replacing it.
Guido van Rossum [Mon, 10 Dec 2001 15:45:54 +0000 (15:45 +0000)]
SF patch #491049 (David Jacobs): Small PyString_FromString optimization
PyString_FromString():
Since the length of the string is already being stored in size,
changed the strcpy() to a memcpy() for a small speed improvement.
Jack Jansen [Sun, 9 Dec 2001 23:25:00 +0000 (23:25 +0000)]
The module generator now tells its object generators about the module name (through the new setmodulename() method). If the module name has been set the object generators output it as part of the tp_name field for the object type.
Jack Jansen [Sun, 9 Dec 2001 23:15:56 +0000 (23:15 +0000)]
Mods by Tony Lownds (patch 490100, slightly massaged by me) to make Tkinter
work with Mac OS X Aqua-Tk, all nicely within ifdefs.
The process is not for the faint of heart, though: you need to download
and install the (alfa) Aqua-Tk, obtain a few needed X11 headers from
somewhere else and then everything builds. To run scripts using Tkinter
you must build with --enable-framework, build Python.app in Mac/OSX
and run your Tkinter scripts with that. Then, about half the tests in
Demo/tkinter work (or at least do something).
Checking this in anyway because it shouldn't break anything, and newer
versions of Aqua-Tk will streamline the process.
Finn Bock [Sun, 9 Dec 2001 10:19:25 +0000 (10:19 +0000)]
Moved a print statement outside the jython platform test. Otherwise
the output fails to compare correctly for jython. This change was part
of the original patch #403666.
Tim Peters [Sat, 8 Dec 2001 23:40:38 +0000 (23:40 +0000)]
PySymtableEntry_New(): I'm not sure what this routine is doing, but it
was obviously leaking an int object when whatever the heck it's looking for
was found. Repaired that. This accounts for why entering function and
class definitions at an interactive prompt leaked a reference to the
integer 1 each time.
Bugfix candidate.
Patch supplied by Burton Radons for his own SF bug #487390: Modifying
type.__module__ behavior.
This adds the module name and a dot in front of the type name in every
type object initializer, except for built-in types (and those that
already had this). Note that it touches lots of Mac modules -- I have
no way to test these but the changes look right. Apologies if they're
not. This also touches the weakref docs, which contains a sample type
object initializer. It also touches the mmap test output, because the
mmap type's repr is included in that output. It touches object.h to
put the correct description in a comment.
SF patch #490515 (Joe A) urllib.open_https() protocol issue
open_http():
In urllib.py library module, URLopener.open_https()
returns a class instance of addinfourl() with its
self.url property missing the protocol.
Instead of "https://www.someurl.com", it becomes
"://www.someurl.com".
Just van Rossum [Sat, 8 Dec 2001 09:51:41 +0000 (09:51 +0000)]
Don't do App.DrawThemeListBoxFrame() upon activate: it starts
looking worse and worse if you deactivate/activate the window
a few times. I don't know how to fix this properly, but I'm beginning
to think that it's almost impossible to support the Appearance
manager properly due to the way W works. Time for W2?...
Fred Drake [Fri, 7 Dec 2001 21:56:13 +0000 (21:56 +0000)]
Revise description of dumbdbm.open() to reflect that the flag argument is
ignored and that mode was ignored before Python 2.2.
This closes SF bug #490098.
Fred Drake [Fri, 7 Dec 2001 21:54:46 +0000 (21:54 +0000)]
Honor the mode argument to dumbdbm.open(); there is not good reason not to,
especially since the documentation described it in detail.
This partially closes SF bug #490098.
Fred Drake [Fri, 7 Dec 2001 21:35:57 +0000 (21:35 +0000)]
Describe the behavior of the read() method when the list of filenames
includes files that do not exist, explain the intended use of the interface,
and show how to ensure an expected file really exists.
This closes SF bug #490399.
I found that when run as a script, this test suite ran its tests
twice! Fixed this by avoiding the import of test_email, which loads
the module a second time in that situation, and fiddled the __main__
section to resemble other test suites using unittest.
Tim Peters [Fri, 7 Dec 2001 20:35:43 +0000 (20:35 +0000)]
SF patch #489173: Make os.spawnv not block the interpreter, from
Anthony Roach.
Release the global interpreter lock around platform spawn calls.
Bugfix candidate? Hard to say; I favor "yes, bugfix".
These clearly *should* have been releasing the GIL all along, if for no
other reason than compatibility with the similar os.system(). But it's
possible some program out there is (a) multithreaded, (b) calling a spawn
function with P_WAIT, and (c) relying on the spawn call to block all their
threads until the spawned program completes. I think it's very unlikely
anyone is doing that on purpose, but someone may be doing so by accident.
O_cwrite(): rewrote for clarity, replacing all the (Oobject *)self
casts with a variable oself that has the proper type. A smart
compiler may put this thing into a register.
(I'm not sure what good this does except satisfy my desire to
understand this function; I got a report about an uninitialized read
from Insure++ about this function and it hurt my eyes to even look at
it. I gotta run away or I'll get tempted to reformat the entire
file...)
_PyTuple_Resize(): this dumped core on tuple(globals()) for me. Turns
out the for loop at the end intended to zero out new items wasn't
doing anything, because sv->ob_size was already equal to newsize. The
fix slightly refactors the function, introducing a variable oldsize
and doing away with sizediff (which was used only once), and using
oldsize and newsize consistently. I also added comments explaining
what the two for loops do. (Looking at the CVS annotation of this
function, it's no miracle a bug crept in -- this has been patched by
many different folks! :-)
Jack Jansen [Fri, 7 Dec 2001 16:07:04 +0000 (16:07 +0000)]
Not being able to copy PythonCore to the system-folder is not a fatal error, on OSX the user may not have permission to do so. Also give a more informative message in this case.