Commit Graph

21032 Commits

Author SHA1 Message Date
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
Jack Jansen 2a42c3a8d3 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.
Fixes bug 475253.
2001-12-07 16:07:04 +00:00
Michael W. Hudson 542411384c Fix for:
[ #417634 ] configuring without C++ compiler name

by checking that we're not about to try to compile C++ files with "yes".

Now we wait for the system where the C++ compiler *is* called yes...
2001-12-07 15:38:26 +00:00
Jeremy Hylton 0702858d73 Missing DECREFs when exception is raised in sys.excepthook.
Bug fix candidate for 2.1 branch.

(I imagine the other recent leak patches are bug fix candidates, too,
but I forgot to mark mine as such.)
2001-12-07 15:35:35 +00:00
Andrew M. Kuchling 038215ab0c Use an immutable tuple for __slots instead of a mutable list
Bump version number
2001-12-07 14:22:13 +00:00
Guido van Rossum 4e173846c8 Fix for #489672 (Neil Norwitz): memory leak in test_sre.
(At least for the repeatable test case that Tim produced.)

pattern_subx(): Add missing DECREF(filter) in both exit branches
(normal and error return).  Also fix a DECREF(args) that should
certainly be a DECREF(match) -- because it's inside if (!args) and
right after allocation of match.
2001-12-07 04:25:10 +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
Tim Peters eb4b7bad33 audioop_ratecv() again: settle for a sloppier upper bound that's less
obnoxious to compute and easier to explain.  No compromise on safety.
2001-12-07 00:37:39 +00:00
Tim Peters b404145936 s/it/if/ in descriptions of spawn mode argument. 2001-12-06 23:37:17 +00:00
Tim Peters c7cb69263d For ratecv, document that None should be the initial state argument (when
I was squashing spurious overflows in the implementation, I got hung up
on this point).
2001-12-06 23:16:09 +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
Jack Jansen e3d7622fb3 Don't fail on importing things with undefined references. Unfortunately we
still fail on importing modules that link with libraries that fail
their initialization code (such as windowing libraries when we don't have
access to the window server) and that is what I really wanted to fix.
2001-12-06 22:58:56 +00:00
Jack Jansen dd19cf8134 Silly mistake in build directory extension fix. 2001-12-06 22:36:17 +00:00
Fred Drake 38419c003c Wrap some long lines. 2001-12-06 22:24:47 +00:00
Jack Jansen 6a77cf12dd Cleaned up Mac OS X section to the current state of affairs. 2001-12-06 21:49:02 +00:00
Jack Jansen 1999ef4973 Test wether we are building on a case-insensitive filesystem (such
as OSX HFS+) and if so add an extension to the python executable, but
only in the build directory, not on the installed python.
2001-12-06 21:47:20 +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
Guido van Rossum 35974fbf31 Fix for SF bug #489671 (Neil Norwitz): memory leak in test_richcmp.
Had nothing to do with rich comparisons -- some stack cleanup code was
lost as a result of merging in Neil Schemenauer's generators patch.
Reinserted the stack cleanup code, skipping it when yielding.
2001-12-06 21:28:18 +00:00
Jack Jansen ffa260fb54 sys.platform is now "darwin" without digits appended. 2001-12-06 21:14:00 +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 32a3587345 Document that PyString_FromString() cannot take NULL as a parameter.
This closes SF bug #489872.
2001-12-06 20:38:15 +00:00
Tim Peters 62de65b25e PyString_FromString: this requires its argument be non-NULL, but doesn't
check it.  Added an assert() to that effect.
2001-12-06 20:29:32 +00:00
Guido van Rossum 604ddf80d8 Fix for #489669 (Neil Norwitz): memory leak in test_descr (unicode).
This is best reproduced by

  while 1:
      class U(unicode):
          pass
      U(u"xxxxxx")

The unicode_dealloc() code wasn't properly freeing the str and defenc
fields of the Unicode object when freeing a subtype instance.  Fixed
this by a subtle refactoring that actually reduces the amount of code
slightly.
2001-12-06 20:03:56 +00:00
Martin v. Löwis a631f580ea Undefine addrinfo.h constants if the system header defined them.
Fixes #486099.
2001-12-06 19:04:35 +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 22d35a7337 [Bug #459270] Fix incorrect filename for system-wide config file 2001-12-06 16:34:53 +00:00
Andrew M. Kuchling d303b61eb4 [Bug #459270] Fix incorrect docstring 2001-12-06 16:32:05 +00:00
Andrew M. Kuchling e7ffbb24e8 [Bug #480882] Remove now-pointless check for existence for _curses_panel.c;
Bugfix candidate.
2001-12-06 15:57:16 +00:00
Jeremy Hylton 1a48ca8c53 Fix memory leak in dict_to_map(), SF bug [ #485152 ] memory leak in test_scope.
PyCell_Set() incremenets the reference count, so the earlier XINCREF
causes a leak.

Also make a number of small performance improvements to the code on
the assumption that most of the time variables are not rebound across
a FastToLocals() / LocalsToFast() pair.

Replace uses of PyCell_Set() and PyCell_Get() with PyCell_SET() and
PyCell_GET(), since the frame is guaranteed to contain cells.
2001-12-06 15:48:16 +00:00
Jeremy Hylton 7802a53e38 Little stuff.
Add a missing DECREF in an obscure corner.  If the str() or repr() of
an object passed to a string interpolation -- e.g. "%s" % obj --
returns a non-string, the returned object was leaked.

Repair an indentation glitch.

Replace a bunch of PyString_AsString() calls (and their ilk) with
macros.
2001-12-06 15:18:48 +00:00
Jeremy Hylton 2554dd993a Fix [ #489673 ] memory leak in test_symtable: Free the st_future slot.
The st_future slot of the symtable is not freed by PySymtable_Free()
because it is shared by the symtable and compiling structs in
compiel.c.  Since it is shared, it is explicitly deallocated when the
compiling struct is freed.
2001-12-06 14:34:58 +00:00
Guido van Rossum 2556f2e1e2 Fix a typo (probably caused by autocompletion <blush>) that caused a
leak when a class defined a __metaclass__.  This fixes the problem
reported on python-dev by Ping; I dunno if it's the same as SF bug
#489669 (since that mentions Unicode).
2001-12-06 14:09:56 +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
Guido van Rossum bf7c804588 SF patch #489680 (David Abrahams): h2py uses nonexistent method splitfields() 2001-12-06 03:31:04 +00:00
Guido van Rossum 436fd75b4a Warning message about unfound file was missing trailing \n. 2001-12-06 03:28:17 +00:00
Guido van Rossum e51c3f5ecb SF patch #489680 (David Abrahams): h2py uses nonexistent method splitfields() 2001-12-06 03:24:30 +00:00
Guido van Rossum 14227b4dd4 The previous checkin to clear __slots__ variables did a little bit of
the work each time it found another base class.  All the work is
contiguous, so we might as well do it all at once at the end.
2001-12-06 02:35:58 +00:00
Jack Jansen 101de912d3 Replace sprintf() with PyOS_snprintf(). 2001-12-05 23:27:58 +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
Jack Jansen a7594db5bc Link more modules with weak import, and add CarbonAccessors.o to all relevant PowerPC toolbox modules. This, in combination with recent IDE mods, makes the IDE work again under MacOS 8.1. 2001-12-05 22:46:23 +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
Jack Jansen 9145be4310 Define NDEBUG if Py_DEBUG isn't defined. 2001-12-05 22:44:45 +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
Tim Peters 3127c28b3f audioop_ratecv(): I left a potentially unsafe multiply unchecked
yesterday -- repair that.  Also renamed the silly size_times_nchannels
to bytes_per_frame.
2001-12-05 22:30: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
Fred Drake 8b55b2d9aa Fix memory leak in the parser module: There were two leaks in
parser_tuple2st() and a failure to propogate an error in
build_node_children() (masking yet another leak, of course!).
This closes SF bug #485133 (confirmed by Insure++).
2001-12-05 22:10:44 +00:00