Tim Peters [Fri, 6 Aug 2004 22:02:59 +0000 (22:02 +0000)]
Merging from tim-doctest-branch, which is now closed.
This primarily adds more powerful ways to work with unittest, including
spiffy support for building suites out of doctests in non-Python
"text files".
Brett Cannon [Fri, 6 Aug 2004 04:30:46 +0000 (04:30 +0000)]
Changes the remote address used for tests in TimeoutTestCase from google.com to
python.org . This way the delay should be great enough for
testConnectTimeout() to pass even when one has a really fast Net connection
that allows connections faster than .001 seconds.
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.
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.
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)
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...).
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
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.
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.
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.
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.
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).
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.
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.
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.