Fred Drake [Wed, 13 Nov 2002 19:16:37 +0000 (19:16 +0000)]
- Committing the modified signature lines I've been using for a long
time in http://www.python.org/dev/doc/. There have been no bug
reports on these for a long time now.
- Remove local "use" statement that duplicates a top-level "use".
Back out part of rev. 1.53, restoring the use of the string module.
The two long lines have been reflowed differently; hopefully someone on
BeOS can test them. Rev. 1.53 also converted string.atoi() to int(); I've
left that alone.
Fred Drake [Wed, 13 Nov 2002 15:32:34 +0000 (15:32 +0000)]
Update: Older versions of Python crashed when calling repr()
(including the implied call using back-ticks) of a recursive object,
but this is no longer the case.
Reported by Manus Hand via email.
Improved clarity and thoroughness of docstring.
Added design notes in comments.
Used better variable names.
Eliminated the unsavory "pool[-k:]" which was an aspiring bug (for k==0).
Used if/else to show the two algorithms in parallel style.
Added one more test assertion.
Fred Drake [Wed, 13 Nov 2002 15:13:38 +0000 (15:13 +0000)]
Clarify that PyImport_AddModule() and PyImport_ExecCodeModule() don't
add any package support structure even if a dotted-name is passed for
the module.
Closes SF bug #424106.
Neal Norwitz [Tue, 12 Nov 2002 23:01:12 +0000 (23:01 +0000)]
Fix SF # 635969, No error "not all arguments converted"
When mwh added extended slicing, strings and unicode became mappings.
Thus, dict was set which prevented an error when doing:
newstr = 'format without a percent' % string_value
This fix raises an exception again when there are no formats
and % with a string value.
Fred Drake [Tue, 12 Nov 2002 22:19:34 +0000 (22:19 +0000)]
Handle the Content-Type header a little more appropriately: if it
contains options, drop them to get the major/minor content type.
Modified from the supplied patch to support more whitespace variation.
Closes SF patch #613605.
Tim Peters [Tue, 12 Nov 2002 22:08:10 +0000 (22:08 +0000)]
SF patch 637176: list.sort crasher
Armin Rigo's Draconian but effective fix for
SF bug 453523: list.sort crasher
slightly fiddled to catch more cases of list mutation. The dreaded
internal "immutable list type" is gone! OTOH, if you look at a list
*while* it's being sorted now, it will appear to be empty. Better
than a core dump.
Walter Dörwald [Tue, 12 Nov 2002 11:42:20 +0000 (11:42 +0000)]
Use PyInt_AsLong instead of PyInt_AS_LONG after the call to
PyNumber_Int, because now PyNumber_Int might return a long,
and PyInt_AsLong can handle that, whereas PyInt_AS_LONG can't.
Tim Peters [Mon, 11 Nov 2002 19:44:39 +0000 (19:44 +0000)]
Some help for SF 614770: MSVC 7.0 compiler support
This changes sys.version under Microsoft builds to include the MS compiler
version number (_MSC_VER). Since VC 6 and VC 7 are apparently
incompatible, and both can be installed on a single box, distutils needs
some way to figure out which version of MSVC a given Python was compiled
under.
As also suggested by MvL, got rid of #ifdef'ery for the defunct _M_ALPHA
target.
Bugfix candidate? Hard to say. As far as I'm concerned, VC 7 wasn't
a supported platform in the 2.2 line. If somebody thinks it should be,
they can do the work.
Jack Jansen [Mon, 11 Nov 2002 00:05:00 +0000 (00:05 +0000)]
- Building IDE is optional on waste being available, similar to building
IDLE (it was a fatal error before)
- Shuffled a few things around to facilitate the experimental building
of MacPython for Jaguar's pre-installed python.
Tim Peters [Sat, 9 Nov 2002 06:31:56 +0000 (06:31 +0000)]
Many changes to get this to pass on Windows, and to make it easier to
figure out what the code was doing. The fixes were a combination of
closing open files before deletion, opening files in binary mode, and
plain skipping things that can't work on Windows (BaseTest.decompress
uses a process gimmick that doesn't exist on Windows, and, even if it
did, assumes a "bunzip2" executable is on PATH).
Tim Peters [Sat, 9 Nov 2002 04:48:58 +0000 (04:48 +0000)]
Start building the bz2 module on Windows.
CAUTION: The Python test still has many failures, but I'm out of time
for this now (already took much longer than hoped to get this far).
The base bz2 library does pass its own tests (see next).
CAUTION: People building on Windows have to download and build tne
bz2 compression libraries now. See PCbuild\readme.txt for complete
instructions.
Tim Peters [Sat, 9 Nov 2002 04:26:02 +0000 (04:26 +0000)]
BZ2Comp_compress(): changed decl of totalout to LONG_LONG, since it's
solely used to hold LONG_LONG values, and the compiler rightfully warns
about potential data loss otherwise.
[Bug #233259] Ugly traceback for DistutilsPlatformError
Fixed by catching all exceptions that are subclasses of DistutilsError,
so only the error message will be printed. You can still get the
whole traceback by enabling the Distutils debugging mode.
Tim Peters [Fri, 8 Nov 2002 05:26:52 +0000 (05:26 +0000)]
_update(): Commented the new obscurity. Materialized into a tuple
instead of into a list for a bit of speed/space savings. Reopened the
bug report too (628246), as I'm unclear on why we don't sort out the
cause of the TypeError instead.
The _update method detected mutable elements by trapping TypeErrors.
Unfortunately, this masked useful TypeErrors raised by the iterable
itself. For cases where it is possible for an iterable to raise
a TypeError, the iterable is pre-converted to a list outside the
try/except so that any TypeErrors propagate through.
Jack Jansen [Thu, 7 Nov 2002 23:07:05 +0000 (23:07 +0000)]
Got rid of the python.rsrc resource file. The error message strings and
dialogs are now stored in Mac/Lib, and loaded on demand through macresource.
Not only does this simplify a MacPython based on Apple's Python, but
it also makes Mac error codes come out symbolically when running command
line python (if you have Mac/Lib in your path).
The resource files are copied from Mac/Resources. The old ones will disappear
after the OS9 build procedure has been adjusted.
Thomas Heller [Thu, 7 Nov 2002 16:46:19 +0000 (16:46 +0000)]
Use dynamic linking for the SHGetSpecialFolderPath function, it is not
always available on Windows NT. When the function cannot be loaded,
get_special_folder_path raises OSError, "function not available".
This bug happened because: 1) the scanner_search and scanner_match methods
were not checking the buffer limits before increasing the current pointer;
and 2) SRE_SEARCH was using "if (ptr == end)" as a loop break, instead of
"if (ptr >= end)".
* Modules/_sre.c
(SRE_SEARCH): Check for "ptr >= end" to break loops, so that we don't
hang forever if a pointer passing the buffer limit is used.
(scanner_search,scanner_match): Don't increment the current pointer
if we're going to pass the buffer limit.