summaryrefslogtreecommitdiffstats
path: root/Lib/test
Commit message (Collapse)AuthorAgeFilesLines
* Do a little more searching for the data file for the test: this allowsFred Drake2003-04-221-1/+12
| | | | | | using a build directory just inside the source directory and saving just one copy of the test data in the source tree, rather than having a copy in each build directory.
* Change test_pwd and test_grp so they can handle duplicate userWalter Dörwald2003-04-222-3/+7
| | | | and group names. This should fix SF bug #724771.
* Adding new built-in function sum, with docs and tests.Alex Martelli2003-04-221-0/+21
|
* Test suite for optparse. This is a slightly-edited copy ofGreg Ward2003-04-211-0/+1210
| | | | test/test_optik.py (rev 1.19) from the Optik CVS.
* More work on bug #672491 and patch #712900.Gustavo Niemeyer2003-04-202-1/+7
| | | | | | | | | | | | | | | | I've applied a modified version of Greg Chapman's patch. I've included the fixes without introducing the reorganization mentioned, for the sake of stability. Also, the second fix mentioned in the patch don't fix the mentioned problem anymore, because of the change introduced by patch #720991 (by Greg as well). The new fix wasn't complicated though, and is included as well. As a note. It seems that there are other places that require the "protection" of LASTMARK_SAVE()/LASTMARK_RESTORE(), and are just waiting for someone to find how to break them. Particularly, I belive that every recursion of SRE_MATCH() should be protected by these macros. I won't do that right now since I'm not completely sure about this, and we don't have much time for testing until the next release.
* - Changed shlex.split() method to have more useful andGustavo Niemeyer2003-04-201-7/+3
| | | | meaningful parameters.
* Patch #553171: Add writeback parameter. Also add protocol parameter.Martin v. Löwis2003-04-191-6/+45
|
* - bool() called without arguments now returns False rather thanGuido van Rossum2003-04-192-0/+11
| | | | | | | raising an exception. This is consistent with calling the constructors for the other builtin types -- called without argument they all return the false value of that type. (SF patch #724135) Thanks to Alex Martelli.
* New PyGILState_ API - implements pep 311, from patch 684256.Mark Hammond2003-04-191-0/+29
|
* New file.Martin v. Löwis2003-04-191-0/+90
|
* Patch #681152: Support escaped Unicode characters in classes. Fixes #612074.Martin v. Löwis2003-04-191-0/+4
| | | | Will backport to 2.2.
* Make _strptime escape regex syntax in format string to prevent use in ↵Brett Cannon2003-04-191-0/+14
| | | | internal regex.
* Skip nameprep test 3.43, as we do allow unassigned characters. The testMartin v. Löwis2003-04-181-2/+4
| | | | fails only in UCS-2 mode, since it tests a non-BMP character.
* Implement IDNA (Internationalized Domain Names in Applications).Martin v. Löwis2003-04-181-0/+296
|
* Delete the 'h' test -- 'h' is no longer unsigned so the machinery hereGuido van Rossum2003-04-181-16/+1
| | | | can't test it. It's unchanged so why would we test it anyway...
* Get test to work under regrtest when running whole suiteNeal Norwitz2003-04-171-1/+6
|
* Add test that demonstrates SGML-style handling of processingFred Drake2003-04-171-0/+3
| | | | instructions.
* Implemented posix-mode parsing support in shlex.py, as dicussed inGustavo Niemeyer2003-04-171-0/+191
| | | | mailing list, and in patch #722686.
* SF # 595026: support for masks in getargs.c.Thomas Heller2003-04-171-0/+245
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New functions: unsigned long PyInt_AsUnsignedLongMask(PyObject *); unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *); unsigned long PyLong_AsUnsignedLongMask(PyObject *); unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *); New and changed format codes: b unsigned char 0..UCHAR_MAX B unsigned char none ** h unsigned short 0..USHRT_MAX H unsigned short none ** i int INT_MIN..INT_MAX I * unsigned int 0..UINT_MAX l long LONG_MIN..LONG_MAX k * unsigned long none L long long LLONG_MIN..LLONG_MAX K * unsigned long long none Notes: * New format codes. ** Changed from previous "range-and-a-half" to "none"; the range-and-a-half checking wasn't particularly useful. New test test_getargs2.py, to verify all this.
* - super() no longer ignores data descriptors, except __class__. SeeGuido van Rossum2003-04-161-1/+16
| | | | | the thread started at http://mail.python.org/pipermail/python-dev/2003-April/034338.html
* Test SystemEvents too.Jack Jansen2003-04-151-1/+4
|
* Ouch, it's Carlo Verre, not Verre Carlo.Guido van Rossum2003-04-151-5/+5
|
* Add a few errors tests for range().Walter Dörwald2003-04-151-0/+6
|
* Fix copy & paste error in comment.Walter Dörwald2003-04-151-1/+1
|
* Fix the test so that it works even when /etc/group has two entriesWalter Dörwald2003-04-151-1/+12
| | | | for the same gid.
* Fix the test so that it works even when /etc/passwd has two entriesWalter Dörwald2003-04-151-1/+12
| | | | for the same uid.
* test_range(): The C code changed to raise TypeError in one of theseTim Peters2003-04-151-1/+1
| | | | cases, but the test still expected ValueError. Repaired that.
* Port test_pwd.py to PyUnit. Check that getpwall() andWalter Dörwald2003-04-154-239/+319
| | | | | | | | | | | | getpwnam()/getpwuid() return consistent data. Change test_grp to check that getgrall() and getgrnam()/getgrgid() return consistent data. Add error checks similar to test_pwd.py. Port test___all__.py to PyUnit. From SF patch #662807.
* The date class is now properly subclassable. (SF bug #720908)Guido van Rossum2003-04-141-0/+6
| | | | | (This is only the tip of the iceberg; the time and datetime classes need the same treatment.)
* Close off the "Verre Carlo hack" as discussed on python-dev.Guido van Rossum2003-04-141-0/+17
|
* - list.insert(i, x) now interprets negative i as it would beGuido van Rossum2003-04-141-0/+5
| | | | | | interpreted by slicing, so negative values count from the end of the list. This was the only place where such an interpretation was not placed on a list index.
* SF patch #720991 by Gary Herron:Guido van Rossum2003-04-141-0/+13
| | | | | | | A small fix for bug #545855 and Greg Chapman's addition of op code SRE_OP_MIN_REPEAT_ONE for eliminating recursion on simple uses of pattern '*?' on a long string.
* Get test working if gzip support is not availableNeal Norwitz2003-04-141-1/+2
|
* Patch by Chad Netzer (with significant change):Guido van Rossum2003-04-111-0/+35
| | | | | | | - range() now works even if the arguments are longs with magnitude larger than sys.maxint, as long as the total length of the sequence fits. E.g., range(2**100, 2**101, 2**100) is the following list: [1267650600228229401496703205376L]. (SF patch #707427.)
* From http://mail.python.org/pipermail/i18n-sig/2003-April/001557.htmlBarry Warsaw2003-04-111-125/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Expose NullTranslations and GNUTranslations to __all__ - Set the default charset to iso-8859-1. It used to be None, which would cause problems with .ugettext() if the file had no charset parameter. Arguably, the po/mo file would be broken, but I still think iso-8859-1 is a reasonable default. - Add a "coerce" default argument to GNUTranslations's constructor. The reason for this is that in Zope, we want all msgids and msgstrs to be Unicode. For the latter, we could use .ugettext() but there isn't currently a mechanism for Unicode-ifying msgids. The plan then is that the charset parameter specifies the encoding for both the msgids and msgstrs, and both are decoded to Unicode when read. For example, we might encode po files with utf-8. I think the GNU gettext tools don't care. Since this could potentially break code [*] that wants to use the encoded interface .gettext(), the constructor flag is added, defaulting to False. Most code I suspect will want to set this to True and use .ugettext(). - A few other minor changes from the Zope project, including asserting that a zero-length msgid must have a Project-ID-Version header for it to be counted as the metadata record.
* SF patch #706707, time.tzset standards compliance update by Stuart BishopNeal Norwitz2003-04-111-58/+41
| | | | Update configure and test to use proper timezone specifications
* Avoid creating one of the TestSuite objects.Fred Drake2003-04-111-2/+1
|
* Attempt to make all the various string *strip methods the same.Neal Norwitz2003-04-101-28/+27
| | | | | | | | | | | * Doc - add doc for when functions were added * UserString * string object methods * string module functions 'chars' is used for the last parameter everywhere. These changes will be backported, since part of the changes have already been made, but they were inconsistent.
* hoist contents of csv submodule up to the package levelSkip Montanaro2003-04-101-1/+1
|
* Add test for MessageBeep()Guido van Rossum2003-04-091-1/+13
|
* New tests identical to boom and boom2, except using new-style classes.Tim Peters2003-04-081-0/+44
| | | | | | | These never failed in 2.3, and the tests confirm it. They still blow up in the 2.2 branch, despite that all the gc-vs-__del__ fixes from 2.3 have been backported (and this is expected -- 2.2 needs more work than 2.3 needed).
* s/referrents/referents/g. Gotta love that referrers remains rife with rs.Tim Peters2003-04-081-11/+11
|
* Finished implementing gc.get_referrents(): dealt with error and endTim Peters2003-04-081-1/+25
| | | | cases, wrote docs, added a test.
* Reworked has_finalizer() to use the new _PyObject_Lookup() insteadTim Peters2003-04-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of PyObject_HasAttr(); the former promises never to execute arbitrary Python code. Undid many of the changes recently made to worm around the worst consequences of that PyObject_HasAttr() could execute arbitrary Python code. Compatibility is hard to discuss, because the dangerous cases are so perverse, and much of this appears to rely on implementation accidents. To start with, using hasattr() to check for __del__ wasn't only dangerous, in some cases it was wrong: if an instance of an old- style class didn't have "__del__" in its instance dict or in any base class dict, but a getattr hook said __del__ existed, then hasattr() said "yes, this object has a __del__". But instance_dealloc() ignores the possibility of getattr hooks when looking for a __del__, so while object.__del__ succeeds, no __del__ method is called when the object is deleted. gc was therefore incorrect in believing that the object had a finalizer. The new method doesn't suffer that problem (like instance_dealloc(), _PyObject_Lookup() doesn't believe __del__ exists in that case), but does suffer a somewhat opposite-- and even more obscure --oddity: if an instance of an old-style class doesn't have "__del__" in its instance dict, and a base class does have "__del__" in its dict, and the first base class with a "__del__" associates it with a descriptor (an object with a __get__ method), *and* if that descriptor raises an exception when __get__ is called, then (a) the current method believes the instance does have a __del__, but (b) hasattr() does not believe the instance has a __del__. While these disagree, I believe the new method is "more correct": because the descriptor *will* be called when the object is destructed, it can execute arbitrary Python code at the time the object is destructed, and that's really what gc means by "has a finalizer": not specifically a __del__ method, but more generally the possibility of executing arbitrary Python code at object destruction time. Code in a descriptor's __get__() executed at destruction time can be just as problematic as code in a __del__() executed then. So I believe the new method is better on all counts. Bugfix candidate, but it's unclear to me how all this differs in the 2.2 branch (e.g., new-style and old-style classes already took different gc paths in 2.3 before this last round of patches, but don't in the 2.2 branch).
* SF bug #699934: Obscure error messageRaymond Hettinger2003-04-061-3/+2
| | | | | mwh pointed out that the error message did not make sense if obtained by rearranging the bases.
* SF patch #701494: more apply removalsRaymond Hettinger2003-04-062-2/+2
|
* Reworked move_finalizer_reachable() to create two distinct lists:Tim Peters2003-04-061-4/+32
| | | | | | | | | externally unreachable objects with finalizers, and externally unreachable objects without finalizers reachable from such objects. This allows us to call has_finalizer() at most once per object, and so limit the pain of nasty getattr hooks. This fixes the failing "boom 2" example Jeremy posted (a non-printing variant of which is now part of test_gc), via never triggering the nasty part of its __getattr__ method.
* test_boom: More comments. Also check that len(gc.garbage) doesn'tTim Peters2003-04-051-4/+9
| | | | | change (it would be another kind of bug if the trash cycle weren't reclaimed).
* Add Tim's gc boom test to the test suite.Jeremy Hylton2003-04-041-0/+19
|
* Revert Patch #670715: iconv support.Martin v. Löwis2003-04-032-103/+0
|