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.
Tim Peters [Thu, 14 Oct 2004 04:16:54 +0000 (04:16 +0000)]
remove_stderr_debug_decorations(): Always try the substitution. Else
this test failed under the combination of passing -O to a debug-build
Python. Now all 4 of those pass ({debug, release} x {-O, no -O}).
Anthony Baxter [Wed, 13 Oct 2004 15:54:17 +0000 (15:54 +0000)]
Patch 983206: distutils obeys LDSHARED env var. Removed the code in
Python's own setup.py that did the same thing (and tested on Solaris,
where LDSHARED is needed...)