Fred Drake [Thu, 4 Apr 2002 20:41:34 +0000 (20:41 +0000)]
Support manual proxy configuration for simple urlopen() operations.
This change is similar to the supplied patch, but does not save the opener
when a proxy configuration is specified.
This closes SF patch #523415.
Tim Peters [Thu, 4 Apr 2002 20:02:04 +0000 (20:02 +0000)]
SF bug 497854: Short-cuts missing for All Users
Fix Windows-specific install glitch. Tested on Win2K, but I can't test
on XP.
Already checked in to the release22-maint branch.
Fred Drake [Thu, 4 Apr 2002 17:57:08 +0000 (17:57 +0000)]
Avoid creating circular references between the ExpatParser and the
ContentHandler. While GC will eventually clean up, it can take longer than
normal for applications that create a lot of strings (or other immutables)
rather without creating many containers.
This closes SF bug #535474.
Removed old Digital Creations copyright/license notices (with
permission from Paul Everitt). Also removed a few other references to
Digital Creations and changed the remaining ones to Zope Corporation.
Clarifying code rearrangement and comments by David Abrahams. I've
got to admit that I haven't reviewed this carefully, but it looks okay
from 30,000 views, and doesn't break anything. (SF patch 536407.)
Tim Peters [Thu, 4 Apr 2002 04:44:32 +0000 (04:44 +0000)]
_PyMalloc_{Malloc, Realloc}: Strive to meet the doc's promises about
what these do given a 0 size argument. This is so that when pymalloc
is enabled, we don't need to wrap pymalloc calls in goofy little
routines special-casing 0. Note that it's virtually impossible to meet
the doc's promise that malloc(0) will never return NULL; this makes a
best effort, but not an insane effort. The code does promise that
realloc(not-NULL, 0) will never return NULL (malloc(0) is much harder).
_PyMalloc_Realloc: Changed to take over all requests for 0 bytes, and
rearranged to be a little quicker in expected cases.
All over the place: when resorting to the platform allocator, call
free/malloc/realloc directly, without indirecting thru macros. This
should avoid needing a nightmarish pile of #ifdef-ery if PYMALLOC_DEBUG
is changed so that pymalloc takes over all Py(Mem, Object} memory
operations (which would add useful debugging info to PyMem_xyz
allocations too).
Add the 'bool' type and its values 'False' and 'True', as described in
PEP 285. Everything described in the PEP is here, and there is even
some documentation. I had to fix 12 unit tests; all but one of these
were printing Boolean outcomes that changed from 0/1 to False/True.
(The exception is test_unicode.py, which did a type(x) == type(y)
style comparison. I could've fixed that with a single line using
issubtype(x, type(y)), but instead chose to be explicit about those
places where a bool is expected.
Still to do: perhaps more documentation; change standard library
modules to return False/True from predicates.
Jack Jansen [Wed, 3 Apr 2002 21:52:10 +0000 (21:52 +0000)]
e macresource.need() to open the W resource file in the application init
code (if it isn't open already).
PythonIDE still opens the resource file "manually" because it also uses
presence of the CURS resource to determine whether it needs to adjust
sys.path.
Mark Hammond [Wed, 3 Apr 2002 01:47:00 +0000 (01:47 +0000)]
Fix bugs:
457466: popenx() argument mangling hangs python
226766: popen('python -c"...."') tends to hang
Fixes argument quoting in w9xpopen.exe for Windows 9x. w9xpopen.exe
also never attempts to display a MessageBox when not executed
interactively.
Added test_popen() test. This test currently just executes
"python -c ..." as a child process, and checks that the expected
arguments were all recieved correctly by the child process. This
test succeeds for me on Win9x, win2k and Linux, and I hope it does
for other popen supported platforms too :)
Fred Drake [Mon, 1 Apr 2002 23:56:03 +0000 (23:56 +0000)]
Make test_commands work on more systems. This removes much of the dependency
on how a system is configured.
This closes SF bug #497160 (which has the patch) and #460613.
Fred Drake [Mon, 1 Apr 2002 23:30:47 +0000 (23:30 +0000)]
Explain that os.spawn*() return the process handle on Windows.
Clarify that os.waitpid() on Windows takes a process handle, not a process ID.
This closes SF bug #537582.
Jeremy Hylton [Mon, 1 Apr 2002 21:33:55 +0000 (21:33 +0000)]
Restore a minimal definition of execution frame, since other parts of
the manual refer to it.
XXX Not sure that it belongs in this section, or that the concept is
particularly important for writing documentation. Perhaps references
to the frame should be removed entirely.
Jeremy Hylton [Mon, 1 Apr 2002 20:38:01 +0000 (20:38 +0000)]
Update docs for nested scopes.
Replace section 4.1 with section A.3.
The new section 4.1 is titled "Naming and binding." It includes the
text of section A.3 augmented with some of the detailed text from the
old section 4.1.
The \dfn, \index stuff is probably wrong, but I tried.
Also update other parts of appendix A to mention that nested scopes
and generators are standard features.
Tim Peters [Mon, 1 Apr 2002 19:23:44 +0000 (19:23 +0000)]
Restructured my pool-management overview in terms of the three
possible pool states. I think it's much clearer now.
Added a new long overdue block-management overview comment block.
I believe the comments are in good shape now.
Added two comments about possible small optimizations (one getting rid
of runtime multiplications at the cost of a new pool_header member; the
other getting rid of runtime divisions and the pool_header capacity
member, at the cost of a static const vector of 32 uints).
Jeremy Hylton [Mon, 1 Apr 2002 18:53:36 +0000 (18:53 +0000)]
Update documentation of code objects.
Split the description of co_flags into two paragraphs. The first
describes the flags that are used for non-future purposes, where
CO_GENERATOR was added. The second describes __future__'s use of
co_flags and mentions the only one currently meaningful,
CO_FUTURE_DIVISION.
Tim Peters [Mon, 1 Apr 2002 06:04:21 +0000 (06:04 +0000)]
New PYMALLOC_DEBUG function void _PyMalloc_DebugDumpStats(void).
This displays stats about the # of arenas, pools, blocks and bytes, to
stderr, both used and reserved but unused.
CAUTION: Because PYMALLOC_DEBUG is on, the debug malloc routine adds
16 bytes to each request. This makes each block appear two size classes
higher than it would be if PYMALLOC_DEBUG weren't on.
So far, playing with this confirms the obvious: there's a lot of activity
in the "small dict" size class, but nothing in the core makes any use of
the 8-byte or 16-byte classes.
Guido van Rossum [Sun, 31 Mar 2002 23:38:48 +0000 (23:38 +0000)]
Hopeful fix for SF bug 503031: urllib.py: open_http() host problem.
I really can't test this, but from reading the discussion in that bug
report, it's likely that this works. It may also close a whole bunch
of other bug reports related to urllib and proxies on Windows, but who
knows.
Jack Jansen [Sun, 31 Mar 2002 22:01:33 +0000 (22:01 +0000)]
Added a "run with commandline Python" flag. Works in MachoPython, should work
in OSX MacPython (untested), and should be disabled/removed in OS9 (but
that doesn't happen yet).
Neal Norwitz [Sun, 31 Mar 2002 15:27:00 +0000 (15:27 +0000)]
Remove METH_OLDARGS:
Convert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple
Convert METH_OLDARGS -> METH_NOARGS: remove args parameter
Please review. All tests pass, but some modules don't have tests.
I spot checked various functions to try to make sure nothing broke.
Tim Peters [Sun, 31 Mar 2002 02:18:01 +0000 (02:18 +0000)]
_PyMalloc_Free(): As was already done for _PyMalloc_Malloc, rearranged
the code so that the most frequent cases come first. Added comments.
Found a hidden assumption that a pool contains room for at least two
blocks, and added an assert to catch a violation if it ever happens in
a place where that matters. Gave the normal "I allocated this block"
case a longer basic block to work with before it has to do its first
branch (via breaking apart an embedded assignment in an "if", and
hoisting common code out of both branches).