Commit Graph

34083 Commits

Author SHA1 Message Date
Martin v. Löwis c597d1b446 Unlink the structseq type from the global list of
objects before initializing it. It might be linked
already if there was a Py_Initialize/Py_Finalize
cycle earlier; not unlinking it would break the global
list.
2006-04-15 12:45:05 +00:00
Martin v. Löwis 4b501e6c7d Patch #1191700: Adjust column alignment in bdb breakpoint lists.
Backported to 2.4.
2006-04-15 08:41:11 +00:00
Martin v. Löwis 7e75f1aafb Patch #1191065: Fix preprocessor problems on systems where recvfrom
is a macro.
2006-04-15 08:35:59 +00:00
Martin v. Löwis c90b17ec82 Patch #1161914: Add python-config. 2006-04-15 08:13:05 +00:00
Tim Peters adcd25e7fa frame_clear(): Explain why it's important to make the frame
look dead right at the start.  Use Py_CLEAR for four more
frame members.
2006-04-15 03:30:08 +00:00
Tim Peters de2acf6512 frame_traverse(): Use the standard Py_VISIT macro.
Py_VISIT:  cast the `op` argument to PyObject* when calling
`visit()`.  Else the caller has to pay too much attention to
this silly detail (e.g., frame_traverse needs to traverse
`struct _frame *` and `PyCodeObject *` pointers too).
2006-04-15 03:22:46 +00:00
Tim Peters a13131cf7f Trimmed trailing whitespace. 2006-04-15 03:15:24 +00:00
Tim Peters 9d2ced8fa0 There were no comments explaining what Py_CLEAR() did or
why it's important.  Now there are ;-)

If someone else hasn't already, I'll add a Py_CLEAR cleanup
task to the TODO Wiki next.
2006-04-15 02:14:03 +00:00
Tim Peters 7f098112ee Changed comments to make sense now that the LazyList-based
examples no longer require any explicit closing to avoid
leaking.

That the tee-based examples still do is (I think) still a
mystery.  Part of the mystery is that gc.garbage remains
empty:  if it were the case that some generator in a trash
cycle said it needed finalization, suppressing collection
of that cycle, that generator _would_ show up in gc.garbage.

So this is acting more like, e.g., some tp_traverse slot
isn't visiting all the pointers it should (in which case
the skipped pointer(s) would act like an external root,
silently suppressing collection of everything reachable
from it(them)).
2006-04-15 01:48:57 +00:00
Phillip J. Eby 8ebb28df3a Fix SF#1470508: crash in generator cycle finalization. There were two
problems: first, PyGen_NeedsFinalizing() had an off-by-one bug that
prevented it from ever saying a generator didn't need finalizing, and
second, frame objects cleared themselves in a way that caused their
owning generator to think they were still executable, causing a double
deallocation of objects on the value stack if there was still a loop
on the block stack.  This revision also removes some unnecessary
close() operations from test_generators that are now appropriately
handled by the cycle collector.
2006-04-15 01:02:17 +00:00
Thomas Wouters 3cfea2dc98 Coverity-found bug: datetime_strptime() failed to check for NULL return from
PySequence_GetItem of the time.strptime() result. Not a high probability
bug, but not inconceivable either, considering people can provide their own
'time' module.
2006-04-14 21:23:42 +00:00
Andrew M. Kuchling 29b3d08604 Add an item; better crediting; fix error in SQL example; minor edits 2006-04-14 20:35:17 +00:00
Andrew M. Kuchling 8ed29143fc Typo fix 2006-04-14 20:32:36 +00:00
Tim Peters c187f33e2b Whitespace normalization. 2006-04-14 18:34:14 +00:00
Walter Dörwald 78a0be6ab3 Add a BufferedIncrementalEncoder class that can be used for implementing
an incremental encoder that must retain part of the data between calls
to the encode() method.

Fix the incremental encoder and decoder for the IDNA encoding.

This closes SF patch #1453235.
2006-04-14 18:25:39 +00:00
Walter Dörwald a40cf31de6 Make error message less misleading for u"a..b".encode("idna"). 2006-04-14 17:00:36 +00:00
Martin v. Löwis 82972e7f01 Patch #702933: Undocument PyObject_NEW, PyObject_NEW_VAR,
and PyObject_DEL.
2006-04-14 15:58:03 +00:00
Walter Dörwald b17f12bbc6 Fix wrong attribute name. 2006-04-14 15:40:54 +00:00
Walter Dörwald 6493699c0d Make raise statements PEP 8 compatible. 2006-04-14 15:22:27 +00:00
Martin v. Löwis f7afe958ed Patch #1045620: Prepend Modules/ before Setup in stdout. 2006-04-14 15:16:15 +00:00
Martin v. Löwis f24de1e990 Patch #1470300: Port _hotshot to QNX4.25 port. 2006-04-14 15:07:46 +00:00
Martin v. Löwis 7580149bde Patch #1355883: Build Python-ast.c and Python-ast.h
independently. Fixes #1355883.
2006-04-14 15:02:32 +00:00
Armin Rigo 969ef7501c Show case: reference cycles involving only the ob_type field are rather
uncommon but possible.  Inspired by SF bug 1469629.
2006-04-14 14:58:30 +00:00
Andrew M. Kuchling db4018f320 Typo fix 2006-04-14 14:54:18 +00:00
Martin v. Löwis 0f48d98b74 Patch #1324762: Change --with-cxx to --with-cxx-main. 2006-04-14 14:34:26 +00:00
Walter Dörwald 15be5ec100 Call encode()/decode() with final==True as the last call in the
incremental codec tests.
2006-04-14 14:03:55 +00:00
Andrew M. Kuchling 121c98cce1 Typo fixes 2006-04-14 12:42:09 +00:00
Andrew M. Kuchling c7095843ae Add more items 2006-04-14 12:41:19 +00:00
Andrew M. Kuchling 984bdd759e Typo fix 2006-04-14 12:07:41 +00:00
Andrew M. Kuchling 75ba244c7b Add an item and a reminder 2006-04-14 10:29:55 +00:00
Martin v. Löwis 5cb6936672 Make Py_BuildValue, PyObject_CallFunction and
PyObject_CallMethod aware of PY_SSIZE_T_CLEAN.
2006-04-14 09:08:42 +00:00
Neal Norwitz 38a76a1017 Copy note from leakers README here too. We want to keep all test cases. 2006-04-14 06:35:46 +00:00
Neal Norwitz 621292237c Restore test tee with some modifications.
The test case came from test_generators, not test_itertools.
Ensure there's no cyclic garbage we are counting.

This is weird because it leaks, then reaches a limit:

python.exe -i test_tee.py
>>> leak()
0
[26633 refs]
>>> leak()
0
[26658 refs]
>>> leak()
0
[26683 refs]
>>> leak()
0
[26708 refs]
>>> leak()
0
[26708 refs]
>>> leak()
0
[26708 refs]
>>> leak()
0
2006-04-14 06:33:24 +00:00
Neal Norwitz cde8750414 Move the old test_generator_cycle.py which leaked but was removed into the test 2006-04-14 06:11:08 +00:00
Neal Norwitz 03f3be50af Update notes to address cyclic garbage and what should happen when a test is fixed. 2006-04-14 05:35:39 +00:00
Neal Norwitz 615461603c SF Bug #1454485, array.array('u') could crash the interpreter when
passing a string.  Martin already fixed the actual crash by ensuring
Py_UNICODE is unsigned.  As discussed on python-dev, this fix
removes the possibility of creating a unicode string from a raw buffer.

There is an outstanding question of how to fix the crash in 2.4.
2006-04-14 05:20:28 +00:00
Tim Peters 384178c12d Added George Yoshida. 2006-04-14 04:54:58 +00:00
Neal Norwitz 8c0dc84398 ALIGNMENT_SHIFT is not used 2006-04-14 03:53:34 +00:00
Tim Peters 7db4f2460f When using -R, lots of "*** DocTestRunner.merge:" nuisance messages
appear.  Get rid of them by nuking doctest's default DocTestRunner
instance as part of cleanup().  Also cleanup() before running the
first test repetition (the test was run once before we get into
the -R branch).
2006-04-13 23:12:24 +00:00
Tim Peters 8e6480ca02 Whitespace normalization. 2006-04-13 22:58:42 +00:00
Gregory P. Smith 3adc4aa2fb raise the minimum supported BerkeleyDB version to 3.3 and add notes to
news about this and a couple other recent fixes.
2006-04-13 19:19:01 +00:00
Martin v. Löwis da69041123 Force 8-alignment of memory blocks, as needed on
64-bit machines that require pointers to be aligned (e.g. IA64)
2006-04-13 19:16:13 +00:00
Martin v. Löwis f33dea2961 Fix type errors. 2006-04-13 13:08:58 +00:00
Andrew M. Kuchling 5d4cf5ecc1 Typo fix 2006-04-13 13:02:42 +00:00
Andrew M. Kuchling 3b4fb041df [Bug #1464571] Mention that generator's .gi_frame can now be None 2006-04-13 12:49:39 +00:00
Andrew M. Kuchling 6fc6976507 Add some items 2006-04-13 12:37:21 +00:00
Martin v. Löwis 0cc56e5c59 Introduce asdl_int_seq, to hold cmpop_ty. 2006-04-13 12:29:43 +00:00
Andrew M. Kuchling 0f1955daee Include more detail on Coverity results and add a link; minor edits 2006-04-13 12:09:08 +00:00
Andrew M. Kuchling 61434b6d51 Describe sys.subversion, Py_GetBuildInfo()
Add metadata example
2006-04-13 11:51:07 +00:00
Andrew M. Kuchling aa571c9a0a Add missing word 2006-04-13 11:40:29 +00:00