* 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.
Peter Astrand [Thu, 21 Oct 2004 19:28:34 +0000 (19:28 +0000)]
Removed test_close_fds, because it's too unreliable. We simply cannot
know that the newly-started Python process only has 3 filedescriptors
open. Fixes bug 1048808.