Commit Graph

5525 Commits

Author SHA1 Message Date
Guido van Rossum 61d3637ff8 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.
2001-12-10 16:42:43 +00:00
Michael W. Hudson fb173cd471 Fix for
[ #409430 ] pydoc install broken
2001-12-10 16:15:44 +00:00
Michael W. Hudson 49bdaede1b Fix for
[ #477371 ] build_scripts can use wrong #! line

scripts now get "built" into a directory

build/scripts-$(PYTHON_VERSION)/
2001-12-10 15:28:30 +00:00
Finn Bock 793ead5696 A workaround for the missing buffer() builtin in jython.
This closes patch "[ #490850 ] Jython and test_StringIO".
2001-12-09 20:06:32 +00:00
Fredrik Lundh 82b230732f bug #133283, #477728, #483789, #490573
backed out of broken minimal repeat patch from July

also fixed a couple of minor potential resource leaks in pattern_subx
(Guido had already fixed the big one)
2001-12-09 16:13:15 +00:00
Finn Bock ed69aeedb9 test(): Avoid a UnboundLocalError when a method is missing from both the string
module and from string methods.

This closes patch "[ #490811 ] Jython and test_string".
2001-12-09 16:06:29 +00:00
Finn Bock d08011a0e1 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.
2001-12-09 10:19:25 +00:00
Finn Bock 4ab7adbd94 The initial patch #468662 was not applied quite verbatim. This should one
will fix the remaining Jython issues.

This closes patch "[ #490411 ] Jython and test_grammar.py".
2001-12-09 09:12:34 +00:00
Finn Bock ada1983950 Refcounting isn't available in Jython. Putting the jython test around it.
This closes patch "[ #490414 ] Jython and test_socket".
2001-12-09 08:57:46 +00:00
Guido van Rossum 146483964e 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.
2001-12-08 18:02:58 +00:00
Guido van Rossum b931bf3c55 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".
2001-12-08 17:09:07 +00:00
Finn Bock aa3dc45658 Enable support for jython:
1. Acknowledge the welknown difference that jython
allows continue in the finally clause.

2. Avoid using _testcapi when running with jython.

This closes patch "[ #490417 ] Jython and test_exceptions"
2001-12-08 10:15:48 +00:00
Guido van Rossum baefcebb55 Remove erroneous and confusing comment -- sre patterns *can* be
pickled and we do *not* expect exceptions from either pickle or
cPickle.
2001-12-08 05:11:15 +00:00
Fred Drake 2c8373bc23 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.
2001-12-07 21:54:46 +00:00
Tim Peters cbfc0343fc SF patch 490393: test___all__ and Jython; from Finn Bock.
Don't even try to import _socket when running under Jython.
2001-12-07 21:35:42 +00:00
Guido van Rossum 78f0dd3397 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.
2001-12-07 21:07:08 +00:00
Finn Bock 71be984b80 Align the number of %s with the number of format arguments.
This closes patch "[ #490330 ] String format bug in test_b2."
2001-12-07 18:21:56 +00:00
Guido van Rossum a35e2cee32 Move import dbhash out of test_sundry and into test_bsddb,
so that test_sundry won't fail if the bsddb module is absent.
2001-12-07 16:43:19 +00:00
Guido van Rossum 202dd1ef42 In unconditional except clauses, don't catch KeyboardInterrupt -- it's
annoying that often you have to hit ^C numerous times before it
works.  The solution: before the "except:" clause, insert "except
KeyboardInterrupt: raise".  This propagates KeyboardInterrupt out,
stopping the test in its tracks.
2001-12-07 03:39:34 +00:00
Fred Drake 9028d0a525 Visious hackery to solve a build-control problem related to our use of
distutils for the library modules built as shared objects.  A better solution
appears possible, but with the threat that the distutils becomes more
magical ("complex").
This closes SF bug #458343.
2001-12-06 22:59:54 +00:00
Andrew M. Kuchling 3ecc1ce529 [Bug #475009] Tighten the pattern for the first line, so we don't
adjust it when a versioned interpreter is supplied (#!.../python2 ...)
2001-12-06 21:29:28 +00:00
Fred Drake 21d45356b8 Whitespace normalization. 2001-12-06 21:01:19 +00:00
Fred Drake b94b849d65 Whitespace normalization. 2001-12-06 20:51:35 +00:00
Thomas Heller bcd8975740 Use a version number of 0.0.0 instead of ???. The latter leads to
invalid filenames on Windows when building without specifying a
version number in the setup script.

See also
http://mail.python.org/pipermail/distutils-sig/2001-November/002656.html

Bugfix candidate.
2001-12-06 20:44:19 +00:00
Fred Drake 2998a55f2d Attribute nodes did not always get their ownerDocument and ownerElement
properly set.  This fixes that.
2001-12-06 18:27:48 +00:00
Fred Drake 6b04ffe9e5 Be more careful about accessing attributes of the parent: if Tk has not been
initialized, this will be None, but the functions will still work (there will
simply be a bogus parent on the screen).  Allowing the parent to be None
is useful when testing the functions from an interactive interpreter.

Add an optional keyword paramter "show" to the _QueryString class; when given
it is used to set the -show option to the entry widget.  This allows passing
show="*" or the like to askstring(), making it useful for requesting
passwords/passphrases from the user.
This closes SF bug #438517.

Changed a docstring to be less font-lock-hostile.
2001-12-06 16:51:41 +00:00
Andrew M. Kuchling d303b61eb4 [Bug #459270] Fix incorrect docstring 2001-12-06 16:32:05 +00:00
Tim Peters 3caca2326e SF bug #488514: -Qnew needs work
Big Hammer to implement -Qnew as PEP 238 says it should work (a global
option affecting all instances of "/").

pydebug.h, main.c, pythonrun.c:  define a private _Py_QnewFlag flag, true
iff -Qnew is passed on the command line.  This should go away (as the
comments say) when true division becomes The Rule.  This is
deliberately not exposed to runtime inspection or modification:  it's
a one-way one-shot switch to pretend you're using Python 3.

ceval.c:  when _Py_QnewFlag is set, treat BINARY_DIVIDE as
BINARY_TRUE_DIVIDE.

test_{descr, generators, zipfile}.py:  fiddle so these pass under
-Qnew too.  This was just a matter of s!/!//! in test_generators and
test_zipfile.  test_descr was trickier, as testbinop() is passed
assumptions that "/" is the same as calling a "__div__" method; put
a temporary hack there to call "__truediv__" instead when the method
name is "__div__" and 1/2 evaluates to 0.5.

Three standard tests still fail under -Qnew (on Windows; somebody
please try the Linux tests with -Qnew too!  Linux runs a whole bunch
of tests Windows doesn't):
    test_augassign
    test_class
    test_coercion
I can't stay awake longer to stare at this (be my guest).  Offhand
cures weren't obvious, nor was it even obvious that cures are possible
without major hackery.

Question:  when -Qnew is in effect, should calls to __div__ magically
change into calls to __truediv__?  See "major hackery" at tail end of
last paragraph <wink>.
2001-12-06 06:23:26 +00:00
Fred Drake e50959a58e Fix appendChild() and insertBefore() (and replaceChild() indirectly) when
the node being added is a fragment node.
This closes SF bug #487929.
2001-12-06 04:32:18 +00:00
Jack Jansen 8a97f4a380 sys.platform on Mac OS X is now "darwin", without any version number appended.
This should probably go into NEWS (who's responsible for that?).
2001-12-05 23:27:32 +00:00
Guido van Rossum 33bab01da6 Fix SF bug #489581: __slots__ leak.
It was easier than I thought, assuming that no other things contribute
to the instance size besides slots -- a pretty good bet.  With a test
suite, no less!
2001-12-05 22:45:48 +00:00
Fred Drake a16433b14e Re-enabled debugging prints in poplib & documented the set_debuglevel()
method.
This closes SF patch #486079.
2001-12-05 22:37:21 +00:00
Fred Drake ee836445d1 Added a missing period at the end of an error message. 2001-12-05 22:27:47 +00:00
Guido van Rossum d331cb5502 At the PythonLabs meeting someone mentioned it would make Jim really
happy if one could delete the __dict__ attribute of an instance.  I
love to make Jim happy, so here goes...

- New-style objects now support deleting their __dict__.  This is for
  all intents and purposes equivalent to assigning a brand new empty
  dictionary, but saves space if the object is not used further.
2001-12-05 19:46:42 +00:00
Fred Drake 698da02d3b Separate the script portion from the library portion; everything that
pertains to the script is now in the if __name__ == "__main__" block.
This is in response to a commenton python-dev from Neal Norwitz.
2001-12-05 15:58:29 +00:00
Steven M. Gava 2d4e03b092 changes to use new tabpages classes 2001-12-05 07:54:07 +00:00
Steven M. Gava 34b8851c5f remove cruft from other project 2001-12-05 06:39:18 +00:00
Steven M. Gava 5b357b977a cleaner tabbed-page mini implementation through classes 2001-12-05 06:32:46 +00:00
Tim Peters 6d30c3e391 Change new tests to use integer division (// instead of /). 2001-12-05 00:30:09 +00:00
Tim Peters a3c01ce696 SF bug #488480: integer multiply to return -max_int-1.
int_mul():  new and vastly simpler overflow checking.  Whether it's
faster or slower will likely vary across platforms, favoring boxes
with fast floating point.  OTOH, we no longer have to worry about
people shipping broken LONG_BIT definitions <0.9 wink>.
2001-12-04 23:05:10 +00:00
Ka-Ping Yee fa78d0fbe4 Add "file" argument to Hook constructor.
By default, save sys.stdout in self.file when a Hook instance is created
    (e.g. when cgitb.enable() is called).
2001-12-04 18:45:17 +00:00
Guido van Rossum 4b402f2074 Address SF patch #485789 (Stefan Schwarzer).
$BROWSER should be split on os.pathsep, not on ":".
2001-12-04 17:43:22 +00:00
Guido van Rossum 6b70599450 Fix SF bug #486144: Uninitialized __slot__ vrbl is None.
There's now a new structmember code, T_OBJECT_EX, which is used for
all __slot__ variables (except __weakref__, which has special behavior
anyway).  This new code raises AttributeError when the variable is
NULL rather than converting NULL to None.
2001-12-04 16:23:42 +00:00
Guido van Rossum bb8f59a371 unpack_iterable(): Add a missing DECREF in an error case. Reported by
Armin Rigo (SF bug #488477).  Added a testcase to test_unpack_iter()
in test_iter.py.
2001-12-03 19:33:25 +00:00
Barry Warsaw c44d2c52c9 decode(), encode(): Accepting the minor optimizations from SF patch
#486375, but not the rest of it, since that changes the documented
semantics of encode().
2001-12-03 19:26:40 +00:00
Fred Drake 248b04383f Convert to using string methods instead of the string module.
In goahead(), use a bound version of rawdata.startswith() since we use the
same method all the time and never change the value of rawdata.  This can
save a lot of bound method creation.
2001-12-03 17:09:50 +00:00
Fred Drake 073148c4ef Add a test that makes sure unclosed entity references are handled consitently. 2001-12-03 16:44:09 +00:00
Guido van Rossum dbb53d9918 Fix of SF bug #475877 (Mutable subtype instances are hashable).
Rather than tweaking the inheritance of type object slots (which turns
out to be too messy to try), this fix adds a __hash__ to the list and
dict types (the only mutable types I'm aware of) that explicitly
raises an error.  This has the advantage that list.__hash__([]) also
raises an error (previously, this would invoke object.__hash__([]),
returning the argument's address); ditto for dict.__hash__.

The disadvantage for this fix is that 3rd party mutable types aren't
automatically fixed.  This should be added to the rules for creating
subclassable extension types: if you don't want your object to be
hashable, add a tp_hash function that raises an exception.

Also, it's possible that I've forgotten about other mutable types for
which this should be done.
2001-12-03 16:32:18 +00:00
Guido van Rossum cb33165ca2 _tryorder should always be a list, then the problem Jack had to fix in
1.24 wouldn't have occurred in the first place.

Remove a debug print command accidentally inserted by Martin in 1.23.
2001-12-03 15:51:31 +00:00
Jack Jansen 55c5abb52f Missing comma in tuple initializer caused webbrowser.open() not to work at
all in MacPython. (why did noone ever notice this?)
2001-12-03 15:44:17 +00:00