Walter Dörwald
4e41a4b64c
Disable a few other tests, that can't work if Python is compiled without
...
Unicode support.
2005-08-03 17:09:04 +00:00
Phillip J. Eby
0d6615fd29
PEP 342 implementation. Per Guido's comments, the generator throw()
...
method still needs to support string exceptions, and allow None for the
third argument. Documentation updates are needed, too.
2005-08-02 00:46:46 +00:00
Raymond Hettinger
d794666048
* Improve code for the empty frozenset singleton:
...
- Handle both frozenset() and frozenset([]).
- Do not use singleton for frozenset subclasses.
- Finalize the singleton.
- Add test cases.
* Factor-out set_update_internal() from set_update(). Simplifies the
code for several internal callers.
* Factor constant expressions out of loop in set_merge_internal().
* Minor comment touch-ups.
2005-08-01 21:39:29 +00:00
Fred Drake
50747fc1b9
add support for svn: and svn+ssh: URL schemes to urlparse
2005-07-29 15:56:32 +00:00
Walter Dörwald
6eea789fd2
Disable encoding/decoding test, if unicode is disabled.
2005-07-28 16:49:15 +00:00
Georg Brandl
7eb4b7d177
Fix all wrong instances of "it's".
2005-07-22 21:49:32 +00:00
Walter Dörwald
c9878e1b22
Make attributes and local variables in the StreamReader str objects instead
...
of unicode objects, so that codecs that do a str->str decoding won't promote
the result to unicode. This fixes SF bug #1241507 .
2005-07-20 22:15:39 +00:00
Tim Peters
f5f32b4712
Whitespace normalization.
2005-07-17 23:16:17 +00:00
Hye-Shik Chang
4e422817eb
Add support for FreeBSD 7.
2005-07-17 02:36:59 +00:00
Georg Brandl
5c5fe2f445
RFE [ 1216944 ] Add Error Code Dictionary to urllib2
2005-07-14 06:40:47 +00:00
Michael W. Hudson
0edc7a03e2
Fix:
...
[ 1229429 ] missing Py_DECREF in PyObject_CallMethod
Add a test in test_enumerate, which is a bit random, but suffices
(reversed_new calls PyObject_CallMethod under some circumstances).
2005-07-12 10:21:19 +00:00
Raymond Hettinger
82cb9a235d
Add test for hash commutativity.
2005-07-05 05:34:43 +00:00
Georg Brandl
9a65d583ac
Add doctest for examples in libweakref.tex to test_weakref.
2005-07-02 19:07:30 +00:00
Raymond Hettinger
3296e696db
SF bug #1224347 : int/long unification and hex()
...
Hex longs now print with lowercase letters like their int counterparts.
2005-06-29 23:29:56 +00:00
Georg Brandl
22bfdab682
Adapt output file to new Cookie JS output.
2005-06-27 05:51:07 +00:00
Georg Brandl
ecf93c765c
Fix test cases for doctest.
2005-06-26 23:09:51 +00:00
Raymond Hettinger
da99d1cbfe
SF bug #1224621 : tokenize module does not detect inconsistent dedents
2005-06-21 07:43:58 +00:00
Michael W. Hudson
7390942aa1
test_asynchat is no longer expected to produce output.
...
also, wait for threads to finish before proceeding.
2005-06-20 13:45:34 +00:00
Raymond Hettinger
bb999b5925
SF patch #1200018 : Restore GC support to set objects
...
Reverts 1.26 and 1.27.
And adds cycle testing.
2005-06-18 21:00:26 +00:00
Skip Montanaro
9847000267
Add tests for posix O_SHLOCK & O_EXLOCK. Missed checking this in with
...
posixmodule.c 2.335. Really should be considered part of patch #1103951 .
2005-06-17 01:14:49 +00:00
Andrew M. Kuchling
d1badac99c
[Patch #1005892 from Alexandr Zamaraev] Fix two errors in the curses test suite
2005-06-15 18:44:23 +00:00
Michael W. Hudson
1a7285250b
yet another cache to clear when leak hunting.
2005-06-14 09:31:28 +00:00
Walter Dörwald
a00215983b
Port test_long.py to unittest.
2005-06-13 21:44:48 +00:00
Michael W. Hudson
f2ca5af439
Fix bug
...
[ 1180997 ] lax error-checking in new-in-2.4 marshal stuff
which I'd assigned to Martin, but actually turned out to be easy to fix.
Also, a test.
2005-06-13 18:28:46 +00:00
Raymond Hettinger
68c0453418
Add untokenize() function to allow full round-trip tokenization.
...
Should significantly enhance the utility of the module by supporting
the creation of tools that modify the token stream and writeback the
modified result.
2005-06-10 11:05:19 +00:00
Andrew M. Kuchling
5ac2534bbc
Convert asynchat test to unittest; exercise the client using a numeric value as the terminator
2005-06-09 14:56:31 +00:00
Andrew M. Kuchling
01cb47b59c
[Bug #1074261 , patch #1074381 ] Restrict the size of chunks read from the file in order to avoid overflow or huge memory consumption. Patch by Mark Eichin
2005-06-09 14:19:32 +00:00
Andrew M. Kuchling
a6f68e1b1f
Convert gzip test suite to use unittest
2005-06-09 14:12:36 +00:00
Andrew M. Kuchling
6e57c2a653
[Patch #1171487 , bug #1170331 ] Fix error in base64.b32decode when encoding a single null byte; test a null byte in all encodings to be sure it works
2005-06-08 22:51:38 +00:00
Anthony Baxter
95a2a4ea70
Tools/scripts/reindent.py _is_ your friend
2005-06-08 04:35:50 +00:00
Andrew M. Kuchling
ecdad8575e
[Bug #1172763 ] dumbdbm uses eval() on lines, so it chokes if there's an extra \r on the end of a line; fixed by stripping off trailing whitespace.
2005-06-07 19:36:10 +00:00
Skip Montanaro
61aa630d01
Fix missing assignments of marshal.load() values. Closes #1214662 .
2005-06-04 12:55:32 +00:00
Tim Peters
5d36a55eaa
Whitespace normalization.
2005-06-03 22:40:27 +00:00
Georg Brandl
6b95f1d963
Bug #1194181 : bz2.BZ2File didn't handle mode 'U' correctly.
2005-06-03 19:47:00 +00:00
Anthony Baxter
451ae18751
[ 1197218 ] test_locale fix on modern linux
...
On more modern linuxes (and probably others) straight 'en_US' isn't a
valid locale. Make the code try a couple of alternates.
backport candidate
2005-06-03 15:04:15 +00:00
Michael W. Hudson
df88846ebc
This is my patch:
...
[ 1180995 ] binary formats for marshalling floats
Adds 2 new type codes for marshal (binary floats and binary complexes), a
new marshal version (2), updates MAGIC and fiddles the de-serializing of
code objects to be less likely to clobber the real reason for failing if
it fails.
2005-06-03 14:41:55 +00:00
Georg Brandl
268e61cf74
Bug #1213894 : os.path.realpath didn't resolve symlinks that were the first
...
component of the path.
2005-06-03 14:28:50 +00:00
Michael W. Hudson
e7fa1af85b
M-x untabify
2005-06-03 13:55:58 +00:00
Andrew M. Kuchling
3554cad009
[Bug #1177831 ] Exercise (?(id)yes|no) for a group other than the first one
2005-06-02 13:38:45 +00:00
Neil Schemenauer
f36947032f
Fix compiler.ast.flatten function so that it works on lists.
2005-06-02 05:55:20 +00:00
Michael W. Hudson
ba283e2b7f
This is my patch:
...
[ 1181301 ] make float packing copy bytes when they can
which hasn't been reviewed, despite numerous threats to check it in
anyway if noone reviews it. Please read the diff on the checkin list,
at least!
The basic idea is to examine the bytes of some 'probe values' to see if
the current platform is a IEEE 754-ish platform, and if so
_PyFloat_{Pack,Unpack}{4,8} just copy bytes around.
The rest is hair for testing, and tests.
2005-05-27 15:23:20 +00:00
Michael W. Hudson
ff52286d4a
Fix test_site to not call open('...', 'wU'), as that now raises an error.
...
Is anyone running the test suite regularly at the moment?
2005-05-27 14:58:06 +00:00
Skip Montanaro
bbf12ba7b2
Disallow opening files with modes 'aU' or 'wU' as specified by PEP
...
278. Closes bug 967182.
2005-05-20 03:07:06 +00:00
Armin Rigo
57179feec8
This test relied on short-circuiting details of dictobject.py to avoid
...
crashing, and indirectly on the fact that hash codes in
random.randrange(1000000000) were very unlikely to exhibit collisions.
To see the problem, replace this number with 500 and observe the crash on
either del target[key] or del keys[i].
The fix prevents recursive mutation, just as in the key insertion case.
2005-05-15 13:29:26 +00:00
Skip Montanaro
174dd2219d
Add better datetime support to xmlrpclib module. Closes patch #1120353 .
2005-05-14 20:54:16 +00:00
Michael W. Hudson
abb103b17a
Don't use 'is not' to compare strings.
...
(spotted by reading pypy-svn :)
2005-05-04 11:59:38 +00:00
Brett Cannon
53e9a8b9f3
Fix error in a docstring where a single quote started the docstring but triple
...
quote ended it.
Closes bug #1192777 . Thanks Christopher Smith.
2005-04-30 05:50:19 +00:00
Brett Cannon
c3647ac93e
Make subclasses of int, long, complex, float, and unicode perform type
...
conversion using the proper magic slot (e.g., __int__()). Also move conversion
code out of PyNumber_*() functions in the C API into the nb_* function.
Applied patch #1109424 . Thanks Walter Doewald.
2005-04-26 03:45:26 +00:00
Walter Dörwald
43148c8413
Update test to the current readline() behaviour.
2005-04-21 21:45:36 +00:00
Barry Warsaw
b180c06a54
Fix tests dependent on the exception raised by non-settable descriptors.
2005-04-20 19:41:36 +00:00
Tim Peters
e890682e52
Whitespace normalization.
2005-04-20 17:45:13 +00:00
Brett Cannon
f4189916e3
Flush out support for ``class B(): pass`` syntax by adding support to the
...
'parser' module and 'compiler' package.
Closes patch #1176012 . Thanks logistix.
2005-04-09 02:30:16 +00:00
Brett Cannon
4ebc7e3bd0
Add test for ``class B1(): pass``.
2005-04-09 01:27:37 +00:00
Tim Peters
f754f5fd68
test_default_encoding_issues(): Fully restore sys.setdefaultencoding.
...
test_site often failed under "regrtest.py -r", because this xmlrpc test
left sys with a setdefaultencoding attribute, but loading site.py removes
that attribute and test_site.py verifies the attribute is gone. Changed
this test to get rid of sys.setdefaultencoding if it didn't exist when
this test started.
Don't know whether this is a bugfix (backport) candidate.
2005-04-08 18:00:59 +00:00
Walter Dörwald
7a6dc139de
Fix for SF bug #1175396 : readline() will now read one more character, if
...
the last character read is "\r" (and size is None, i.e. we're allowed to
call read() multiple times), so that we can return the correct line ending
(this additional character might be a "\n").
If the stream is temporarily exhausted, we might return the wrong line ending
(if the last character read is "\r" and the next one (after the byte stream
provides more data) is "\n", but at least the atcr member ensure that we
get the correct number of lines (i.e. this "\n" will not be treated as
another line ending.)
2005-04-04 21:38:47 +00:00
Hye-Shik Chang
ac89f6ef29
Fix testcase for 64bit BSD systems: long is 8 bytes for those systems
...
so there's no need to pad after off_t members. And a small typo fix.
2005-04-04 15:21:04 +00:00
Michael W. Hudson
e2749cb264
Fix for rather inaccurately titled bug
...
[ 1165306 ] Property access with decorator makes interpreter crash
Don't allow the creation of unbound methods with NULL im_class, because
attempting to call such crashes.
Backport candidate.
2005-03-30 16:32:10 +00:00
Tim Peters
eba28bea9b
Whitespace normalization.
2005-03-28 01:08:02 +00:00
Raymond Hettinger
fdf3bd6630
SF patch #1171417 : bug fix for islice() in docs
2005-03-27 20:11:44 +00:00
Raymond Hettinger
267b868f23
* Fix decimal's handling of foreign types. Now returns NotImplemented
...
instead of raising a TypeError. Allows other types to successfully
implement __radd__() style methods.
* Remove future division import from test suite.
* Remove test suite's shadowing of __builtin__.dir().
2005-03-27 10:47:39 +00:00
Raymond Hettinger
e6c470f255
SF bug #1770766 : weakref proxy has incorrect __nonzero__ behavior.
2005-03-27 03:04:54 +00:00
Walter Dörwald
09a3f2cc2f
Add tests for tuple, list and UserList that initialize the object from
...
various iterables.
(Copied from test_deque.py as suggested by Jim Jewett in SF bug #1166274 )
2005-03-22 22:43:28 +00:00
Walter Dörwald
c448a91ee8
Fix typo.
2005-03-22 11:22:38 +00:00
Walter Dörwald
7355e8133d
Add list tests that ensure that remove() removes the first occurrence.
...
(Copied from test_deque.py as suggested by Jim Jewett in SF bug #1166274 )
2005-03-21 21:31:47 +00:00
Raymond Hettinger
d73202c596
Apply remove's mutation test after every equality test.
2005-03-19 00:00:51 +00:00
Raymond Hettinger
4aec61e0fc
Add a remove() method to collections.deque objects.
2005-03-18 21:20:23 +00:00
Raymond Hettinger
bea3f6f5c7
Bug #1163325 : "special" decimals aren't hashable
2005-03-15 04:59:17 +00:00
Walter Dörwald
729c31f5c3
Reset internal buffers when seek() is called. This fixes SF bug #1156259 .
2005-03-14 19:06:30 +00:00
Johannes Gijsbers
a5855d5ace
Patch #1159931/bug #1143895 : inspect.getsource failed when functions,
...
etc., had comments after the colon, and some other cases. This patch
take a simpler approach that doesn't rely on looking for a ':'. Thanks
Simon Percivall!
2005-03-12 16:37:11 +00:00
Raymond Hettinger
f77d0334f3
Revised the itertools quantifier recipes to match the performance of the
...
new builtins.
2005-03-11 22:17:30 +00:00
Raymond Hettinger
96229b1918
Add two new functions, any() and all().
2005-03-11 06:49:40 +00:00
Raymond Hettinger
26e512a04f
Test partial() with bound/unbound methods.
2005-03-11 06:48:49 +00:00
Brett Cannon
01668a1ab9
Fix test for socket.getfqdn() to also include the name returned by
...
socket.gethostname() in the check for a valid return.
Also clarified docs (official and docstring) that the value from gethostname()
is returned if gethostbyaddr() doesn't do the job.
2005-03-11 00:04:17 +00:00
Raymond Hettinger
984f9bb714
operator.itemgetter() and operator.attrgetter() now support extraction
...
of multiple fields. This provides direct support for sorting by
multiple keys.
2005-03-09 16:38:48 +00:00
Martin v. Löwis
e2713becd8
Build with --disable-unicode again. Fixes #1158607 .
...
Will backport to 2.4.
2005-03-08 15:03:08 +00:00
Martin v. Löwis
b60ae99601
Convert file names of posix.access according to the file system encoding.
2005-03-08 09:10:29 +00:00
Raymond Hettinger
c8b6d1bd8c
Make functional.partial() more closely match the spec by emulating
...
some useful features of regular functions:
* Made weak referencable.
* Allow attribute access so a user can set __name__, __doc__, etc.
2005-03-08 06:14:50 +00:00
Greg Ward
50682d0f78
SF #818006 : merge from release24-maint branch: add useful read-only
...
attributes to oss_audio_device object: 'closed', 'name', and 'mode'.
2005-03-07 01:41:11 +00:00
Martin v. Löwis
78be7df9e4
Patch #918101 : Add tarfile open mode r|* for auto-detection of the
...
stream compression; add, for symmetry reasons, r:* as a synonym of r.
2005-03-05 12:47:42 +00:00
Brett Cannon
653a5adcca
Tweak test_communicate_stderr so that it works when run under a pydebug build.
2005-03-05 06:40:52 +00:00
Greg Ward
40407943b7
SF #1149508 : ensure textwrap handles hyphenated numbers correctly,
...
eg. "2004-03-04" is not broken across lines. (Merged from 2.4 branch.)
2005-03-05 02:53:17 +00:00
Peter Astrand
f7f1bb7ff5
Only run extensive subprocess tests if -usubprocess to regrtest is specified. Fixes #1124637
2005-03-03 20:47:37 +00:00
Peter Astrand
cbac93c229
Added three more testcases: Using communicate with only one of
...
stdin/stdout/stderr redirected.
2005-03-03 20:24:28 +00:00
Raymond Hettinger
b67cc80bb9
SF bug #1155938 : Missing None check for __init__().
2005-03-03 16:45:19 +00:00
Martin v. Löwis
6ce7ed23d0
Revert previous checkin on getargs 'L' code. Try to convert all
...
numbers in PyLong_AsLongLong, and update test suite accordingly.
Backported to 2.4.
2005-03-03 12:26:35 +00:00
Martin v. Löwis
7fe60c0a0a
Patches #749830 , #1144555 : allow UNIX mmap size to default to current
...
file size.
2005-03-03 11:22:44 +00:00
Martin v. Löwis
c5574e809b
Patch #1117454 : Remove code to special-case cookies without values
...
in LWPCookieJar. Backported to 2.4.
2005-03-03 10:57:37 +00:00
Martin v. Löwis
4ea3eade51
Patch #1117339 : Add cookielib special name tests.
...
Backported to 2.4.
2005-03-03 10:48:12 +00:00
Martin v. Löwis
ff232d7230
Clear internal call error in 'L' format. Fixes #723201 .
...
Backported to 2.4.
2005-03-03 09:24:38 +00:00
Martin v. Löwis
df24153f65
Patch #1107973 : tarfile.ExFileObject iterators.
2005-03-03 08:17:42 +00:00
Brett Cannon
e94e74a8e1
Make test__locale more fine-grained. Now test localeconv and nl_langinfo
...
individually as tests.
Also improved output when the test fails.
2005-03-01 03:15:50 +00:00
Raymond Hettinger
9c323f8de4
SF patch #941881 : PEP 309 Implementation (Partial Function Application).
...
Combined efforts of many including Peter Harris, Hye-Shik Chang,
Martin v. Löwis, Nick Coghlan, Paul Moore, and Raymond Hettinger.
2005-02-28 19:39:44 +00:00
Martin v. Löwis
c2a0ac20b7
Patch #1049151 : adding bool support to xdrlib.py.
...
Also add xdrlib._test into the test suite.
2005-02-24 20:22:10 +00:00
Raymond Hettinger
afd842f5b2
Teach the peepholer to fold unary operations on constants.
...
Afterwards, -0.5 loads in a single step and no longer requires a runtime
UNARY_NEGATIVE operation.
2005-02-20 12:46:54 +00:00
Raymond Hettinger
57e7447c44
* Beef-up tests for str.count().
...
* Speed-up str.count() by using memchr() to fly between first char matches.
2005-02-20 09:54:53 +00:00
Raymond Hettinger
7cbf1bcb3e
* Beef-up testing of str.__contains__() and str.find().
...
* Speed-up "x in y" where x has more than one character.
The existing code made excessive calls to the expensive memcmp() function.
The new code uses memchr() to rapidly find a start point for memcmp().
In addition to knowing that the first character is a match, the new code
also checks that the last character is a match. This significantly reduces
the incidence of false starts (saving memcmp() calls and making quadratic
behavior less likely).
Improves the timings on:
python -m timeit -r7 -s"x='a'*1000" "'ab' in x"
python -m timeit -r7 -s"x='a'*1000" "'bc' in x"
Once this code has proven itself, then string_find_internal() should refer
to it rather than running its own version. Also, something similar may
apply to unicode objects.
2005-02-20 04:07:08 +00:00
Walter Dörwald
af3b39a182
Add support for negative indices in UserString.MutableString.__setitem__
...
and UserString.MutableString.__delitem__.
2005-02-18 13:22:43 +00:00
Walter Dörwald
1fd4db9c6c
Fix copy & paste error.
2005-02-17 22:31:28 +00:00
Walter Dörwald
7f79152929
Add tests for the methods added by UserString.MutableString.
2005-02-17 22:03:31 +00:00
Martin v. Löwis
5510f65f5a
Avoid using items() in environ.update(). Fixes #1124513 .
...
Will backport to 2.4.
2005-02-17 21:23:20 +00:00