summaryrefslogtreecommitdiffstats
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* SF patch #461413 (Gerhard Häring): Add STARTTLS feature to smtplibGuido van Rossum2001-09-141-2/+54
| | | | | | | | | | | This patch adds the features from RFC 2487 (Secure SMTP over TLS) to the smtplib module: - A starttls() function - Wrapper classes that simulate enough of sockets and files for smtplib, but really wrap a SSLObject - reset the list of known SMTP extensions at each call of ehlo(). This should have been the case anyway.
* Changed the dict implementation to take "string shortcuts" only whenTim Peters2001-09-141-2/+36
| | | | | | | | | | | | | | | | keys are true strings -- no subclasses need apply. This may be debatable. The problem is that a str subclass may very well want to override __eq__ and/or __hash__ (see the new example of case-insensitive strings in test_descr), but go-fast shortcuts for strings are ubiquitous in our dicts (and subclass overrides aren't even looked for then). Another go-fast reason for the change is that PyCheck_StringExact() is a quicker test than PyCheck_String(), and we make such a test on virtually every access to every dict. OTOH, a str subclass may also be perfectly happy using the base str eq and hash, and this change slows them a lot. But those cases are still hypothetical, while Python's own reliance on true-string dicts is not.
* Now that file objects are subclassable, you can get at the file constructorTim Peters2001-09-132-2/+44
| | | | | | just by doing type(f) where f is any file object. This left a hole in restricted execution mode that rexec.py can't plug by itself (although it can plug part of it; the rest is plugged in fileobject.c now).
* Use the keyword form of file() instead of open() to create TESTFN.Tim Peters2001-09-131-2/+2
|
* Added simple tests of keyword arguments in the basic type constructors.Tim Peters2001-09-131-0/+24
|
* type_call(): Change in policy. The keyword args (if any) are now passedTim Peters2001-09-131-2/+13
| | | | | | on to the tp_new slot (if non-NULL), as well as to the tp_init slot (if any). A sane type implementing both tp_new and tp_init should probably pay attention to the arguments in only one of them.
* SF bug [#460467] file objects should be subclassable.Tim Peters2001-09-132-7/+49
| | | | Preliminary support. What's here works, but needs fine-tuning.
* SF bug #461073: mailbox __iter__ bug, by Andrew Dalke.Guido van Rossum2001-09-131-3/+3
| | | | | | | Andrew quite correctly notices that the next() method isn't quite what we need, since it returns None upon end instead of raising StopIteration. His fix is easy enough, using iter(self.next, None) instead.
* Added subclass equality tests. Almost all of these are commented out now,Tim Peters2001-09-121-0/+11
| | | | because they don't work yet.
* Again perhaps the end of [#460020] bug or feature: unicode() and subclasses.Tim Peters2001-09-121-0/+24
| | | | | Inhibited complex unary plus optimization when applied to a complex subtype. Added PyComplex_CheckExact macro. Some comments and minor code fiddling.
* If interning an instance of a string subclass, intern a real string objectTim Peters2001-09-121-0/+14
| | | | | | with the same value instead. This ensures that a string (or string subclass) object's ob_sinterned pointer is always a str (or NULL), and that the dict of interned strings only has strs as keys.
* str_subtype_new, unicode_subtype_new:Tim Peters2001-09-121-0/+10
| | | | | | | | + These were leaving the hash fields at 0, which all string and unicode routines believe is a legitimate hash code. As a result, hash() applied to str and unicode subclass instances always returned 0, which in turn confused dict operations, etc. + Changed local names "new"; no point to antagonizing C++ compilers.
* More on bug 460020: disable many optimizations of unicode subclasses.Tim Peters2001-09-121-2/+55
|
* More bug 460020: lots of string optimizations inhibited for stringTim Peters2001-09-121-2/+25
| | | | | | | | | subclasses, all "the usual" ones (slicing etc), plus replace, translate, ljust, rjust, center and strip. I don't know how to be sure they've all been caught. Question: Should we complain if someone tries to intern an instance of a string subclass? I hate to slow any code on those paths.
* More bug 460020. Disable a number of long optimizations for long subclasses.Tim Peters2001-09-111-0/+24
|
* More bug 460020: when F is a subclass of float, disable the unary plusTim Peters2001-09-111-0/+1
| | | | optimization (+F(whatever)).
* More bug 460020. When I is a subclass of int, disable the +I(whatever),Tim Peters2001-09-111-0/+5
| | | | | I(0) << whatever, I(0) >> whatever, I(whatever) << 0 and I(whatever) >> 0 optimizations.
* The endless 460020 bug.Tim Peters2001-09-111-0/+9
| | | | Disable t[:], t*0, t*1 optimizations when t is of a tuple subclass type.
* Add login() method and SMTPAuthenticationError exception. SF patchGuido van Rossum2001-09-111-3/+93
| | | | | | | | #460112 by Gerhard Haering. (With slight layout changes to conform to docstrings guidelines and to prevent a line longer than 78 characters. Also fixed some docstrings that Gerhard didn't touch.)
* Test for new hmac module.Guido van Rossum2001-09-111-0/+2
|
* HMAC algorithm as described by RFC 2104, by Gerhard Häring (SF patchGuido van Rossum2001-09-111-0/+110
| | | | #460112).
* Patch #460554: Properly test for tuples.Martin v. Löwis2001-09-111-1/+1
|
* Fix the second reincarnation of SF #456395 -- failure on IRIX. ThisGuido van Rossum2001-09-111-6/+2
| | | | time use .replace() to change all \r\n into \n, not just the last one.
* Restore the comparisons that I initially put in the test but that TimGuido van Rossum2001-09-111-6/+6
| | | | | | XXX'ed out. Turns out that after fixing the constructors, the comparisons in fact succeed. E.g. int(hexint(12345)) returns an int with value 12345.
* Possibly the end of SF [#460020] bug or feature: unicode() and subclasses.Tim Peters2001-09-111-2/+2
| | | | | Changed unicode(i) to return a true Unicode object when i is an instance of a unicode subclass. Added PyUnicode_CheckExact macro.
* Added another test of str() applied to a string subclass instance,Tim Peters2001-09-111-0/+4
| | | | | involving embedded null bytes, since it's possible to screw that up w/o screwing up cases w/o embedded nulls.
* More on SF bug [#460020] bug or feature: unicode() and subclasses.Tim Peters2001-09-111-1/+1
| | | | | Repaired str(i) to return a genuine string when i is an instance of a str subclass. New PyString_CheckExact() macro.
* More on SF bug [#460020] bug or feature: unicode() and subclasses.Tim Peters2001-09-101-1/+1
| | | | | | | | tuple(i) repaired to return a true tuple when i is an instance of a tuple subclass. Added PyTuple_CheckExact macro. PySequence_Tuple(): if a tuple-like object isn't exactly a tuple, it's not safe to return the object as-is -- make a new tuple of it instead.
* test_dir(): Add tests for dir(i) where i is a module subclass.Tim Peters2001-09-101-0/+23
|
* more xmlrpclib tweaks: fixed repr(Fault()); enable UTF-8 parsing inFredrik Lundh2001-09-101-12/+17
| | | | xmllib (on 2.0 and later)
* More for SF bug [#460020] bug or feature: unicode() and subclassesTim Peters2001-09-101-1/+1
| | | | | Repair float constructor to return a true float when passed a subclass instance. New PyFloat_CheckExact macro.
* SF bug #460020: bug or feature: unicode() and subclasses.Tim Peters2001-09-101-0/+21
| | | | | | | | | | | Given an immutable type M, and an instance I of a subclass of M, the constructor call M(I) was just returning I as-is; but it should return a new instance of M. This fixes it for M in {int, long}. Strings, floats and tuples remain to be done. Added new macros PyInt_CheckExact and PyLong_CheckExact, to more easily distinguish between "is" and "is a" (i.e., only an int passes PyInt_CheckExact, while any sublass of int passes PyInt_Check). Added private API function _PyLong_Copy.
* sync with pythonware codebase: much faster import (doesn't importFredrik Lundh2001-09-101-65/+70
| | | | | xmllib unless needed), merged docstring patches, added overridable Transport.getparser to simplify plugging in different parsers.
* Remove two XXX comments that have been resolved.Guido van Rossum2001-09-101-2/+0
|
* Move the global variables 'size' and 'name' to the top -- these areGuido van Rossum2001-09-101-5/+5
| | | | | "module parameters", and used in the Windows test (which crashed because size was undefined -- sigh).
* Change the criteria for skipping the test.Guido van Rossum2001-09-101-19/+22
| | | | | | | | | | | | | | | If on Windows, we require the 'largefile' resource. If not on Windows, we use a test that actually writes a byte beyond the 2BG limit -- seeking alone is not sufficient, since on some systems (e.g. Linux with glibc 2.2) the sytem call interface supports large seek offsets but not all filesystem implementations do. Note that on Windows, we do not use the write test: on Win2K, that test can take a minute trying to zero all those blocks on disk, and on Windows our code always supports large seek offsets (but again, not all filesystems do). This may mean that on Win95, or on certain other backward filesystems, test_largefile will *fail*.
* Test the failed-unicode-decoding bug in PyArg_ParseTuple().Jeremy Hylton2001-09-101-0/+24
|
* Repair late-night doc typos.Tim Peters2001-09-102-3/+3
|
* Teach regrtest how to pass on doctest failure msgs. This is done via aTim Peters2001-09-098-27/+95
| | | | | | | | | | | horridly inefficient hack in regrtest's Compare class, but it's about as clean as can be: regrtest has to set up the Compare instance before importing a test module, and by the time the module *is* imported it's too late to change that decision. The good news is that the more tests we convert to unittest and doctest, the less the inefficiency here matters. Even now there are few tests with large expected-output files (the new cost here is a Python-level call per .write() when there's an expected- output file).
* Force "test." into the start of the module name, inherited by class andTim Peters2001-09-091-17/+11
| | | | type reprs, to accomodate the way Jack runs tests on the Mac.
* Generalize operator.indexOf (PySequence_Index) to work with anyTim Peters2001-09-081-0/+41
| | | | | | | | | | iterable object. I'm not sure how that got overlooked before! Got rid of the internal _PySequence_IterContains, introduced a new internal _PySequence_IterSearch, and rewrote all the iteration-based "count of", "index of", and "is the object in it or not?" routines to just call the new function. I suppose it's slower this way, but the code duplication was getting depressing.
* It appears that unittest was changed to stop hoarding raw exception data,Tim Peters2001-09-081-4/+1
| | | | | | | | | saving instead a traceback string, but test_support's run_unittest was still peeking into unittest internals and trying to pick apart unittest's errors and failures vectors as if they contained exc_info() tuples instead of strings. Whatever, when a unittest-based test failed, test_support blew up. I'm not sure this is the right way to fix it; it simply gets me unstuck.
* Merging in removal of this file from branch to trunk.Barry Warsaw2001-09-071-163/+0
|
* Patch #438790: Add additional mappings.Martin v. Löwis2001-09-071-3/+36
| | | | Also remove mappings that are not registered with IANA, and not extensions.
* Fix typo in error reporting. This doesn't need to go into the releaseTim Peters2001-09-071-1/+1
| | | | branch (if it ever gets to the typo, the test is failing anyway).
* Reverting to rev 1.2. Apparently gcc doesn't use the extended-precisionTim Peters2001-09-061-3/+16
| | | | | | | | capabilities of the Pentium FPU, so what should have been (and were on Windows) exact results got fuzzy. Then it turns out test_support.fcmp() isn't tolerant of tiny errors when *one* of the comparands is 0, but test_complex's old check_close_real() is. Rather than fix gcc <wink>, easier to revert this test and revisit after the release.
* Rewrite to use test_support's fine fcmp instead -- I didn't know thatTim Peters2001-09-061-16/+3
| | | | existed when I wrote this test.
* Added some underflow-to-0.0 long/long true division tests.Tim Peters2001-09-061-0/+6
|
* Rename 'getset' to 'property'.Guido van Rossum2001-09-063-19/+19
|
* Add missing period in docstring.Fred Drake2001-09-061-1/+1
| | | | (Steve, can you add this to the PyUnit repository as well?)