]> granicus.if.org Git - python/log
python
22 years agoTypo repair.
Tim Peters [Tue, 9 Jul 2002 19:27:20 +0000 (19:27 +0000)]
Typo repair.

22 years agoMoved COUNT_ALLOCS down and finished writing its description.
Tim Peters [Tue, 9 Jul 2002 19:24:54 +0000 (19:24 +0000)]
Moved COUNT_ALLOCS down and finished writing its description.

22 years agoCheckin comment.
Tim Peters [Tue, 9 Jul 2002 18:48:32 +0000 (18:48 +0000)]
Checkin comment.

22 years agoActualized descrintro.html URL.
Guido van Rossum [Tue, 9 Jul 2002 18:44:09 +0000 (18:44 +0000)]
Actualized descrintro.html URL.

22 years agoNew file to try to document the "special build" preprocessor symbols.
Tim Peters [Tue, 9 Jul 2002 18:35:34 +0000 (18:35 +0000)]
New file to try to document the "special build" preprocessor symbols.
Incomplete.  Add to it!  Once it settles down, it would make a nice
appendix in the real docs.

22 years ago_Py_AskYesNo(): Removed this function. It was defined only in a
Tim Peters [Tue, 9 Jul 2002 18:22:55 +0000 (18:22 +0000)]
_Py_AskYesNo():  Removed this function.  It was defined only in a
Py_TRACE_REFS build, but wasn't referenced.

22 years agondiffAssertEqual(): Stringify the arguments before running
Barry Warsaw [Tue, 9 Jul 2002 16:36:36 +0000 (16:36 +0000)]
ndiffAssertEqual(): Stringify the arguments before running
.splitlines() on them, since they may be Header instances.

test_multilingual(), test_header_ctor_default_args(): New tests of
make_header() and that Header can take all default arguments.

22 years agomake_header(): New function to take the output of decode_header() and
Barry Warsaw [Tue, 9 Jul 2002 16:33:47 +0000 (16:33 +0000)]
make_header(): New function to take the output of decode_header() and
create a Header instance.  Closes feature request #539481.

Header.__init__(): Allow the initial string to be omitted.

__eq__(), __ne__(): Support rich comparisons for equality of Header
instances withy Header instances or strings.

Also, update a bunch of docstrings.

22 years agoFix SF Bug 564931: compile() traceback must include filename.
Thomas Heller [Tue, 9 Jul 2002 09:23:27 +0000 (09:23 +0000)]
Fix SF Bug 564931: compile() traceback must include filename.

22 years agoNote that unicode() can raise LookupError for unknown codecs.
Fred Drake [Tue, 9 Jul 2002 05:25:46 +0000 (05:25 +0000)]
Note that unicode() can raise LookupError for unknown codecs.
Closes SF bug #513666.

22 years agoRemove unused variable.
Fred Drake [Tue, 9 Jul 2002 03:24:32 +0000 (03:24 +0000)]
Remove unused variable.

22 years agoThe Py_REF_DEBUG/COUNT_ALLOCS/Py_TRACE_REFS macro minefield: added
Tim Peters [Tue, 9 Jul 2002 02:57:01 +0000 (02:57 +0000)]
The Py_REF_DEBUG/COUNT_ALLOCS/Py_TRACE_REFS macro minefield:  added
more trivial lexical helper macros so that uses of these guys expand
to nothing at all when they're not enabled.  This should help sub-
standard compilers that can't do a good job of optimizing away the
previous "(void)0" expressions.

Py_DECREF:  There's only one definition of this now.  Yay!  That
was that last one in the family defined multiple times in an #ifdef
maze.

Py_FatalError():  Changed the char* signature to const char*.

_Py_NegativeRefcount():  New helper function for the Py_REF_DEBUG
expansion of Py_DECREF.  Calling an external function cuts down on
the volume of generated code.  The previous inline expansion of abort()
didn't work as intended on Windows (the program often kept going, and
the error msg scrolled off the screen unseen).  _Py_NegativeRefcount
calls Py_FatalError instead, which captures our best knowledge of
how to abort effectively across platforms.

22 years agoAnthony Baxter's patch for non-strict parsing. This adds a `strict'
Barry Warsaw [Tue, 9 Jul 2002 02:50:02 +0000 (02:50 +0000)]
Anthony Baxter's patch for non-strict parsing.  This adds a `strict'
argument to the constructor -- defaulting to true -- which is
different than Anthony's approach of using global state.

parse(), parsestr(): Grow a `headersonly' argument which stops parsing
once the header block has been seen, i.e. it does /not/ parse or even
read the body of the message.  This is used for parsing message/rfc822
type messages.

We need test cases for the non-strict parsing.  Anthony will supply
these.

_parsebody(): We can get rid of the isdigest end-of-line kludges,
although we still need to know if we're parsing a multipart/digest so
we can set the default type accordingly.

22 years agoAdd the concept of a "default type". Normally the default type is
Barry Warsaw [Tue, 9 Jul 2002 02:46:12 +0000 (02:46 +0000)]
Add the concept of a "default type".  Normally the default type is
text/plain but the RFCs state that inside a multipart/digest, the
default type is message/rfc822.  To preserve idempotency, we need a
separate place to define the default type than the Content-Type:
header.

get_default_type(), set_default_type(): Accessor and mutator methods
for the default type.

22 years ago__init__(): Don't attach the subparts if its an empty tuple. If the
Barry Warsaw [Tue, 9 Jul 2002 02:44:26 +0000 (02:44 +0000)]
__init__(): Don't attach the subparts if its an empty tuple.  If the
boundary was given in the arguments, call set_boundary().

22 years agoclone(): A new method for creating a clone of this generator (for
Barry Warsaw [Tue, 9 Jul 2002 02:43:47 +0000 (02:43 +0000)]
clone(): A new method for creating a clone of this generator (for
recursive generation).

_dispatch(): If the message object doesn't have a Content-Type:
header, check its default type instead of assuming it's text/plain.
This makes for correct generation of message/rfc822 containers.

_handle_multipart(): We can get rid of the isdigest kludge.  Just
print the message as normal and everything will work out correctly.

_handle_mulitpart_digest(): We don't need this anymore either.

22 years ago__init__(): Be sure to set the default type to message/rfc822.
Barry Warsaw [Tue, 9 Jul 2002 02:40:35 +0000 (02:40 +0000)]
__init__(): Be sure to set the default type to message/rfc822.

22 years ago_structure(): A handy little debugging aid that I don't (yet) intend
Barry Warsaw [Tue, 9 Jul 2002 02:39:07 +0000 (02:39 +0000)]
_structure(): A handy little debugging aid that I don't (yet) intend
to make public, but that others might still find useful.

22 years agoTestEmailBase.ndiffAssertEqual(): Python 2.1's difflib doesn't have an
Barry Warsaw [Tue, 9 Jul 2002 02:38:24 +0000 (02:38 +0000)]
TestEmailBase.ndiffAssertEqual(): Python 2.1's difflib doesn't have an
ndiff function, so just alias it to assertEqual in that case.

Various: make sure all openfile()/read()'s are wrapped in
try/finally's so the file gets closed.

A bunch of new tests checking the corner cases for multipart/digest
and message/rfc822.

22 years agoNew files which test the corners of multipart/message and
Barry Warsaw [Tue, 9 Jul 2002 02:36:10 +0000 (02:36 +0000)]
New files which test the corners of multipart/message and
message/rfc822 compliance.

22 years agoWith the addition of Oleg's support for RFC 2231, it's time to bump
Barry Warsaw [Tue, 9 Jul 2002 02:13:10 +0000 (02:13 +0000)]
With the addition of Oleg's support for RFC 2231, it's time to bump
the version number to 2.1.

22 years agoSF bug 578752: COUNT_ALLOCS vs heap types
Tim Peters [Mon, 8 Jul 2002 22:11:52 +0000 (22:11 +0000)]
SF bug 578752: COUNT_ALLOCS vs heap types
Repair segfaults and infinite loops in COUNT_ALLOCS builds in the
presence of new-style (heap-allocated) classes/types.

Bugfix candidate.  I'll backport this to 2.2.  It's irrelevant in 2.1.

22 years agoThe readme file said that OSX Carbon modules were only built for
Jack Jansen [Mon, 8 Jul 2002 21:39:36 +0000 (21:39 +0000)]
The readme file said that OSX Carbon modules were only built for
-enable-framework builds, but setup.py built them anyway. Fixed.
Also normalized whitespace.

Bugfix candidate.

22 years agoPyNode_AddChild() and fancy_roundup(): Be paranoid about int overflow.
Tim Peters [Mon, 8 Jul 2002 19:11:07 +0000 (19:11 +0000)]
PyNode_AddChild() and fancy_roundup():  Be paranoid about int overflow.

22 years agoRemove the configure option for disabling the reference cycle GC.
Neil Schemenauer [Mon, 8 Jul 2002 14:47:12 +0000 (14:47 +0000)]
Remove the configure option for disabling the reference cycle GC.

22 years agoFix typo reported by Kent Engström, and a bunch of broken markup.
Fred Drake [Mon, 8 Jul 2002 14:42:22 +0000 (14:42 +0000)]
Fix typo reported by Kent Engström, and a bunch of broken markup.

22 years agoFix typo: "an Unicode string" --> "a Unicode string"
Fred Drake [Mon, 8 Jul 2002 14:29:05 +0000 (14:29 +0000)]
Fix typo:  "an Unicode string" --> "a Unicode string"
Clarify the return value when the parameter is a Unicode object.

22 years agoFixed a typo and updated information about using the Times fonts when
Fred Drake [Mon, 8 Jul 2002 14:10:41 +0000 (14:10 +0000)]
Fixed a typo and updated information about using the Times fonts when
formatting PostScript documents.  Reported by Dave Kuhlman.

22 years agoAdded font-setting line (and associated comments) to the A4 version of
Fred Drake [Mon, 8 Jul 2002 14:08:48 +0000 (14:08 +0000)]
Added font-setting line (and associated comments) to the A4 version of
this file; the lack of this was causing the A4 version of tutorial to
use really bad Type 3 fonts instead of Type 1 fonts, which also
bloated the file size substantially.

I thought there was a SourceForge bug for this, but couldn't find it.

22 years agoGot rid of symlink target, and in stead have "make dontinstallmacsubtree"
Jack Jansen [Mon, 8 Jul 2002 13:34:23 +0000 (13:34 +0000)]
Got rid of symlink target, and in stead have "make dontinstallmacsubtree"
which uses a .pth file to add the Mac/Lib from your source tree to sys.path.

Also put the Python version number in a variable.Killed by signal 2.

22 years agoChange the "__ private" names to "_ protected"; this has been a pain for
Fred Drake [Mon, 8 Jul 2002 12:28:06 +0000 (12:28 +0000)]
Change the "__ private" names to "_ protected"; this has been a pain for
subclassing so many times it should simply be changed.

22 years agoGot rid of special case for Macintosh realloc slowdown: Tim fixed the problem.
Jack Jansen [Mon, 8 Jul 2002 10:07:25 +0000 (10:07 +0000)]
Got rid of special case for Macintosh realloc slowdown: Tim fixed the problem.

22 years agoDefine WITH_PYMALLOC as 1
Jack Jansen [Mon, 8 Jul 2002 10:05:23 +0000 (10:05 +0000)]
Define WITH_PYMALLOC as 1

22 years agoPyNode_AddChild(): Do aggressive over-allocation when the number of
Tim Peters [Mon, 8 Jul 2002 06:32:09 +0000 (06:32 +0000)]
PyNode_AddChild():  Do aggressive over-allocation when the number of
children gets large, to avoid severe platform realloc() degeneration
in extreme cases (like test_longexp).

Bugfix candidate.

This was doing extremely timid over-allocation, just rounding up to the
nearest multiple of 3.  Now so long as the number of children is <= 128,
it rounds up to a multiple of 4 but via a much faster method.  When the
number of children exceeds 128, though, and more space is needed, it
doubles the capacity.  This is aggressive over-allocation.

SF patch <http://www.python.org/sf/578297> has Andrew MacIntyre using
PyMalloc in the parser to overcome platform malloc problems in
test_longexp on OS/2 EMX.  Jack Jansen notes there that it didn't help
him on the Mac, because the Mac has problems with frequent ever-growing
reallocs, not just with gazillions of teensy mallocs.  Win98 has no
visible problems with test_longexp, but I tried boosting the test-case
size and soon got "senseless" MemoryErrors out of it, and soon after
crashed the OS:  as I've seen in many other contexts before, while the
Win98 realloc remains zippy in bad cases, it leads to extreme
fragmentation of user address space, to the point that the OS barfs.

I don't yet know whether this fixes Jack's Mac problems, but it does cure
Win98's problems when boosting the test case size.  It also speeds
test_longexp in its unaltered state.

22 years ago- Got rid if WITH_CYCLE_GC
Jack Jansen [Sun, 7 Jul 2002 20:54:44 +0000 (20:54 +0000)]
- Got rid if WITH_CYCLE_GC
- Cleaned up Python banner string, so the normal build for MacPython 2.3
  will have a short banner.

22 years agoRearranged and added comments to object.h, to clarify many things
Tim Peters [Sun, 7 Jul 2002 19:59:50 +0000 (19:59 +0000)]
Rearranged and added comments to object.h, to clarify many things
that have taken me "too long" to reverse-engineer over the years.
Vastly reduced the nesting level and redundancy of #ifdef-ery.
Took a light stab at repairing comments that are no longer true.

sys_gettotalrefcount():  Changed to enable under Py_REF_DEBUG.
It was enabled under Py_TRACE_REFS, which was much heavier than
necessary.  sys.gettotalrefcount() is now available in a
Py_REF_DEBUG-only build.

22 years agoFix from SF patch #527518: proxy config with user+pass authentication.
Jeremy Hylton [Sun, 7 Jul 2002 16:57:35 +0000 (16:57 +0000)]
Fix from SF patch #527518: proxy config with user+pass authentication.

Bug fix candidate.

22 years agoRemoved 3 unlikely #includes that were only needed for the non-gc flavor
Tim Peters [Sun, 7 Jul 2002 16:52:50 +0000 (16:52 +0000)]
Removed 3 unlikely #includes that were only needed for the non-gc flavor
of the trashcan code.

22 years agoFix for SF bug #432621: httplib: multiple Set-Cookie headers
Jeremy Hylton [Sun, 7 Jul 2002 16:51:37 +0000 (16:51 +0000)]
Fix for SF bug #432621: httplib: multiple Set-Cookie headers

If multiple header fields with the same name occur, they are combined
according to the rules in RFC 2616 sec 4.2:

Appending each subsequent field-value to the first, each separated by
a comma. The order in which header fields with the same field-name are
received is significant to the interpretation of the combined field
value.

22 years agoTrashcan cleanup: Now that cyclic gc is always there, the trashcan
Tim Peters [Sun, 7 Jul 2002 05:13:56 +0000 (05:13 +0000)]
Trashcan cleanup:  Now that cyclic gc is always there, the trashcan
mechanism is no longer evil:  it no longer plays dangerous games with
the type pointer or refcounts, and objects in extension modules can play
along too without needing to edit the core first.

Rewrote all the comments to explain this, and (I hope) give clear
guidance to extension authors who do want to play along.  Documented
all the functions.  Added more asserts (it may no longer be evil, but
it's still dangerous <0.9 wink>).  Rearranged the generated code to
make it clearer, and to tolerate either the presence or absence of a
semicolon after the macros.  Rewrote _PyTrash_destroy_chain() to call
tp_dealloc directly; it was doing a Py_DECREF again, and that has all
sorts of obscure distorting effects in non-release builds (Py_DECREF
was already called on the object!).  Removed Christian's little "embedded
change log" comments -- that's what checkin messages are for, and since
it was impossible to correlate the comments with the code that changed,
I found them merely distracting.

22 years agoRemoved WITH_CYCLE_GC #ifdef-ery. Holes:
Tim Peters [Sun, 7 Jul 2002 03:59:34 +0000 (03:59 +0000)]
Removed WITH_CYCLE_GC #ifdef-ery.  Holes:

+ I'm not sure what to do about configure.in.  Left it alone.

+ Ditto pyexpat.c.  Fred or Martin will know what to do.

22 years agoFix SF bug #575360
Jeremy Hylton [Sat, 6 Jul 2002 18:55:01 +0000 (18:55 +0000)]
Fix SF bug #575360

Subclasses of Exception that define an __init__ must call
Exception.__init__ or define self.args.  Otherwise, str() will fail.

Bug fix candidate.

22 years agoHandle HTTP/0.9 responses.
Jeremy Hylton [Sat, 6 Jul 2002 18:48:07 +0000 (18:48 +0000)]
Handle HTTP/0.9 responses.

Section 19.6 of RFC 2616 (HTTP/1.1):

   It is beyond the scope of a protocol specification to mandate
   compliance with previous versions. HTTP/1.1 was deliberately
   designed, however, to make supporting previous versions easy....

   And we would expect HTTP/1.1 clients to:

      - recognize the format of the Status-Line for HTTP/1.0 and 1.1
        responses;

      - understand any valid response in the format of HTTP/0.9, 1.0, or
        1.1.

The changes to the code do handle response in the format of HTTP/0.9.
Some users may consider this a bug because all responses with a
sufficiently corrupted status line will look like an HTTP/0.9
response.  These users can pass strict=1 to the HTTP constructors to
get a BadStatusLine exception instead.

While this is a new feature of sorts, it enhances the robustness of
the code (be tolerant in what you accept).  Thus, I consider it a bug
fix candidate.

XXX strict needs to be documented.

22 years agoModifying EditorWindow causes breakpoints in that module to be removed
Kurt B. Kaiser [Sat, 6 Jul 2002 04:22:25 +0000 (04:22 +0000)]
Modifying EditorWindow causes breakpoints in that module to be removed
from both sides of the split debugger.
M Debugger.py
M EditorWindow.py

22 years agoDecent burial for venerated ancestor (urn in attic)
Kurt B. Kaiser [Sat, 6 Jul 2002 01:20:51 +0000 (01:20 +0000)]
Decent burial for venerated ancestor  (urn in attic)

22 years agoRemove dead code.
Kurt B. Kaiser [Sat, 6 Jul 2002 01:07:15 +0000 (01:07 +0000)]
Remove dead code.

22 years ago1. Test Sourceforge checkin, idle-dev posting
Kurt B. Kaiser [Sat, 6 Jul 2002 00:51:33 +0000 (00:51 +0000)]
1. Test Sourceforge checkin, idle-dev posting
2. Remove extraneous comment

22 years agoCombine OldStackViewer.py with Debugger.py, removing dead code.
unknown [Fri, 5 Jul 2002 22:05:24 +0000 (22:05 +0000)]
Combine OldStackViewer.py with Debugger.py, removing dead code.
M Debugger.py       : Incorporate StackViewer, NamespaceViewer classes
M StackViewer.py    : remove import OldStackViewer
U OldStackViewer.py : remove file

22 years agoprintlist(): Replaced the guts with a call to textwrap. Yay!
Tim Peters [Thu, 4 Jul 2002 19:45:06 +0000 (19:45 +0000)]
printlist():  Replaced the guts with a call to textwrap.  Yay!

22 years agogc_list_move defined but not used.
Michael W. Hudson [Thu, 4 Jul 2002 17:11:36 +0000 (17:11 +0000)]
gc_list_move defined but not used.

22 years agoDocstring improvements. In particular, added docstrings for the
Greg Ward [Thu, 4 Jul 2002 14:51:49 +0000 (14:51 +0000)]
Docstring improvements.  In particular, added docstrings for the
standalone wrap() and fill() functions.  This should address the
misunderstanding that led to SF bug 577106.

22 years agoFix a typo.
Thomas Heller [Thu, 4 Jul 2002 08:36:53 +0000 (08:36 +0000)]
Fix a typo.

22 years agoRevise asyncore documentation and document asynchat for the first time.
Steve Holden [Wed, 3 Jul 2002 18:36:39 +0000 (18:36 +0000)]
Revise asyncore documentation and document asynchat for the first time.

22 years agoNo need to be ambiguous about *how* extended slices and built-in types
Fred Drake [Wed, 3 Jul 2002 12:02:01 +0000 (12:02 +0000)]
No need to be ambiguous about *how* extended slices and built-in types
have changed.

Uncomment a heading so that PendingDeprecationWarning doesn't seem so
out of place.

22 years agoFix up a few more consistency nits and incorrectly applied markup.
Fred Drake [Wed, 3 Jul 2002 05:08:48 +0000 (05:08 +0000)]
Fix up a few more consistency nits and incorrectly applied markup.
Further clarify the English-centricity of fix_sentence_endings.

22 years agoappend(): Clarify the expected type of charset.
Barry Warsaw [Wed, 3 Jul 2002 05:04:04 +0000 (05:04 +0000)]
append(): Clarify the expected type of charset.

22 years agoDebugger Exception Info and GUI Stack Exception Traceback: finish
Kurt B. Kaiser [Wed, 3 Jul 2002 03:55:43 +0000 (03:55 +0000)]
Debugger Exception Info and GUI Stack Exception Traceback: finish
implementation.

22 years agoStop trying to cater to platforms with a broken HUGE_VAL definition. It
Tim Peters [Wed, 3 Jul 2002 03:31:20 +0000 (03:31 +0000)]
Stop trying to cater to platforms with a broken HUGE_VAL definition.  It
breaks other platforms (in this case, the hack for broken Cray systems in
turn caused failure on a Mac system broken in a different way).

22 years agoUpdate freeze to use zlib 1.1.4.
Mark Hammond [Wed, 3 Jul 2002 02:40:25 +0000 (02:40 +0000)]
Update freeze to use zlib 1.1.4.

From patch: [ 574532 ] Update freeze to use zlib 1.1.4

22 years agoAdd annotations that describe the change in the "errors" and "failures"
Fred Drake [Tue, 2 Jul 2002 22:46:42 +0000 (22:46 +0000)]
Add annotations that describe the change in the "errors" and "failures"
attributes of the TestResult.

22 years agoUpdate the documentation of the errors and failures attributes of the
Fred Drake [Tue, 2 Jul 2002 22:34:44 +0000 (22:34 +0000)]
Update the documentation of the errors and failures attributes of the
TestResult object.  Add an example of how to get even more information for
apps that can use it.
Closes SF bug #558278.

22 years agoAnother stab at SF 576327: zipfile when sizeof(long) == 8
Tim Peters [Tue, 2 Jul 2002 22:24:50 +0000 (22:24 +0000)]
Another stab at SF 576327: zipfile when sizeof(long) == 8
binascii_crc32():  The previous patch forced this to return the same
result across platforms.  This patch deals with that, on a 64-bit box,
the *entry* value may have "unexpected" bits in the high four bytes.

Bugfix candidate.

22 years agovisit_decref(): Added another assert.
Tim Peters [Tue, 2 Jul 2002 22:15:28 +0000 (22:15 +0000)]
visit_decref():  Added another assert.

22 years agoDon't list all the keyword args to the TextWrapper constructor in the
Greg Ward [Tue, 2 Jul 2002 21:48:12 +0000 (21:48 +0000)]
Don't list all the keyword args to the TextWrapper constructor in the
classdesc -- just use "..." with prose explaining the correspondence
between keyword args and instance attributes.

Document 'width' along with the other instance attributes.

Describe default values consistently.

Typo fixes.

22 years agoBe consistent with the functions in the posix/nt module: docstrings
Fred Drake [Tue, 2 Jul 2002 21:28:04 +0000 (21:28 +0000)]
Be consistent with the functions in the posix/nt module:  docstrings
don't include a " -> None" for functions that have no return value.

22 years agoAttempt to clarify removedirs().
Fred Drake [Tue, 2 Jul 2002 21:03:49 +0000 (21:03 +0000)]
Attempt to clarify removedirs().
Based on SF bug #574773.

22 years agoDeal with & remove the XXX comments.
Fred Drake [Tue, 2 Jul 2002 20:37:12 +0000 (20:37 +0000)]
Deal with & remove the XXX comments.
Change the markup to be more like the rest of the documentation.

22 years agoAbstract the creation of signature lines for callable things; the new
Fred Drake [Tue, 2 Jul 2002 20:32:50 +0000 (20:32 +0000)]
Abstract the creation of signature lines for callable things; the new
\py@sigline macro will wrap the argument list so it will not extend into
the right margin.
Substantially based on a contribution from Dave Cole.
This addresses one of the comments in SF bug #574742.

22 years agoFix for SF bug #576327: zipfile when sizeof(long) == 8
Tim Peters [Tue, 2 Jul 2002 20:20:08 +0000 (20:20 +0000)]
Fix for SF bug #576327: zipfile when sizeof(long) == 8
binascii_crc32():  Make this return a signed 4-byte result across
platforms.  The other way to make this platform-independent would be to
make it return an unsigned unbounded int, but the evidence suggests
other code out there treats it like a signed 4-byte int (e.g., existing
code writing the result with struct.pack "l" format).

Bugfix candidate.

22 years agoConvert raise to call exception class. Add whitespace.
Jeremy Hylton [Tue, 2 Jul 2002 20:19:08 +0000 (20:19 +0000)]
Convert raise to call exception class.  Add whitespace.

22 years agoRepair badly formatted code.
Jeremy Hylton [Tue, 2 Jul 2002 18:25:00 +0000 (18:25 +0000)]
Repair badly formatted code.

22 years agoFinished transitioning to using gc_refs to track gc objects' states.
Tim Peters [Tue, 2 Jul 2002 18:12:35 +0000 (18:12 +0000)]
Finished transitioning to using gc_refs to track gc objects' states.
This was mostly a matter of adding comments and light code rearrangement.
Upon untracking, gc_next is still set to NULL.  It's a cheap way to
provoke memory faults if calling code is insane.  It's also used in some
way by the trashcan mechanism.

22 years agoRemove bogus assignment to self.length in NamedNodeMap.__delitem__().
Fred Drake [Tue, 2 Jul 2002 17:27:06 +0000 (17:27 +0000)]
Remove bogus assignment to self.length in NamedNodeMap.__delitem__().

22 years agoMinor markup adjustments, consistency changes, and shorten a long
Fred Drake [Tue, 2 Jul 2002 16:17:58 +0000 (16:17 +0000)]
Minor markup adjustments, consistency changes, and shorten a long
line.

22 years agoAdd refcount info for PyErr_SetFromWindowsErr() and
Fred Drake [Tue, 2 Jul 2002 16:16:18 +0000 (16:16 +0000)]
Add refcount info for PyErr_SetFromWindowsErr() and
PyErr_SetFromWindowsErrWithFilename().

22 years agoDocs for PyErr_SetFromWindowsErrWithFilename() and
Thomas Heller [Tue, 2 Jul 2002 15:47:03 +0000 (15:47 +0000)]
Docs for PyErr_SetFromWindowsErrWithFilename() and
PyErr_SetFromWindowsErr().
Fixes SF# 576016, with additional markup.

22 years agoDo not depend on pymemcompat.h (was only used for PyXML); Martin likes
Fred Drake [Tue, 2 Jul 2002 15:44:36 +0000 (15:44 +0000)]
Do not depend on pymemcompat.h (was only used for PyXML); Martin likes
it all inline.

22 years agoMac OS X Jaguar (developer preview) seems to have a working getaddrinfo().
Jack Jansen [Tue, 2 Jul 2002 14:40:42 +0000 (14:40 +0000)]
Mac OS X Jaguar (developer preview) seems to have a working getaddrinfo().

22 years agoReserved another gc_refs value for untracked objects. Every live gc
Tim Peters [Tue, 2 Jul 2002 00:52:30 +0000 (00:52 +0000)]
Reserved another gc_refs value for untracked objects.  Every live gc
object should now have a well-defined gc_refs value, with clear transitions
among gc_refs states.  As a result, none of the visit_XYZ traversal
callbacks need to check IS_TRACKED() anymore, and those tests were removed.
(They were already looking for objects with specific gc_refs states, and
the gc_refs state of an untracked object can no longer match any other
gc_refs state by accident.)
Added more asserts.
I expect that the gc_next == NULL indicator for an untracked object is
now redundant and can also be removed, but I ran out of time for this.

22 years agoBring this back into sync with PyXML revision 1.58.
Fred Drake [Mon, 1 Jul 2002 14:02:31 +0000 (14:02 +0000)]
Bring this back into sync with PyXML revision 1.58.

22 years agoOK, I couldn't stand it <0.5 wink>: removed all uncertainty about what's
Tim Peters [Mon, 1 Jul 2002 03:52:19 +0000 (03:52 +0000)]
OK, I couldn't stand it <0.5 wink>:  removed all uncertainty about what's
in gc_refs, even at the cost of putting back a test+branch in
visit_decref.

The good news:  since gc_refs became utterly tame then, it became
clear that another special value could be useful.  The move_roots() and
move_root_reachable() passes have now been replaced by a single
move_unreachable() pass.  Besides saving a pass over the generation, this
has a better effect:  most of the time everything turns out to be
reachable, so we were breaking the generation list apart and moving it
into into the reachable list, one element at a time.  Now the reachable
stuff stays in the generation list, and the unreachable stuff is moved
instead.  This isn't quite as good as it sounds, since sometimes we
guess wrongly that a thing is unreachable, and have to move it back again.

Still, overall, it yields a significant (but not dramatic) boost in
collection speed.

22 years agovisit_decref(): Two optimizations.
Tim Peters [Sun, 30 Jun 2002 21:31:03 +0000 (21:31 +0000)]
visit_decref():  Two optimizations.

1. You're not supposed to call this with a NULL argument, although the
   docs could be clearer about that.  The other visit_XYZ() functions
   don't bother to check.  This doesn't either now, although it does
   assert non-NULL-ness now.

2. It doesn't matter whether the object is currently tracked, so don't
   bother checking that either (if it isn't currently tracked, it may
   have some nonsense value in gc_refs, but it doesn't hurt to
   decrement gibberish, and it's cheaper to do so than to make everyone
   test for trackedness).

It would be nice to get rid of the other tests on IS_TRACKED.  Perhaps
trackedness should not be a matter of not being in any gc list, but
should be a matter of being in a new "untracked" gc list.  This list
simply wouldn't be involved in the collection mechanism.  A newly
created object would be put in the untracked list.  Tracking would
simply unlink it and move it into the gen0 list.  Untracking would do
the reverse.  No test+branch needed then.  visit_move() may be vulnerable
then, though, and I don't know how this would work with the trashcan.

22 years agoSF bug #574132: Major GC related performance regression
Tim Peters [Sun, 30 Jun 2002 17:56:40 +0000 (17:56 +0000)]
SF bug #574132:  Major GC related performance regression
"The regression" is actually due to that 2.2.1 had a bug that prevented
the regression (which isn't a regression at all) from showing up.  "The
regression" is actually a glitch in cyclic gc that's been there forever.

As the generation being collected is analyzed, objects that can't be
collected (because, e.g., we find they're externally referenced, or
are in an unreachable cycle but have a __del__ method) are moved out
of the list of candidates.  A tricksy scheme uses negative values of
gc_refs to mark such objects as being moved.  However, the exact
negative value set at the start may become "more negative" over time
for objects not in the generation being collected, and the scheme was
checking for an exact match on the negative value originally assigned.
As a result, objects in generations older than the one being collected
could get scanned too, and yanked back into a younger generation.  Doing
so doesn't lead to an error, but doesn't do any good, and can burn an
unbounded amount of time doing useless work.

A test case is simple (thanks to Kevin Jacobs for finding it!):

x = []
for i in xrange(200000):
    x.append((1,))

Without the patch, this ends up scanning all of x on every gen0 collection,
scans all of x twice on every gen1 collection, and x gets yanked back into
gen1 on every gen0 collection.  With the patch, once x gets to gen2, it's
never scanned again until another gen2 collection, and stays in gen2.

Bugfix candidate, although the code has changed enough that I think I'll
need to port it by hand.  2.2.1 also has a different bug that causes
bound method objects not to get tracked at all (so the test case doesn't
burn absurd amounts of time in 2.2.1, but *should* <wink>).

22 years agoPatch #569753: Remove support for WIN16.
Martin v. Löwis [Sun, 30 Jun 2002 15:26:10 +0000 (15:26 +0000)]
Patch #569753: Remove support for WIN16.
Rename all occurrences of MS_WIN32 to MS_WINDOWS.

22 years agoBump required PyXML version to 0.6.5.
Martin v. Löwis [Sun, 30 Jun 2002 15:08:22 +0000 (15:08 +0000)]
Bump required PyXML version to 0.6.5.

22 years agoImplement the encoding argument for toxml and toprettyxml.
Martin v. Löwis [Sun, 30 Jun 2002 15:05:00 +0000 (15:05 +0000)]
Implement the encoding argument for toxml and toprettyxml.
Document toprettyxml.

22 years agoMerge from PyXML:
Martin v. Löwis [Sun, 30 Jun 2002 07:38:50 +0000 (07:38 +0000)]
Merge from PyXML:
[1.3] Added documentation of the namespace URI for elements with no namespace.
[1.4] New property http://www.python.org/sax/properties/encoding.
[1.5] Support optional string interning in pyexpat.

22 years agoAdd xml namespace initially (PyXML 1.19).
Martin v. Löwis [Sun, 30 Jun 2002 07:32:56 +0000 (07:32 +0000)]
Add xml namespace initially (PyXML 1.19).

22 years agoFix spacing.
Martin v. Löwis [Sun, 30 Jun 2002 07:27:30 +0000 (07:27 +0000)]
Fix spacing.

22 years agoMerge changes from PyXML:
Martin v. Löwis [Sun, 30 Jun 2002 07:21:24 +0000 (07:21 +0000)]
Merge changes from PyXML:
[1.15]
Added understanding of the feature_validation, feature_external_pes,
and feature_string_interning features.
Added support for the feature_external_ges feature.
Added support for the property_xml_string property.
[1.16]
Made it recognize the namespace prefixes feature.
[1.17]
removed erroneous first line
[1.19]
Support optional string interning in pyexpat.
[1.21]
Restore compatibility with versions of Python that did not support weak
references.  These do not get the cyclic reference fix, but they will
continue to work as they did before.
[1.22]
Activate entity processing unless standalone.

22 years agoDefine PyDoc_STRVAR if it is not available (PyXML 1.54).
Martin v. Löwis [Sun, 30 Jun 2002 06:40:55 +0000 (06:40 +0000)]
Define PyDoc_STRVAR if it is not available (PyXML 1.54).
Remove support for Python 1.5 (PyXML 1.55).

22 years agoUndo usage of PyOS_snprintf (rev. 1.51 of PyXML).
Martin v. Löwis [Sun, 30 Jun 2002 06:03:35 +0000 (06:03 +0000)]
Undo usage of PyOS_snprintf (rev. 1.51 of PyXML).

22 years agoFixed bug 574978 shutil example out of sync with source code
Raymond Hettinger [Sun, 30 Jun 2002 04:43:20 +0000 (04:43 +0000)]
Fixed bug 574978 shutil example out of sync with source code

22 years agoFix bug 575221 referred to dictionary type instead of dict.
Raymond Hettinger [Sun, 30 Jun 2002 04:32:38 +0000 (04:32 +0000)]
Fix bug 575221 referred to dictionary type instead of dict.

22 years agoCode modernization. Replace v=s[i]; del s[i] with single lookup v=s.pop(i)
Raymond Hettinger [Sun, 30 Jun 2002 03:39:14 +0000 (03:39 +0000)]
Code modernization.  Replace v=s[i]; del s[i] with single lookup v=s.pop(i)

22 years agoClarify the version information for the unicode() built-in.
Fred Drake [Sat, 29 Jun 2002 16:06:47 +0000 (16:06 +0000)]
Clarify the version information for the unicode() built-in.
Closes SF bug #575272.

22 years agoAnother test of long headers.
Barry Warsaw [Sat, 29 Jun 2002 15:23:39 +0000 (15:23 +0000)]
Another test of long headers.

22 years agoOleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133
Barry Warsaw [Sat, 29 Jun 2002 05:58:45 +0000 (05:58 +0000)]
Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133

New test cases.

22 years agoOleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133
Barry Warsaw [Sat, 29 Jun 2002 05:58:04 +0000 (05:58 +0000)]
Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133

Specifically,

decode_rfc2231(), encode_rfc2231(): Functions to encode and decode RFC
2231 style parameters.

decode_params(): Function to decode a list of parameters.

22 years agoOleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133
Barry Warsaw [Sat, 29 Jun 2002 05:56:15 +0000 (05:56 +0000)]
Oleg Broytmann's support for RFC 2231 encoded parameters, SF patch #549133

Specifically,

_formatparam(): Teach this about encoded `param' arguments, which are
a 3-tuple of items (charset, language, value).  language is ignored.

_unquotevalue(): Handle both 3-tuple RFC 2231 values and unencoded
values.

_get_params_preserve(): Decode the parameters before returning them.

get_params(), get_param(): Use _unquotevalue().

get_filename(), get_boundary(): Teach these about encoded (3-tuple)
parameters.