Patch #1061931 / bug #971872: factor out part of spillproperties, so
properties are also documented if help(Class.<property>) is called
instead of help(Class).
Clarify that it's not necessary to subclass from TestCase to create a
test case. As Jeremy put it: "subclassing is an implementation
technique, not a type declaration".
memset() wrote one past the end of the buffer, which was likely to be unused padding or a yet-to-be-initialized local variable. This routine is already tested by test_socket.
Brett Cannon [Sun, 7 Nov 2004 01:24:12 +0000 (01:24 +0000)]
Move the AC_MSG_RESULT function call for checking for pthread options up into
the 'if' statement that performed the test. Not all platforms run the test and
on those tests configure outputted a rogue 'no' line.
Brett Cannon [Sun, 7 Nov 2004 01:19:00 +0000 (01:19 +0000)]
Add comment about removal of CoreServices/CoreFoundation compilation against
the core on OS X (also specifically mention removal of
PyMac_GetAppletScriptFile() ).
SF patch #1035255: Remove CoreServices / CoreFoundation dependencies in core
(Contributed by Bob Ippolito.)
This patch trims down the Python core on Darwin by making it
independent of CoreFoundation and CoreServices. It does this by:
Changed linker flags in configure/configure.in
Removed the unused PyMac_GetAppletScriptFile
Moved the implementation of PyMac_StrError to the MacOS module
Moved the implementation of PyMac_GetFullPathname to the
Carbon.File module
Armin Rigo [Thu, 4 Nov 2004 11:29:09 +0000 (11:29 +0000)]
Mistakes in the "sequence types" page:
* explanation for example with lists of lists made confusing use of
the word "contains" to mean "is built out of".
* wrong formula for slices with step. Is it ok to use LaTeX formulas
(which become images in the html document)? This version needs one
because it's based on a fraction. Just writing "\code{(j-i)/k}" here would
be ambiguous because it looks like a rounding-down-to-the-previous-integer
division, which is not what we need here. Of course we could write
"\code{float(j-i)/k}" but it just looks confusing.
* Bumped up the sleep() delay to four seconds so this test will run
reliably on WinME with FAT32.
* Native speaker rewrite of the comment block.
* Removed unnecessary backslashes from the multi-line function defintions.
Tim Peters [Mon, 1 Nov 2004 16:39:57 +0000 (16:39 +0000)]
gc_list_move(): Make this truly equivalent to remove+append. While
nothing in gc currently cares, the original coding could screw up if,
e.g., you tried to move a node to the list it's already in, and the node
was already the last in its list.
Barry Warsaw [Mon, 1 Nov 2004 03:52:43 +0000 (03:52 +0000)]
SF patch #1056967, changes the semantics of Template.safe_substitute() to not
raise a ValueError for dangling delimiters (the delimiter itself is returned).
Tim Peters [Mon, 1 Nov 2004 01:39:08 +0000 (01:39 +0000)]
gc list function cleanup.
Introduced gc_list_move(), which captures the common gc_list_remove() +
gc_list_append() sequence. In fact, no uses of gc_list_append() remained
(they were all in a gc_list_move() sequence), so commented that one out.
gc_list_merge(): assert that `from` != `to`; that was an implicit
precondition, now verified in a debug build.
* Use simpler, faster two pass algorithm for markblocks().
* Free the blocks variable if not NULL and exiting without change.
* Verify that the rest of the compiler has not set an exception.
* Make the test for tuple of constants less restrictive.
* Embellish the comment for chained conditional jumps.
Armin Rigo [Thu, 28 Oct 2004 16:32:00 +0000 (16:32 +0000)]
Wrote down the invariants of some common objects whose structure is
exposed in header files. Fixed a few comments in these headers.
As we might have expected, writing down invariants systematically exposed a
(minor) bug. In this case, function objects have a writeable func_code
attribute, which could be set to code objects with the wrong number of
free variables. Calling the resulting function segfaulted the interpreter.
Added a corresponding test.
Brett Cannon [Thu, 28 Oct 2004 04:49:21 +0000 (04:49 +0000)]
Fix bug of implementation of algorithm for calculating the date from year, week
of the year, and day of the week. Was not taking into consideration properly
the issue of when %U is used for the week of the year but the year starts on
Monday.
SF patch #1053375.
(Contributed by Facundo Batista.)
Code simplification by eliminating the unnecessary and error-prone
convolutions for the previously weird sign convention in _WorkRep().
Makes the code more understandable, more reliable, and a bit faster.
Tim Peters [Wed, 27 Oct 2004 02:33:15 +0000 (02:33 +0000)]
Paper over bug 1054615 by passing sane values to os.utime().
The underlying bug still exists, but also existed in 2.3.4:
import.c's load_source_module() returns NULL if
PyOS_GetLastModificationTime() returns -1, but
PyOS_GetLastModificationTime() doesn't set any exception when it returns
-1, and neither does load_source_module() when it gets back -1. This
leads to "SystemError: NULL result without error in PyObject_Call"
on an import that fails in this way.
Just van Rossum [Tue, 26 Oct 2004 11:02:08 +0000 (11:02 +0000)]
- Added tests for the string load/dump function.
- Added a chunk of plist data as generated by Cocoa's NSDictionary and
verify we output the same (including formatting)
- Changed the "literal" plist code to match the raw test data
Just van Rossum [Tue, 26 Oct 2004 10:30:55 +0000 (10:30 +0000)]
Made <data> output match Apple's exactly. To do that I had to add a custom
version of base64.encodestring() so I could control the line length of the
base64 output.
Hye-Shik Chang [Tue, 26 Oct 2004 09:16:42 +0000 (09:16 +0000)]
SF #737473: Show up-to-date source code in tracebacks always.
And add an optional argument 'filename' to linecache.checkcache()
to enable checking caches per-file.
Peepholer could be fooled into misidentifying a tuple_of_constants.
Added code to count consecutive occurrences of LOAD_CONST.
Use the count to weed out the misidentified cases.
Added a unittest.
Just van Rossum [Tue, 26 Oct 2004 07:20:26 +0000 (07:20 +0000)]
- Removed Date class. We don't really need it for b/w compatibility since
a) the functionality depended on PyXML before and b) hardly worked to
begin with.
- Instead, output and require upon input datetime.datetime objects.
Just van Rossum [Tue, 26 Oct 2004 06:50:50 +0000 (06:50 +0000)]
- added two more convenience functions: readPlistFromString() and
writePlistToString()
- use these two in the resource functions.
- Tweaked module doc string.
Tim Peters [Sun, 24 Oct 2004 23:45:42 +0000 (23:45 +0000)]
format_paragraph_event(): Patch 961387 introduced a bug here, causing
the indentation of a comment block to be ignored when reformatting the
block, leading to overly long reformatted lines (too wide by an amount
equal to the indentation width). Looks like a typo in the original
patch, a 1-character repair.