]> granicus.if.org Git - python/log
python
22 years agoMinor wording change.
Fred Drake [Thu, 28 Mar 2002 21:06:17 +0000 (21:06 +0000)]
Minor wording change.

22 years agoAdd _Py_AS_GC macro. It will be used by the trashcan code on object.c.
Neil Schemenauer [Thu, 28 Mar 2002 21:06:16 +0000 (21:06 +0000)]
Add _Py_AS_GC macro.  It will be used by the trashcan code on object.c.

22 years agoAdd missing "void" to function.
Neil Schemenauer [Thu, 28 Mar 2002 21:05:38 +0000 (21:05 +0000)]
Add missing "void" to function.

22 years agoAdd type cast.
Neil Schemenauer [Thu, 28 Mar 2002 21:04:14 +0000 (21:04 +0000)]
Add type cast.

22 years agoadd comment reminding people about class hierarchy in Doc/lib/libexcs.tex
Skip Montanaro [Thu, 28 Mar 2002 20:57:51 +0000 (20:57 +0000)]
add comment reminding people about class hierarchy in Doc/lib/libexcs.tex

22 years agoadd exception class hierarchy. This should probably be done differently,
Skip Montanaro [Thu, 28 Mar 2002 20:53:22 +0000 (20:53 +0000)]
add exception class hierarchy.  This should probably be done differently,
but at least the content is there.

22 years agoThis is Neil's fix for SF bug 535905 (Evil Trashcan and GC interaction).
Guido van Rossum [Thu, 28 Mar 2002 20:34:59 +0000 (20:34 +0000)]
This is Neil's fix for SF bug 535905 (Evil Trashcan and GC interaction).

The fix makes it possible to call PyObject_GC_UnTrack() more than once
on the same object, and then move the PyObject_GC_UnTrack() call to
*before* the trashcan code is invoked.

BUGFIX CANDIDATE!

22 years agoAllow a page break in a code longish example.
Fred Drake [Thu, 28 Mar 2002 20:19:23 +0000 (20:19 +0000)]
Allow a page break in a code longish example.

22 years agoFix an issue that was reported in but unrelated to the main problem of
Guido van Rossum [Thu, 28 Mar 2002 20:17:52 +0000 (20:17 +0000)]
Fix an issue that was reported in but unrelated to the main problem of
SF bug 535905 (Evil Trashcan and GC interaction).

The SETLOCAL() macro should not DECREF the local variable in-place and
then store the new value; it should copy the old value to a temporary
value, then store the new value, and then DECREF the temporary value.
This is because it is possible that during the DECREF the frame is
accessed by other code (e.g. a __del__ method or gc.collect()) and the
variable would be pointing to already-freed memory.

BUGFIX CANDIDATE!

22 years agoAdd documentation on the hasfree data object.
Fred Drake [Thu, 28 Mar 2002 19:34:53 +0000 (19:34 +0000)]
Add documentation on the hasfree data object.

22 years agoReindent.
Martin v. Löwis [Thu, 28 Mar 2002 16:26:40 +0000 (16:26 +0000)]
Reindent.

22 years agoAdd a simple test of the METH_CLASS and METH_STATIC flags for type methods.
Fred Drake [Thu, 28 Mar 2002 15:49:54 +0000 (15:49 +0000)]
Add a simple test of the METH_CLASS and METH_STATIC flags for type methods.

22 years agoPatch #536117: Typo in turtle.py.
Martin v. Löwis [Thu, 28 Mar 2002 15:45:57 +0000 (15:45 +0000)]
Patch #536117: Typo in turtle.py.
2.2.2 candidate.

22 years agoMinor consistency adjustments.
Fred Drake [Thu, 28 Mar 2002 12:40:45 +0000 (12:40 +0000)]
Minor consistency adjustments.

22 years agoPYMALLOC_DEBUG routines: The "check API family" gimmick was going nowhere
Tim Peters [Thu, 28 Mar 2002 07:32:11 +0000 (07:32 +0000)]
PYMALLOC_DEBUG routines:  The "check API family" gimmick was going nowhere
fast, and just cluttered the code.  Get rid of it for now.  If a compelling
case can be made for it, easy to restore it later.

22 years agoIntroduce two new flag bits that can be set in a PyMethodDef method
Fred Drake [Thu, 28 Mar 2002 05:33:33 +0000 (05:33 +0000)]
Introduce two new flag bits that can be set in a PyMethodDef method
descriptor, as used for the tp_methods slot of a type.  These new flag
bits are both optional, and mutually exclusive.  Most methods will not
use either.  These flags are used to create special method types which
exist in the same namespace as normal methods without having to use
tedious construction code to insert the new special method objects in
the type's tp_dict after PyType_Ready() has been called.

If METH_CLASS is specified, the method will represent a class method
like that returned by the classmethod() built-in.

If METH_STATIC is specified, the method will represent a static method
like that returned by the staticmethod() built-in.

These flags may not be used in the PyMethodDef table for modules since
these special method types are not meaningful in that case; a
ValueError will be raised if these flags are found in that context.

22 years agoIgnore new output directory.
Fred Drake [Wed, 27 Mar 2002 20:37:04 +0000 (20:37 +0000)]
Ignore new output directory.

22 years agoExpose C library's gettext. Fixes #516412.
Martin v. Löwis [Wed, 27 Mar 2002 18:49:02 +0000 (18:49 +0000)]
Expose C library's gettext. Fixes #516412.

22 years agoDestroy and unlink deleted NoteBook panes. Fixes #516703.
Martin v. Löwis [Wed, 27 Mar 2002 17:59:17 +0000 (17:59 +0000)]
Destroy and unlink deleted NoteBook panes. Fixes #516703.
2.2.2 candidate.

22 years agoadd seealso referring to site module doc where people can learn how to
Skip Montanaro [Wed, 27 Mar 2002 17:29:50 +0000 (17:29 +0000)]
add seealso referring to site module doc where people can learn how to
extend sys.path using .pth files.

22 years agoIgnore widgets with unknown names in winfo_children. Fixes #518283.
Martin v. Löwis [Wed, 27 Mar 2002 17:15:57 +0000 (17:15 +0000)]
Ignore widgets with unknown names in winfo_children. Fixes #518283.
2.2.2 candidate.

22 years agoRemove weakref free list. This has the side effect of fixing a memory
Neil Schemenauer [Wed, 27 Mar 2002 15:18:21 +0000 (15:18 +0000)]
Remove weakref free list.  This has the side effect of fixing a memory
management bug.  Also, move some duplicated code into the new_weakref
fucntion.

22 years agofix a typo in PyErr_Format table and add row for 'p' format char
Skip Montanaro [Wed, 27 Mar 2002 13:42:50 +0000 (13:42 +0000)]
fix a typo in PyErr_Format table and add row for 'p' format char
closes bug 534495

22 years agoChange sys_exit to use METH_VARARGS.
Neal Norwitz [Wed, 27 Mar 2002 13:03:09 +0000 (13:03 +0000)]
Change sys_exit to use METH_VARARGS.
sys.exit() now requires 0-1 arguments.  Previously 2+ arguments were allowed.

22 years agoDon't imply XPG4 constants from CODESET presence. Fixes #534153.
Martin v. Löwis [Wed, 27 Mar 2002 12:15:57 +0000 (12:15 +0000)]
Don't imply XPG4 constants from CODESET presence. Fixes #534153.
2.2.2 candiate.

22 years agofurther work on new config system;
Steven M. Gava [Wed, 27 Mar 2002 08:40:46 +0000 (08:40 +0000)]
further work on new config system;
recent files menu

22 years agoFill in this document a bit, adding reminders of items that should be included
Andrew M. Kuchling [Wed, 27 Mar 2002 02:29:48 +0000 (02:29 +0000)]
Fill in this document a bit, adding reminders of items that should be included

22 years agofurther work on new config system;
Steven M. Gava [Wed, 27 Mar 2002 02:25:44 +0000 (02:25 +0000)]
further work on new config system;
user defined help items

22 years ago_finally_ tracked down and eliminated a major problem
Steven M. Gava [Wed, 27 Mar 2002 00:51:53 +0000 (00:51 +0000)]
_finally_ tracked down and eliminated a major problem
in PyShell.py that was causing extreme headaches in
working on EditorWindow.py

22 years agoAdd the "What's New" document to the index of HTML documents.
Fred Drake [Tue, 26 Mar 2002 20:29:11 +0000 (20:29 +0000)]
Add the "What's New" document to the index of HTML documents.

22 years agoImplement iterator protocol.
Neil Schemenauer [Tue, 26 Mar 2002 20:28:40 +0000 (20:28 +0000)]
Implement iterator protocol.

22 years ago__init__(): We'll try to be more RFC 2821 compliant by providing for a
Barry Warsaw [Tue, 26 Mar 2002 20:27:35 +0000 (20:27 +0000)]
__init__(): We'll try to be more RFC 2821 compliant by providing for a
better local_hostname default.  According to RFC 2821, it is
recommended that the fqdn hostname be provided in the EHLO/HELO verb
and if that can't be calculated, to use a domain literal.

The rationale for this change is documented in SF patch #497736 which
also had privacy concerns about leaking the fqdn in the EHLO/HELO.  We
decided this wasn't a big concern because no user data is leaked, and
the IP will always be leaked.  The local_hostname argument is provided
for those clients that are super paranoid.

Using localhost.localdomain may break some strict smtp servers so we
decided against using it as the default.

22 years agoThe <link> to the stylesheet should include the type attribute.
Fred Drake [Tue, 26 Mar 2002 19:57:52 +0000 (19:57 +0000)]
The <link> to the stylesheet should include the type attribute.

22 years agoWire up the makefile to more fully support the "What's New" documents.
Fred Drake [Tue, 26 Mar 2002 19:53:56 +0000 (19:53 +0000)]
Wire up the makefile to more fully support the "What's New" documents.

22 years agoWire in the "What's New" document.
Fred Drake [Tue, 26 Mar 2002 19:18:18 +0000 (19:18 +0000)]
Wire in the "What's New" document.

22 years agoAdd a starter for the next "What's New" document.
Fred Drake [Tue, 26 Mar 2002 19:17:43 +0000 (19:17 +0000)]
Add a starter for the next "What's New" document.

22 years agoMake \url to force horizontal mode.
Fred Drake [Tue, 26 Mar 2002 19:14:41 +0000 (19:14 +0000)]
Make \url to force horizontal mode.

22 years agotime and socket were already imported in the module, no need to re-import
Neal Norwitz [Tue, 26 Mar 2002 16:25:01 +0000 (16:25 +0000)]
time and socket were already imported in the module, no need to re-import

22 years agore was already imported in the module, no need to re-import
Neal Norwitz [Tue, 26 Mar 2002 16:23:28 +0000 (16:23 +0000)]
re was already imported in the module, no need to re-import

22 years agoos was already imported in the module, no need to re-import
Neal Norwitz [Tue, 26 Mar 2002 16:21:52 +0000 (16:21 +0000)]
os was already imported in the module, no need to re-import

22 years agoCleanup x so it is not left in module
Neal Norwitz [Tue, 26 Mar 2002 16:20:26 +0000 (16:20 +0000)]
Cleanup x so it is not left in module

22 years agoMissed change METH_OLDARGS to METH_NOARGS for two aliased functions
Neal Norwitz [Tue, 26 Mar 2002 14:52:00 +0000 (14:52 +0000)]
Missed change METH_OLDARGS to METH_NOARGS for two aliased functions

22 years agoMake object browser work in OSX (by rewriting the old browser
Just van Rossum [Tue, 26 Mar 2002 12:06:11 +0000 (12:06 +0000)]
Make object browser work in OSX (by rewriting the old browser
LDEF in Python). If at all possible, this should go into 2.2.1.

22 years agooperate as a filter when no files or directories appear on the command line
Skip Montanaro [Tue, 26 Mar 2002 11:39:26 +0000 (11:39 +0000)]
operate as a filter when no files or directories appear on the command line

22 years agoFix for SF 502085.
Guido van Rossum [Tue, 26 Mar 2002 00:51:56 +0000 (00:51 +0000)]
Fix for SF 502085.
Don't die when issubclass(t, TypeType) fails.

Bugfix candidate (but I think it's too late for 2.2.1).

22 years agoRemove last occurrance of PyArg_GetInt. It is deprecated,
Neal Norwitz [Mon, 25 Mar 2002 22:23:53 +0000 (22:23 +0000)]
Remove last occurrance of PyArg_GetInt. It is deprecated,

22 years agoAdd a comment that PyArg_GetInt is deprecated and should not be used
Neal Norwitz [Mon, 25 Mar 2002 22:21:58 +0000 (22:21 +0000)]
Add a comment that PyArg_GetInt is deprecated and should not be used

22 years agomake default banner match what the real interpreter displays
Skip Montanaro [Mon, 25 Mar 2002 22:04:23 +0000 (22:04 +0000)]
make default banner match what the real interpreter displays

22 years agoremove unqualified excepts - catch ImportError when trying to import
Skip Montanaro [Mon, 25 Mar 2002 21:44:07 +0000 (21:44 +0000)]
remove unqualified excepts - catch ImportError when trying to import
readline and get rid of string exception fallback when showing syntax
errors.
see bug 411881

22 years agoeliminate unqualified except when checking for presence of LC_MESSAGES
Skip Montanaro [Mon, 25 Mar 2002 21:40:36 +0000 (21:40 +0000)]
eliminate unqualified except when checking for presence of LC_MESSAGES
see bug 411881

22 years agotighten up unqualified except in currentframe()
Skip Montanaro [Mon, 25 Mar 2002 21:37:54 +0000 (21:37 +0000)]
tighten up unqualified except in currentframe()
see bug 411881

22 years agoMissed change METH_OLDARGS to METH_NOARGS for two aliased functions
Neal Norwitz [Mon, 25 Mar 2002 21:05:50 +0000 (21:05 +0000)]
Missed change METH_OLDARGS to METH_NOARGS for two aliased functions

22 years agoRemove many uses of PyArg_NoArgs macro, change METH_OLDARGS to METH_NOARGS.
Neal Norwitz [Mon, 25 Mar 2002 20:46:46 +0000 (20:46 +0000)]
Remove many uses of PyArg_NoArgs macro, change METH_OLDARGS to METH_NOARGS.

22 years agoDocument the finditer() function and method.
Fred Drake [Mon, 25 Mar 2002 20:22:59 +0000 (20:22 +0000)]
Document the finditer() function and method.
This closes SF bug #520904.

Explain that many of the escapes supported by string literals are also
supported by the RE compiler, and list which ones.
This closes SF bug #529923.

22 years agoUpdate master Windows build-number list for 2.2.1c2.
Tim Peters [Mon, 25 Mar 2002 19:35:58 +0000 (19:35 +0000)]
Update master Windows build-number list for 2.2.1c2.

22 years agoAdd tests for the iterkeys, itervalues and iteritems
Walter Dörwald [Mon, 25 Mar 2002 18:36:32 +0000 (18:36 +0000)]
Add tests for the iterkeys, itervalues and iteritems
methods in dict-proxy objects.

22 years agoAdd missing methods iterkeys, itervalues and iteritems to
Walter Dörwald [Mon, 25 Mar 2002 17:43:22 +0000 (17:43 +0000)]
Add missing methods iterkeys, itervalues and iteritems to
dict-proxy objects.

Add real docstrings to all methods.

22 years agoAdded description of binhex.Error.
Fred Drake [Mon, 25 Mar 2002 16:37:56 +0000 (16:37 +0000)]
Added description of binhex.Error.

22 years agoInclude obmalloc.c in the build.
Jack Jansen [Mon, 25 Mar 2002 15:43:37 +0000 (15:43 +0000)]
Include obmalloc.c in the build.

22 years agoDue to interaction between the MSL C library and the GUSI I/O library I can get reads...
Jack Jansen [Mon, 25 Mar 2002 15:32:01 +0000 (15:32 +0000)]
Due to interaction between the MSL C library and the GUSI I/O library I can get reads from sockets to work consistently either for unbuffered binary files or for buffered binary files, but not for both:-(

The workaround is to force socket.makefile() to disable buffering for binary files.

Fixes bug 534625. 2.2.1 candidate.

22 years agoFix SF # 532618 517704, install problems when building modules fail.
Neal Norwitz [Mon, 25 Mar 2002 14:20:09 +0000 (14:20 +0000)]
Fix SF # 532618 517704, install problems when building modules fail.
Fix whitespace on a line also.

22 years agoFix whitespace.
Walter Dörwald [Mon, 25 Mar 2002 11:16:18 +0000 (11:16 +0000)]
Fix whitespace.

22 years agoRemove bug.py. This is something I sent to Guido via email in or before
Tim Peters [Mon, 25 Mar 2002 06:55:57 +0000 (06:55 +0000)]
Remove bug.py.  This is something I sent to Guido via email in or before
'94, demonstrating a thread bug that was later repaired via Python growing
an internal import lock.  It's of no current interest, and the now-std
test_threaded_import.py is pretty much the same test.

22 years agoI've been waiting 8 years for KSR to re-emerge from bankruptcy. If they
Tim Peters [Mon, 25 Mar 2002 06:49:10 +0000 (06:49 +0000)]
I've been waiting 8 years for KSR to re-emerge from bankruptcy.  If they
ever do, they can damn well #define _POSIX_THREADS their own damn selves.

22 years agoSMTP.__init__(): Fixed minor typo in docstring.
Barry Warsaw [Mon, 25 Mar 2002 04:00:38 +0000 (04:00 +0000)]
SMTP.__init__(): Fixed minor typo in docstring.

22 years agoWeaklink most toolbox modules, improving backward compatibility. Modules will no...
Jack Jansen [Mon, 25 Mar 2002 00:32:17 +0000 (00:32 +0000)]
Weaklink most toolbox modules, improving backward compatibility. Modules will no longer fail to load if a single routine is missing on the curent OS version, in stead calling the missing routine will raise an exception.

Should finally fix 531398. 2.2.1 candidate.

22 years agoQuote href properly.
Neil Schemenauer [Sun, 24 Mar 2002 23:11:21 +0000 (23:11 +0000)]
Quote href properly.

22 years agoWeaklink most toolbox modules, improving backward compatibility. Modules will no...
Jack Jansen [Sun, 24 Mar 2002 23:04:18 +0000 (23:04 +0000)]
Weaklink most toolbox modules, improving backward compatibility. Modules will no longer fail to load if a single routine is missing on the curent OS version, in stead calling the missing routine will raise an exception.

Should finally fix 531398. 2.2.1 candidate.

Also blacklisted some constants with definitions that were not Python-compatible.

22 years agoRemove unnecessary \b. It was causing the RE to miss the tailing
Neil Schemenauer [Sun, 24 Mar 2002 23:02:07 +0000 (23:02 +0000)]
Remove unnecessary \b.  It was causing the RE to miss the tailing
slash on strings like "http://www.python.org/ is good".

22 years agoWeaklink most toolbox modules, improving backward compatibility. Modules will no...
Jack Jansen [Sun, 24 Mar 2002 22:59:16 +0000 (22:59 +0000)]
Weaklink most toolbox modules, improving backward compatibility. Modules will no longer fail to load if a single routine is missing on the curent OS version, in stead calling the missing routine will raise an exception.

Should finally fix 531398. 2.2.1 candidate.

22 years agoExpose RLIM_INFINITY constant. Closes SF patch 489066.
Neil Schemenauer [Sun, 24 Mar 2002 22:27:39 +0000 (22:27 +0000)]
Expose RLIM_INFINITY constant.  Closes SF patch 489066.

22 years agoIf possible, set FD_CLOEXEC flag on file descriptors opened using
Neil Schemenauer [Sun, 24 Mar 2002 22:21:48 +0000 (22:21 +0000)]
If possible, set FD_CLOEXEC flag on file descriptors opened using
TemporaryFile.  This flag causes the fd to be closed on exec().

22 years agotighten up except - os.close only raises OSError
Skip Montanaro [Sun, 24 Mar 2002 20:48:26 +0000 (20:48 +0000)]
tighten up except - os.close only raises OSError
see bug 411881

22 years agoSF bug 480215: softspace confused in nested print
Tim Peters [Sun, 24 Mar 2002 19:25:00 +0000 (19:25 +0000)]
SF bug 480215:  softspace confused in nested print
This fixes the symptom, but PRINT_ITEM has no way to know what (if
anything) PyFile_WriteObject() writes unless the object being printed
is a string.  When the object isn't a string, this fix retains the
guess that softspace should be set after PyFile_WriteObject().
We might want to say that it's the job of filelike-object write methods
to leave the file's softspace in the correct state.  That would probably
be better -- but everyone relies on PRINT_ITEM to guess for them now.

22 years agooops - export InvalidURL in __all__
Skip Montanaro [Sun, 24 Mar 2002 16:56:45 +0000 (16:56 +0000)]
oops - export InvalidURL in __all__

22 years agodocument InvalidURL exception
Skip Montanaro [Sun, 24 Mar 2002 16:55:57 +0000 (16:55 +0000)]
document InvalidURL exception

22 years agoadd test for InvalidURL
Skip Montanaro [Sun, 24 Mar 2002 16:54:38 +0000 (16:54 +0000)]
add test for InvalidURL

22 years agoadd test of InvalidURL
Skip Montanaro [Sun, 24 Mar 2002 16:54:16 +0000 (16:54 +0000)]
add test of InvalidURL

22 years agoadd InvalidURL exception - raised if port is given but empty or non-numeric
Skip Montanaro [Sun, 24 Mar 2002 16:53:50 +0000 (16:53 +0000)]
add InvalidURL exception - raised if port is given but empty or non-numeric

22 years agotighten up except - in this context, AttributeError is the only exception
Skip Montanaro [Sun, 24 Mar 2002 16:34:21 +0000 (16:34 +0000)]
tighten up except - in this context, AttributeError is the only exception
that can be raised - do_help won't be called if arg is not a string

22 years agoAdd local_hostname to SMTP.__init__().
Neil Schemenauer [Sun, 24 Mar 2002 15:41:40 +0000 (15:41 +0000)]
Add local_hostname to SMTP.__init__().

22 years agoAdd local_hostname option to SMTP.__init__. If supplied, it is used
Neil Schemenauer [Sun, 24 Mar 2002 15:30:40 +0000 (15:30 +0000)]
Add local_hostname option to SMTP.__init__.  If supplied, it is used
as the fully qualified local hostname.

22 years agoTry /var/mail before trying /usr/mail. Most new systems use /var.
Neil Schemenauer [Sun, 24 Mar 2002 01:38:38 +0000 (01:38 +0000)]
Try /var/mail before trying /usr/mail.  Most new systems use /var.
This in inside the test so it really doesn't matter much.  Closes
SF patch 497097.

22 years agoAdd more tests for built-in types. Add tests for buffer objects.
Neil Schemenauer [Sun, 24 Mar 2002 01:24:54 +0000 (01:24 +0000)]
Add more tests for built-in types.  Add tests for buffer objects.
Closes SF patch 494871.

22 years agoAdd get_history_item, get_current_history_length, and redisplay functions.
Neil Schemenauer [Sun, 24 Mar 2002 01:09:04 +0000 (01:09 +0000)]
Add get_history_item, get_current_history_length, and redisplay functions.
Clarify the docstring for get_history_length.  Closes SF patch 494066.

22 years ago_PyMalloc_DebugRealloc(): simplify decl of "fresh".
Tim Peters [Sun, 24 Mar 2002 00:34:21 +0000 (00:34 +0000)]
_PyMalloc_DebugRealloc():  simplify decl of "fresh".

Assorted:  bump the serial number via a trivial new bumpserialno()
function.  The point is to give a single place to set a breakpoint when
waiting for a specific serial number.

22 years agoUse linecache for loading source code. Closes SF patch 490374.
Neil Schemenauer [Sat, 23 Mar 2002 23:51:04 +0000 (23:51 +0000)]
Use linecache for loading source code.  Closes SF patch 490374.

22 years agoAdd namespace selection for rlcompleter. Closes SF patch 490026.
Neil Schemenauer [Sat, 23 Mar 2002 23:44:51 +0000 (23:44 +0000)]
Add namespace selection for rlcompleter.  Closes SF patch 490026.

22 years agoMinor code cleanup -- no semantic changes.
Tim Peters [Sat, 23 Mar 2002 22:28:18 +0000 (22:28 +0000)]
Minor code cleanup -- no semantic changes.

22 years agoFix example for PyErr_SetFromErrno() (need to pass exception type).
Neil Schemenauer [Sat, 23 Mar 2002 20:57:11 +0000 (20:57 +0000)]
Fix example for PyErr_SetFromErrno() (need to pass exception type).

22 years agoFix wording of sys.exit docstring. Close SF bug 534113.
Neil Schemenauer [Sat, 23 Mar 2002 20:46:35 +0000 (20:46 +0000)]
Fix wording of sys.exit docstring.  Close SF bug 534113.

22 years agoFlush stdout before reading next command. Closes SF bug 526357.
Neil Schemenauer [Sat, 23 Mar 2002 20:43:59 +0000 (20:43 +0000)]
Flush stdout before reading next command.  Closes SF bug 526357.

22 years agoGrow the string buffer at a mildly exponential rate for the getc version
Neil Schemenauer [Sat, 23 Mar 2002 19:41:34 +0000 (19:41 +0000)]
Grow the string buffer at a mildly exponential rate for the getc version
of get_line.  This makes test_bufio finish in 1.7 seconds instead of 57
seconds on my machine (with Py_DEBUG defined).

Also, rename the local variables n1 and n2 to used_v_size and
total_v_size.

22 years agoGive Python a debug-mode pymalloc, much as sketched on Python-Dev.
Tim Peters [Sat, 23 Mar 2002 10:03:50 +0000 (10:03 +0000)]
Give Python a debug-mode pymalloc, much as sketched on Python-Dev.

When WITH_PYMALLOC is defined, define PYMALLOC_DEBUG to enable the debug
allocator.  This can be done independent of build type (release or debug).
A debug build automatically defines PYMALLOC_DEBUG when pymalloc is
enabled.  It's a detected error to define PYMALLOC_DEBUG when pymalloc
isn't enabled.

Two debugging entry points defined only under PYMALLOC_DEBUG:

+ _PyMalloc_DebugCheckAddress(const void *p) can be used (e.g., from gdb)
  to sanity-check a memory block obtained from pymalloc.  It sprays
  info to stderr (see next) and dies via Py_FatalError if the block is
  detectably damaged.

+ _PyMalloc_DebugDumpAddress(const void *p) can be used to spray info
  about a debug memory block to stderr.

A tiny start at implementing "API family" checks isn't good for
anything yet.

_PyMalloc_DebugRealloc() has been optimized to do little when the new
size is <= old size.  However, if the new size is larger, it really
can't call the underlying realloc() routine without either violating its
contract, or knowing something non-trivial about how the underlying
realloc() works.  A memcpy is always done in this case.

This was a disaster for (and only) one of the std tests:  test_bufio
creates single text file lines up to a million characters long.  On
Windows, fileobject.c's get_line() uses the horridly funky
getline_via_fgets(), which keeps growing and growing a string object
hoping to find a newline.  It grew the string object 1000 bytes each
time, so for a million-character string it took approximately forever
(I gave up after a few minutes).

So, also:

fileobject.c, getline_via_fgets():  When a single line is outrageously
long, grow the string object at a mildly exponential rate, instead of
just 1000 bytes at a time.

That's enough so that a debug-build test_bufio finishes in about 5 seconds
on my Win98SE box.  I'm curious to try this on Win2K, because it has very
different memory behavior than Win9X, and test_bufio always took a factor
of 10 longer to complete on Win2K.  It *could* be that the endless
reallocs were simply killing it on Win2K even in the release build.

22 years agoOnly AttributeError can be raised in this situation - on systems without
Skip Montanaro [Sat, 23 Mar 2002 05:58:52 +0000 (05:58 +0000)]
Only AttributeError can be raised in this situation - on systems without
getuid or getpid.  posix_getuid & posix_getpid never raise exceptions when
called with no args.

22 years agoimport statements only raise ImportError, right?
Skip Montanaro [Sat, 23 Mar 2002 05:55:18 +0000 (05:55 +0000)]
import statements only raise ImportError, right?

22 years agotighten up except - only ValueError can be raised in this situation
Skip Montanaro [Sat, 23 Mar 2002 05:50:17 +0000 (05:50 +0000)]
tighten up except - only ValueError can be raised in this situation

22 years agotighten up except - int() only raises ValueError
Skip Montanaro [Sat, 23 Mar 2002 05:47:31 +0000 (05:47 +0000)]
tighten up except - int() only raises ValueError

22 years agoadded RFC 2396 tests from Aaron Swartz included in bug # 450225.
Skip Montanaro [Sat, 23 Mar 2002 05:32:10 +0000 (05:32 +0000)]
added RFC 2396 tests from Aaron Swartz included in bug # 450225.
converted to use unittest

22 years agono longer needed - converted test_urlparse.py to use unittest
Skip Montanaro [Sat, 23 Mar 2002 05:29:59 +0000 (05:29 +0000)]
no longer needed - converted test_urlparse.py to use unittest