]> granicus.if.org Git - python/log
python
20 years agoWarn that settrace() is implementation rather than language
Phillip J. Eby [Thu, 5 Aug 2004 12:13:46 +0000 (12:13 +0000)]
Warn that settrace() is implementation rather than language
definition, per Guido's request  in off-list email.

20 years agoThis commit was manufactured by cvs2svn to create tag 'r24a2'. v2.4a2
cvs2svn [Thu, 5 Aug 2004 07:21:01 +0000 (07:21 +0000)]
This commit was manufactured by cvs2svn to create tag 'r24a2'.

20 years agorelease date
Anthony Baxter [Thu, 5 Aug 2004 07:21:01 +0000 (07:21 +0000)]
release date

20 years agoDoc/lib/libfuncs.tex: correct items in itemize
Matthias Klose [Wed, 4 Aug 2004 23:18:49 +0000 (23:18 +0000)]
Doc/lib/libfuncs.tex: correct items in itemize
Doc/dist/dist.tex: avoid uncommenting the verbose environment (by the py2texi tool)

20 years agoadd constants for many error values added over the past couple of
Fred Drake [Wed, 4 Aug 2004 22:28:16 +0000 (22:28 +0000)]
add constants for many error values added over the past couple of
years

20 years agoExample.__init__: this cannot use assert, because that fails to trigger
Tim Peters [Wed, 4 Aug 2004 20:04:32 +0000 (20:04 +0000)]
Example.__init__:  this cannot use assert, because that fails to trigger
in a -O run, and so test_doctest was failing under -O.  Simple cause,
simple cure.

20 years agoEdward Loper's cool and massive refactoring of doctest.py, merged from
Tim Peters [Wed, 4 Aug 2004 18:46:34 +0000 (18:46 +0000)]
Edward Loper's cool and massive refactoring of doctest.py, merged from
the tim-doctest-merge-24a2 tag on the the tim-doctest-branch branch.
We did development on the branch in case it wouldn't land in time for
2.4a2, but the branch looked good:  Edward's tests passed there, ditto
Python's tests, and ditto the Zope3 tests.  Together, those hit doctest
heavily.

20 years agoAdd a proper pointer to SF bug item.
Hye-Shik Chang [Wed, 4 Aug 2004 17:40:38 +0000 (17:40 +0000)]
Add a proper pointer to SF bug item.

20 years agoSF #941229: Decode source code with sys.stdin.encoding in interactive
Hye-Shik Chang [Wed, 4 Aug 2004 17:36:41 +0000 (17:36 +0000)]
SF #941229: Decode source code with sys.stdin.encoding in interactive
modes like non-interactive modes.  This allows for non-latin-1 users
to write unicode strings directly and sets Japanese users free from
weird manual escaping <wink> in shift_jis environments.
(Reviewed by Martin v. Loewis)

20 years agoAdd a missing decref -- PyErr_SetObject increfs the 'object'!
Michael W. Hudson [Wed, 4 Aug 2004 14:59:00 +0000 (14:59 +0000)]
Add a missing decref -- PyErr_SetObject increfs the 'object'!

20 years agoFix a leak of a reference on None.
Michael W. Hudson [Wed, 4 Aug 2004 14:33:28 +0000 (14:33 +0000)]
Fix a leak of a reference on None.

20 years agoTo ever run this test "you must import TestSkipped" from the right
Michael W. Hudson [Wed, 4 Aug 2004 14:22:56 +0000 (14:22 +0000)]
To ever run this test "you must import TestSkipped" from the right
place! (can that please be it for silly mistakes in this file? :-) I
know I started it, but...).

Also, rearrangements to run repeatedly.

20 years agoBump buildno for 2.4a2
Martin v. Löwis [Wed, 4 Aug 2004 13:42:43 +0000 (13:42 +0000)]
Bump buildno for 2.4a2

20 years agoRevert 2.312; turns out interning the file name did do some good (reducing
Michael W. Hudson [Wed, 4 Aug 2004 10:26:08 +0000 (10:26 +0000)]
Revert 2.312; turns out interning the file name did do some good (reducing
.pyc size) after all.

20 years agoUpdated Logger.log() docstring to clarify that lvl parameter should be an integer.
Vinay Sajip [Wed, 4 Aug 2004 08:38:08 +0000 (08:38 +0000)]
Updated Logger.log() docstring to clarify that lvl parameter should be an integer.

20 years agoUpdated Logger.log() documentation to clarify that lvl parameter should be an integer.
Vinay Sajip [Wed, 4 Aug 2004 08:36:44 +0000 (08:36 +0000)]
Updated Logger.log() documentation to clarify that lvl parameter should be an integer.

20 years agoClose handlers and tidy up loggers by removing closed handlers - to avoid problems...
Vinay Sajip [Wed, 4 Aug 2004 08:29:14 +0000 (08:29 +0000)]
Close handlers and tidy up loggers by removing closed handlers - to avoid problems when run twice (SF #1002537)

20 years agoRemove .width() and .iswide() from UserString as well.
Hye-Shik Chang [Wed, 4 Aug 2004 08:01:06 +0000 (08:01 +0000)]
Remove .width() and .iswide() from UserString as well.

20 years agoSF #989185: Drop unicode.iswide() and unicode.width() and add
Hye-Shik Chang [Wed, 4 Aug 2004 07:38:35 +0000 (07:38 +0000)]
SF #989185: Drop unicode.iswide() and unicode.width() and add
unicodedata.east_asian_width().  You can still implement your own
simple width() function using it like this:
    def width(u):
        w = 0
        for c in unicodedata.normalize('NFC', u):
            cwidth = unicodedata.east_asian_width(c)
            if cwidth in ('W', 'F'): w += 2
            else: w += 1
        return w

20 years agoAdd a workaround for a problem that UTF-8 strings can be corrupted
Hye-Shik Chang [Wed, 4 Aug 2004 06:33:51 +0000 (06:33 +0000)]
Add a workaround for a problem that UTF-8 strings can be corrupted
or broken by basic ctype functions in 4.4BSD descendants.  This
will be fixed in their future development branches but they'll keep
the POSIX-incompatibility for their backward-compatiblities in near
future.

20 years agoWhitespace normalization.
Tim Peters [Wed, 4 Aug 2004 02:36:18 +0000 (02:36 +0000)]
Whitespace normalization.

20 years agotest_threadsignals is an expected skip on win32.
Tim Peters [Wed, 4 Aug 2004 02:32:03 +0000 (02:32 +0000)]
test_threadsignals is an expected skip on win32.

20 years agoTo raise TestSkipped, you must import TestSkipped.
Tim Peters [Wed, 4 Aug 2004 02:30:45 +0000 (02:30 +0000)]
To raise TestSkipped, you must import TestSkipped.

20 years agoihooks FancyModuleLoader.load_module()
Tim Peters [Wed, 4 Aug 2004 02:29:12 +0000 (02:29 +0000)]
ihooks FancyModuleLoader.load_module()
imputils Importer._process_result():
    remove name from modules dict if exec fails.

This is what all the builtin importers do now, new in 2.4.

20 years agoTkapp_New(): Rewrite in C so it compiles again.
Tim Peters [Wed, 4 Aug 2004 02:16:48 +0000 (02:16 +0000)]
Tkapp_New():  Rewrite in C so it compiles again.

20 years agomake sure distutils logging is shut off in tests to avoid spurious output
Fred Drake [Tue, 3 Aug 2004 18:53:07 +0000 (18:53 +0000)]
make sure distutils logging is shut off in tests to avoid spurious output

20 years agoPatch #986929: Add support for wish -sync and -use options.
Martin v. Löwis [Tue, 3 Aug 2004 18:45:31 +0000 (18:45 +0000)]
Patch #986929: Add support for wish -sync and -use options.

20 years agoPatch #986929: Add support for wish -sync and -use options.
Martin v. Löwis [Tue, 3 Aug 2004 18:36:25 +0000 (18:36 +0000)]
Patch #986929: Add support for wish -sync and -use options.

20 years agoWait for visibility before setting a grab. Fixes #946153.
Martin v. Löwis [Tue, 3 Aug 2004 18:36:25 +0000 (18:36 +0000)]
Wait for visibility before setting a grab. Fixes #946153.

20 years agoallow ctime(), gmtime(), and localtime() to take None as equivalent to an omitted arg
Fred Drake [Tue, 3 Aug 2004 17:58:55 +0000 (17:58 +0000)]
allow ctime(), gmtime(), and localtime() to take None as equivalent to an omitted arg
(closes SF bug #658254, patch #663482)

20 years agoThis allows additional commands to be provided for existing setup.py
Fred Drake [Tue, 3 Aug 2004 16:37:40 +0000 (16:37 +0000)]
This allows additional commands to be provided for existing setup.py
scripts without modifying either the distutils installation or the
setup.py scripts of packages with which the new commands will be used.

Specifically, an option is added to distutils that allows additional
packages to be searched for command implementations in addition to
distutils.command.  The additional packages can be specified on the
command line or via the installation or personal configuration files
already loaded by distutils.

For discussion, see the thread starting with:

http://mail.python.org/pipermail/distutils-sig/2004-August/004112.html

This closes SF patch #102241.

20 years agoadd missing import!
Fred Drake [Tue, 3 Aug 2004 16:14:13 +0000 (16:14 +0000)]
add missing import!

20 years agolet's avoid the extra nesting where reasonable
Fred Drake [Tue, 3 Aug 2004 16:02:35 +0000 (16:02 +0000)]
let's avoid the extra nesting where reasonable

20 years agoon to a2!
Anthony Baxter [Tue, 3 Aug 2004 15:57:39 +0000 (15:57 +0000)]
on to a2!

20 years agoavoid fragility: make sure POSIXLY_CORRECT is completely controlled
Fred Drake [Tue, 3 Aug 2004 15:54:45 +0000 (15:54 +0000)]
avoid fragility: make sure POSIXLY_CORRECT is completely controlled
for the tests, and restored properly when done

20 years agoAdd the same guard as test_signal.
Michael W. Hudson [Tue, 3 Aug 2004 15:35:29 +0000 (15:35 +0000)]
Add the same guard as test_signal.

20 years agoBe more careful about maintaining the invariants; it was actually
Fred Drake [Tue, 3 Aug 2004 14:47:25 +0000 (14:47 +0000)]
Be more careful about maintaining the invariants; it was actually
possible that the callback-less flavors of the ref or proxy could have
been added during GC, so we don't want to replace them.

20 years agoArgh! This was meant to be part of patch #960406.
Michael W. Hudson [Tue, 3 Aug 2004 14:37:14 +0000 (14:37 +0000)]
Argh!  This was meant to be part of patch #960406.

20 years agoPatch #823072: add option to NOT use ~/.netrc in nntplib.NNTP().
Martin v. Löwis [Tue, 3 Aug 2004 14:36:32 +0000 (14:36 +0000)]
Patch #823072: add option to NOT use ~/.netrc in nntplib.NNTP().

20 years agoPatch #977074: Move Encode/Decode to the top so gcc can inline them.
Martin v. Löwis [Tue, 3 Aug 2004 13:08:07 +0000 (13:08 +0000)]
Patch #977074: Move Encode/Decode to the top so gcc can inline them.

20 years agoPatch #994595: Recognize Basic auth even if other schemes are offered.
Martin v. Löwis [Tue, 3 Aug 2004 12:59:55 +0000 (12:59 +0000)]
Patch #994595: Recognize Basic auth even if other schemes are offered.
Will backport to 2.3.

20 years agoPatch #870382: Automatically add msvcr71 to the list of libraries if
Martin v. Löwis [Tue, 3 Aug 2004 12:41:42 +0000 (12:41 +0000)]
Patch #870382: Automatically add msvcr71 to the list of libraries if
Python was built with VC 7.1.

20 years agoCheck in my refleak hunting code.
Michael W. Hudson [Tue, 3 Aug 2004 11:33:28 +0000 (11:33 +0000)]
Check in my refleak hunting code.

It's not the 100% solution -- it may not even be the 90% solution -- but
it does seem to help.

20 years agoFix the reference count errors revealed by the test suite...
Michael W. Hudson [Tue, 3 Aug 2004 11:31:31 +0000 (11:31 +0000)]
Fix the reference count errors revealed by the test suite...

20 years agonice tests dont leave little suprises in the environ
Anthony Baxter [Tue, 3 Aug 2004 11:14:19 +0000 (11:14 +0000)]
nice tests dont leave little suprises in the environ

20 years agoMore "noone expected this to run twice"ness removal.
Michael W. Hudson [Tue, 3 Aug 2004 11:14:09 +0000 (11:14 +0000)]
More "noone expected this to run twice"ness removal.

20 years agomake this test work when run repeatedly.
Michael W. Hudson [Tue, 3 Aug 2004 11:08:32 +0000 (11:08 +0000)]
make this test work when run repeatedly.

20 years agoRemoved use of 'cgi.initlog()' - the first call to cgi.log is actually
Anthony Baxter [Tue, 3 Aug 2004 11:05:04 +0000 (11:05 +0000)]
Removed use of 'cgi.initlog()' - the first call to cgi.log is actually
an initlog() (and initlog()'s docstring says "don't use this"!) This
allows test_cgi to be run repeatedly in a single run of the interpreter.

20 years agoDon't exit test_main() with the lock 'done' held -- there's no cleaner
Michael W. Hudson [Tue, 3 Aug 2004 10:45:59 +0000 (10:45 +0000)]
Don't exit test_main() with the lock 'done' held -- there's no cleaner
way to guarantee a deadlock on the next call!

If I've inadvertently done some damage to this test, sorry (but I don't
think I have).

20 years agoDon't intern the filename of a file being compiled.
Michael W. Hudson [Tue, 3 Aug 2004 10:24:03 +0000 (10:24 +0000)]
Don't intern the filename of a file being compiled.
Hard to believe it ever helped anything, and it hurts finding reference
leaks.

20 years agoRepair the same thinko in two places about handling of _Py_RefTotal in
Michael W. Hudson [Tue, 3 Aug 2004 10:21:03 +0000 (10:21 +0000)]
Repair the same thinko in two places about handling of _Py_RefTotal in
the case of __del__ resurrecting an object.
This makes the apparent reference leaks in test_descr go away (which I
expected) and also kills off those in test_gc (which is more surprising
but less so once you actually think about it a bit).

20 years agoDelete the items variable (and explain why).
Michael W. Hudson [Tue, 3 Aug 2004 10:17:34 +0000 (10:17 +0000)]
Delete the items variable (and explain why).

20 years agoRestore compilation on MSVC++ 6.0
Raymond Hettinger [Tue, 3 Aug 2004 08:52:46 +0000 (08:52 +0000)]
Restore compilation on MSVC++ 6.0

20 years agoSF bug #808756: refleaks in _hotshot.c.
Armin Rigo [Tue, 3 Aug 2004 08:33:55 +0000 (08:33 +0000)]
SF bug #808756: refleaks in _hotshot.c.

20 years agoupdate to Expat 1.95.8
Fred Drake [Tue, 3 Aug 2004 07:06:22 +0000 (07:06 +0000)]
update to Expat 1.95.8

20 years agoDocument general mappings for the locals argument for exec and execfile().
Raymond Hettinger [Tue, 3 Aug 2004 05:17:58 +0000 (05:17 +0000)]
Document general mappings for the locals argument for exec and execfile().

20 years agoFix [ 1001018 ]: Windows: setdefaulttimeout causes unnecessary timeouts on
Mark Hammond [Tue, 3 Aug 2004 05:06:26 +0000 (05:06 +0000)]
Fix [ 1001018 ]: Windows: setdefaulttimeout causes unnecessary timeouts on
connect error

20 years agoTweak previous patch to silence a warning about the unused left value in the
Brett Cannon [Tue, 3 Aug 2004 04:53:29 +0000 (04:53 +0000)]
Tweak previous patch to silence a warning about the unused left value in the
comma expression in listpop() that was being returned.  Still essentially
unused (as it is meant to be), but now the compiler thinks it is worth
*something* by having it incremented.

20 years agofix a little lie ;-(
Fred Drake [Mon, 2 Aug 2004 23:05:25 +0000 (23:05 +0000)]
fix a little lie  ;-(

20 years agoFix typo though
Neal Norwitz [Mon, 2 Aug 2004 21:56:33 +0000 (21:56 +0000)]
Fix typo though

20 years agofix markup error
Fred Drake [Mon, 2 Aug 2004 21:50:26 +0000 (21:50 +0000)]
fix markup error

20 years agostart filling in documentation on extending distutils
Fred Drake [Mon, 2 Aug 2004 21:39:11 +0000 (21:39 +0000)]
start filling in documentation on extending distutils

20 years ago- fix description of option table entries
Fred Drake [Mon, 2 Aug 2004 17:58:51 +0000 (17:58 +0000)]
- fix description of option table entries
- fix broken assert statement; should just raise

20 years agoUse isabs() in conditional, not abspath
Andrew M. Kuchling [Mon, 2 Aug 2004 14:54:16 +0000 (14:54 +0000)]
Use isabs() in conditional, not abspath

20 years agoFix for the unfortunate fact that PyDict_GetItem and PyObject_GetItem
Michael W. Hudson [Mon, 2 Aug 2004 14:50:43 +0000 (14:50 +0000)]
Fix for the unfortunate fact that PyDict_GetItem and PyObject_GetItem
have differing refcount semantics.  If anyone sees a prettier way to
acheive the same ends, then please go for it.

I think this is the first time I've ever used Py_XINCREF.

20 years agoAdd PEP318
Andrew M. Kuchling [Mon, 2 Aug 2004 13:48:18 +0000 (13:48 +0000)]
Add PEP318

20 years agoAny call to insort_{left,right} with a non-list leaked a reference to None
Michael W. Hudson [Mon, 2 Aug 2004 13:24:54 +0000 (13:24 +0000)]
Any call to insort_{left,right} with a non-list leaked a reference to None
(or to whatever the 'insert' method chose to return).

20 years agoAdd a missing decref.
Michael W. Hudson [Mon, 2 Aug 2004 13:22:01 +0000 (13:22 +0000)]
Add a missing decref.

20 years agofor some reason, the lack of adherence to Python's C whitespace rules
Michael W. Hudson [Mon, 2 Aug 2004 13:21:09 +0000 (13:21 +0000)]
for some reason, the lack of adherence to Python's C whitespace rules
must have annoyed me at some point.

20 years agoAdd import change; add empty section for function decorators
Andrew M. Kuchling [Mon, 2 Aug 2004 12:44:28 +0000 (12:44 +0000)]
Add import change; add empty section for function decorators

20 years agoUpdate item
Andrew M. Kuchling [Mon, 2 Aug 2004 12:09:58 +0000 (12:09 +0000)]
Update item

20 years agoand a unit test for the staticmethod-of-a-non-method failure just fixed
Anthony Baxter [Mon, 2 Aug 2004 11:34:10 +0000 (11:34 +0000)]
and a unit test for the staticmethod-of-a-non-method failure just fixed

20 years agofix for @decorators under a debug build.
Anthony Baxter [Mon, 2 Aug 2004 11:08:15 +0000 (11:08 +0000)]
fix for @decorators under a debug build.

20 years agoFix doubled word.
Raymond Hettinger [Mon, 2 Aug 2004 08:36:07 +0000 (08:36 +0000)]
Fix doubled word.

20 years agoCompleted the patch for Bug #215126.
Raymond Hettinger [Mon, 2 Aug 2004 08:30:07 +0000 (08:30 +0000)]
Completed the patch for Bug #215126.
* Fixes an incorrect variable in a PyDict_CheckExact.
* Allow general mapping locals arguments for the execfile() function
  and exec statement.
* Add tests.

20 years agonotes for @decorator
Anthony Baxter [Mon, 2 Aug 2004 06:24:59 +0000 (06:24 +0000)]
notes for @decorator

20 years agoPEP-0318, @decorator-style. In Guido's words:
Anthony Baxter [Mon, 2 Aug 2004 06:10:11 +0000 (06:10 +0000)]
PEP-0318, @decorator-style. In Guido's words:
"@ seems the syntax that everybody can hate equally"
Implementation by Mark Russell, from SF #979728.

20 years agoTypo repair.
Tim Peters [Mon, 2 Aug 2004 04:30:37 +0000 (04:30 +0000)]
Typo repair.

20 years agoCompleted a sentence I left dangling.
Tim Peters [Mon, 2 Aug 2004 04:14:10 +0000 (04:14 +0000)]
Completed a sentence I left dangling.

20 years agoRemoved reliance on damaged module object appearing in sys.modules
Tim Peters [Mon, 2 Aug 2004 03:59:57 +0000 (03:59 +0000)]
Removed reliance on damaged module object appearing in sys.modules
after a failed import.

This is the last checkin in the "change import failure semantics" series.

20 years agoNew tests:
Tim Peters [Mon, 2 Aug 2004 03:58:27 +0000 (03:58 +0000)]
New tests:
    test_failing_import_sticks -- if an import raises an exception,
        ensure that trying to import it again continues raising exceptions
    test_failing_reload -- if a module loads OK, but a reload raises an
        exception, ensure that the module is still in sys.modules, and
        that its __dict__ reflects as much of the reload attempt as
        succeeded.  That doesn't seem like sane semantics, but it is
        backward-compatible semantics <wink>.

20 years agoRemoved no-longer-needed convolutions to recover from damaged modules
Tim Peters [Mon, 2 Aug 2004 03:55:18 +0000 (03:55 +0000)]
Removed no-longer-needed convolutions to recover from damaged modules
getting left beyind in sys.modules.

20 years agoPyImport_ExecCodeModuleEx(): remove module from sys.modules in error cases.
Tim Peters [Mon, 2 Aug 2004 03:52:12 +0000 (03:52 +0000)]
PyImport_ExecCodeModuleEx():  remove module from sys.modules in error cases.
PyImport_ReloadModule():  restore the module to sys.modules in error cases.
load_package():  semantic-neutral refactoring from an earlier stab at
                 this patch; giving it a common error exit made the code
                 easier to follow, so retaining that part.
_RemoveModule():  new little utility to delete a key from sys.modules.

20 years ago"Core" and "C API" news about new semantics for failing imports.
Tim Peters [Mon, 2 Aug 2004 03:48:03 +0000 (03:48 +0000)]
"Core" and "C API" news about new semantics for failing imports.

20 years agoPyImport_ImportModule, PyImport_ImportModuleEx, PyImport_ExecCodeModule:
Tim Peters [Mon, 2 Aug 2004 03:46:45 +0000 (03:46 +0000)]
PyImport_ImportModule, PyImport_ImportModuleEx, PyImport_ExecCodeModule:
in failure cases, incompletely initalized module objects are no longer
left behind in sys.modules.

20 years agolock_held() docs: Use True/False instead of 1/0. The LaTeX docs were
Tim Peters [Sun, 1 Aug 2004 23:26:05 +0000 (23:26 +0000)]
lock_held() docs:  Use True/False instead of 1/0.  The LaTeX docs were
already correct, so not changed here.

20 years agoTrimmed trailing whitespace.
Tim Peters [Sun, 1 Aug 2004 23:24:21 +0000 (23:24 +0000)]
Trimmed trailing whitespace.

20 years agoFix SF #1001053, wave.open() with unicode filename fails
Neal Norwitz [Sun, 1 Aug 2004 22:48:06 +0000 (22:48 +0000)]
Fix SF #1001053, wave.open() with unicode filename fails

Backport candidate.

20 years agoFix typo in comment
Neal Norwitz [Sun, 1 Aug 2004 22:45:27 +0000 (22:45 +0000)]
Fix typo in comment

20 years agoSF bug #1001088, incorrect reference to macro named foo
Neal Norwitz [Sun, 1 Aug 2004 22:36:40 +0000 (22:36 +0000)]
SF bug #1001088, incorrect reference to macro named foo

Backport candidate.

20 years agolist_ass_slice(): Document the obscure new intent that deleting a slice
Tim Peters [Sat, 31 Jul 2004 21:53:19 +0000 (21:53 +0000)]
list_ass_slice():  Document the obscure new intent that deleting a slice
of no more than 8 elements cannot fail.

listpop():  Take advantage of that its calls to list_resize() and
list_ass_slice() can't fail.  This is assert'ed in a debug build now, but
in an icky way.  That is, you can't say:

assert(some_call() >= 0);

because then some_call() won't occur at all in a release build.  So it
has to be a big pile of #ifdefs on Py_DEBUG (yuck), or the pleasant:

        status = some_call();
        assert(status >= 0);

But in that case, compilers may whine in a release build, because status
appears unused then.  I'm not certain the ugly trick I used here will
convince all compilers to shut up about status (status is always "used" now,
as the first (ignored) clause in a comma expression).

20 years agoWhitespace normalization.
Tim Peters [Sat, 31 Jul 2004 21:17:37 +0000 (21:17 +0000)]
Whitespace normalization.

20 years agoBe more careful about reverting mutuations to system-wide (sys) variables.
Tim Peters [Sat, 31 Jul 2004 21:14:28 +0000 (21:14 +0000)]
Be more careful about reverting mutuations to system-wide (sys) variables.
This fixes 15 spurious test failures on Windows (probably all due to
the test leaving a wrong path in sys.argv[0], which then prevented
regrtest.py from finding the expected-output files for tests running
after test_optparse).

20 years agoMention upgrade of optparse to Optik 1.5a1.
Greg Ward [Sat, 31 Jul 2004 16:16:11 +0000 (16:16 +0000)]
Mention upgrade of optparse to Optik 1.5a1.

20 years agoUpgrade optparse module and tests to Optik 1.5a1:
Greg Ward [Sat, 31 Jul 2004 16:15:44 +0000 (16:15 +0000)]
Upgrade optparse module and tests to Optik 1.5a1:
  * add expansion of default values in help text: the string
    "%default" in an option's help string is expanded to str() of
    that option's default value, or "none" if no default value.
  * bug #955889: option default values that happen to be strings are
    now processed in the same way as values from the command line; this
    allows generation of nicer help when using custom types.  Can
    be disabled with parser.set_process_default_values(False).
  * bug #960515: don't crash when generating help for callback
    options that specify 'type', but not 'dest' or 'metavar'.
  * feature #815264: change the default help format for short options
    that take an argument from e.g. "-oARG" to "-o ARG"; add
    set_short_opt_delimiter() and set_long_opt_delimiter() methods to
    HelpFormatter to allow (slight) customization of the formatting.
  * patch #736940: internationalize Optik: all built-in user-
    targeted literal strings are passed through gettext.gettext().  (If
    you want translations (.po files), they're not included with Python
    -- you'll find them in the Optik source distribution from
    http://optik.sourceforge.net/ .)
  * bug #878453: respect $COLUMNS environment variable for
    wrapping help output.
  * feature #988122: expand "%prog" in the 'description' passed
    to OptionParser, just like in the 'usage' and 'version' strings.
    (This is *not* done in the 'description' passed to OptionGroup.)

20 years agolist_ass_slice(): The difference between "recycle" and "recycled" was
Tim Peters [Sat, 31 Jul 2004 02:54:42 +0000 (02:54 +0000)]
list_ass_slice():  The difference between "recycle" and "recycled" was
impossible to remember, so renamed one to something obvious.  Headed
off potential signed-vs-unsigned compiler complaints I introduced by
changing the type of a vrbl to unsigned.  Removed the need for the
tedious explanation about "backward pointer loops" by looping on an
int instead.

20 years agoArmin asked for a list_ass_slice review in his checkin, so here's the
Tim Peters [Sat, 31 Jul 2004 02:24:20 +0000 (02:24 +0000)]
Armin asked for a list_ass_slice review in his checkin, so here's the
result.

list_resize():  Document the intent.  Code is increasingly relying on
subtle aspects of its behavior, and they deserve to be spelled out.

list_ass_slice():  A bit more simplification, by giving it a common
error exit and initializing more values.

Be clearer in comments about what "size" means (# of elements?  # of
bytes?).

While the number of elements in a list slice must fit in an int, there's
no guarantee that the number of bytes occupied by the slice will.  That
malloc() and memmove() take size_t arguments is a hint about that <wink>.
So changed to use size_t where appropriate.

ihigh - ilow should always be >= 0, but we never asserted that.  We do
now.

The loop decref'ing the recycled slice had a subtle insecurity:  C doesn't
guarantee that a pointer one slot *before* an array will compare "less
than" to a pointer within the array (it does guarantee that a pointer
one beyond the end of the array compares as expected).  This was actually
an issue in KSR's C implementation, so isn't purely theoretical.  Python
probably has other "go backwards" loops with a similar glitch.
list_clear() is OK (it marches an integer backwards, not a pointer).

20 years agoRepair typo in docstring.
Tim Peters [Sat, 31 Jul 2004 00:19:43 +0000 (00:19 +0000)]
Repair typo in docstring.

20 years agore-wrap paragraphs containing long lines
Fred Drake [Fri, 30 Jul 2004 19:12:38 +0000 (19:12 +0000)]
re-wrap paragraphs containing long lines

20 years ago- document the termination condition for cmd.Cmd.cmdloop()
Fred Drake [Fri, 30 Jul 2004 18:58:54 +0000 (18:58 +0000)]
- document the termination condition for cmd.Cmd.cmdloop()
- document the use of the return value for cmd.Cmd.do_*() methods