Tim Peters [Sat, 2 Mar 2002 08:43:19 +0000 (08:43 +0000)]
Whether platform malloc(0) returns NULL has nothing to do with whether
platform realloc(p, 0) returns NULL, so MALLOC_ZERO_RETURNS_NULL can
be correctly undefined yet realloc(p, 0) can return NULL anyway.
Prevent realloc(p, 0) doing free(p) and returning NULL via a different
hack. Would probably be better to get rid of MALLOC_ZERO_RETURNS_NULL
entirely.
Tim Peters [Sat, 2 Mar 2002 04:33:09 +0000 (04:33 +0000)]
For clarity, change _longobject to build directly from PyObject_VAR_HEAD
instead of faking it by hand. It *is* a var object, and nothing but
hysterical raisins to pretend it's an oddball.
Barry Warsaw [Fri, 1 Mar 2002 22:39:14 +0000 (22:39 +0000)]
Added PortableUnixMailbox to the __all__ variable, and in the __main__
section use this class instead of UnixMailbox as per the comments in
the latter's class.
SF patch 514641 (Naofumi Honda) - Negative ob_size of LongObjects
Due to the bizarre definition of _PyLong_Copy(), creating an instance
of a subclass of long with a negative value could cause core dumps
later on. Unfortunately it looks like the behavior of _PyLong_Copy()
is quite intentional, so the fix is more work than feels comfortable.
This fix is almost, but not quite, the code that Naofumi Honda added;
in addition, I added a test case.
Tim Peters [Thu, 28 Feb 2002 21:34:34 +0000 (21:34 +0000)]
SF patch 522961: Leak in Python/thread_nt.h, from Gerald S. Williams.
A file-static "threads" dict mapped thread IDs to Windows handles, but
was never referenced, and entries never got removed. This gets rid of
the YAGNI-dict entirely.
Bugfix candidate.
Tim Peters [Thu, 28 Feb 2002 19:38:51 +0000 (19:38 +0000)]
PyGC_Head: Use "long double" instead of "double" as the worst-case
alignment gimmick. David Abrahams notes that the standard "long double"
actually requires stricter alignment than "double" on some Tru64 box.
On my box and yours <wink>, it's the same, so no harm done on most
boxes.
Martin v. Löwis [Thu, 28 Feb 2002 15:24:47 +0000 (15:24 +0000)]
Correct various errors:
- Use substring search, not re search for user-agent and paths.
- Consider * entry last. Unquote, then requote URLs.
- Treat empty Disallow as "allow everything".
Add test cases. Fixes #523041
Guido van Rossum [Tue, 26 Feb 2002 22:39:23 +0000 (22:39 +0000)]
SF patch #523169, by Samuele Pedroni.
There were never tests for the fact that list() always returns a *new*
list object, even when the argument is a list, while tuple() may
return a reference to the argument when it is a tuple. Now there are.
Andrew MacIntyre [Tue, 26 Feb 2002 11:41:34 +0000 (11:41 +0000)]
OS/2 EMX port changes (Python part of patch #450267):
Python/
dynload_shlib.c // EMX port emulates dlopen() etc. for DL extensions
import.c // changes to support 8.3 DLL name limit (VACPP+EMX)
// and case sensitive import semantics
importdl.h
thread_os2.h
Andrew MacIntyre [Tue, 26 Feb 2002 11:36:35 +0000 (11:36 +0000)]
OS/2 EMX port changes (Objects part of patch #450267):
Objects/
fileobject.c
stringobject.c
unicodeobject.c
This commit doesn't include the cleanup patches for stringobject.c and
unicodeobject.c which are shown separately in the patch manager. Those
patches will be regenerated and applied in a subsequent commit, so as
to preserve a fallback position (this commit to those files).
Guido van Rossum [Mon, 25 Feb 2002 23:23:24 +0000 (23:23 +0000)]
canonic(): Fix by Edward K Ream to make breakpoints work better on
Windows: apply normcase() as well as abspath(). (Note: this isn't
needed to make IDLE work, but it's a good idea anyway.)
Tim Peters [Sat, 23 Feb 2002 04:40:15 +0000 (04:40 +0000)]
SF bug #501591: dir() doc is old
Bugfix candidate.
+ Updated dir() description to match actual 2.2 behavior.
+ Replaced the dir(sys) example with dir(struct), because the former
was way out of date and is bound to change frequently, while the
latter is stable.
+ Added a note cautioning that dir() is supplied primarily for
convenience at an interactive prompt (hoping to discourage its
use as the foundation of introspective code outside the core).
Andrew MacIntyre [Fri, 22 Feb 2002 11:06:30 +0000 (11:06 +0000)]
Create and populate OS/2 EMX port platform specific library directory:
Lib/plat-os2emx/
IN.py
SOCKET.py
grp.py
pwd.py // pwd module that can process real passwd files
regen
Thomas Heller [Wed, 20 Feb 2002 08:01:19 +0000 (08:01 +0000)]
First version which runs an install-script (specified by the
--install-script ... command line option to bdist_wininst) at the end
of the installation and at the start of deinstallation. Output
(stdout, stderr) of the script (if any) is displayed in the last
screen at installation, or in a simple message box at deinstallation.
sys.argv[1] for the script will contain '-install' at installation
time or '-remove' at deinstallation time.
The installation script runs in an environment (embedded by the
bdist_wininst runtime) where an additional function is available as
builtin:
Tim Peters [Tue, 19 Feb 2002 04:25:19 +0000 (04:25 +0000)]
Somebody made list.__dict__ grow a '__doc__' key, but apparently didn't
run the test suite afterwards. Either that, or whether '__doc__' shows
up is platform-dependent!
Neil Schemenauer [Sun, 17 Feb 2002 19:10:14 +0000 (19:10 +0000)]
Move some opcodes to top of big eval_frame switch statement. Skip
things_to_do block for a few common opcodes that don't do any real
work. Closes SF patch #512256.
Tim Peters [Sun, 17 Feb 2002 07:03:05 +0000 (07:03 +0000)]
SF bug #497839: reindent chokes on empty first lines.
Reindenter.run(): copy over initial all-whitespace lines (if any, and
after normalizing to remove trailing blanks and tabs).
Bugfix candidate.
Tim Peters [Sun, 17 Feb 2002 04:25:24 +0000 (04:25 +0000)]
Repair so that importing socket doesn't blow up on platforms that lack
SSL support. test_socket.py passes again on Windows.
Added an XXX about adding _ssl exports to the __all__ list (it doesn't
appear to be doing anything about that now, but since I don't have SSL
on this box I can't really tell).
Tim Peters [Sun, 17 Feb 2002 04:13:21 +0000 (04:13 +0000)]
Moved the declaration of PySocketSock_Type from socketmodule.h to
socketmodule.c. No code outside of the .c file references it, so it
doesn't belong the .h file (at least not yet ...), and declaring it
an imported symbol in the .h file can't be made to work on Windows (it's
a cross-DLL symbol then) without substantial code rewriting. Also
repaired the comment that goes along with the decl, to stop referring
to names and functions that haven't existed for 7 years <wink>.
socketmodule.c compiles cleanly on Windows again. The test_socket dies
at once, though (later).
Tim Peters [Sun, 17 Feb 2002 03:58:51 +0000 (03:58 +0000)]
For readability, switch to tab indents; was using a mix of tab indents,
4-space indents, and ambiguous space+tab indents. Added an XXX comment
about a confusing part. Still doesn't build on Windows.
Martin v. Löwis [Sat, 16 Feb 2002 23:06:19 +0000 (23:06 +0000)]
The Grande 'sendall()' patch, copied from release21-maint. Fixes #516715.
Replaces calls to socket.send() (which isn't guaranteed to send all data)
with the new socket.sendall() method.
Break SSL support out of _socket module and place it into a new
helper module _ssl.
The support for the RAND_* APIs in _ssl is now only enabled
for OpenSSL 0.9.5 and up since they were added in that
release.
Note that socketmodule.* should really be renamed to _socket.* --
unfortunately, this seems to lose the CVS history of the file.
Please review and test... I was only able to test the header file
chaos in socketmodule.c/h on Linux. The test run through fine
and compiles don't give errors or warnings.
WARNING: This patch does *not* include changes to the various
non-Unix build process files.
Tim Peters [Sat, 16 Feb 2002 07:26:27 +0000 (07:26 +0000)]
SF bug #516372: test_thread: unhandled exc. in thread
Fix exit races in test_thread.py and test_threaded_import.py.
I suspect the bug is provokable only under Linux (where child threads
seem to get lots of cycles before they get killed after the main thread
exits), or on multi-processor machines running other OSes.
Bugfix candidate.
Tim Peters [Wed, 13 Feb 2002 23:56:46 +0000 (23:56 +0000)]
Finish the pyexpat rework for Windows: builders needn't suck down the
Expat installer from SF anymore, and the installer shouldn't install
expat.dll anymore.
Tim Peters [Wed, 13 Feb 2002 05:14:18 +0000 (05:14 +0000)]
Windows time_clock(): rewrite to get rid of horrid casting tricks.
Don't blame Mark! The horrid casting tricks were my idea to begin with.
The rewrite works fine under VC6, and I *expect* will work fine under VC7.
Jack Jansen [Tue, 12 Feb 2002 21:30:53 +0000 (21:30 +0000)]
Two OSX fixes related to switching Python versions in an existing sourcetree:
- Create the Python.framework/Versions/$(VERSION) dir if it doesn't exist
- Override existing symlinks in the framework.